/* The stylesheet of the shell, the only one: a module carries no CSS of its own.
   Rhythm and pieces come from the mail prototype (`doc/mail-first/prototype.html`). The
   fonts are IBM Plex — Sans, Serif, Mono — served by the kit from `static/fonts/` with
   their licence, `OFL.txt` (card 365): never from a CDN, because the portal runs on the
   office network, with or without the internet, and does not tell a third party who
   opens it. The dark theme follows the operating system.

   The colours of grounds, ink, lines, accent and masthead (`--ground` … `--bar-brand`)
   are not here: they are the office's palette (card 280), one of the kit's in
   `portal/palettes.py`, and `shell/base.html` writes them in a `<style>` after this
   sheet. Text in the accent's hue uses `--accent-ink`, never `--accent`: on a light
   ground the fuchsia of Xhalia does not read. */

/* IBM Plex, the weights the portal uses, in two subsets each: latin and latin-ext. */
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/IBMPlexSans-400-latin.woff2") format("woff2");
  unicode-range: U+0000, U+000D, U+0020-007E, U+00A0-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2013-2014, U+2018-201A, U+201C-201E, U+2020-2022, U+2026, U+2030, U+2039-203A, U+2044, U+20AC, U+2122, U+2212, U+FB01-FB02; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/IBMPlexSans-400-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-0101, U+0104-0130, U+0132-0151, U+0154-017F, U+018F, U+0192, U+01A0-01A1, U+01AF-01B0, U+01FA-01FF, U+0218-021B, U+0237, U+0259, U+1E80-1E85, U+1E9E, U+20A1, U+20A4, U+20A6, U+20A8-20AA, U+20AD-20AE, U+20B1-20B2, U+20B4-20B5, U+20B8-20BA, U+20BD, U+20BF; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("fonts/IBMPlexSans-500-latin.woff2") format("woff2");
  unicode-range: U+0000, U+000D, U+0020-007E, U+00A0-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2013-2014, U+2018-201A, U+201C-201E, U+2020-2022, U+2026, U+2030, U+2039-203A, U+2044, U+20AC, U+2122, U+2212, U+FB01-FB02; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("fonts/IBMPlexSans-500-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-0101, U+0104-0130, U+0132-0151, U+0154-017F, U+018F, U+0192, U+01A0-01A1, U+01AF-01B0, U+01FA-01FF, U+0218-021B, U+0237, U+0259, U+1E80-1E85, U+1E9E, U+20A1, U+20A4, U+20A6, U+20A8-20AA, U+20AD-20AE, U+20B1-20B2, U+20B4-20B5, U+20B8-20BA, U+20BD, U+20BF; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("fonts/IBMPlexSans-600-latin.woff2") format("woff2");
  unicode-range: U+0000, U+000D, U+0020-007E, U+00A0-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2013-2014, U+2018-201A, U+201C-201E, U+2020-2022, U+2026, U+2030, U+2039-203A, U+2044, U+20AC, U+2122, U+2212, U+FB01-FB02; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("fonts/IBMPlexSans-600-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-0101, U+0104-0130, U+0132-0151, U+0154-017F, U+018F, U+0192, U+01A0-01A1, U+01AF-01B0, U+01FA-01FF, U+0218-021B, U+0237, U+0259, U+1E80-1E85, U+1E9E, U+20A1, U+20A4, U+20A6, U+20A8-20AA, U+20AD-20AE, U+20B1-20B2, U+20B4-20B5, U+20B8-20BA, U+20BD, U+20BF; }
@font-face { font-family: "IBM Plex Serif"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("fonts/IBMPlexSerif-500-latin.woff2") format("woff2");
  unicode-range: U+0000, U+000D, U+0020-007E, U+00A0-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2013-2014, U+2018-201A, U+201C-201E, U+2020-2022, U+2026, U+2030, U+2039-203A, U+2044, U+20AC, U+2122, U+2212, U+FB01-FB02; }
@font-face { font-family: "IBM Plex Serif"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("fonts/IBMPlexSerif-500-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-0101, U+0104-0130, U+0132-0151, U+0154-017F, U+018F, U+0192, U+01A0-01A1, U+01AF-01B0, U+01FA-01FF, U+0218-021B, U+0237, U+0259, U+1E80-1E85, U+1E9E, U+20A1, U+20A4, U+20A6, U+20A8-20AA, U+20AD-20AE, U+20B1-20B2, U+20B4-20B5, U+20B8-20BA, U+20BD, U+20BF; }
@font-face { font-family: "IBM Plex Serif"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("fonts/IBMPlexSerif-600-latin.woff2") format("woff2");
  unicode-range: U+0000, U+000D, U+0020-007E, U+00A0-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2013-2014, U+2018-201A, U+201C-201E, U+2020-2022, U+2026, U+2030, U+2039-203A, U+2044, U+20AC, U+2122, U+2212, U+FB01-FB02; }
@font-face { font-family: "IBM Plex Serif"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("fonts/IBMPlexSerif-600-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-0101, U+0104-0130, U+0132-0151, U+0154-017F, U+018F, U+0192, U+01A0-01A1, U+01AF-01B0, U+01FA-01FF, U+0218-021B, U+0237, U+0259, U+1E80-1E85, U+1E9E, U+20A1, U+20A4, U+20A6, U+20A8-20AA, U+20AD-20AE, U+20B1-20B2, U+20B4-20B5, U+20B8-20BA, U+20BD, U+20BF; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/IBMPlexMono-400-latin.woff2") format("woff2");
  unicode-range: U+0000, U+000D, U+0020-007E, U+00A0-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2013-2014, U+2018-201A, U+201C-201E, U+2020-2022, U+2026, U+2030, U+2039-203A, U+2044, U+20AC, U+2122, U+2212, U+FB01-FB02; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/IBMPlexMono-400-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-0101, U+0104-0130, U+0132-0151, U+0154-017F, U+018F, U+0192, U+01A0-01A1, U+01AF-01B0, U+01FA-01FF, U+0218-021B, U+0237, U+0259, U+1E80-1E85, U+1E9E, U+20A1, U+20A4, U+20A6, U+20A8-20AA, U+20AD-20AE, U+20B1-20B2, U+20B4-20B5, U+20B8-20BA, U+20BD, U+20BF; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("fonts/IBMPlexMono-500-latin.woff2") format("woff2");
  unicode-range: U+0000, U+000D, U+0020-007E, U+00A0-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2013-2014, U+2018-201A, U+201C-201E, U+2020-2022, U+2026, U+2030, U+2039-203A, U+2044, U+20AC, U+2122, U+2212, U+FB01-FB02; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("fonts/IBMPlexMono-500-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-0101, U+0104-0130, U+0132-0151, U+0154-017F, U+018F, U+0192, U+01A0-01A1, U+01AF-01B0, U+01FA-01FF, U+0218-021B, U+0237, U+0259, U+1E80-1E85, U+1E9E, U+20A1, U+20A4, U+20A6, U+20A8-20AA, U+20AD-20AE, U+20B1-20B2, U+20B4-20B5, U+20B8-20BA, U+20BD, U+20BF; }

:root {
  /* Light confidence colours are the prototype's (#2E8B57, #C08A1E, #B94A3E) darkened to
     the least that holds 4.5:1 as text; they do not depend on the palette. */
  --certain: #287A4C;
  --uncertain: #8B6416;
  --new: #3B4E86;
  --unrecognised: #B5483D;
  --neutral: #6C7775;
  --notice: #9A3131;
  --radius: 6px;
  /* The voice's ground and the «new» ground, derived from the palette's own tokens
     (= `--ai-soft` and `--nuova-soft` of the prototype). */
  --voice-ground: color-mix(in srgb, var(--accent) 6%, var(--raised));
  --new-ground: color-mix(in srgb, var(--new) 12%, var(--raised));
  --serif: "IBM Plex Serif", Georgia, serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --certain: #5CC08A;
    --uncertain: #D9A94B;
    --new: #8FA0DC;
    --unrecognised: #E07C70;
    --neutral: #8A9491;
    --notice: #E08A8A;
  }
}

* { box-sizing: border-box; }

/* The body text is the root size (card 418): 1rem is 13px, and every size of a text is
   in rem, so nothing is written larger than the text around it. */
html { font-size: 13px; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 1rem/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}

/* The whole width of the window, the padding alone at the sides (card 418). */
.sheet {
  padding: 2rem 1rem 4rem;
}

h1 { font-family: var(--serif); font-size: 1.6rem; font-weight: 500; letter-spacing: -.01em; margin: 0 0 1.5rem; }
h2 { font-family: var(--serif); font-size: 1.15rem; font-weight: 600; margin: 0 0 .75rem; }

a { color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

.warning { border: 1px solid var(--notice); border-radius: var(--radius); color: var(--notice); margin: 0 0 1.5rem; padding: .6rem .9rem; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.login { display: grid; gap: .6rem; max-width: 20rem; }
/* The pages of the access — login, the code, the link of the app, the password, the
   recovery (card 482): the title and the form in the middle of the window, never pushed
   to the left. `safe` keeps the top in sight when the block is taller than the window
   (the QR of the link). The sheet of those pages is `.access` (base.html, block `sheet`). */
.sheet.access {
  min-height: 100vh;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: safe center;
}
.sheet.access > * { width: min(100%, 20rem); box-sizing: border-box; }

label { font-size: .9rem; }

input, button, select {
  font: inherit;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--line2);
  border-radius: var(--radius);
}
input, select { padding: .4rem .7rem; }

/* A button, and a link that looks like one (the prototype's `.btn`). */
button, a.button {
  padding: 5px 12px;
  font-size: .8667rem;
  background: var(--surface);
  border: 1px solid var(--line2);
  border-radius: var(--radius);
}

input[type=text], input[type=password] { min-width: 0; max-width: 100%; }

button, a.button { cursor: pointer; white-space: nowrap; }
a.button { display: inline-block; text-decoration: none; color: var(--ink); font-family: inherit; line-height: normal; box-sizing: border-box; }
button:hover, a.button:hover { border-color: var(--ink3); }
button[disabled] { opacity: .45; cursor: default; }
/* An action at work (card 466, `busy` in xhalia.js): the cursor of waiting on the form and
   on its switched-off controls, a spinner on the button pressed in place of the grey. The
   spinner turns for a minute at most (60 turns), then stands still: no animation of the
   stylesheet runs without end (card 298); the ring and the cursor stay until the answer. */
form[aria-busy="true"], form[aria-busy="true"] :disabled { cursor: progress; }
form[aria-busy="true"] button[data-busy] { opacity: 1; }
button[data-busy]::after, a[data-busy]:not(.tile)::after, .tile[data-busy] .tile-opening::after { content: ""; display: inline-block; width: .8em; height: .8em; margin-left: .45em; vertical-align: -.1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: busy-spin 1s linear 60; }
@keyframes busy-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { button[data-busy]::after, a[data-busy]:not(.tile)::after, .tile[data-busy] .tile-opening::after { animation: none; } }
/* Leaving for another page (xhalia.js, `leave`): the cursor says it, wherever it is. */
html[aria-busy="true"], html[aria-busy="true"] * { cursor: progress; }
/* The panel of the message before while the next one comes (card 580, `openInPane`). */
section.panel[aria-busy="true"] { opacity: .5; cursor: progress; }
/* Card 619: a panel whose module has not answered yet holds what the tab kept of it, or
   nothing; the spinner in its corner says that the server is still being asked. */
section.panel[data-pending] { position: relative; min-height: 3rem; cursor: progress; }
section.panel[data-pending]::after { content: ""; position: absolute; top: .6rem; right: .6rem; width: .8em; height: .8em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: busy-spin 1s linear 60; }
@media (prefers-reduced-motion: reduce) { section.panel[data-pending]::after { animation: none; } }
/* The bodies written below the columns (`data-body-of`) wait hidden for `xhaliaPlace` on a page
   whose scripts run (`data-js`). Without scripts nobody places them: the empty places go, the
   page scrolls and the bodies are read where they are, their rows plain links. */
html[data-js] [data-body-of] { display: none; }
html:not([data-js]) section.panel[data-pending] { display: none; }
html:not([data-js])[data-layout="mail"], html:not([data-js]) body[data-layout="mail"] { height: auto; overflow: visible; }
.busy-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* The main gesture of a form: the login, the confirmation of a proposal, the
   application of the approved ones. */
.login button,
form[data-action="ok"] button,
form[data-action="apply"] button,
button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.notice { color: var(--notice); margin: .5rem 0 0; }

.context { color: var(--ink2); font-size: .9rem; margin: 0 0 .75rem; }
.empty { color: var(--ink3); font-size: .9rem; padding: .75rem 0; }
.muted { color: var(--ink3); font-size: .85rem; }

[data-outcome] { color: var(--ink2); font-size: .85rem; margin-left: .5rem; }

/* The passing receipt of a form with `data-fades` (card 358), written by `xhalia.js` at the end
   of the body: `div.receipt.passing`. It is not `details.receipt` of the matters, which stays
   in the page. Inverted ink and ground, so it stands out in both themes; `data-fading` takes
   it to nothing in .7s, and with reduced motion there is no transition. */
div.receipt.passing[role="status"] {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  width: min(620px, calc(100% - 32px));
  z-index: 60;
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgb(0 0 0 / .22);
  background: var(--ink);
  color: var(--ground);
  font-size: .9rem;
  cursor: pointer;
  overflow-wrap: anywhere;
  transition: opacity .7s ease;
}
div.receipt.passing[data-fixed] { cursor: default; }
div.receipt.passing[data-fading] { opacity: 0; }
div.receipt.passing .receipt-head { display: flex; align-items: center; gap: 8px; margin: 0; font-size: .8667rem; font-weight: 600; }
div.receipt.passing .receipt-head .voice-avatar { width: 22px; height: 22px; }
div.receipt.passing ul { margin: 0; padding-left: 18px; display: grid; gap: 2px; }
div.receipt.passing .receipt-gestures { display: flex; justify-content: flex-end; gap: 8px; margin: 0; }
div.receipt.passing button { background: transparent; color: var(--ground); border-color: rgb(255 255 255 / .35); }
@media (prefers-reduced-motion: reduce) {
  div.receipt.passing[role="status"] { transition: none; }
}

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .45rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink3); font-weight: 600; }

/* A list of rows, the shape of every read-only module (mail-done, cases). */
table.list { border-top: 1px solid var(--line); }
table.list td { background: var(--surface); }

/* A pill: a short word of state, in capitals, with its own color. */
.pill {
  display: inline-block;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .09em;
  font-weight: 600;
  padding: .1rem .5rem;
  border-radius: 11px;
  border: 1px solid var(--line2);
  color: var(--ink2);
  white-space: nowrap;
}
.pill.state-certain { color: var(--certain); border-color: var(--certain); }
.pill.state-uncertain { color: var(--uncertain); border-color: var(--uncertain); }
.pill.state-new { color: var(--new); border-color: var(--new); }
.pill.state-active { color: var(--certain); border-color: var(--certain); }
.pill.state-dormant { color: var(--ink3); }
.pill.state-decided { color: var(--neutral); }
.pill.state-unrelated { color: var(--neutral); border-color: var(--neutral); }
.pill.kind-home { color: var(--certain); border-color: var(--certain); }
.pill.kind-reference { color: var(--neutral); border-color: var(--neutral); }

/* The notice of the trial (card 314, CRA art. 4(3)), above everything on every page:
   `sticky`, so it stays in sight however far the page scrolls, and nothing closes it. */
.beta-notice { position: sticky; top: 0; z-index: 20; background: var(--surface); color: var(--notice); border-bottom: 2px solid var(--notice); padding: .4rem 1rem; font-size: .85rem; line-height: 1.4; text-align: center; overflow-wrap: anywhere; }

/* --- the masthead, the heading of the home and the tabs ---------------------- */

/* The masthead (cards 260, 297), one line on every page after the login, fixed on top:
   on the left the mark and the title of the page, then the line of state (card 298),
   «Vai a…», the person's circle on the right. Its colours are three tokens, `--bar-bg`,
   `--bar-ink`, `--bar-brand`: the palette's own, the bar at contrast (card 280) — or,
   when the office chose the bar as the page (`data-bar="page"`), the page's `surface`,
   `ink` and `accent-ink`. Nothing in the masthead is written in a colour of its own:
   the mark and the controls take the bar's. Lower once the page scrolls
   (`data-scrolled`, `xhalia.js`), without transition when motion is reduced. The
   offsets `--beta-h` and `--top-h` are the heights of the trial notice and of both,
   kept by `xhalia.js`, so what else is sticky stays under the masthead. */
.masthead[data-bar="page"] { --bar-bg: var(--surface); --bar-ink: var(--ink); --bar-brand: var(--accent-ink); }
.masthead { position: sticky; top: var(--beta-h, 0px); z-index: 19; background: var(--bar-bg); color: var(--bar-ink); border-bottom: 1px solid var(--line); }
.masthead-bar { padding: .55rem 1rem; display: flex; align-items: center; gap: 1rem; transition: padding .15s; }
.masthead[data-scrolled] .masthead-bar { padding-top: .25rem; padding-bottom: .25rem; }
.masthead-where { display: flex; align-items: center; gap: .6rem; min-width: 0; flex: 0 1 auto; }
.brand { font-family: var(--serif); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; font-size: 1rem; color: var(--bar-brand); text-decoration: none; white-space: nowrap; flex: none; }
.brand:hover { text-decoration: underline; }
.brand-logo { display: inline-flex; align-items: center; }
.brand-logo img { display: block; height: 2.375rem; max-width: 12rem; width: auto; object-fit: contain; transition: height .15s; }
.masthead[data-scrolled] .brand-logo img { height: 1.75rem; }
.masthead-here { display: flex; align-items: baseline; gap: .6rem; min-width: 0; font-family: var(--serif); font-size: 1.05rem; }
.masthead-slash { opacity: .55; flex: none; }
.masthead-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-unavailable { margin: 0; font-size: .85rem; color: var(--bar-ink); }
.masthead-status { min-width: 0; flex: 0 1 auto; }
.masthead-status:empty { display: none; }
/* The line of state (card 298): one line, in a muted tone, in the bar's ink; what is not
   well — or a state that does not read — in the bar's accent, `--bar-brand`. Its sign, drawn
   here: a ring when all is well, a filled diamond when not. A new text comes in with a
   short fade (`status-fresh`, put by `xhalia.js` only when it changed), none when motion
   is reduced; nothing moves otherwise. */
.status-line { display: flex; align-items: center; gap: .45rem; min-width: 0; font-size: .85rem; color: var(--bar-ink); opacity: .8; text-decoration: none; }
.status-line[data-state="attention"], .status-line[data-state="unavailable"] { color: var(--bar-brand); opacity: 1; }
a.status-line:hover .status-text { text-decoration: underline; }
/* A panel drawn from what the tab kept because the server did not answer now (`data-stale`,
   `xhalia-place.js`): one soft line in the masthead, after a red dot. */
.stale-line { display: flex; align-items: center; gap: .45rem; min-width: 0; font-size: .85rem; color: var(--bar-ink); opacity: .8; }
.stale-line::before { content: ""; flex: none; width: .6rem; height: .6rem; border-radius: 50%; background: #e5484d; }
.stale-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 40rem) { .stale-text { display: none; } }
.status-sign { flex: none; width: .6rem; height: .6rem; box-sizing: border-box; border: 1.5px solid currentColor; border-radius: 50%; }
.status-line[data-state="attention"] .status-sign, .status-line[data-state="unavailable"] .status-sign { background: currentColor; border-radius: 1px; transform: rotate(45deg); width: .55rem; height: .55rem; }
.status-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes status-in { from { opacity: 0; } }
.status-fresh { animation: status-in .4s ease-out; }

/* «Vai a…»: the link that opens the search (a link to the home without JavaScript), and
   under it the panel, on the page's grounds. */
.goto { position: relative; margin-left: auto; flex: none; }
.goto-open { display: inline-flex; align-items: center; gap: .45rem; padding: .3rem .6rem; border: 1px solid currentColor; border-radius: var(--radius); color: var(--bar-ink); text-decoration: none; font-size: .9rem; white-space: nowrap; }
.goto-open:hover { background: var(--bar-ink); color: var(--bar-bg); }
/* The lens, drawn by the stylesheet in the bar's ink: a ring and its handle. */
.goto-lens { position: relative; flex: none; width: 1rem; height: 1rem; }
.goto-lens::before { content: ""; position: absolute; left: 0; top: 0; width: 68%; height: 68%; border: 2px solid currentColor; border-radius: 50%; box-sizing: border-box; }
.goto-lens::after { content: ""; position: absolute; right: 4%; bottom: 4%; width: 38%; height: 2px; background: currentColor; border-radius: 1px; transform-origin: right center; transform: rotate(45deg); }
.goto-key { font-family: var(--mono); font-size: .72rem; opacity: .7; }
.goto-panel { position: absolute; right: 0; top: calc(100% + .4rem); z-index: 3; width: min(26rem, calc(100vw - 2rem)); max-height: min(70vh, 32rem); display: flex; flex-direction: column; background: var(--raised); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 6px 18px color-mix(in srgb, var(--ink) 14%, transparent); }
.goto-panel[hidden] { display: none; }
.goto-search { margin: .5rem; width: auto; }
.goto-list { overflow: auto; padding: 0 .35rem .4rem; }
.goto-group-name { font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink3); padding: .5rem .45rem .25rem; }
.goto-group[hidden] { display: none; }
.goto-option { display: flex; align-items: center; gap: .6rem; padding: .35rem .45rem; border-radius: var(--radius); color: var(--ink); text-decoration: none; }
.goto-option[hidden] { display: none; }
.goto-option:hover, .goto-option[aria-selected="true"] { background: var(--surface2); }
.goto-option[aria-current="page"] .goto-name { font-weight: 600; }
.goto-pic { flex: none; width: 2.5rem; height: 1.75rem; display: grid; place-items: center; background: var(--surface2); border-radius: 4px; overflow: hidden; }
.goto-pic svg { display: block; width: 100%; height: 100%; color: var(--ink); }
.goto-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.goto-option .count { flex: none; min-width: 1.4em; padding: 0 .4em; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: .75rem; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; }
.goto-none { margin: .25rem .8rem .7rem; color: var(--ink3); font-size: .88rem; }
.goto-panel > .notice { margin: .25rem .8rem .7rem; }

/* The person: a circle with the initials, the menu of before under it. */
.masthead-person { position: relative; flex: none; }
.masthead-person > summary { list-style: none; cursor: pointer; display: block; border-radius: 50%; }
.masthead-person > summary::-webkit-details-marker { display: none; }
.initials { display: grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: 50%; border: 1.5px solid var(--bar-ink); color: var(--bar-ink); font-size: .8rem; font-weight: 600; letter-spacing: .04em; }
.masthead-person > summary:hover .initials, .masthead-person[open] .initials { background: var(--bar-ink); color: var(--bar-bg); }
.masthead-person > ul {
  position: absolute; right: 0; top: calc(100% + .4rem); z-index: 3; min-width: 12rem;
  list-style: none; margin: 0; padding: .3rem; background: var(--raised);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 4px 12px color-mix(in srgb, var(--ink) 10%, transparent);
}
.masthead-person li > a, .masthead-person li button { display: block; width: 100%; text-align: left; padding: .35rem .6rem; font-size: .9rem; color: var(--ink); text-decoration: none; border-radius: var(--radius); }
.masthead-person li > a:hover, .masthead-person li button:hover { background: var(--surface2); }
.masthead-person form { margin: 0; }

@media (prefers-reduced-motion: reduce) { .masthead-bar, .brand-logo img { transition: none; } .status-fresh { animation: none; } }

/* On a phone: the mark and the title cut with an ellipsis, the sign of the line of state —
   its text stays for the screen readers, in `title` and in the panel —, the lens alone,
   the initials. */
@media (max-width: 40rem) {
  .masthead-bar { flex-wrap: wrap; gap: .6rem; padding-left: .75rem; padding-right: .75rem; }
  .masthead-where { flex: 1 1 0; }
  .brand { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .brand-logo img { height: 2rem; max-width: 8rem; }
  .masthead-status { flex: none; }
  .status-line { padding: .35rem; }
  .status-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .goto { margin-left: 0; position: static; }
  .goto-open { border-color: transparent; padding: .35rem; }
  .chat-open { margin-left: 0; padding: .3rem .5rem; font-size: .8rem; }
  .goto-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .goto-key { display: none; }
  .goto-lens { width: 1.25rem; height: 1.25rem; }
  .goto-panel { left: .5rem; right: .5rem; width: auto; top: calc(100% + .2rem); }
}

/* The heading of the home (card 260): the greeting and the date. */
.greeting { margin: 0 0 1.25rem; }
.greeting h1 { margin: 0; }
.greeting .today { color: var(--ink3); font-size: .9rem; margin: .2rem 0 0; }
.page-title { margin: 0 0 1rem; }

.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin: 0 0 1.5rem; overflow-x: auto; }
.tabs [role="tab"] {
  background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0;
  color: var(--ink2); font-size: .95rem; padding: .6rem .9rem; margin-bottom: -1px;
  text-decoration: none;
}
.tabs [role="tab"]:hover { color: var(--ink); border-color: transparent; }
.tabs [role="tab"][aria-selected="true"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }
/* What waits for the person in a tab (card 238): «Da vedere 15». */
.tabs .count { display: inline-block; min-width: 1.4em; margin-left: .35rem; padding: 0 .4em; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); font-size: .78rem; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; }

.screen-title { font-size: 1.25rem; margin: 0 0 .9rem; }

/* The tabs as a column on the left of the open screen above 56rem (~900px), on every
   page with tabs (card 282): no key in the manifest of the page chooses it. Below, they
   stay a row on top, scrolling inside themselves rather than the page. */
@media (min-width: 56rem) {
  .tabbed { display: grid; grid-template-columns: minmax(10rem, 14rem) minmax(0, 1fr); column-gap: 1.75rem; align-items: start; }
  .tabbed > .screen { min-width: 0; }
  .tabbed .tabs { flex-direction: column; gap: .1rem; border-bottom: 0; border-right: 1px solid var(--line); margin: 0; overflow-x: visible; position: sticky; top: calc(var(--top-h, 0px) + 1rem); }
  .tabbed .tabs [role="tab"] { border-bottom: 0; border-right: 2px solid transparent; margin: 0 -1px 0 0; padding: .5rem .9rem .5rem 0; }
  .tabbed .tabs [role="tab"][aria-selected="true"] { border-right-color: var(--accent); }
}
.part { margin: 0 0 1.5rem; }

/* --- the tiles of the home (card 281) ----------------------------------------
   One tile per page: its drawing, its title, its line, what waits in it. The drawings
   carry no colour of their own: the classes below map them on the theme's tokens, so
   the same drawing holds in light and in dark (doc/portal.md §Images of the pages). */
.tile-group { margin: 0 0 1.75rem; }
.tile-group-name { font-family: var(--sans); font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink3); margin: 0 0 .75rem; }
.tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr)); gap: .9rem; }
.tiles > li { display: grid; min-width: 0; }
/* The home (card 478): the panel as wide as its tiles, in the middle of the page; it wraps
   and stays centred when the tiles do not fit in one row. The panel is the one that holds
   a `.tile-board`, the root of the tiles in every branch: the rule names no module. */
.panel:has(.tile-board) { width: fit-content; max-width: 100%; margin-inline: auto; }
.panel:has(.tile-board) > h2, .panel:has(.tile-board) .tile-group-name { text-align: center; }
.panel:has(.tile-board) .tiles { display: flex; flex-wrap: wrap; justify-content: center; }
.panel:has(.tile-board) .tiles > li { display: block; flex: 0 1 13rem; width: 13rem; max-width: 100%; }
.tile { display: grid; grid-template-rows: auto 1fr; background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius); color: inherit; text-decoration: none; overflow: hidden; min-width: 0; transition: border-color .15s, transform .15s; }
.tile:hover { border-color: var(--accent); transform: translateY(-1px); }
.tile-pic { background: var(--surface2); padding: 6px 10px 0; }
.tile-pic svg { display: block; width: 100%; height: auto; color: var(--ink); }
.tile-noimage { margin: 0; padding: .6rem 0 .7rem; font-size: .8rem; color: var(--notice); overflow-wrap: anywhere; }
.tile-text { padding: .75rem .9rem .9rem; display: grid; gap: .35rem; align-content: start; }
.tile-name { font-family: var(--serif); font-size: 1.08rem; line-height: 1.25; }
.tile-desc { color: var(--ink2); font-size: .86rem; line-height: 1.45; }
.tile-count { justify-self: start; margin-top: .25rem; font-size: .78rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--on-accent); background: var(--accent); border-radius: 999px; padding: 2px 9px; }
.tile-quiet { margin-top: .25rem; font-size: .78rem; color: var(--ink3); }
.tile.calm .tile-pic { opacity: .82; }
/* A tile opened (card 462, `xhalia.js`): at once the cursor of waiting, the accent on its
   border and ground, and «Apertura…» with the spinner of card 466, until the page arrives. */
.tile[aria-busy="true"] { cursor: progress; border-color: var(--accent); background: var(--accent-soft); }
.tile-opening { justify-self: start; margin-top: .25rem; font-size: .78rem; font-weight: 600; color: var(--accent-ink); }
.tile-pic .s, .goto-pic .s { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tile-pic .f, .goto-pic .f { fill: var(--accent-soft); stroke: none; }
.tile-pic .a, .goto-pic .a { fill: var(--accent); stroke: none; }
.tile-pic .as, .goto-pic .as { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; }
.tile-pic .on, .goto-pic .on { fill: none; stroke: var(--on-accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tile-pic .g, .goto-pic .g { stroke: var(--line2); stroke-width: 1.5; stroke-linecap: round; }
@media (prefers-reduced-motion: reduce) { .tile { transition: none; } .tile:hover { transform: none; } }

/* A small word of state next to a proposal: in capitals, spaced, discreet. */
.tag { font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; color: var(--ink3); margin-left: .35rem; font-weight: 500; white-space: nowrap; }

button.quiet, a.button.quiet { background: none; border-color: transparent; color: var(--ink2); }
button.quiet:hover, a.button.quiet:hover { border-color: var(--line2); }
summary.button { list-style: none; display: inline-block; cursor: pointer; font-size: .8667rem; padding: 5px 12px; border: 1px solid var(--line2); border-radius: var(--radius); background: var(--surface); white-space: nowrap; }
summary.button::-webkit-details-marker { display: none; }

/* --- the mail: the queue, the new case, the done ----------------------------- */

.news { margin: 0 0 .25rem; color: var(--ink2); }
.summary { color: var(--ink2); font-size: .9rem; margin: 0 0 1rem; text-align: right; }
.group-heading { font-family: var(--sans); font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--ink3); font-weight: 600; margin: 1.5rem 0 .5rem; }

.queue, .members { list-style: none; margin: 0; padding: 0; }
.queue { border-top: 1px solid var(--line); }
.queue > li {
  background: var(--surface); border-bottom: 1px solid var(--line);
  padding: .9rem 1rem .9rem 1.25rem; box-shadow: inset 3px 0 0 var(--neutral);
}
.queue > li { display: flex; gap: 1rem; justify-content: space-between; align-items: center; }
.queue > li .body { min-width: 0; flex: 1 1 auto; }
.queue > li.state-certain { box-shadow: inset 3px 0 0 var(--certain); }
.queue > li.state-uncertain { box-shadow: inset 3px 0 0 var(--uncertain); }
.queue > li.state-new { box-shadow: inset 3px 0 0 var(--new); }
.queue > li[data-settled] { box-shadow: inset 3px 0 0 var(--accent-ink); }

.subject { font-weight: 600; letter-spacing: -.005em; }
.meta { color: var(--ink3); font-size: .85rem; margin-top: .1rem; }
.proposal { margin: .45rem 0 0; }
.proposal strong { color: var(--accent-ink); font-weight: 600; border-bottom: 1px dotted var(--line2); }
/* The confidence of a proposal, a dot before it (card 249): green no doubt, yellow some
   doubt, red not recognised. Its words are in the `aria-label`, the colour is not alone. */
.dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; margin-right: .4rem; vertical-align: .05em; }
.dot-green { background: var(--certain); }
.dot-yellow { background: var(--uncertain); }
.dot-red { background: var(--notice); }
/* The same dot with the trust colours of the common pieces (card 365), 7px as the
   prototype's. The selector is `.dot.dot-*`, so the three of card 249 keep their size. */
.dot.dot-sure, .dot.dot-unsure, .dot.dot-new, .dot.dot-none { width: 7px; height: 7px; flex: none; }
.dot.dot-sure { background: var(--certain); }
.dot.dot-unsure { background: var(--uncertain); }
.dot.dot-new { background: var(--new); }
.dot.dot-none { background: var(--unrecognised); }
/* The matter a message is tied to, as a small chip (the prototype's `.chip`; `.chip` is
   the «Cambia» window's). */
.matter-tag { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; box-sizing: border-box; font-size: .8rem; padding: 1px 8px 1px 6px; border-radius: 11px; background: var(--voice-ground); color: var(--ink2); border: 1px solid var(--line); }
.matter-tag .dot { margin-right: 0; }
.matter-tag .title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.matter-tag.new { background: var(--new-ground); color: var(--new); border-color: transparent; }
.matter-tag.decided { background: transparent; }
.matter-tag .tick { color: var(--certain); font-weight: 600; }
/* A code, a size, a mailbox: small mono in a thin frame (the prototype's `.cas` and
   `.allegato .est`). `.caps` is the optional upper case. */
.code-tag { font-family: var(--mono); font-size: .7rem; color: var(--ink3); border: 1px solid var(--line2); border-radius: 3px; padding: 0 4px; }
.code-tag.caps { text-transform: uppercase; }
/* The type of a proposed entity — a `pratica`, a `fornitore` — next to its name (card 223). */
.entity-type { font-size: .82rem; color: var(--ink3); margin-left: .3rem; }
.why-line { color: var(--ink2); font-size: .88rem; margin: .25rem 0 0; }
.why-line details { display: inline; }
.why-line summary { display: inline; cursor: pointer; color: var(--ink3); text-decoration: underline dotted; margin-left: .4rem; }
.why-line ul { margin: .3rem 0; padding-left: 1.1rem; }

.gestures { display: flex; flex-wrap: wrap; gap: .4rem; align-items: flex-start; justify-content: flex-end; flex: 0 0 auto; max-width: 55%; }
.gestures form.first { order: -1; }
.gestures form { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; }
.gestures [data-outcome] { flex-basis: 100%; margin: 0; text-align: right; }
/* A row with a decision on it (Annulla, 2026-10-01): the gestures and the proposal give
   way to the decision on the right — the case in evidence, its why, Annulla alone. */
.queue > li .decision { display: none; flex: 0 1 auto; max-width: 55%; text-align: right; }
.queue > li[data-settled] .decision { display: block; }
/* The proposal of the AI (card 255): apart from the one of `judgment`, never a decision. */
.ai-proposal { margin: .55rem 0 0; padding: .45rem .7rem; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 4px 4px 0; }
.ai-proposal p { margin: .15rem 0; }
.ai-proposal form { margin: .35rem 0 0; }
.queue > li[data-settled] > .gestures,
.queue > li[data-settled] > .body > .ai-proposal,
.queue > li[data-settled] > .body > .proposal,
.queue > li[data-settled] > .body > .why-line { display: none; }
.decision-case { margin: 0; }
.decision-case strong { color: var(--accent-ink); font-family: var(--serif); font-size: 1.15rem; font-weight: 600; }
.decision .why-line ul { text-align: left; }
.decision form { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .3rem; margin-top: .4rem; }
.decision [data-outcome] { flex-basis: 100%; margin: 0; }
/* «Altrove…» holds two forms (card 245): the cases that exist, and a new case below them. */
.elsewhere:has(> details[open]) { flex-basis: 100%; }
.gestures .elsewhere form { display: block; }
.new-case-choice { padding: 0 .75rem; text-align: left; }
.new-case-choice > details > summary { cursor: pointer; color: var(--accent-ink); margin: .2rem 0 .4rem; }
.new-case-choice .folder-field summary { cursor: pointer; color: var(--ink3); font-size: .85rem; margin: 0 0 .4rem; }
.choices { list-style: none; padding: .6rem .75rem; margin: .4rem 0; background: var(--surface2); border-radius: var(--radius); text-align: left; }
.choices-heading { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink3); font-weight: 600; margin-top: .4rem; }
.choice .why { font-size: .82rem; color: var(--ink3); margin: .1rem 0 .3rem; padding-left: 1.4rem; }

.new-case {
  background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: inset 3px 0 0 var(--new), 0 1px 3px rgba(0,0,0,.05);
  padding: 1rem 1.25rem; margin: 0 0 1.25rem;
}
.new-case h3 { font-family: var(--serif); font-size: 1.05rem; font-weight: 600; margin: 0 0 .3rem; }
.new-case form { margin: .8rem 0; }
.new-case .field, .new-case-choice .field { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .8rem; margin: 0 0 .5rem; }
.new-case .field > span, .new-case-choice .field > span { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink3); font-weight: 600; }
.new-case .field input[type=text], .new-case-choice .field input[type=text] { flex: 1 1 18rem; }
.new-case .folder-field summary { cursor: pointer; color: var(--ink3); font-size: .85rem; margin: 0 0 .4rem; }
.new-case .gestures { justify-content: flex-start; max-width: none; }
.members { border-top: 1px solid var(--line); }
.members li { padding: .5rem 0; border-bottom: 1px solid var(--line); }
.members li:last-child { border-bottom: 0; }
.members .meta { display: block; }

.apply-bar {
  position: sticky; bottom: 0; z-index: 1; margin: 1rem 0 0; padding: .75rem 0;
  background: linear-gradient(to bottom, transparent, var(--ground) 30%);
}
.apply-bar form { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }

/* A folder that can become a case, in the tree of a mailbox: a chain icon at the end of its row,
   and the form below the row once it is opened. */
.tree li { position: relative; }
.tree li.attachable > .folder { padding-right: 1.9rem; }
.attach-folder > summary {
  position: absolute; top: 3px; right: 6px; list-style: none; cursor: pointer;
  display: flex; padding: .2rem; border-radius: var(--radius); color: var(--ink3);
}
.attach-folder > summary::-webkit-details-marker { display: none; }
.attach-folder > summary:hover, .attach-folder[open] > summary,
.attach-folder.placed > summary { color: var(--accent-ink); }
/* The popover of the chain: a panel laid over the page, under the icon, so the rows below do not
   move. Fixed, because the side pane scrolls and would clip it: xhalia.js puts it under the row. Two sections, the case of the folder and «Rileggi dal server». */
.attach-folder > .folder-pop, .case-pop > .folder-pop {
  position: fixed; top: 0; left: 0; z-index: 20; box-sizing: border-box;
  width: min(24rem, calc(100vw - 1rem)); max-height: 80vh; overflow-y: auto; padding: .8rem 1rem;
  border: 1px solid var(--line2); border-radius: var(--radius); background: var(--surface);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}
.folder-pop > h3 { margin: 0 0 .6rem; font-size: .95rem; overflow-wrap: anywhere; }
.pop-section h4 { margin: 0 0 .35rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink3); font-weight: 600; }
.pop-section + .pop-section { margin-top: .8rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.pop-section p { margin: 0 0 .5rem; font-size: .85rem; }
/* The name and the type of a new case show only when «a new case» is the chosen option
   of the folder's form: before, they would read as asked of everyone. */
.attach-folder .new-case { display: none; }
.attach-folder [data-outcome] { display: block; margin: .5rem 0; }
.attach-folder [data-outcome]:empty { margin: 0; }
.attach-folder .placed-case { display: flex; flex-wrap: wrap; align-items: center; gap: 0 .4rem; }
.attach-folder .placed-case > p { margin: 0; flex: 1 1 auto; }
.attach-folder .placed-case [data-outcome] { flex-basis: 100%; }
/* «Rileggi dal server» (card 468): the button and, under it, the sentence of the preview and the
   confirmation. */
.reread-folder { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; margin: 0; }
.reread-folder [data-outcome] { flex-basis: 100%; }
.reread-folder [data-outcome]:empty { display: none; }
/* The dossiers of the office (`cases`, card 505): a series of tiles. On the first line the name
   with the pencil, then at the right end the count of the messages and the X; under them the
   type and the pills; at the bottom the events of the period and the icon of the page of the
   dossier. The events open over the tiles below (absolute, under the tile): no tile moves. The
   pencil and the X open the `.folder-pop` of the Posta, placed by xhalia.js. */
ul.briefing { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); gap: .9rem; }
ul.briefing > li { position: relative; display: flex; flex-direction: column; gap: .35rem; min-width: 0; padding: .7rem .9rem; background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius); }
ul.briefing > li.events-open { z-index: 5; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
/* A closed dossier is faded, not its panels: the reopen panel reads as every other. */
ul.briefing > li.closed > :not(header), ul.briefing > li.closed > header > :not(.ends),
ul.briefing > li.closed .messages, ul.briefing > li.closed .case-pop > summary { opacity: .6; }
ul.briefing > li > header { display: flex; align-items: center; gap: .3rem; min-width: 0; }
ul.briefing .name { min-width: 0; overflow-wrap: anywhere; }
ul.briefing .name a { text-decoration: none; }
ul.briefing .ends { margin-left: auto; display: flex; align-items: center; gap: .3rem; flex: none; }
ul.briefing .messages { display: inline-flex; align-items: center; gap: .25rem; font-size: .85rem; color: var(--ink3); text-decoration: none; white-space: nowrap; }
a.messages:hover { color: var(--accent-ink); }
.case-pop > summary { list-style: none; cursor: pointer; display: flex; padding: .2rem; border-radius: var(--radius); color: var(--ink3); }
.case-pop > summary::-webkit-details-marker { display: none; }
.case-pop > summary:hover, .case-pop[open] > summary { color: var(--accent-ink); }
.case-pop form { display: flex; flex-direction: column; align-items: flex-start; gap: .5rem; }
.case-pop .field { display: flex; flex-direction: column; gap: .2rem; width: 100%; }
.case-pop .field input { width: 100%; box-sizing: border-box; }
.case-pop p { margin: 0; font-size: .85rem; }
.case-pop [data-outcome]:empty { display: none; }
ul.briefing .kind { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .5rem; margin: 0; font-size: .85rem; }
ul.briefing > li > footer { display: flex; align-items: flex-start; gap: .5rem; margin-top: auto; }
ul.briefing > li > footer > p { margin: 0; font-size: .85rem; }
.case-details { margin-left: auto; display: flex; padding: .2rem; color: var(--ink3); flex: none; }
.case-details:hover { color: var(--accent-ink); }
.case-events { min-width: 0; font-size: .85rem; }
.case-events > summary { cursor: pointer; color: var(--ink2); }
.case-events > .events {
  position: absolute; left: -1px; right: -1px; top: 100%; margin: 0; padding: .4rem .9rem .7rem;
  list-style: none; max-height: 50vh; overflow-y: auto; background: var(--raised);
  border: 1px solid var(--line); border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: 0 8px 18px rgba(0, 0, 0, .14);
}
.case-events .events li { display: flex; gap: .6rem; padding: .25rem 0; overflow-wrap: anywhere; min-width: 0; }
.case-events .events .at { flex: none; color: var(--ink3); font-variant-numeric: tabular-nums; }
/* A proposed dossier (`case-messages`, filter `new`, card 516): the same tile, a yellowish folder
   before the name. Its messages open under it, in the tile, which takes the whole row: the rows
   of the queue need the width. «Apri il dossier» stays on the line of the panel's summary. */
ul.briefing > li.proposed > header > .object-icon { width: 1.6rem; height: 1.6rem; color: var(--uncertain); }
ul.briefing > li.proposed > header > .object-icon path { fill: var(--uncertain); fill-opacity: .22; }
ul.briefing > li.proposed > footer { flex-wrap: wrap; align-items: center; }
ul.briefing > li.proposed.messages-open { grid-column: 1 / -1; }
.group-messages { min-width: 0; font-size: .85rem; }
.group-messages > summary { cursor: pointer; color: var(--ink2); }
.group-messages[open] { flex-basis: 100%; order: 2; font-size: 1rem; }
.group-messages > .message-rows { margin: .5rem 0 0; }
ul.briefing > li.proposed form.coin { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; margin-left: auto; min-width: 0; }
ul.briefing > li.proposed form.coin [data-outcome]:empty { display: none; }
ul.briefing > li.proposed .folder-pop { display: flex; flex-direction: column; align-items: flex-start; gap: .5rem; }
/* A list of settings (card 479): a name, its value, the gestures on it. Neutral classes, the
   same for every module that lists what the office has chosen. `.settings-remove` and
   `.settings-add` are native `<details>`; a button `data-collapse` closes the one it is in. */
.settings-title { margin: 1.5rem 0 .4rem; font-size: 1.05rem; }
.settings-group { margin: 1rem 0 .4rem; font-size: .9rem; }
.settings-list { list-style: none; margin: 0 0 .5rem; padding: 0; border-top: 1px solid var(--line); }
.settings-row { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .8rem; padding: .45rem .6rem; border-bottom: 1px solid var(--line); background: var(--surface); }
.settings-name { flex: 1 1 12rem; min-width: 0; overflow-wrap: anywhere; }
.settings-value { flex: 0 0 auto; }
.settings-empty { margin: 0 0 .5rem; }
.settings-remove form, .settings-add form { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .8rem; margin: .5rem 0; }
.settings-remove form > p { flex-basis: 100%; margin: 0; }
.settings-add .field { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; }
.settings-add .field > span { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink3); font-weight: 600; }
.settings-remove form [data-outcome], .settings-add form [data-outcome] { flex-basis: 100%; }
.settings-remove form [data-outcome]:empty, .settings-add form [data-outcome]:empty { display: none; }
/* «Sgancia» (card 257): the broken chain at the end of the line that names the case. */
.detach-folder { display: contents; }
.detach-folder > button.quiet { display: flex; padding: .2rem; color: var(--ink3); }
.detach-folder > button.quiet:hover { color: var(--accent-ink); }
/* What an outcome names between «» (xhalia.js): a folder, a case, a message. */
[data-outcome] .named { color: var(--accent-ink); }
.attach-folder form.new-chosen .new-case { display: block; }

/* The register of the decisions (card 345) in the rows of «Da confermare» (card 517): the
   accent of the kind on the left — a decision, one already there, a proposal or a dismissal,
   a home the person corrected (card 238), a reading withdrawn, a correction taken back. */
.register > li.message-row { box-shadow: inset 3px 0 0 var(--certain); }
.register > li.by-external, .register > li.entry-proposed, .register > li.entry-discarded { box-shadow: inset 3px 0 0 var(--neutral); }
.register > li.corrected, .register > li.entry-withdrawn, .register > li.entry-undone { box-shadow: inset 3px 0 0 var(--uncertain); }
.message-row .band-lines { flex: 1 1 100%; min-width: 0; }
.message-row .band-lines:not(:has(*)) { display: none; }
.correction { margin: .45rem 0 0; font-size: .9rem; color: var(--ink2); }
.correction .before { text-decoration: line-through; color: var(--ink3); }
.learned { margin: .5rem 0 0; padding: .5rem .75rem; background: var(--accent-soft); border-radius: var(--radius); font-size: .85rem; color: var(--accent-ink); }
.learned strong { font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; margin-right: .4rem; }
.register .why { margin: .35rem 0 0; font-size: .88rem; color: var(--ink2); overflow-wrap: anywhere; }
.register .why strong, .withdrawn strong { font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; margin-right: .4rem; }
.withdrawn { margin: .5rem 0 0; padding: .5rem .75rem; border-left: 2px solid var(--line); font-size: .85rem; color: var(--ink2); overflow-wrap: anywhere; }
.withdrawn q { display: block; margin-top: .25rem; color: var(--ink3); text-decoration: line-through; quotes: none; }

/* The briefing of the matters page (card 337): a card per matter, its events a list. */
.briefing-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .8rem; margin: 0 0 .8rem; }
.briefing-bar label { display: flex; align-items: center; gap: .4rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink3); font-weight: 600; }
.briefing { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.briefing > li { background: var(--surface); border-radius: var(--radius); padding: .7rem .75rem; min-width: 0; }
.briefing > li.chosen { box-shadow: inset 3px 0 0 var(--accent); }
.briefing header { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .6rem; }
.briefing .name { font-family: var(--serif); font-size: 1.05rem; font-weight: 600; overflow-wrap: anywhere; }
.briefing .events { list-style: none; margin: .5rem 0 0; padding: 0; }
.briefing .events li { display: flex; gap: .6rem; padding: .2rem 0; min-width: 0; }
.briefing .events .at { flex: none; color: var(--ink3); font-variant-numeric: tabular-nums; }
.briefing .events a { overflow-wrap: anywhere; min-width: 0; }
.briefing .events .proposed { min-width: 0; overflow-wrap: anywhere; flex: 1 1 auto; }
.pill.pending { color: var(--uncertain); border-color: var(--uncertain); }
/* «Confermo» on an event to confirm (card 339, C7c): the event settles in place - the form and
   the «da confermare» pill give way to the decision, which says what was done. */
.briefing .events .confirm { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; margin: .35rem 0 0; }
.briefing .events .confirm [data-outcome] { flex: 1 1 100%; min-width: 0; margin: 0; overflow-wrap: anywhere; }
.briefing .events .decision { display: none; margin: .2rem 0 0; min-width: 0; overflow-wrap: anywhere; }
.briefing .events .decision-case { margin: 0; }
.briefing .events .decision .why-line { margin: .15rem 0 0; }
.pill.confirmed { color: var(--certain); border-color: var(--certain); }
.briefing .events li[data-settled] { box-shadow: inset 3px 0 0 var(--accent-ink); padding-left: .5rem; }
.briefing .events li[data-settled] .decision { display: block; }
.briefing .events li[data-settled] .confirm,
.briefing .events li[data-settled] .proposed > .pill.pending { display: none; }
.briefing .preview > summary { cursor: pointer; color: var(--accent-ink); }
.briefing .preview-body { margin: .4rem 0 0; display: grid; gap: .1rem; min-width: 0; }
.briefing .preview-body dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink3); font-weight: 600; margin-top: .4rem; }
.briefing .preview-body dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.briefing .preview-body pre { white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--sans); margin: 0; }
.briefing .preview-body ul { margin: 0; padding-left: 1.1rem; }
.new-matters { margin: 0 0 1rem; }

@media (max-width: 40rem) {
  .queue > li { flex-direction: column; align-items: stretch; }
  .gestures { justify-content: flex-start; max-width: none; }
  .gestures [data-outcome] { text-align: left; }
  .queue > li .decision { max-width: none; text-align: left; }
  .decision form { justify-content: flex-start; }
  .summary { text-align: left; }
}

/* --- the search of the mail page (card 189) --------------------------------- */

.mail-search { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 .4rem; }
.mail-search input[type=text] { flex: 1 1 16rem; }
.mail-search-heading { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink3); font-weight: 600; margin: 1rem 0 .4rem; }

/* --- the credentials and the persons (the tabs Password and Persone of the page
   Configurazione) --------------------------------------------------------------- */

/* Card 395: four columns — credential, of whom, state, action. The forms of a row share
   the column Azione, so the field and «Imposta» line up from one row to the next.
   Card 396: the persons are the same table — name, role, password, actions. */
.credentials, .people { width: 100%; }
.credentials td, .people td { vertical-align: top; }
.credentials .cred-name { width: 30%; }
.credentials .cred-action, .people .person-action { min-width: 22rem; }
.credentials .cred-of { min-width: 8rem; overflow-wrap: break-word; color: var(--ink2); }
.credentials .cred-actions, .people .person-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.credentials form, .person-actions form { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: 0; }
.credentials form [data-outcome], .person-actions form [data-outcome] { flex: 1 1 100%; min-width: 0; overflow-wrap: anywhere; }
.credentials tr.state-missing td:first-child { box-shadow: inset 3px 0 0 var(--uncertain); }
/* The persons: the name stands out, the rest is lighter; «Ritira» to the right of the
   field and «Reimposta»; a retired person is a dimmed row. */
.people .person-name { width: 30%; }
.people .person-role, .people .person-password { color: var(--ink2); }
.people .person-role .pill + .pill { margin-left: .3rem; }
.people .person-actions { flex-wrap: nowrap; }
.people .person-actions > form:first-child { flex: 1 1 auto; flex-wrap: nowrap; }
.people .person-actions > form:first-child [data-outcome]:empty { display: none; }
.people .person-retire { margin-left: auto; }
.people .person-retire [data-outcome]:empty { display: none; }
.people tr.retired td { color: var(--ink3); }
.people tr.retired .person-name strong { font-weight: 500; }
/* «Ammetti una persona»: a panel under the table, each label over its field. */
.people-admit { margin-top: 1.5rem; }
.people-admit form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .6rem; }
.people-admit .admit-field { display: flex; flex-direction: column; gap: .25rem; flex: 1 1 12rem; min-width: 0; }
.people-admit form [data-outcome] { flex: 1 1 100%; min-width: 0; overflow-wrap: anywhere; }
.people-admit form [data-outcome]:empty { display: none; }
.admit-hint { margin: .6rem 0 0; font-size: .88rem; color: var(--ink2); }
/* The «i»: a closed details next to the label, its sentence under it in the same cell. */
.cred-info { display: inline; }
.cred-info > summary { display: inline-flex; align-items: center; justify-content: center; width: 1.2rem; height: 1.2rem; margin-left: .3rem; border: 1px solid var(--line); border-radius: 50%; font-size: .75rem; font-style: italic; font-family: var(--serif); color: var(--accent-ink); cursor: pointer; list-style: none; vertical-align: middle; }
.cred-info > summary::-webkit-details-marker { display: none; }
.cred-info[open] > p { display: block; margin: .35rem 0 0; max-width: 36rem; font-size: .88rem; color: var(--ink2); overflow-wrap: anywhere; }

/* The credentials and the persons on a phone (cards 282, 395, 396): one row under the
   other, field and buttons full width — never a horizontal scroll. */
@media (max-width: 40rem) {
  table.credentials, table.credentials tbody, table.credentials tr, table.credentials td,
  table.people, table.people tbody, table.people tr, table.people td { display: block; width: 100%; box-sizing: border-box; }
  table.credentials thead, table.people thead { display: none; }
  table.credentials tr, table.people tr { border-bottom: 1px solid var(--line); padding: .4rem 0; }
  table.credentials td, table.people td { border: 0; padding: .2rem .6rem; width: 100%; min-width: 0; }
  table.credentials td.cred-of:empty, table.people td:empty { display: none; }
  table.credentials td[data-label]:not(.cred-name)::before { content: attr(data-label) ": "; color: var(--ink2); }
  table.people td[data-label]::before { content: attr(data-label) ": "; color: var(--ink2); }
  table.people form { display: flex; flex-wrap: wrap; gap: .4rem; margin: .2rem 0; }
  table.credentials td.cred-action::before { display: none; }
  table.credentials .cred-actions, table.credentials form,
  table.people .person-actions, table.people .person-actions form { display: flex; flex-direction: column; align-items: stretch; width: 100%; }
  table.credentials form input[name=secret], table.people form input[name=secret] { width: 100%; box-sizing: border-box; }
  table.people .person-retire { margin-left: 0; }
  .people-admit form { flex-direction: column; align-items: stretch; }
  .people-admit .admit-field { flex: none; }
}

/* --- the tab «Aspetto» (card 282) ------------------------------------------ */

/* Card 485: one boxed section per setting; the tokens are those of the other boxed
   panels (border --line, --radius, --raised). */
.appearance-section { margin: 0 0 1rem; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--raised); min-width: 0; }
.appearance-section > h3 { margin-top: 0; }
.appearance-section fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.appearance-section legend { padding: 0; }
.appearance-section .voice-preview { margin: .75rem 0 0; }
form.appearance { display: grid; gap: .6rem; justify-items: start; margin: 0 0 1rem; }
/* The section Logo (card 486): its own form, the file and its button one under the other. */
.appearance-logo form { display: grid; gap: .5rem; justify-items: start; margin: 0 0 .6rem; }
.appearance-logo input[type="file"] { max-width: 100%; }
.palettes { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); gap: .5rem; width: 100%; }
.palettes legend { padding: 0; margin: 0 0 .4rem; color: var(--ink2); }
/* The masthead bar (card 297): each choice shows itself, with the office's name, in the
   colours it has in the light theme and in the dark one (`bars` of the verb). */
.bars { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); gap: .5rem; width: 100%; }
.bars legend { padding: 0; margin: 0 0 .4rem; color: var(--ink2); }
.bar-choice { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: .3rem .5rem; padding: .5rem .7rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--raised); cursor: pointer; }
.bar-choice:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.bar-choice, .palette-choice { min-width: 0; }
.palette-name { min-width: 0; overflow-wrap: anywhere; }
.bar-name { min-width: 0; overflow-wrap: anywhere; }
.bar-previews { grid-column: 2; display: flex; flex-wrap: wrap; gap: .4rem; }
.bar-preview { display: inline-block; padding: .2rem .55rem; border: 1px solid var(--line2); border-radius: 3px; font-size: .78rem; white-space: normal; overflow-wrap: anywhere; min-width: 0; max-width: 100%; box-sizing: border-box; }
.bar-previews > * { min-width: 0; }
.bar-preview > span { font-family: var(--serif); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.palette-choice { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: .2rem .5rem; padding: .5rem .7rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--raised); cursor: pointer; }
.palette-choice:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.palette-choice .swatches { grid-column: 2; display: flex; gap: .5rem; }
.swatch-set { display: inline-flex; border: 1px solid var(--line2); border-radius: 3px; overflow: hidden; }
.swatch { display: inline-block; width: .9rem; height: .9rem; }

/* --- the panes of a page (card 225) ------------------------------------------
   Generic: a module marks the root of its template with data-pane="side|main|detail"
   and the page that holds one is laid out in a grid — the side on the left, main and
   detail on the right, one under the other; a panel without a pane takes the whole
   width. No name of a module here, no key in the manifest of the page. Below 52rem,
   one column: the panels in the written order.
   Card 585: the panel that holds a pane says which (`data-holds`, written by page.html and by
   xhalia.js for the panel it creates), so no rule asks `:has()` — a browser without it
   (Firefox 115 ESR) would lose the columns. The grid is every wide `.panes`: a page without
   panes has each panel across the whole width, as one under the other. */

@media (min-width: 52rem) {
  .panes {
    display: grid;
    grid-template-columns: minmax(13rem, 18rem) minmax(0, 1fr);
    column-gap: 1.25rem;
    align-items: start;
  }
  .panes > * { grid-column: 1 / -1; min-width: 0; }
  .panes > [data-holds="side"] {
    grid-column: 1; grid-row: span 2;
    position: sticky; top: calc(var(--top-h, 0px) + 1rem); max-height: calc(100vh - 2rem - var(--top-h, 0px)); overflow: auto;
  }
  .panes > [data-holds="main"],
  .panes > [data-holds="detail"] { grid-column: 2; }
}

/* The tree of the folders (cards 354, 368). A row is the prototype's `.cart`: icon, name, and at
   the end the unseen count (or the messages count in «all»). A folder under a group of type
   (`.sub`) is indented by itself, so the list inside carries no indent of its own. */
.tree { list-style: none; margin: 0; padding: 0; }
.tree ul { list-style: none; margin: 0; padding: 0; }
.tree li:not(.type-group) > ul { padding-left: 14px; }
.tree .type-group { margin-bottom: 14px; }
.tree .folder {
  display: flex; align-items: center; gap: 8px; min-width: 0; padding: 5px 10px;
  border-radius: var(--radius); font-size: .9333rem; color: var(--ink); text-decoration: none;
}
.tree a.folder:hover { background: var(--surface2); }
.tree .folder[aria-current="true"] { background: var(--accent-soft); font-weight: 600; }
.tree span.folder { cursor: default; }
.tree .folder.sub { padding-left: 28px; font-size: .9rem; }
.tree .folder.sub .icon { color: var(--ink3); }
.tree .folder .icon { flex: none; width: 14px; text-align: center; color: var(--ink2); }
.tree .folder .name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree .folder .unseen, .tree .folder .count, .tree > li .count {
  margin-left: auto; font-family: var(--mono); font-size: .7667rem; color: var(--accent-ink); font-weight: 600;
}
.tree .group-title {
  display: block; padding: 10px 10px 4px; font-size: .7333rem; text-transform: uppercase;
  letter-spacing: .1em; color: var(--ink3); font-weight: 600;
}

/* The folders of the mailbox grouped by type (card 354): a folder bound to an entity of
   Xhalia carries the mark of a chain after its title, a closed one is dimmed and labelled.
   A long title wraps, never a row wider than the panel. */
.linked-mark { display: inline-flex; vertical-align: middle; color: var(--ink3); }
.linked-mark svg { width: 14px; height: 14px; }
.tree .closed > a, .tree .closed > .folder, .tree .closed > .linked-mark { opacity: .55; }
.tree .closed-label { margin-left: .3rem; }
.legend { color: var(--ink3); font-size: .8rem; margin: 12px 10px 0; display: flex; gap: 6px; align-items: center; }
.closed-toggle { display: flex; align-items: center; gap: 6px; padding: 8px 10px 0 28px; font-size: .8rem; color: var(--ink3); text-decoration: none; overflow-wrap: anywhere; }
.closed-toggle::before { content: ""; flex: none; width: .9rem; height: .9rem; box-sizing: border-box; border: 1.5px solid var(--ink3); border-radius: 3px; background: transparent; }
.closed-toggle[aria-checked="true"]::before { background: var(--accent); border-color: var(--accent); box-shadow: inset 0 0 0 2px var(--ground); }

/* The choice of the mailbox (card 368): the prototype's `.seg`, then the address in mono. */
.mailbox-switch { display: flex; gap: 2px; background: var(--surface2); border-radius: var(--radius); padding: 2px; margin: 0 2px 12px; }
.mailbox-switch a {
  flex: 1 1 0; min-width: 0; padding: 4px 6px; border-radius: 4px; text-align: center; font-size: .8667rem;
  color: var(--ink2); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mailbox-switch a[aria-pressed="true"] { background: var(--raised); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgb(19 26 25 / .12); }
.mailbox-address { margin: 0; padding: 0 10px; font-family: var(--mono); font-size: .7333rem; color: var(--ink3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.messages-head { position: sticky; top: 0; z-index: 2; background: var(--raised); border-bottom: 1px solid var(--line); padding: 12px 14px 10px; display: grid; gap: 4px; }
.messages-head h2 { font-family: var(--serif); font-size: 1.1333rem; font-weight: 600; margin: 0; }
.messages-head .under { margin: 0; color: var(--ink3); font-size: .8333rem; overflow-wrap: anywhere; }
.messages { list-style: none; margin: 0; padding: 0; }
.messages li a { display: grid; grid-template-columns: 8px minmax(0, 1fr); gap: 8px; padding: 9px 14px 10px 8px; border-bottom: 1px solid var(--line); background: var(--raised); text-decoration: none; color: var(--ink); }
.messages li a:hover { background: var(--surface); }
.messages li a[aria-current="true"] { background: var(--accent-soft); }
.messages .marker { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; }
.messages .unseen .marker { background: var(--accent); }
.messages .unseen .sender, .messages .unseen .subject { font-weight: 600; }
.messages .row-body { min-width: 0; display: block; }
.messages .line { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.messages .sender, .messages .subject, .messages .preview { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.messages .when { font-family: var(--mono); font-size: .7667rem; color: var(--ink3); white-space: nowrap; font-variant-numeric: tabular-nums; margin-left: auto; text-align: right; }
.messages .preview { color: var(--ink3); font-size: .8667rem; }
.messages .tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; }
.messages .tags:empty { display: none; }
.messages.set-aside .row { opacity: .78; }
.fold { display: flex; width: 100%; box-sizing: border-box; justify-content: space-between; align-items: center; gap: 8px; background: var(--surface); border-bottom: 1px solid var(--line); padding: 10px 14px; color: var(--ink2); font-size: .8667rem; text-decoration: none; }
.fold:hover { color: var(--ink); }
.unknown { font-size: .8rem; color: var(--new); }
/* The older and the more recent page: a triangle, absent at its end of the folder. */
.pager { display: flex; justify-content: center; padding: 6px 14px; color: var(--ink3); font-size: .8rem; text-decoration: none; border-bottom: 1px solid var(--line); }
.pager[data-page="older"] { border-bottom: 0; border-top: 1px solid var(--line); }
.pager:hover, .pager:focus-visible { color: var(--ink); background: var(--surface); }

/* The message opened (card 366, P2): prototype `.lettura`. */
.letter { max-width: 860px; padding: 18px 26px 40px; display: grid; gap: 14px; min-width: 0; }
.letter > * { margin: 0; min-width: 0; }
.letter .position { font-size: .8rem; color: var(--ink3); margin-bottom: -6px; overflow-wrap: anywhere; }
.letter .subject { font-family: var(--serif); font-size: 1.4rem; font-weight: 600; line-height: 1.3; text-wrap: balance; overflow-wrap: anywhere; }
.letter-head { display: flex; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap; font-size: .9rem; }
.letter-head .sender { min-width: 0; overflow-wrap: anywhere; }
.letter-head .sender b { font-weight: 600; }
.letter-head .recipients { color: var(--ink3); font-size: .8333rem; }
.letter-head .recipients > summary { list-style: none; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.letter-head .recipients > summary::-webkit-details-marker { display: none; }
.letter-head .recipients[open] > summary { white-space: normal; overflow-wrap: anywhere; }
.letter-head .sender { min-width: 0; }
.letter-head .when { font-family: var(--mono); font-size: .8rem; color: var(--ink3); white-space: nowrap; }
.letter-gestures { display: flex; justify-content: flex-end; gap: 8px; margin: 8px 0 0; }
/* The answer and the forward (card 439): small buttons with the icon, the name in `title`. */
a.button.icon { display: inline-flex; align-items: center; justify-content: center; padding: 5px 8px; color: var(--ink2); }
a.button.icon:hover { color: var(--ink); }
.forward-note { color: var(--ink2); font-size: .85rem; margin: 0; }
.forward-original { white-space: pre-wrap; overflow-wrap: anywhere; font-family: inherit; font-size: .85rem; color: var(--ink2); max-height: 12rem; overflow: auto; margin: 0; padding: 8px 10px; border-left: 3px solid var(--line2); background: var(--surface); }
.forward-form [data-outcome] { white-space: pre-wrap; overflow-wrap: anywhere; }
:is(.letter, .message-row) .band { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; border: 1px solid var(--line); border-left: 3px solid var(--ink3); background: var(--voice-ground); border-radius: var(--radius); padding: 9px 12px; }
:is(.letter, .message-row) .band-sure { border-left-color: var(--certain); }
:is(.letter, .message-row) .band-unsure { border-left-color: var(--uncertain); }
:is(.letter, .message-row) .band-none { border-left-color: var(--unrecognised); }
:is(.letter, .message-row) .band-unread { border-left-color: var(--ink3); }
:is(.letter, .message-row) .band-new { border-left-color: var(--new); background: var(--new-ground); }
:is(.letter, .message-row) .band-settled { border-left-color: var(--accent); background: transparent; }
:is(.letter, .message-row) .band-words { flex: 1 1 160px; min-width: 0; color: inherit; text-decoration: none; overflow-wrap: anywhere; }
:is(.letter, .message-row) .band-words:hover .voice-phrase { text-decoration: underline; text-underline-offset: 3px; }
:is(.letter, .message-row) .band-gestures { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 0; }
:is(.letter, .message-row) .band-gestures form { margin: 0; display: flex; align-items: center; gap: 6px; }
/* One size and one baseline for the gestures of the band: a link, a button and the summary of
   «Sposta in…» are drawn alike, and an outcome still empty takes no room beside them. */
:is(.letter, .message-row) .band-gestures :is(button, a.button, summary.button) { font: inherit; font-size: .8667rem; line-height: 1.4; padding: 5px 12px; box-sizing: border-box; display: inline-block; }
:is(.letter, .message-row) .band-gestures [data-outcome]:empty { display: none; }
:is(.letter, .message-row) .band-gestures [data-outcome] { margin: 0; }
:is(.letter, .message-row) .band-gestures details[open] { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.letter .body { white-space: pre-wrap; font-family: var(--sans); font-size: 1rem; line-height: 1.65; max-width: 68ch; overflow-wrap: anywhere; }
/* The body in HTML (card 363): a frame as tall as its content, white whatever the theme. */
.letter .letter-frame { display: block; width: 100%; border: 0; background: #fff; overflow: hidden; }
.letter .letter-images { margin: 0 0 .5rem; }
.letter .notice { color: var(--notice); font-size: .85rem; margin: 0 0 .5rem; }
@media (prefers-color-scheme: dark) {
  .letter .letter-frame { border: 1px solid var(--line); }
}
/* The attachments (card 364, box of card 366): extension, preview, name and meta in one box. */
.letter .attachments { font-size: .8667rem; color: var(--ink2); }
.letter .attachments h3 { font-size: .8rem; font-weight: 600; color: var(--ink3); margin: 0 0 6px; }
.letter .attachments ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.letter .attachments li { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 10px; font-size: .8667rem; background: var(--surface); min-width: 0; overflow-wrap: anywhere; }
.letter .attachment-preview { display: block; max-width: 96px; max-height: 72px; border: 1px solid var(--line); }
.letter .attachment-meta { color: var(--ink3); font-size: .8rem; }
.mail-back[hidden] { display: none; }
.mail-back { display: inline-block; border: 1px solid var(--line2); border-radius: var(--radius); padding: 3px 10px; font-size: .8667rem; color: var(--ink); text-decoration: none; }
@media (max-width: 720px) {
  .letter { padding: 14px 16px 32px; }
  :is(.letter, .message-row) .band-gestures { flex-basis: 100%; }
}

/* The window (card 247): one module over the page, in a `<dialog>`. Closing it leaves the
   page under it as it was — the same tab, the same point of the list. */
dialog.window {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: inherit;
  max-height: 85vh;
  max-width: 52rem;
  overflow: auto;
  padding: 1.25rem;
  width: calc(100% - 2rem);
}
dialog.window::backdrop { background: rgb(0 0 0 / .35); }
dialog.window .window-close { float: right; }
a.read { font-size: .9rem; margin-left: .4rem; }

/* case-messages, la riga di messaggio (card 341): one line per message, the rest opens. */
.case-messages-filters { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .8rem; margin: 0 0 .8rem; }
.case-messages-filters .filters { display: flex; flex-wrap: wrap; gap: .3rem; min-width: 0; }
.case-messages-filters label { display: flex; align-items: center; gap: .4rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink3); font-weight: 600; }
.case-messages-filters .filter.active { border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.case-messages-filters .count { color: var(--ink3); font-variant-numeric: tabular-nums; }
.message-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.message-rows > li { background: var(--surface); border-radius: var(--radius); padding: .5rem .75rem; min-width: 0; overflow-wrap: anywhere; }
.message-row.chosen { box-shadow: inset 3px 0 0 var(--accent); }
.message-row[data-settled] { box-shadow: inset 3px 0 0 var(--accent-ink); }
.message-row summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .6rem; cursor: pointer; min-width: 0; }
.message-row summary a { min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.message-row summary .sender, .message-row summary .at, .message-row summary .decision-line { min-width: 0; overflow-wrap: anywhere; }
.message-row summary .pill { white-space: normal; overflow-wrap: anywhere; }
.message-row .message-body { margin: .5rem 0 0; min-width: 0; }
/* The row of «Da confermare» as in the mail (2026-10-20): the folder small before the subject,
   the pill on the right under one heading of the column; open, what it says, the first lines
   of the text on a lighter ground, the attachments, the band of Xhalia as in the mail. */
.message-rows-head { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem .8rem; margin: 0 .75rem .35rem; }
.message-rows-head .select-all { display: inline-flex; align-items: center; gap: .4rem; font-size: .8667rem; }
.message-rows-head .column-head { margin-left: auto; font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink3); font-weight: 600; }
.message-row.selectable { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: .6rem; align-items: start; }
.message-row.selectable > :not(.select-row) { grid-column: 2; }
.message-row > .select-row { margin: .35rem 0 0; grid-row: 1; }
.message-row summary { justify-content: space-between; align-items: center; }
.message-row .message-head { display: flex; flex-direction: column; flex: 1 1 16rem; min-width: 0; }
.message-row .subject-line { min-width: 0; overflow-wrap: anywhere; }
.message-row .subject-line .folder { font-size: .78rem; margin-right: .35rem; }
.message-row .subject-line .subject { font-weight: 600; }
.message-row .from-line { font-size: .85rem; }
.message-row summary .decision-line { margin-left: auto; text-align: right; }
.message-row .says-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink3); font-weight: 600; margin: .6rem 0 0; }
.message-row .says { margin: .15rem 0 .5rem; }
.message-row .text-excerpt { white-space: pre-wrap; background: var(--voice-ground); border-radius: var(--radius); padding: .5rem .75rem; margin: .4rem 0; color: var(--ink2); font-size: .9rem; line-height: 1.55; overflow-wrap: anywhere; }
.message-row .attachments { list-style: none; margin: .4rem 0; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem .9rem; font-size: .8667rem; color: var(--ink2); }
.message-row .attachments li::before { content: "\1F4CE\FE0E  "; }
.message-row .band { margin: .6rem 0 .2rem; }
.message-row .band .voice { flex: 1 1 200px; }
.message-row .band-gestures details.elsewhere > summary { list-style: none; }
.message-row .band-gestures details.elsewhere[open] { flex-basis: 100%; }
.message-row .message-body dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink3); font-weight: 600; margin-top: .4rem; }
.message-row .message-body dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.message-row pre.body { white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--sans); margin: 0; max-width: 100%; }
.message-row .attachments { margin: 0; padding-left: 1rem; }
.message-row .confirm { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; margin: .5rem 0 0; }
.message-row .confirm [data-outcome] { flex: 1 1 100%; min-width: 0; margin: 0; overflow-wrap: anywhere; }
.message-row > .decision { display: none; margin: .2rem 0 0; min-width: 0; overflow-wrap: anywhere; }
.message-row[data-settled] > .decision { display: block; }
.message-row[data-settled] .confirm,
.message-row[data-settled] .decision-line,
.message-row[data-settled] .new-where { display: none; }
p.more { margin-top: .5rem; }
/* «Non è di questa pratica» (card 342, C8b): a `<details>` with the three choices inside, on the
   row of a proposal and on the event to confirm of the briefing — another matter, a new one, not
   work. Each choice is its own form; the outcome stays under it. */
.elsewhere { margin: .4rem 0 0; min-width: 0; }
.elsewhere > summary { cursor: pointer; color: var(--accent-ink); font-size: .9rem; }
.elsewhere[open] > summary { margin-bottom: .3rem; }
.elsewhere-choice {
  display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; min-width: 0;
  margin: .3rem 0 0; padding: .5rem .6rem; border: 1px solid var(--line2);
  border-radius: var(--radius); background: var(--surface);
}
.elsewhere-choice .field { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; min-width: 0; max-width: 100%; }
.elsewhere-choice .field > span { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink3); font-weight: 600; }
.elsewhere-choice select, .elsewhere-choice input[type=text] { min-width: 0; max-width: 100%; flex: 1 1 12rem; }
.elsewhere-choice [data-outcome] { flex: 1 1 100%; min-width: 0; margin: 0; overflow-wrap: anywhere; }
.message-row .restore { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; margin: .5rem 0 0; }
.message-row .restore [data-outcome] { flex: 1 1 100%; min-width: 0; margin: 0; overflow-wrap: anywhere; }
.message-row[data-settled] .elsewhere,
.briefing .events li[data-settled] .elsewhere { display: none; }

/* The voice of Xhalia (card 352, `shell/voice.html`): label above, one row with the
   round avatar and the phrase, the reason below, indented under the phrase. */
.voice { display: block; min-width: 0; }
.voice-label { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; color: var(--accent-ink); font-weight: 600; }
.voice-line { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
.voice-avatar { display: inline-flex; width: 22px; height: 22px; flex: none; border-radius: 50%; overflow: hidden; vertical-align: middle; color: var(--ink); }
.voice-avatar svg, .voice-avatar img { display: block; width: 100%; height: 100%; }
.voice-phrase { min-width: 0; overflow-wrap: anywhere; }
.voice-why { display: block; padding-left: 30px; color: var(--ink2); font-size: .8333rem; overflow-wrap: anywhere; }
.voice-avatar .a { fill: var(--accent); stroke: none; }
.voice-avatar .on { fill: var(--on-accent); stroke: none; }
/* A line of an avatar (it carries its own width, as the prototype draws it): the same mark on the accent, as a stroke. */
.voice-avatar .on[stroke-width] { fill: none; stroke: var(--on-accent); }
.voice-avatar .s { fill: currentColor; stroke: none; }
.voice-avatar .f { fill: var(--accent-soft); stroke: none; }
.voice-avatar .as { fill: none; stroke: var(--accent); }
.voice-avatar .g { fill: none; stroke: var(--line2); }
/* The choice of the voice in the tab Aspetto, as the palettes': each avatar with its name. */
.voices { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 12rem), 1fr)); gap: .5rem; width: 100%; }
.voices legend { padding: 0; margin: 0 0 .4rem; color: var(--ink2); }
.voice-choice { display: flex; align-items: center; gap: .5rem; min-width: 0; padding: .5rem .7rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--raised); cursor: pointer; }
.voice-choice:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.voice-choice .voice-avatar { flex: none; }
.voice-name { flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; hyphens: auto; }
.voice-preview { margin: .75rem 0; padding: .7rem .9rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--raised); }

/* --- the mail layout (card 353, 368) ------------------------------------------
   A page whose manifest says `layout: "mail"` fills the window and does not scroll as a
   whole: the masthead on top, the sheet under it, and each column scrolls by itself.
   Everything is under [data-layout="mail"]; a page without one is untouched. No name of
   a module: the columns are told apart by data-pane, as the panes of card 225. The panels
   that are neither the list nor the message (the mailbox, the folders) sit in `.mail-side`.
   Wide (> 1000px): the side (250px), the list (main, 380px), the message (detail). From
   720 to 1000px: the list and the message side by side, the side a panel that slides in
   from the left, under the bar, when the button is open (absolute in the sheet, which is
   the window under the masthead: the button stays reachable to close it). Under 720px: one box at a time, the list or, with
   `data-open`, the message alone.
   Card 585: nothing here asks `:has()` — in a browser without it (Firefox 115 ESR) a rule that
   names it falls whole, and the page stayed cut, nothing scrolling. `<html>` carries the
   layout too (base.html), the columns are told apart by `data-holds` on their panel, the
   button open by `data-expanded` on what it opens (xhalia.js). */
body[data-layout="mail"] { height: 100vh; height: 100dvh; overflow: hidden; display: flex; flex-direction: column; }
html[data-layout="mail"] { height: 100%; overflow: hidden; }
[data-layout="mail"] .masthead, [data-layout="mail"] .beta-notice { flex: none; }
body[data-layout="mail"] .sheet {
  flex: 1 1 auto; min-height: 0; max-width: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; overflow: hidden; position: relative;
}
[data-layout="mail"] .mail-bar { flex: none; display: none; align-items: center; gap: 12px; height: 45px; box-sizing: border-box; padding: 0 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
[data-layout="mail"] .mail-toggle { background: none; border: 1px solid var(--line2); border-radius: var(--radius); padding: 3px 9px; color: var(--ink); cursor: pointer; }
[data-layout="mail"] .mail-body { flex: 1 1 auto; min-height: 0; min-width: 0; }
[data-layout="mail"] .panes { height: 100%; min-width: 0; }
[data-layout="mail"] .panes > * { min-width: 0; min-height: 0; overflow-wrap: anywhere; border-radius: 0; border: 0; margin: 0; overflow: auto; scrollbar-width: thin; scrollbar-color: var(--line2) transparent; }
[data-layout="mail"] .mail-side { background: var(--surface); border-right: 1px solid var(--line); padding: 10px 0 24px; }
[data-layout="mail"] .mail-side > .panel { padding: 0 8px; margin: 0; border: 0; border-radius: 0; background: none; overflow: visible; min-width: 0; }
[data-layout="mail"] .mail-side > .panel + .panel { margin-top: 0; }

[data-layout="mail"] .panes {
  display: grid; grid-template-columns: 250px var(--main-width, 380px) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); align-items: stretch;
}
[data-layout="mail"] .panes > .mail-side { grid-column: 1; grid-row: 1; }
[data-layout="mail"] .panes > [data-holds="main"] { grid-column: 2; grid-row: 1; border-right: 1px solid var(--line); }
[data-layout="mail"] .panes > [data-holds="detail"] { grid-column: 3; grid-row: 1; }
/* The edge between the list and the preview: a strip over the border, in the column of the
   preview, that the pointer or the arrows move; the width chosen is `--main-width` on the
   panes (xhalia.js). It sits in the middle of the gap the columns keep from `.panes`
   (`column-gap: 1.25rem`). While it is dragged a frame (a PDF) does not take the pointer. */
[data-layout="mail"] .panes > .pane-split {
  grid-column: 3; grid-row: 1; justify-self: start; width: 9px; margin-left: calc(-.625rem - 4.5px); z-index: 2;
  overflow: visible; cursor: col-resize; touch-action: none; background: none;
}
[data-layout="mail"] .panes > .pane-split[hidden] { display: none; }
[data-layout="mail"] .panes > .pane-split:is(:hover, :focus-visible, [data-dragging]) {
  background: linear-gradient(var(--accent-ink), var(--accent-ink)) center / 2px 100% no-repeat; outline: none;
}
[data-layout="mail"][data-splitting] { cursor: col-resize; user-select: none; }
[data-layout="mail"][data-splitting] iframe { pointer-events: none; }

@media (max-width: 1000px) {
  [data-layout="mail"] .mail-bar { display: flex; }
  [data-layout="mail"] .panes { grid-template-columns: var(--main-width, 340px) minmax(0, 1fr); }
  [data-layout="mail"] .panes > [data-holds="main"] { grid-column: 1; }
  [data-layout="mail"] .panes > [data-holds="detail"], [data-layout="mail"] .panes > .pane-split { grid-column: 2; }
  [data-layout="mail"] .panes > .mail-side {
    position: absolute; top: 45px; bottom: 0; left: 0; width: 270px; z-index: 50; grid-column: auto; grid-row: auto;
    box-shadow: 0 2px 6px rgb(19 26 25 / .08), 0 18px 48px rgb(19 26 25 / .16);
    transform: translateX(-105%); visibility: hidden; transition: transform .2s, visibility 0s .2s;
  }
  [data-layout="mail"] .mail-body[data-expanded] .panes > .mail-side {
    transform: none; visibility: visible; transition: transform .2s;
  }
}
@media (max-width: 1000px) and (prefers-reduced-motion: reduce) {
  [data-layout="mail"] .panes > .mail-side { transition: none !important; }
}

@media (max-width: 720px) {
  [data-layout="mail"] .mail-body { overflow: auto; }
  [data-layout="mail"] .panes { display: block; height: auto; }
  [data-layout="mail"] .panes > :not(.mail-side) { overflow: visible; border-right: 0; }
  /* The list, or the open message alone. */
  [data-layout="mail"] .panes > [data-holds="detail"], [data-layout="mail"] .panes > .pane-split { display: none; }
  [data-layout="mail"][data-open="detail"] .panes > [data-holds="detail"] { display: block; }
  [data-layout="mail"][data-open="detail"] .panes > [data-holds="main"] { display: none; }
  [data-layout="mail"][data-open="detail"] .mail-toggle { display: none; }
}

/* The change window of a message (card 359, dressed in card 369): the prototype's `.modal`.
   Title and sentence, the two checks, the field with the labels and the list under it, where
   it goes, the note, the gestures. Nothing wider than the window: at 390px it is 358px. */
dialog.window.change {
  box-sizing: border-box;
  width: min(640px, calc(100% - 32px));
  max-width: none;
  background: var(--raised);
  border: 0;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgb(0 0 0 / .22);
  padding: 18px 20px;
}
dialog.window.change::backdrop { background: rgb(10 16 15 / .42); }
dialog.window.change > .window-close { display: none; }
.change-window { display: grid; gap: 14px; min-width: 0; }
.change-head { margin: 0; }
.change-title { margin: 0; font-family: var(--serif); font-size: 1.2rem; font-weight: 600; }
.change-about { margin: 2px 0 0; font-size: .8667rem; color: var(--ink2); }
.change-checks { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; }
.change-closed { display: inline-flex; align-items: center; gap: 6px; font-size: .8333rem; color: var(--ink2); cursor: pointer; }
.change-closed input { margin: 0; accent-color: var(--accent); }
.change-form { display: grid; gap: 14px; margin: 0; min-width: 0; }
.change-body { display: grid; gap: 6px; min-width: 0; transition: opacity .15s; }
.change-body[inert] { opacity: .45; }
.picker-box { position: relative; min-width: 0; }
.picker-field { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--line2); border-radius: var(--radius); padding: 5px 6px; cursor: text; }
.picker-field:focus-within { border-color: var(--accent); }
.chips { display: contents; list-style: none; margin: 0; padding: 0; }
.picker-find { flex: 1; min-width: 160px; width: auto; border: 0; background: transparent; padding: 3px 4px; outline: none; box-sizing: border-box; }
.chip { display: inline-flex; align-items: center; gap: 2px; position: relative; max-width: 100%; background: var(--raised); border: 1px solid var(--line2); border-radius: 14px; padding: 1px 2px 1px 10px; font-size: .8667rem; min-width: 0; }
.chip:first-child { background: var(--accent); border-color: var(--accent); color: var(--on-accent); padding-left: 8px; }
.chip button { background: none; border: 0; color: inherit; font: inherit; cursor: pointer; }
.chip .chip-main { padding: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; min-width: 0; }
.chip .chip-main[disabled] { opacity: 1; cursor: default; }
.chip .chip-remove { opacity: .7; font-size: 1rem; line-height: 1; padding: 2px 6px; border-radius: 10px; }
.chip .chip-remove:hover { opacity: 1; background: rgb(0 0 0 / .08); }
.chip-flag { display: none; }
.chip:first-child .chip-flag { display: inline; font-size: .7333rem; margin-right: 2px; }
.chip:first-child .chip-flag::before { content: "\2691"; }
.chip-mark { display: none; }
.chip:first-child .chip-mark { display: inline-block; position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.picker-list { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 4px); max-height: 240px; overflow-y: auto; padding: 4px; background: var(--raised); border: 1px solid var(--line2); border-radius: var(--radius); box-shadow: 0 8px 24px rgb(0 0 0 / .22); }
.picker-list[hidden] { display: none; }
.picker-list [data-option] { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 4px; font-size: .9333rem; cursor: pointer; min-width: 0; }
.picker-list [data-option][hidden] { display: none; }
.picker-list [data-option]:hover, .picker-list [data-option][data-active] { background: var(--surface); }
.picker-list .option-tick { width: 14px; flex: none; color: var(--accent); font-weight: 700; }
.picker-list .option-new { border-bottom: 1px solid var(--line); border-radius: 4px 4px 0 0; margin-bottom: 2px; }
.picker-list .option-new .option-tick { color: var(--new); }
.picker-list .option-text { display: grid; min-width: 0; overflow-wrap: anywhere; }
.picker-list .option-sub { font-size: .8rem; color: var(--ink3); }
.picker-list .closed .option-name { color: var(--ink3); }
.picker-list .option-why { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; font-size: .8rem; color: var(--ink3); white-space: nowrap; }
.picker-list .option-why[hidden] { display: none; }
.picker-list .option-why .voice-avatar { width: 14px; height: 14px; }
.picker-list .empty { margin: 0; padding: 8px; font-size: .8667rem; color: var(--ink3); }
/* The folders outside Xhalia under the matters (card 393): a heading line, and a chosen folder is
   a plain label, never the main matter. */
.picker-list .picker-group { margin: 4px 0 0; padding: 8px 8px 4px; border-top: 1px solid var(--line); font-size: .7333rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink3); font-weight: 600; }
/* The list of the dossiers on the left of the page of one dossier (card 515, `case-picker`):
   the order on top, the search, then the dossiers as the rows of the folders of the mail
   (`.tree .folder`): the small folder icon of `case-contents`, the name, the one open
   highlighted. */
.case-picker { min-width: 0; }
.case-picker-order { margin: 0 8px .5rem; font-size: .85rem; color: var(--ink3); }
.case-picker-order strong { color: var(--ink); }
.case-picker-find { margin: 0 0 .6rem; }
.case-picker-find input { width: 100%; box-sizing: border-box; }
.case-picker-heading { margin: .8rem 8px .2rem; font-size: .7333rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink3); font-weight: 600; }
.case-picker-list { list-style: none; margin: 0; padding: 0; }
.case-picker-list a { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 4px 8px; border-radius: 4px; color: var(--ink); text-decoration: none; }
.case-picker-list a:hover { background: var(--surface2); }
.case-picker-list a[aria-current="true"] { background: var(--accent-soft); font-weight: 600; }
.case-picker-list .object-icon { width: 1rem; height: 1rem; }
.case-picker-list .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.case-picker-list .closed a { opacity: .55; }
.case-picker-closed { flex: none; font-size: .8rem; color: var(--ink3); }
.chip[data-folder]:first-child { background: var(--raised); border-color: var(--line2); color: inherit; padding-left: 10px; }
.chip[data-folder] .chip-flag, .chip[data-folder] .chip-mark { display: none; }
.change-where { margin: 0; padding: 6px 9px; border-radius: 4px; background: var(--surface2); color: var(--ink2); font-family: var(--mono); font-size: .8rem; overflow-wrap: anywhere; }
.change-where:empty { display: none; }
.change-note { display: grid; gap: 4px; font-size: .7333rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink3); font-weight: 600; }
.change-note textarea { width: 100%; box-sizing: border-box; text-transform: none; letter-spacing: normal; font-weight: 400; }
.change-note textarea { min-height: 56px; resize: vertical; }
.change-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; margin: 0; }
.change-actions [data-outcome] { flex: 1 1 100%; margin: 0; }
/* The window «Rispondi» of a message (card 411): the fields one under the other, the gestures
   at the end as in «Cambia». */
.reply-form { display: flex; flex-direction: column; gap: 10px; }
.reply-form textarea { width: 100%; box-sizing: border-box; }
.reply-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; margin: 0; }
.reply-actions [data-outcome] { flex: 1 1 100%; margin: 0; }

/* The panel Attività (card 298): the table of the runs scrolls inside the window on a
   phone, never the page. */
.activity-table { overflow-x: auto; }

/* The chat (card 397): the conversations of the person on the left, on the right the messages
   that scroll and, at the bottom, the field to write in. The height of `.chat` is what the window
   leaves under what stands above it, set by `xhalia.js`: the page itself does not scroll. The
   person writes on the right, Xhalia answers on the left; an outcome is a small line in the
   middle. On a phone the list goes in a closed `details` over the messages.
   Card 419: three columns — the conversations, the conversation, the side panel with its
   sections (`[data-chat-side]`, filled by the cards after). The two sides are `details`: their
   summary is the control, closed a side is a narrow strip with its name on end, and the
   conversation takes the width. On a phone the two summaries stand in a row above the
   conversation, and an open side is laid over it.
   Card 432: on a wide screen the side panel open is not a fixed column: what the conversations
   leave goes half to the conversation and half to the panel. */
.sheet:has([data-chat]) { padding-bottom: 1rem; }
.panel:has([data-chat]) { margin-bottom: 0; }
.chat { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 1rem; min-height: 18rem; }
/* Card 493: in a container that holds the chat (`data-chat-fill`) the height is the container's,
   set by `xhalia.js` as above: the floor of the page does not apply, or a short container would
   be overflowed. */
[data-chat-fill] .chat { min-height: 0; }
.chat-recent, .chat-side { min-height: 0; overflow-y: auto; }
.chat-recent { border-right: 1px solid var(--line); padding-right: .75rem; }
.chat-recent[open] { width: 16rem; }
.chat-side { border-left: 1px solid var(--line); padding-left: .75rem; }
.chat.side-open { grid-template-columns: auto minmax(0, 1fr) var(--side-width, minmax(0, 1fr)); }
.chat > .chat-recent { grid-column: 1; grid-row: 1; }
.chat > .chat-main { grid-column: 2; grid-row: 1; }
.chat > .chat-side { grid-column: 3; grid-row: 1; }
/* The edge between the conversation and the side panel open, as the one of the mail layout: a
   strip in the middle of the gap, that the pointer or the arrows move; the width chosen is
   `--side-width` on `.chat` (xhalia.js). While it is dragged a frame does not take the pointer. */
.chat > .chat-split {
  grid-column: 3; grid-row: 1; justify-self: start; width: 9px; margin-left: calc(-.5rem - 4.5px); z-index: 2;
  cursor: col-resize; touch-action: none;
}
.chat:not(.side-open) > .chat-split, .chat-drawer .chat-split { display: none; }
.chat > .chat-split:is(:hover, :focus-visible, [data-dragging]) {
  background: linear-gradient(var(--accent-ink), var(--accent-ink)) center / 2px 100% no-repeat; outline: none;
}
body[data-splitting] { cursor: col-resize; user-select: none; }
body[data-splitting] .chat iframe { pointer-events: none; }
/* The artifact shown, over the whole window: a `<dialog>` in the top layer, closed by Esc too. */
.chat-full-open { display: inline-flex; padding: .3rem; color: var(--ink2); }
.chat-full-open:hover { color: var(--accent-ink); }
dialog.chat-full { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: .75rem; border: 0; background: var(--ground); color: inherit; }
dialog.chat-full[open] { display: flex; flex-direction: column; gap: .5rem; }
dialog.chat-full > .window-close { align-self: flex-end; }
dialog.chat-full > :is(.chat-artifact-view, .chat-markdown-view) { flex: 1 1 auto; height: auto; max-height: none; min-height: 0; }
.chat-recent > summary, .chat-side > summary { cursor: pointer; padding: .2rem .1rem .5rem; color: var(--accent-ink); font-weight: 600; white-space: nowrap; }
:is(.chat-recent, .chat-side):not([open]) > summary { writing-mode: vertical-rl; padding: .3rem .1rem; }
.chat-side-section > summary { cursor: pointer; padding: .3rem 0; font-size: .7333rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink3); font-weight: 600; }
.chat-side-section [data-chat-side] { padding: 0 0 .6rem; font-size: .85rem; }
.chat-side-section [data-chat-side] > p { margin: 0; }
/* Card 420: the steps of the last turn of Xhalia; what she said in her voice, the tools quieter. */
.chat-side-steps { margin: 0; padding-left: 1.2rem; }
.chat-side-steps li + li { margin-top: .25rem; }
.chat-side-steps .chat-step-tool { color: var(--ink3); }
/* Card 421: the memory of the office and of the person, each with «Dimentica». */
.chat-memory + .chat-memory { margin-top: .75rem; }
.chat-memory h3 { margin: 0 0 .25rem; font-size: inherit; }
.chat-memory-text > :first-child { margin-top: 0; }
/* A rule of a memory: its text, then the pencil, which opens the field in place, and the X. */
.chat-rules { list-style: none; margin: 0; padding: 0; }
.chat-rule { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: start; gap: .15rem; padding: .2rem 0; }
.chat-rule + .chat-rule { border-top: 1px solid var(--line); }
.chat-rule-text > :last-child { margin-bottom: 0; }
.chat-rule-edit { display: contents; }
.chat-rule-edit > summary { grid-column: 2; grid-row: 1; list-style: none; cursor: pointer; display: flex; padding: .2rem; border-radius: var(--radius); color: var(--ink3); }
.chat-rule-edit > summary::-webkit-details-marker { display: none; }
.chat-rule-edit > summary:hover, .chat-rule-edit[open] > summary { color: var(--accent-ink); }
.chat-rule-edit > form { grid-column: 1 / -1; grid-row: 2; display: flex; flex-direction: column; align-items: flex-end; gap: .25rem; }
.chat-rule-edit textarea { width: 100%; font: inherit; padding: .35rem .5rem; color: inherit; background: var(--raised); border: 1px solid var(--line2); border-radius: var(--radius); resize: vertical; }
.chat-rule-remove { grid-column: 3; grid-row: 1; }
.chat-rule-remove > button { display: flex; padding: .2rem; color: var(--ink3); }
.chat-rule-remove > button:hover { color: var(--accent-ink); }
.chat-rule [data-outcome]:empty { display: none; }
/* Card 433: the artifacts of the conversation — the titles, the chosen one in a frame as wide as
   the panel; what does not fit scrolls inside the frame, never the page. */
.chat-artifacts { display: flex; flex-wrap: wrap; gap: .25rem; margin: 0 0 .5rem; padding: 0; list-style: none; }
.chat-artifacts button { max-width: 100%; white-space: normal; overflow-wrap: anywhere; text-align: left; }
.chat-artifacts button[aria-current] { border-color: var(--accent-ink); color: var(--accent-ink); }
.chat-artifact-view { display: block; width: 100%; height: 60vh; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.chat-markdown-view { padding: .6rem .8rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); max-height: 60vh; overflow: auto; }
.chat-artifact-tools { display: flex; justify-content: flex-end; gap: .25rem; margin: 0 0 .25rem; }
.chat-artifact-view[hidden], .chat-artifact-tools > .chat-download[hidden], .chat-markdown-view[hidden] { display: none; }
.chat-recent ul { list-style: none; margin: 0; padding: 0; }
.chat-recent a { display: block; padding: .4rem .6rem; border-radius: var(--radius); color: inherit; text-decoration: none; }
.chat-recent a:hover { background: var(--surface2); }
.chat-recent a[aria-current="true"] { background: var(--surface2); box-shadow: inset 3px 0 0 var(--accent); }
.chat-recent a.chat-new { color: var(--accent-ink); font-weight: 600; margin-bottom: .25rem; }
/* Card 519: the box of each conversation on the left, «Archivia» on top, the archived ones under
   a light rule, folded. */
.chat-recent-head { display: flex; align-items: center; gap: .25rem; }
.chat-recent-head .chat-new { flex: 1; }
.chat-archive { background: none; border: 0; padding: .3rem; color: var(--ink3); cursor: pointer; border-radius: var(--radius); }
.chat-archive:not(:disabled):hover { color: var(--accent-ink); background: var(--surface2); }
.chat-archive:disabled { opacity: .4; cursor: default; }
.chat-recent-row { display: flex; align-items: center; gap: .25rem; }
.chat-recent-row > a { flex: 1; min-width: 0; }
.chat-archived { margin-top: .5rem; border-top: 1px solid var(--line); padding-top: .4rem; }
.chat-archived > summary { cursor: pointer; list-style: none; font-size: .8rem; color: var(--ink3); padding: .2rem .6rem; }
.chat-archived > summary::-webkit-details-marker { display: none; }
.chat-archived[open] > summary svg { transform: rotate(180deg); }
.chat-title { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-recent time { display: block; font-size: .75rem; color: var(--ink3); }
.chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-download { align-self: flex-end; display: inline-flex; padding: .3rem; border-radius: var(--radius); color: var(--ink2); }
.chat-download:hover { background: var(--surface2); color: var(--accent-ink); }
.chat-thread { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: .25rem .25rem .75rem; }
.chat-thread > .empty { display: grid; place-items: center; min-height: 100%; margin: 0; padding: 0; text-align: center; }
.chat .conversation { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .75rem; }
.chat .turn { max-width: 75%; min-width: 0; overflow-wrap: anywhere; }
.chat .turn-person { align-self: flex-end; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem .8rem; }
.chat .turn-xhalia { align-self: flex-start; }
.chat .turn-outcome { align-self: center; max-width: 100%; color: var(--ink3); font-size: .8rem; text-align: center; }
.chat .turn-text { margin: 0; white-space: pre-wrap; }
.chat .turn-text[data-markdown], .chat .turn-person .turn-text { white-space: normal; line-height: 1.5; }
.chat .turn-text > :first-child { margin-top: 0; }
.chat .turn-text > :last-child { margin-bottom: 0; }
.chat .turn-text :is(p, ul, ol, pre, blockquote, table) { margin: 0 0 .6em; }
.chat .turn-text :is(h1, h2, h3, h4, h5, h6) { margin: .9em 0 .4em; font-size: 1rem; line-height: 1.3; }
.chat .turn-text h1 { font-size: 1.15rem; }
.chat .turn-text :is(ul, ol) { padding-left: 1.4em; }
.chat .turn-text code { font-family: var(--mono); font-size: .88em; background: var(--surface); border: 1px solid var(--line); border-radius: 3px; padding: 0 .25em; }
.chat .turn-text pre { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem .7rem; }
.chat .turn-text pre code { border: 0; padding: 0; background: none; white-space: pre; }
.chat .turn-text blockquote { border-left: 3px solid var(--line2); padding-left: .7em; color: var(--ink3); }
.chat .turn-text table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.chat .turn-text :is(th, td) { border: 1px solid var(--line); padding: .2em .5em; text-align: left; }
.chat .turn .preview { margin: .4rem 0 .2rem; }
/* Card 523: the preview the verb said in plain words — the title, the subject, a line per change. */
.chat .preview-card { margin: .5rem 0 .3rem; padding: .5rem .7rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.chat .preview-card > p { margin: 0; }
.chat .preview-card-title { font-weight: 600; }
.chat .preview-card-subject { font-size: .85rem; }
.chat .preview-card-lines { margin: .35rem 0 0; padding-left: 1.1rem; overflow-wrap: anywhere; }
.chat .preview-card-lines .swatches { display: inline-flex; gap: .4rem; margin-left: .4rem; vertical-align: middle; }
.chat .preview-card-label { font-weight: 600; }
.chat .preview-card [data-preview-cut] { margin-top: .35rem; font-size: .85rem; }
/* Card 410: what the turn in progress is doing, with «Ferma»; shown only while it runs. */
.chat-progress { flex: none; margin: 0 0 .5rem; padding: .45rem .7rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); font-size: .85rem; }
.chat-progress[hidden] { display: none; }
.chat-now { margin: 0; color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-progress-foot { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin: .35rem 0 0; }
.chat-composer { flex: none; border-top: 1px solid var(--line); padding-top: .6rem; }
.chat-composer [data-outcome] { display: block; margin: 0 0 .4rem; color: var(--ink3); font-size: .85rem; }
.chat-composer [data-outcome]:empty { display: none; }
.chat-field { display: flex; gap: .5rem; align-items: flex-end; }
.chat-field textarea { flex: 1 1 auto; min-width: 0; resize: none; overflow-y: auto; font: inherit; line-height: 1.4; padding: .45rem .6rem; color: inherit; background: var(--raised); border: 1px solid var(--line2); border-radius: var(--radius); }
@media (max-width: 40rem) {
  .chat, .chat.side-open { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "recent side" "main main"; gap: .5rem; }
  .chat > .chat-recent { grid-area: recent; }
  .chat > .chat-side { grid-area: side; }
  .chat > .chat-main { grid-area: main; }
  .chat > .chat-split { display: none; }
  .chat-recent, .chat-side, .chat-recent[open], .chat-side[open] { width: auto; overflow: visible; border: 0; padding: 0; }
  :is(.chat-recent, .chat-side) > summary, :is(.chat-recent, .chat-side):not([open]) > summary { writing-mode: horizontal-tb; padding: .2rem 0; }
  .chat-recent > nav, .chat-side-body { position: absolute; z-index: 4; left: 0; right: 0; top: 2.4rem; max-height: 60vh; overflow-y: auto; padding: .5rem; background: var(--ground); border: 1px solid var(--line2); border-radius: var(--radius); box-shadow: 0 8px 24px rgb(0 0 0 / .22); }
  .chat .turn { max-width: 85%; }
}

/* The panel of the chat (card 494): a column fixed at the right of the window, from top to
   bottom, with the head on top and the container of the chat (`data-chat-fill`) taking the rest.
   On a wide screen the page narrows by the width of the panel (`padding-right` of the body,
   `.chat-drawer-open`, marked by xhalia.js as it opens and closes the panel: card 585, no
   `:has()`), so the panel covers nothing; on a phone
   it takes the whole screen, over the masthead too (z-index above the bar's 19 and the notice's 20). A panel that is narrow draws the chat as the phone does -- the
   conversations and the side as buttons laid over the messages -- so the rules of the phone are
   repeated here for `.chat-drawer .chat`, whatever the window. */
.chat-drawer { --chat-drawer-width: min(30rem, 100vw); position: fixed; top: 0; right: 0; bottom: 0; z-index: 30; width: var(--chat-drawer-width); display: flex; flex-direction: column; background: var(--ground); color: var(--ink); border-left: 1px solid var(--line2); box-shadow: -6px 0 18px color-mix(in srgb, var(--ink) 14%, transparent); }
.chat-drawer[hidden] { display: none; }
.chat-drawer-head { flex: none; display: flex; align-items: center; gap: .5rem; padding: .5rem .75rem; border-bottom: 1px solid var(--line); }
.chat-drawer-head h2 { flex: 1 1 auto; min-width: 0; margin: 0; font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-drawer-head button { flex: none; }
.chat-drawer-body { flex: 1 1 0; min-height: 0; min-width: 0; padding: .5rem .75rem .75rem; }
.chat-drawer .chat { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "recent side" "main main"; gap: .5rem; min-height: 0; }
.chat-drawer .chat.side-open { grid-template-columns: minmax(0, 1fr) auto; }
.chat-drawer .chat > .chat-recent { grid-area: recent; }
.chat-drawer .chat > .chat-side { grid-area: side; }
.chat-drawer .chat > .chat-main { grid-area: main; }
.chat-drawer :is(.chat-recent, .chat-side, .chat-recent[open], .chat-side[open]) { width: auto; overflow: visible; border: 0; padding: 0; }
.chat-drawer :is(.chat-recent, .chat-side) > summary { writing-mode: horizontal-tb; padding: .2rem 0; }
.chat-drawer .chat-recent > nav, .chat-drawer .chat-side-body { position: absolute; z-index: 4; left: 0; right: 0; top: 2.4rem; max-height: 60vh; overflow-y: auto; padding: .5rem; background: var(--ground); border: 1px solid var(--line2); border-radius: var(--radius); box-shadow: 0 8px 24px rgb(0 0 0 / .22); }
.chat-drawer .chat .turn { max-width: 90%; }
@media (min-width: 40.01rem) {
  body.chat-drawer-open { padding-right: min(30rem, 100vw); }
}
@media (max-width: 40rem) {
  .chat-drawer { inset: 0; width: 100%; border-left: 0; box-shadow: none; }
}
/* The button of the masthead that opens it, after the "Vai a..." and with its look. */
.chat-open { flex: none; padding: .3rem .6rem; border: 1px solid currentColor; border-radius: var(--radius); background: transparent; color: var(--bar-ink); font: inherit; font-size: .9rem; white-space: nowrap; cursor: pointer; }
.chat-open:hover, .chat-open[aria-expanded="true"] { background: var(--bar-ink); color: var(--bar-bg); }

/* The page of one matter (card 443, card 514): the path on top, the objects of the matter as
   icons with their title below, in groups that close (`details`), `Altro` closed; the contents
   of a gathering a list of their own (card 621), its icon a box, dashed when virtual. `.object-icon` and `.folder-icon` are the icons, reused by the list of
   the dossiers on the left (card 515). */
.case-contents-path ol { display: flex; flex-wrap: wrap; gap: 2px 6px; list-style: none; margin: 0 0 14px; padding: 0; font-size: 1.05rem; }
.case-contents-path li { min-width: 0; overflow-wrap: anywhere; }
.case-contents-path li + li::before { content: "\203A"; margin-right: 6px; color: var(--ink3); }
/* The way back up, in the second colour: a step of the structure (2026-11-06). */
.case-contents-path a { color: var(--accent2-ink); font-weight: 500; text-decoration: none; }
.case-contents-path a:hover { text-decoration: underline; }
.case-contents-group { margin: 0 0 14px; }
/* A section is an area with its heading on the top edge, in the palette's second colour
   (2026-11-05); closed, only the top edge is left, a line with the heading on it. The heading
   takes the ground of the panel so that it cuts the edge. */
details.case-contents-group { position: relative; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 8px 8px; margin: 22px 0 0; }
details.case-contents-group:not([open]) { border-width: 1px 0 0; border-radius: 0; padding: 0; }
.case-contents-group-heading { position: absolute; top: 0; left: 12px; transform: translateY(-50%); padding: 0 8px; background: var(--surface); line-height: 1; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--accent2-ink); }
details.case-contents-group > summary { cursor: pointer; }
.case-contents-list, .case-contents-grid { list-style: none; margin: 0; padding: 0; }
.case-contents-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr)); gap: 6px; }
.object-icon { position: relative; display: inline-flex; flex: none; width: 2.6rem; height: 2.6rem; color: var(--ink3); }
.object-icon > svg { width: 100%; height: 100%; }
.object-icon .mark { position: absolute; left: 0; right: 0; bottom: 18%; text-align: center; font-size: .55rem; font-weight: 700; letter-spacing: .02em; color: var(--ink2); }
.folder-icon { color: var(--accent-ink); }
.case-contents-grid .case-content a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: var(--radius); color: var(--ink); text-align: center; text-decoration: none; }
.case-contents-grid .title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; max-width: 100%; font-size: .8rem; font-weight: 500; overflow-wrap: anywhere; }
.case-contents-grid .what { font-size: .7rem; }
.case-contents-grid .pill { font-size: .65rem; }
.case-contents-grid .object-icon { color: var(--accent-ink); }
.case-contents-grid .gathering-icon.virtual { color: var(--ink3); }
/* The source of a gathering is printed on the front of its box. */
.case-contents-grid .object-icon .mark { font-size: .5rem; letter-spacing: 0; }
.case-contents-grid .gathering-icon .mark { left: 12%; right: 12%; bottom: 22%; font-size: .45rem; }
.case-contents-list .case-content a { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; padding: 4px 6px; border-radius: var(--radius); color: var(--ink); text-decoration: none; }
.case-content a:hover, .case-content.chosen a { background: var(--surface2); }
.case-contents-list .title { min-width: 0; font-weight: 500; overflow-wrap: anywhere; }
.case-contents-list .at, .case-contents-list .sender { font-size: .8rem; }
/* The sender in the second colour: a step between one message and the next of a gathering. */
.case-contents-list .sender { color: var(--accent2-ink); }
/* One compact header for every preview of the page of a matter: the title large, the type and
   the date small and muted on the right. */
.preview-head { display: flex; justify-content: space-between; align-items: baseline; gap: 4px 16px; flex-wrap: wrap; }
.preview-head .subject { flex: 1 1 auto; min-width: 0; }
.preview-info { margin: 0; flex: none; font-size: .8rem; color: var(--ink3); }
.preview-made { margin: 0; flex: 1 0 100%; font-size: .75rem; color: var(--ink3); overflow-wrap: anywhere; }
.case-note, .case-file, .case-entity { padding: 18px 26px 40px; display: grid; gap: 14px; min-width: 0; max-width: 860px; }
:is(.case-note, .case-file, .case-entity) .subject { font-family: var(--serif); font-size: 1.4rem; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; margin: 0; }
.case-file .file-facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; margin: 0; font-size: .8667rem; }
.case-file .file-facts dt { color: var(--ink3); }
.case-file .file-facts dd { margin: 0; overflow-wrap: anywhere; }
.case-file .file-view { display: block; width: 100%; max-width: 100%; border: 1px solid var(--line); border-radius: var(--radius); }
.case-file [data-file-view="pdf"] { display: grid; gap: .5rem; padding: .5rem; background: var(--line); }
.case-file [data-file-view="pdf"] canvas { display: block; width: 100%; height: auto; background: #fff; }
.case-file img.file-view { height: auto; }
.case-entity .case-entity-heading { margin: 6px 0 0; font-size: .8667rem; color: var(--ink3); font-weight: 600; }
.case-entity .case-entity-relations { margin: 0; padding-left: 18px; }
.case-entity .note { overflow-wrap: anywhere; }
/* The headings of a note in the second colour, a level apart from the text; what the author
   says a section is for is their tooltip. */
:is(.case-note, .case-entity) .note-heading { color: var(--accent2-ink); }
/* A wikilink of a note: a link to the dossier where the note it names stands; one that names no
   note the person reads, its words with a dotted line (2026-11-06). */
:is(.case-note, .case-entity) .note-link { color: var(--accent-ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
:is(.case-note, .case-entity) .note-unlinked { border-bottom: 1px dotted var(--line2); }
:is(.case-note, .case-entity) .note-heading[title] { cursor: help; }

/* The page of one legal document (card 477, kit `legal-it`): the text with every anchored
   passage marked by its state, the panel of the passage chosen on the right, the status bar
   on top, the approval and the register under it. The state is read from `data-state`
   (pending, verified, edited) and `data-attn` (bad, warn) the template writes; the colours
   are the trust ones, so they read on every palette. The panel is a sticky column where the
   detail pane is wide, a sheet fixed at the bottom of the window where it is not (and then
   hidden while no passage is chosen). */
.case-legal-document {
  --act-pending: color-mix(in srgb, var(--accent) 16%, var(--raised));
  --act-ok: color-mix(in srgb, var(--certain) 14%, var(--raised));
  --act-warn: color-mix(in srgb, var(--uncertain) 16%, var(--raised));
  --act-bad: color-mix(in srgb, var(--unrecognised) 14%, var(--raised));
  padding: 14px 20px 40px; display: grid; gap: 12px; min-width: 0;
}
.case-legal-document .act-head .subject { font-family: var(--serif); font-size: 1.4rem; font-weight: 600; line-height: 1.3; margin: 0; overflow-wrap: anywhere; }

.case-legal-document .status { position: sticky; top: 0; z-index: 5; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.case-legal-document .status .count { display: flex; gap: 6px; flex-wrap: wrap; font-size: .9rem; }
.case-legal-document .status .pill { display: inline-flex; align-items: center; gap: 5px; background: var(--raised); font-variant-numeric: tabular-nums; }
.case-legal-document .status .pill i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.case-legal-document .dot-ok { background: var(--certain); }
.case-legal-document .dot-todo { background: var(--accent); }
.case-legal-document .dot-warn { background: var(--uncertain); }
.case-legal-document .dot-bad { background: var(--unrecognised); }
.case-legal-document .status .next { margin-left: auto; }
.case-legal-document .mail { font-size: .9rem; display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 99px; background: var(--act-bad); color: var(--unrecognised); }
.case-legal-document .mail.open { background: var(--act-ok); color: var(--certain); }

.case-legal-document .grid { display: grid; grid-template-columns: minmax(0, 1fr) clamp(250px, 36%, 360px); gap: 16px; align-items: start; }
.case-legal-document .doc { background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px clamp(14px, 3vw, 40px) 28px; min-width: 0; }
.case-legal-document .act { font-family: var(--serif); font-size: 1.2rem; line-height: 1.75; max-width: 68ch; margin: 0 auto; overflow-wrap: anywhere; }
.case-legal-document .blk { margin: 0 0 14px; }
.case-legal-document .blk h4 { font-family: var(--sans); font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink3); margin: 20px 0 6px; font-weight: 600; display: flex; gap: 8px; align-items: baseline; }
.case-legal-document .blk h4 .id { font-family: var(--mono); font-weight: 400; letter-spacing: 0; }
.case-legal-document .blk p { margin: 0; }

.case-legal-document .anc { cursor: pointer; border-radius: 3px; padding: 1px 2px; -webkit-box-decoration-break: clone; box-decoration-break: clone; background: var(--act-pending); border-bottom: 2px solid var(--accent); }
.case-legal-document .anc[data-attn="bad"] { background: var(--act-bad); border-bottom: 2px dashed var(--unrecognised); }
.case-legal-document .anc[data-attn="warn"] { background: var(--act-warn); border-bottom: 2px dashed var(--uncertain); }
.case-legal-document .anc[data-state="verified"], .case-legal-document .anc[data-state="edited"] { background: var(--act-ok); border-bottom: 2px solid var(--certain); }
.case-legal-document .anc[data-state="edited"] { border-bottom-style: dotted; }
.case-legal-document .anc[aria-pressed="true"] { outline: 2px solid var(--accent-ink); outline-offset: 1px; }
.case-legal-document .anc[contenteditable="true"] { background: var(--raised); outline: 2px solid var(--accent-ink); cursor: text; }
.case-legal-document .anc sup { font-family: var(--sans); font-size: .75rem; font-weight: 600; margin-left: 2px; color: var(--ink2); }

.case-legal-document .approve { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 18px; }
.case-legal-document .approve h4 { font-size: 1.1rem; margin: 0 0 8px; }
.case-legal-document .approve-form { display: grid; gap: 10px; max-width: 68ch; justify-items: start; }
.case-legal-document .approve .check { display: flex; gap: 10px; align-items: flex-start; font-size: 1rem; }
.case-legal-document .approve .field { display: grid; gap: 3px; width: 100%; }
.case-legal-document .approve .field input { width: 100%; }
.case-legal-document .approve .why { font-size: .9rem; color: var(--ink3); margin: 0; }
.case-legal-document .approved { padding: 12px 14px; border-radius: var(--radius); background: var(--act-ok); color: var(--certain); font-size: .95rem; line-height: 1.7; }
.case-legal-document .approved code { font-family: var(--mono); font-size: .9rem; word-break: break-all; color: var(--ink); }

.case-legal-document .panel { position: sticky; top: 56px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin: 0; display: flex; flex-direction: column; gap: 12px; max-height: calc(100vh - 140px); overflow: auto; min-width: 0; }
.case-legal-document .anchor-panel { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.case-legal-document .anchor-panel[hidden] { display: none; }
.case-legal-document .ph { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.case-legal-document .ph .x { margin-left: auto; }
.case-legal-document .ph .type { font-size: .8rem; letter-spacing: .07em; text-transform: uppercase; font-weight: 600; color: var(--accent-ink); }
.case-legal-document .lab { font-size: .8rem; letter-spacing: .07em; text-transform: uppercase; color: var(--ink3); margin-bottom: 4px; font-weight: 600; }
.case-legal-document .quote { font-family: var(--serif); font-size: 1.1rem; background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; overflow-wrap: anywhere; }
.case-legal-document .src { font-size: 1rem; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0; }
.case-legal-document .src .file { font-family: var(--mono); font-size: .9rem; background: var(--raised); padding: 2px 6px; border-radius: 4px; word-break: break-all; }
.case-legal-document .excerpt { font-family: var(--serif); font-size: 1.05rem; color: var(--ink2); border-left: 3px solid var(--line2); padding: 4px 0 4px 10px; margin-top: 6px; overflow-wrap: anywhere; }
.case-legal-document .excerpt mark { background: var(--act-ok); color: var(--ink); padding: 0 2px; }
.case-legal-document .excerpt mark.near { background: var(--act-bad); }
.case-legal-document .machine { font-size: 1rem; padding: 8px 10px; border-radius: var(--radius); background: var(--raised); color: var(--ink2); }
.case-legal-document .machine.found { background: var(--act-ok); color: var(--certain); }
.case-legal-document .machine.notfound, .case-legal-document .machine.none { background: var(--act-bad); color: var(--unrecognised); }
.case-legal-document .machine.outside { background: var(--act-warn); color: var(--uncertain); }
.case-legal-document .machine .excerpt { color: var(--ink); }
.case-legal-document .look { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: .95rem; color: var(--ink2); }
.case-legal-document .look b { color: var(--ink); font-weight: 500; }
.case-legal-document .check { display: flex; gap: 10px; align-items: center; font-size: 1rem; font-weight: 500; cursor: pointer; }
.case-legal-document .check input { accent-color: var(--accent-ink); width: 17px; height: 17px; margin: 0; flex: none; }
.case-legal-document textarea { width: 100%; min-height: 64px; resize: vertical; border: 1px solid var(--line2); border-radius: var(--radius); background: var(--raised); padding: 8px; font: inherit; color: inherit; }
.case-legal-document form.verify, .case-legal-document form.ask, .case-legal-document form.edit, .case-legal-document form.reopen { display: grid; gap: 8px; justify-items: start; }
.case-legal-document form [data-outcome] { margin-left: 0; }
.case-legal-document .hint { font-size: .9rem; color: var(--ink3); margin: 0; }
.case-legal-document .panel .done { font-size: 1rem; padding: 10px; border-radius: var(--radius); background: var(--act-ok); color: var(--certain); border-top: 0; }
.case-legal-document .sep { border: 0; border-top: 1px solid var(--line); margin: 0; width: 100%; }
.case-legal-document .legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .95rem; }
.case-legal-document .legend li { padding-left: 14px; border-left: 4px solid var(--accent); }
.case-legal-document .legend li[data-legend="bad"] { border-left-color: var(--unrecognised); }
.case-legal-document .legend li[data-legend="warn"] { border-left-color: var(--uncertain); }
.case-legal-document .legend li[data-legend="resolved"] { border-left-color: var(--certain); }

.case-legal-document .log { margin-top: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; }
.case-legal-document .log summary { cursor: pointer; font-weight: 500; }
.case-legal-document .log ol { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 4px; font-size: .9rem; color: var(--ink2); max-height: 220px; overflow: auto; }
.case-legal-document .log .at { font-family: var(--mono); color: var(--ink3); margin-right: 8px; }

/* Where the detail pane is narrow the panel is a sheet from the bottom, shown only with a
   passage chosen (the script sets `data-open` on it). */
@media (max-width: 1100px) {
  .case-legal-document { padding: 12px 12px 32px; }
  .case-legal-document .grid { grid-template-columns: minmax(0, 1fr); }
  .case-legal-document .panel { position: fixed; left: 0; right: 0; bottom: 0; top: auto; max-height: 72vh; border-radius: 12px 12px 0 0; z-index: 15; padding: 14px 16px calc(16px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -6px 24px rgb(0 0 0 / .18); }
  .case-legal-document .panel:not([data-open]) { display: none; }
  .case-legal-document .status .next { margin-left: 0; }
}

/* OneDrive guide, card 488: each row is two columns, what to do on the left and why on the
   right; under 72rem the explanation goes below. The status pills come before the text, in a
   column. */
.onedrive-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: .5rem 2rem; margin: 0 0 1.25rem; }
@media (min-width: 72rem) {
  .onedrive-row { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; }
}
.onedrive-why { color: var(--ink2); font-size: .9rem; border-left: 2px solid var(--line); padding-left: .9rem; min-width: 0; overflow-wrap: anywhere; }
.onedrive-why p { margin: 0 0 .5rem; }
.onedrive-do { min-width: 0; }
.onedrive-do input[type=text], .onedrive-do select { max-width: 100%; }
.onedrive-step > h3 { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .6rem; }
.onedrive-checks, .onedrive-roots, .onedrive-accounts { list-style: none; margin: 0 0 .75rem; padding: 0; }
.onedrive-checks > li, .onedrive-roots > li { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: .15rem .6rem; align-items: baseline; padding: .25rem 0; }
.onedrive-checks > li > .pill, .onedrive-roots > li > .pill { justify-self: start; }
.onedrive-checks > li > .muted, .onedrive-roots > li > .muted { grid-column: 2; }
.onedrive-todo { padding-left: 1.25rem; }
.onedrive-todo > li + li { margin-top: .6rem; }
.onedrive-line { display: block; }
