/* ── THE WORKSPACE ──────────────────────────────────────────────────────────
   Aria's house (aria-clinic, src/theme/tokens.ts): the warm paper, its ladder
   of surfaces, Season Sans. Separation by surface steps, never by rules; a
   menu over the page is the only thing with a shadow. No scrollbar is drawn
   anywhere, no capitals, no chips. The document's own type (Act Serif, the
   A4 page, the footer) comes from src/paper.ts, the same text the PDF uses. */

@font-face { font-family: "Season Sans"; src: url(/ws/fonts/season-sans.woff2) format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  --app: #eae7e1;
  --panel: #f5f2ed;
  --sunk: #eeebe5;
  --hover: #e6e2dc;
  --active: #e2ded8;
  --white: #fbfaf8;
  --paper: #fffefb;
  --ink: #2d2219;
  --ink-2: #463527;
  --ink-3: #70543f;
  --line: rgba(51, 36, 29, 0.1);
  --acc: #1c2a2a;
  --acc-strong: #305755;
  --acc-well: #a3c2c1;
  --acc-tint: #d5e1e1;
  --acc-edge: #bcd1d1;
  --acc-paper: #eef1f1;
  --good: #305755;
  --warn: #816307;
  --bad: #a6503a;
  --bad-well: #cfa294;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.32, 0.5, 1);
  --pop: 0 18px 50px -12px rgba(45, 34, 25, 0.28), 0 0 0 1px rgba(45, 34, 25, 0.05);
  --rail: 264px;
  /* The band at the top: the bar and the margins around it. The pages scroll under its lower edge. */
  /* the header (52px and its hairline), the sidebar, the comments' column */
  --band: 53px;
  --side: 264px;
  --notes: 340px;
}

html { scrollbar-width: none; -ms-overflow-style: none; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* A tap is a press, not a flash: no tap highlight, and every hover and press look lives only where there is a pointer that hovers (below), so a finger never leaves a button lit. */
* { -webkit-tap-highlight-color: transparent; }
/* A quick second tap on a button is a second press, never a zoom. */
button, a, .navrow, .toc-row, .card { touch-action: manipulation; }
html::-webkit-scrollbar, body::-webkit-scrollbar { width: 0; height: 0; display: none; }
* { scrollbar-width: none; -ms-overflow-style: none; box-sizing: border-box; }
*::-webkit-scrollbar { width: 0; height: 0; display: none; }
html, body { margin: 0; padding: 0; background: var(--app); }
body {
  color: var(--ink); font-family: "Season Sans", system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 14.5px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
}
::selection { background: transparent; color: #d9480f; }
:where(button) { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:where(input, textarea) { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
.row { display: flex; align-items: center; }
.g6 { gap: 6px; } .g8 { gap: 8px; } .g10 { gap: 10px; } .g12 { gap: 12px; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--ink-3); }

/* ── buttons ─────────────────────────────────────────────────────────────── */
.ib {
  position: relative; display: inline-grid; place-items: center; flex-shrink: 0; border-radius: 999px;
  transition: background-color 0.18s, opacity 0.15s; color: var(--ink);
}
/* nothing moves under the pointer: a hover changes the surface, never the place */
@media (hover: hover) { .ib:hover { background-color: var(--hover); } }
@media (hover: hover) { .ib.t-white:hover { background-color: #fff; } }
@media (hover: hover) { .ib.t-dark:hover { background-color: #26393a; } }
@media (hover: hover) { .ib:active { opacity: 0.8; } }
.ib:disabled { opacity: 0.4; cursor: default; }
.t-white { background: var(--white); color: var(--ink); }
.t-panel { background: var(--panel); color: var(--ink); }
.t-sunk { background: var(--sunk); color: var(--ink); }
.t-dark { background: var(--acc); color: var(--acc-paper); }
.t-plain { background: transparent; color: var(--ink-2); }
.t-glass { background: rgba(251, 250, 248, 0.72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); color: var(--ink); }
.ib.t-plain.on { background: var(--sunk); }
@media (hover: hover) { .ib.t-plain:hover { background: var(--sunk); } }
.ib.t-plain.on { color: var(--ink); }
.tb {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 20px; border-radius: 999px; font-size: 14.5px; font-weight: 500;
  white-space: nowrap; flex-shrink: 0; transition: background-color 0.18s, opacity 0.15s;
}
@media (hover: hover) { .tb.t-dark:hover { background-color: #26393a; } }
@media (hover: hover) { .tb.t-white:hover { background-color: #fff; } }
@media (hover: hover) { .tb:active { opacity: 0.85; } }
.tb:disabled { opacity: 0.45; cursor: default; }
/* the dark act not yet possible: a light, flat fill with quiet words, not the dark one faded to mud */
.tb.t-dark:disabled:not(.busy) { opacity: 1; background: #e9e5de; color: rgba(45, 34, 25, 0.4); }
.tb.busy:disabled { opacity: 1; cursor: progress; }
@keyframes spin { to { transform: rotate(360deg); } }
.spin { width: 15px; height: 15px; border-radius: 999px; border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.7s linear infinite; flex-shrink: 0; opacity: 0.9; }
.tb.sm .spin { width: 13px; height: 13px; }
.tb.sm { height: 36px; padding: 0 14px; font-size: 13.5px; gap: 6px; }
@media (hover: hover) { .tb.t-plain:hover { background: var(--sunk); } }
.tb .n { color: inherit; }
/* a pill's words: cut with an ellipsis when the pill is given less room than they need, never past its edge */
.tb > .tx { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb.t-dark .n { color: inherit; }

/* ── overlays: menus, dialogs, sheets ────────────────────────────────────── */
@keyframes pop-in { from { opacity: 0; transform: translateY(-6px) scale(0.98); } }
@keyframes veil-in { from { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(0.98); } }
@keyframes side-in { from { transform: translateX(calc(100% + 24px)); } }
@keyframes foot-in { from { transform: translateY(100%); } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 16px) scale(0.96); } }
/* a menu: its rows a little apart, so a lit row never touches the next */
.popover {
  position: fixed; z-index: 80; border-radius: 22px; padding: 6px; background: #fdfcfa; box-shadow: var(--pop); display: flex; flex-direction: column; gap: 2px;
  animation: pop-in 0.18s var(--ease); max-height: min(70vh, 560px); overflow-y: auto;
}
.menurow {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 40px; padding: 0 12px; border-radius: 14px; text-align: left;
  font-size: 14px; color: var(--ink); transition: background-color 0.15s;
}
.menurow.tall { padding: 8px 12px; align-items: flex-start; }
.menurow.tall > svg:first-child { margin-top: 2px; }
.menurow.active { background: var(--sunk); }
@media (hover: hover) { .menurow:hover { background: var(--sunk); } }
.menurow.danger { color: var(--bad); }
.mr-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mr-main { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mr-sub { font-size: 12.5px; color: var(--ink-3); white-space: normal; line-height: 1.35; margin-top: 2px; }
.mr-tick { color: var(--acc-strong); flex-shrink: 0; }
.menulabel { padding: 8px 12px 4px; font-size: 12.5px; color: var(--ink-3); }
.menulabel .n { margin-left: 4px; color: var(--ink-2); }
.popover hr, .modal hr { border: 0; height: 6px; margin: 0; }

/* A DIALOG: a white panel standing clear of the page under a firm veil; its
   name and × at the top, the fields, the act at the foot on the right. On a
   phone it rises from the foot of the screen and stands on the keyboard. */
.modal-wrap { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 24px; overflow-y: auto; }
.modal-veil { position: fixed; inset: 0; background: rgba(31, 24, 18, 0.36); animation: veil-in 0.2s; }
.modal {
  position: relative; width: 100%; max-width: var(--mw, 520px); border-radius: 20px; background: #fdfcfa;
  box-shadow: 0 0 0 1px rgba(45, 34, 25, 0.06), 0 28px 80px -18px rgba(31, 24, 18, 0.45), 0 2px 8px rgba(31, 24, 18, 0.06);
  animation: modal-in 0.24s var(--ease);
}
.modal-head { display: flex; align-items: center; gap: 12px; padding: 16px 14px 0 24px; min-height: 58px; }
.modal-head h3 { flex: 1; min-width: 0; margin: 0; font-size: 17px; line-height: 1.3; font-weight: 600; letter-spacing: -0.01em; }
.modal-head .ib { color: var(--ink-3); border-radius: 10px; }
.modal-body { padding: 10px 24px 0; }
.modal .sub { margin: 0 0 16px; color: var(--ink-3); font-size: 14px; line-height: 1.45; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; align-items: center; padding: 24px 24px 20px; }
.modal-foot .tb { height: 40px; padding: 0 18px; font-size: 14.5px; }
.modal .err { color: var(--bad); font-size: 13.5px; margin-top: 10px; }
/* inside a dialog: a field has an edge on the white, and a dark one while it is being typed in */
.modal .lbl { font-size: 13px; font-weight: 500; color: var(--ink-2); margin: 18px 0 7px; }
.modal .lbl:first-child { margin-top: 0; }
.modal .lbl .opt { font-weight: 400; color: var(--ink-3); margin-left: 6px; }
.modal .field { height: 44px; border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 1px rgba(51, 36, 29, 0.16); transition: box-shadow 0.15s; }
@media (hover: hover) { .modal .field:hover { box-shadow: inset 0 0 0 1px rgba(51, 36, 29, 0.3); } }
.modal .field:focus { box-shadow: inset 0 0 0 1.5px var(--ink-2); }
.modal .field.area { height: auto; min-height: 104px; padding: 11px 14px; }
.modal .tb.t-white { background: transparent; box-shadow: inset 0 0 0 1px rgba(51, 36, 29, 0.16); }
@media (hover: hover) { .modal .tb.t-white:hover { background: var(--sunk); } }
.modal .check .box { background: #fff; box-shadow: inset 0 0 0 1px rgba(51, 36, 29, 0.24); }
.modal .check.on .box { background: var(--acc); box-shadow: none; }
.modal .linkrow code { background: var(--sunk); }
.modal .pad { background: #fff; box-shadow: inset 0 0 0 1px rgba(51, 36, 29, 0.16); border-radius: 14px; }
.pad-wrap { position: relative; }
.pad-clear { position: absolute; top: 8px; right: 8px; }
.modal-wrap.at-foot { place-items: end stretch; padding: 0; overflow: hidden; }
.modal-wrap.at-foot .modal {
  max-width: none; border-radius: 24px 24px 0 0; margin-bottom: var(--kb, 0px);
  max-height: calc(100vh - 120px); max-height: calc(var(--vvh, 100svh) - 24px); overflow-y: auto; overscroll-behavior: contain;
  padding-bottom: env(safe-area-inset-bottom); animation: foot-in 0.32s var(--ease); transition: margin-bottom 0.12s;
}
.modal-wrap.at-foot .grab { margin: 0 auto -6px; }
.modal-wrap.at-foot .modal-head { padding-top: 6px; touch-action: none; }
.modal-wrap.at-foot .modal-body { padding: 8px 16px 0; }
.modal-wrap.at-foot .modal-foot { padding: 22px 16px 16px; }
.modal-wrap.at-foot .modal-foot > .grow { display: none; }
.modal-wrap.at-foot .modal-foot .tb { flex: 1 1 0; justify-content: center; height: 46px; }
.modal-wrap.at-foot .modal-head { padding-left: 16px; padding-right: 8px; }

.sheet-wrap { position: fixed; inset: 0; z-index: 70; }
.sheet-veil { position: absolute; inset: 0; background: rgba(45, 34, 25, 0.18); animation: veil-in 0.2s; }
.sheet { position: absolute; display: flex; flex-direction: column; background: var(--panel); }
.sheet.from-side { top: 8px; right: 8px; bottom: 8px; max-width: calc(100vw - 16px); border-radius: 28px; padding: 22px; animation: side-in 0.42s var(--ease); }
/* From the foot, the panel is never taller than the screen as it is with the
   browser's own bars showing (svh), less a strip of the page above it, so its
   head and its × are always on screen; it is pulled down to close (kit.tsx). */
.sheet.from-foot {
  left: 0; right: 0; bottom: 0; max-height: calc(100vh - 120px); max-height: calc(100svh - 32px);
  border-radius: 28px 28px 0 0; padding: 0 16px calc(16px + env(safe-area-inset-bottom)); animation: foot-in 0.36s var(--ease);
}
/* the handle a panel is pulled down by: a short bar, with a wide margin of nothing around it for the thumb */
.grab { flex-shrink: 0; width: 40px; height: 5px; border-radius: 3px; background: var(--active); margin: 0 auto 10px; box-sizing: content-box; border: 0 solid transparent; border-width: 10px 40px 0; background-clip: content-box; touch-action: none; }
.sheet.from-foot .grab, .sheet.from-foot .sheet-head { touch-action: none; }
.sheet-head { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.sheet-head h2 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -0.01em; min-width: 0; }
.sheet-body { min-height: 0; flex: 1; overflow-y: auto; overscroll-behavior: contain; }

/* our own tips: a small dark label, never the browser's (kit.tsx, Tips) */
@keyframes tip-in { from { opacity: 0; } }
.tip {
  position: fixed; z-index: 95; max-width: 260px; padding: 5px 9px; border-radius: 8px; background: #2d2219; color: #f5f2ed;
  font-size: 12.5px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none;
  box-shadow: 0 6px 18px -6px rgba(31, 24, 18, 0.35); animation: tip-in 0.12s ease;
}
.tip.below { transform: translate(-50%, 0); }
.tip.above { transform: translate(-50%, -100%); }
.toast {
  position: fixed; left: 50%; bottom: 26px; z-index: 90; transform: translateX(-50%); border-radius: 999px; padding: 12px 20px;
  background: var(--acc); color: var(--acc-paper); font-size: 14px; animation: toast-in 0.3s var(--ease); pointer-events: none;
  max-width: calc(100vw - 32px);
}
.m-phone .toast { bottom: 96px; }

/* A DEFINED TERM'S CARD (Terms.tsx): the term, what the contract says it
   means, and the arrow that points where the definition stands and goes
   there. The way back is a pill at the foot, under the paper's middle. */
@keyframes pop-up { from { opacity: 0; transform: translateY(6px) scale(0.98); } }
.term-card {
  position: fixed; z-index: 80; width: min(340px, calc(100vw - 32px)); padding: 8px 8px 14px 16px; border-radius: 18px;
  background: #fdfcfa; box-shadow: var(--pop); animation: pop-in 0.16s var(--ease);
}
.term-card.up { animation-name: pop-up; }
.term-card.ph { width: calc(100vw - 32px); }
.term-head { display: flex; align-items: center; gap: 8px; min-height: 30px; }
.term-head b { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.term-head .ib { flex-shrink: 0; color: var(--ink-3); border-radius: 10px; }
.term-card p { margin: 1px 8px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); text-wrap: pretty; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 6; overflow: hidden; }
.back-pill {
  position: fixed; bottom: 26px; z-index: 85; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 18px 0 14px; border-radius: 999px; background: var(--acc); color: var(--acc-paper); font-size: 14px; font-weight: 500;
  box-shadow: 0 12px 30px -12px rgba(31, 24, 18, 0.5); animation: toast-in 0.3s var(--ease);
}
.back-pill.ph { bottom: 96px; }

/* SUGGEST MODE (Suggest.tsx): the words typed over a passage come in after it
   as the comparison draws words that came in, with a caret; a change asked and
   not decided reads the same way while the mode is on. The check and the × over
   the end of the words are the selection's own bar, small. */
/* the words a change brings in: a bubble of their own (paintPills), after the struck words with a space between, in the text's own ink */
.flow ins.sg-ins, .flow ins.sg-prop { text-decoration: none; }
.flow del[data-t] + ins.sg-ins, .flow del[data-t] + ins.sg-prop { margin-left: 0.25em; }
/* a passage chosen in suggest mode, not yet typed over: it reads as a selection reads, the caret after it */
.flow del.m-sel { text-decoration: none; color: #d9480f; }
@keyframes sg-blink { 50% { opacity: 0; } }
.sg-caret { display: inline-block; width: 1.5px; height: 1.05em; margin-left: 1px; vertical-align: -0.15em; background: var(--ink); animation: sg-blink 1.1s steps(1) infinite; }
.sg-bar {
  position: fixed; z-index: 60; transform: translate(-50%, -100%); display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: 999px;
  background: #fdfcfa; box-shadow: var(--pop); animation: fade-in 0.14s var(--ease);
}
.sg-bar .ib { color: var(--ink-2); }
/* the field that holds the keys while a change is typed: unseen, at the words' place, so the page never scrolls to it */
.sg-field { position: fixed; z-index: -1; width: 1px; height: 1px; padding: 0; border: 0; margin: 0; opacity: 0; resize: none; overflow: hidden; pointer-events: none; font-size: 16px; }

/* WHERE A PARAGRAPH CAME FROM (Prov.tsx): the version it came in, in the
   page's left margin level with its first line while the pointer is on its
   band; its card holds the version's message, who asked and why, and the words
   as they changed, drawn as the comparison draws them. */
.prov-mark {
  position: fixed; z-index: 60; transform: translate(-100%, -50%); height: 20px; padding: 0 6px; border-radius: 6px;
  font-size: 11.5px; font-weight: 600; line-height: 20px; color: var(--ink-3); background: var(--sunk); font-variant-numeric: tabular-nums;
  animation: tip-in 0.12s ease; transition: background-color 0.15s, color 0.15s;
}
.prov-mark.on { background: var(--hover); color: var(--ink-2); }
@media (hover: hover) { .prov-mark:hover { background: var(--hover); color: var(--ink-2); } }
.prov-card {
  position: fixed; z-index: 80; width: min(340px, calc(100vw - 32px)); padding: 12px 16px 14px; border-radius: 18px;
  background: #fdfcfa; box-shadow: var(--pop); animation: pop-in 0.16s var(--ease);
}
.prov-card.up { animation-name: pop-up; }
.prov-card.ph { width: calc(100vw - 32px); }
.pc-head { display: flex; align-items: baseline; gap: 10px; font-size: 13.5px; line-height: 1.4; }
.pc-head .vn { flex-shrink: 0; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.pc-head .pc-note { min-width: 0; color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-who { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 13.5px; color: var(--ink); }
.pc-who b { font-weight: 600; }
.pc-why { margin: 4px 0 0 28px; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.pc-diff { margin: 12px 0 0; font-size: 13.5px; line-height: 1.6; color: var(--ink-2); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 6; overflow: hidden; }
/* the words come and gone in a card are bubbles too, one a line, in the marks' own colours */
.pc-diff ins, .pc-diff del { padding: 1px 3px; border-radius: 5px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.pc-diff ins { color: var(--ink); text-decoration: none; background: #d5efd6; }
.pc-diff del { color: #5a1c0c; text-decoration: line-through; text-decoration-color: var(--bad); background: #fce3db; }
.pc-new { margin: 12px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--ink-3); }
/* a word struck and the word that took its place stand a little apart, here and in the comparison */
.pc-diff del + ins, .flow .d-del + .d-ins { margin-left: 0.25em; }
@media (hover: hover) { .back-pill:hover { background: #2a3b3b; } }

/* ── people ──────────────────────────────────────────────────────────────── */
.av { display: inline-block; flex-shrink: 0; border-radius: 999px; overflow: hidden; user-select: none; line-height: 0; }
.av svg { display: block; }
.av.ring { box-shadow: 0 0 0 2.5px var(--app); }
.stack { display: flex; align-items: center; }
.stack .av + .av { margin-left: -8px; }
/* a person here is a press: it follows them (Follow.tsx); the one followed wears a ring of their colour */
.av-btn { display: block; border-radius: 999px; line-height: 0; transition: box-shadow 0.18s; }
.stack .av-btn + .av-btn { margin-left: -8px; }
.av-btn.on { position: relative; z-index: 1; box-shadow: 0 0 0 2px var(--app), 0 0 0 4px var(--fc); }
/* FOLLOWING: the reading area framed in the colour of the one followed, their name at its top with the × that stops it */
.follow-frame { position: fixed; right: 0; bottom: 0; z-index: 40; pointer-events: none; box-shadow: inset 0 0 0 2px var(--fc); animation: veil-in 0.2s; }
.follow-pill {
  position: fixed; z-index: 41; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 4px 0 6px;
  border-radius: 999px; background: #fdfcfa; box-shadow: 0 0 0 2px var(--fc), 0 10px 28px -12px rgba(31, 24, 18, 0.45); animation: follow-in 0.24s var(--ease);
  font-size: 13.5px; font-weight: 500; color: var(--ink); max-width: calc(100vw - 32px);
}
@keyframes follow-in { from { opacity: 0; transform: translate(-50%, -6px); } }
.follow-pill .fp-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.follow-pill .ib { color: var(--ink-3); flex-shrink: 0; }
.stack .more { margin-left: 8px; font-size: 13px; color: var(--ink-3); }

/* ── fields ──────────────────────────────────────────────────────────────── */
.field {
  width: 100%; height: 44px; padding: 0 14px; border: 0; border-radius: 14px; background: var(--white); color: var(--ink); font-size: 14.5px;
  outline: none; transition: box-shadow 0.15s;
}
.field.area { height: auto; min-height: 88px; padding: 11px 14px; resize: vertical; line-height: 1.45; display: block; }
/* the ring is drawn inside the field, so no scrolling panel can cut it */
.field:focus { box-shadow: inset 0 0 0 2px var(--acc-well); }
/* A phone zooms into any box whose letters are under 16px the moment it is
   tapped; every box is 16px wherever a finger is the pointer. */
@media (pointer: coarse), (max-width: 719px) {
  .field, input, textarea, select { font-size: 16px; }
  /* a finger has no use for a resize grip in a box's corner */
  .field.area { resize: none; }
}
.field::placeholder { color: #9b8775; }

/* ── a day, on our own calendar (ui/DateField.tsx) ─────────────────────────── */
.date-field { display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; cursor: pointer; }
.date-field svg { flex-shrink: 0; color: var(--ink-3); position: relative; top: -1px; }
.date-field .ph { color: #9b8775; }
.date-field.on { box-shadow: inset 0 0 0 2px var(--acc-well); }
/* a phone: the month inside the sheet, under its field */
.cal-inline { margin: 8px 0 4px; padding: 6px; border-radius: 18px; background: var(--white); }
.cal { padding: 4px 2px 2px; }
.cal-head { display: flex; align-items: center; gap: 2px; padding: 0 0 8px 8px; }
.cal-head b { flex: 1; font-size: 15px; font-weight: 500; color: var(--ink); }
.cal-head b span { font-weight: 400; color: var(--ink-3); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 2px; }
.cal-wd { height: 26px; display: grid; place-items: center; font-size: 11.5px; color: var(--ink-3); }
.cal-day { width: 34px; height: 34px; margin: 0 auto; border-radius: 999px; display: grid; place-items: center; font-size: 13px; color: var(--ink); transition: background-color 0.12s; }
@media (hover: hover) { .cal-day:hover { background: var(--sunk); } }
.cal-day.out { color: var(--ink-3); opacity: 0.55; }
.cal-day.today { box-shadow: inset 0 0 0 1.5px var(--ink-2); }
.cal-day.on { background: var(--acc); color: var(--acc-paper); box-shadow: none; opacity: 1; }
@media (hover: hover) { .cal-day.on:hover { background: var(--acc); } }
.cal-foot { display: flex; gap: 6px; padding: 10px 4px 2px; }
.cal-chip { height: 32px; padding: 0 14px; border-radius: 999px; background: var(--sunk); font-size: 13px; font-weight: 500; color: var(--ink); }
@media (hover: hover) { .cal-chip:hover { background: var(--hover); } }
.lbl { font-size: 13px; color: var(--ink-3); margin: 14px 0 6px; }
.lbl:first-child { margin-top: 0; }
.check { display: flex; align-items: flex-start; gap: 10px; margin-top: 14px; cursor: pointer; font-size: 14px; }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check .box { width: 22px; height: 22px; border-radius: 8px; background: var(--white); display: grid; place-items: center; flex-shrink: 0; color: var(--acc-paper); transition: background-color 0.15s; }
.check.on .box { background: var(--acc); }
.check .txt { padding-top: 1px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* ── the frame ───────────────────────────────────────────────────────────── */
/* Two columns, each with its own top. The sidebar runs the whole height of
   the window at the left: its toggle and the wordmark at the top, then the
   parties, the versions, the contents. The document's header starts at the
   sidebar's edge and spans only the document and the comments docked at the
   right. Put away, the sidebar is gone and its toggle stands at the left of
   the document's header, in the same spot (over the pages on a mid screen).
   Hairlines between them, no floating panels. */
.ws { min-height: 100vh; }
.main { min-width: 0; }
.ws.side .main { padding-left: var(--side); }

/* THE DOCUMENT'S HEADER: the document's name (it opens the set it was sent
   in) on the left; the tools as plain icons, the menu and the one act on the
   right. Solid, so the pages scroll under its lower edge. */
.top {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 4px; height: var(--band); padding: 0 10px 0 8px;
  background: var(--app); border-bottom: 1px solid var(--line);
}
.ws.side .top { margin-left: var(--side); padding-left: 10px; }
.top > .grow { flex: 1; min-width: 8px; }
.top > .ib { border-radius: 10px; color: var(--ink-2); }
.doc-switch {
  display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; height: 36px; padding: 0 8px 0 10px; border-radius: 10px;
  color: var(--ink); transition: background-color 0.15s; flex-shrink: 1;
}
.doc-switch.on { background: var(--sunk); }
@media (hover: hover) { .doc-switch:hover { background: var(--sunk); } }
.doc-switch b { font-size: 14.5px; line-height: 1.3; font-weight: 600; letter-spacing: -0.005em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.doc-switch svg { flex-shrink: 0; color: var(--ink-3); position: relative; top: -1px; }
.tools { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.tool {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px; height: 36px; min-width: 36px; padding: 0 9px; border-radius: 10px;
  color: var(--ink-2); transition: background-color 0.15s, color 0.15s;
}
.tool.on { background: var(--sunk); color: var(--ink); }
/* a mode the page is in (suggest mode): filled while on, so it is plain the page has changed what it does */
.tool.mode.on { background: var(--acc); color: var(--acc-paper); }
@media (hover: hover) { .tool.mode.on:hover { background: #2a3b3b; color: var(--acc-paper); } }
@media (hover: hover) { .tool:hover { background: var(--sunk); color: var(--ink); } }
.tool .n { font-size: 12.5px; line-height: 1; color: var(--ink-3); }
.tools .ib { border-radius: 10px; color: var(--ink-2); }
.tools .skel { flex-shrink: 0; border-radius: 10px; }
/* where the document stands, in the act's place: its mark and its words, no pill; nothing to press, so nothing answers the pointer */
.tb.st { cursor: default; user-select: none; color: var(--ink-2); }
.tb.st svg { color: var(--ink-3); }
@media (hover: hover) { .tb.t-plain.st:hover { background-color: transparent; } .tb.st:active { opacity: 1; } }
.top > .tb, .top > .skel { height: 34px; flex-shrink: 0; margin-left: 6px; }
.top > .tb { padding: 0 14px; font-size: 13.5px; gap: 6px; }
.top > .tb svg { width: 15px; height: 15px; }
/* an icon beside words sits on the centre of their capitals: Season Sans carries its capitals a pixel above the middle of its line (measured, ui-check.mjs) */
.tb > svg { position: relative; top: -1px; }
.top .stack { margin: 0 6px 0 2px; }
.m-phone .top { padding: 0 6px; }
.m-phone .doc-switch b { font-size: 14.5px; }
/* the search in the header */
.find { display: flex; align-items: center; gap: 2px; height: 36px; width: min(380px, 36vw); min-width: 0; padding: 0 4px 0 12px; border-radius: 10px; background: var(--white); flex-shrink: 1; }
.m-phone .find { width: 100%; }
.find-ic { color: var(--ink-3); flex-shrink: 0; }
.find-in { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: transparent; font-size: 14px; padding: 0 8px; color: var(--ink); }
.find-in::-webkit-search-cancel-button { display: none; }
.find-n { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; padding: 0 4px; }
::highlight(af-find) { background-color: rgba(240, 207, 96, 0.5); }
::highlight(af-find-on) { background-color: #f0b429; color: #1d1305; }
/* a defined term under the pointer (Terms.tsx): the accent's ink, underlined. Nothing marks a term at rest. */
::highlight(af-term) { color: var(--acc-strong); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* THE SIDEBAR: the whole height at the left, flat, a hairline at its edge.
   Its top row is as tall as the document's header, so the toggle sits where
   the header puts it when the sidebar is away. */
.rail {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 30; width: var(--side); display: flex; flex-direction: column;
  background: var(--app); border-right: 1px solid var(--line);
}
.ws.peek .rail { z-index: 50; background: var(--panel); box-shadow: var(--pop); }
.rail-veil { position: fixed; inset: 0; z-index: 49; background: rgba(45, 34, 25, 0.12); }
.rail-head { display: flex; align-items: center; gap: 10px; height: calc(var(--band) - 1px); padding: 0 8px; flex-shrink: 0; color: var(--ink); }
.rail-head .ib { color: var(--ink-2); border-radius: 10px; }
/* the wordmark's letters (not its tall l and t) centred on the toggle's icon, its baseline on the icon's foot: measured, 2px up */
.rail-head .wordmark { position: relative; top: -2px; }
.wordmark { display: block; flex-shrink: 0; }
.rail-body { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 10px 20px; }
/* every group's name, here and over the comments, one size and one shade; the parties' own + at its end */
.grp { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 26px; margin: 2px 12px 4px; font-size: 13px; font-weight: 500; color: var(--ink-3); white-space: nowrap; }
/* groups stand apart by a hairline, inset to the rows' own edges */
/* every edge the sidebar draws (a hairline, a lit or hovered row, a group's name pressed) runs on one pair of lines, the rows' own edges; every word starts on one line inside them */
.sec + .sec::before { content: ""; display: block; height: 1px; margin: 12px 0; background: var(--line); }
/* a group's name folds it: the chevron down while open, to the right while folded */
.grp-name { display: inline-flex; align-items: center; gap: 8px; height: 26px; margin-left: -12px; padding: 0 8px 0 12px; border-radius: 8px; color: inherit; font: inherit; transition: background-color 0.15s; }
@media (hover: hover) { .grp-name:hover { background: var(--hover); } }
.grp-chev { color: var(--ink-3); position: relative; top: 0.3px; transition: transform 0.18s var(--ease); }
.sec.shut .grp-chev { transform: rotate(-90deg); }
.grp-add.on { background: var(--white); color: var(--ink); }
.grp-add { display: grid; place-items: center; width: 26px; height: 26px; margin-right: -5px; border-radius: 8px; color: var(--ink-3); transition: background-color 0.15s, color 0.15s; }
@media (hover: hover) { .grp-add:hover { background: var(--hover); color: var(--ink); } }
.rail-sheet .grp:first-child { margin-top: 0; }
/* THE SIDEBAR'S GRID, one for every row: everything starts at the same left
   edge (the groups' names, a person's orb, a chapter's title, a version);
   the second column (a name, a version's message, an annex's sections) at one
   place; the last column (the +, a person's state, a page) on one line at the
   right. Every row 32px, 13.5px; the row you are on lit white. The contents
   carry one number a row, the page, at the right: a chapter is its title. */
.toc { display: flex; flex-direction: column; gap: 2px; }
.toc-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 10px; width: 100%; height: 32px; padding: 0 12px;
  border-radius: 10px; text-align: left; font-size: 13.5px; line-height: 1.3; color: var(--ink-2); transition: background-color 0.18s;
}
@media (hover: hover) { .toc-row:hover { background: var(--hover); } }
.toc-row.on { background: var(--white); color: var(--ink); }
.toc-row .ttl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* an annex's sections, under it, from the second column */
.toc-row.l2 .ttl { padding-left: 34px; }
.toc-row .pg { color: inherit; font-size: inherit; min-width: 16px; text-align: right; font-variant-numeric: tabular-nums; }
/* the contract in force: a label and its value a row, on the contents' own grid (the value ends where a page number ends) */
.kv { display: flex; flex-direction: column; gap: 2px; }
.kv-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 10px; width: 100%; height: 32px; padding: 0 12px;
  font-size: 13.5px; line-height: 1.3; color: var(--ink-2);
}
.kv-row > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kv-row > b { font-weight: 400; color: var(--ink); text-align: right; white-space: nowrap; }
/* the terms dialog: each label over its field, as every dialog has them; the checkbox apart; under them, the words they were read from */
.terms-grid { display: flex; flex-direction: column; }
.terms-grid + .check { margin: 18px 0 2px; }
.check + .terms-grid { margin-top: 16px; }
.terms-src { margin: 18px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--sunk); font-family: "Act Serif", serif; font-size: 13.5px; line-height: 1.45; color: var(--ink-2); white-space: pre-wrap; }
/* a word in a group's header: what is ours to do there (confirm what was read) */
.grp-txt { height: 26px; margin-right: -5px; padding: 0 10px; border-radius: 999px; background: var(--white); color: var(--ink); font-size: 12.5px; font-weight: 500; }
@media (hover: hover) { .grp-txt:hover { background: #fff; } }
.navrow {
  position: relative; display: flex; align-items: center; gap: 10px; width: 100%; height: 32px; padding: 0 12px; border-radius: 10px;
  text-align: left; font-size: 13.5px; line-height: 1.3; color: var(--ink-2); transition: background-color 0.18s;
}
@media (hover: hover) { .navrow:hover { background: var(--hover); } }
.navrow + .navrow { margin-top: 2px; }
.navrow.on { background: var(--white); color: var(--ink); }
/* a person: their orb, their name, and where they stand as one small mark in the last column (its words are its label) */
.navrow.person { cursor: default; }
@media (hover: hover) { .navrow.person:hover { background: transparent; } }
.navrow .ps { display: grid; place-items: center; width: 16px; height: 16px; flex-shrink: 0; color: var(--ink-3); position: relative; top: -0.8px; }
.navrow .ps.good { color: var(--good); }
.navrow .ps.turn { color: var(--acc-strong); }
.navrow .ps.bad { color: var(--bad); }
.navrow > svg { flex-shrink: 0; }
.navrow .t { flex: 1; min-width: 0; }
/* a version as a commit: its number in the first column, its message in the second */
.navrow .vn { width: 24px; flex-shrink: 0; color: var(--ink-3); }
.navrow.on .vn { color: var(--ink-2); }
.navrow .t > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.navrow .t small { display: block; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── the canvas: the pages centred in what is left, the comments docked at the right edge ── */
.canvas { display: flex; align-items: stretch; }
.m-phone .canvas { display: block; padding: 12px 0 132px; }
.col { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; padding: 24px 24px 120px; }
.m-phone .col { display: block; padding: 0; }
.notice {
  display: flex; align-items: center; gap: 12px; border-radius: 18px; background: var(--panel); padding: 10px 10px 10px 18px; margin: 0 0 16px;
  font-size: 14px; color: var(--ink-2); min-height: 52px; width: var(--pw, 100%); max-width: 100%;
}
.notice .grow { padding: 4px 0; }
.notice.bare { background: transparent; padding: 0; min-height: 0; margin-bottom: 12px; }
.m-phone .notice { margin: 0 12px 12px; width: auto; }

.paper { position: relative; }
.sheets { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.pg-sheet { position: absolute; left: 0; width: 210mm; height: 297mm; background: var(--paper); border-radius: 12px; }
.flow { position: absolute; left: 24mm; top: 24mm; width: 162mm; z-index: 1; outline: none; }
.flow [data-pg].pg-line { display: inline-block; width: 100%; vertical-align: top; pointer-events: none; user-select: none; }
.flow [data-pg].pg-gap { display: block; pointer-events: none; user-select: none; }
.pg-num { position: absolute; left: 0; right: 0; text-align: center; font-size: 12px; color: var(--ink-3); pointer-events: none; }

/* on a phone: the same pages, as cards of the reading column */
.cards { position: relative; margin: 0 12px; }
.card-pg { position: absolute; left: 0; right: 0; background: var(--paper); border-radius: 20px; }
.card-pg .pg-lab { position: absolute; left: 20px; right: 20px; bottom: 14px; font-size: 12px; color: var(--ink-3); display: flex; justify-content: space-between; gap: 10px; }
.card-pg .pg-lab span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cards .flow { position: relative; left: 0; top: 0; width: auto; padding: 26px 20px 44px; }
.cards .flow.doc { text-align: left; }
.cards .flow [data-pg].pg-cut { display: block; width: 100%; pointer-events: none; }
/* the draft on a phone: one card of the reading column, the text at the column's width */
.ed-card { position: relative; margin: 0 12px; background: var(--paper); border-radius: 20px; min-height: 60vh; }
.ed-card > .flow, .ed-card > div > .flow { position: relative; left: 0; top: 0; padding: 26px 20px 44px; width: auto; text-align: left; }
.ed-card .skel-lines { position: relative; padding: 26px 20px 44px; }

/* the marks threads put on the text */
/* THE MARKS: rounded bubbles drawn under the words, one per line (ui/Doc.tsx,
   paintPills), never the letters' own background. Clear but light tints (L* 89
   to 93 at rest, 13.8:1 or better for the dark text, as small as the page is
   drawn); a lit thread takes the stronger tint (11:1 or better) and lies over
   any mark it crosses. */
.flow .m { cursor: pointer; }
.flow del.m-del { text-decoration: line-through; text-decoration-color: var(--bad); text-decoration-thickness: 1.4px; color: #5a1c0c; }
.marks { position: absolute; z-index: 0; pointer-events: none; }
.marks i { position: absolute; display: block; border-radius: 5px; background: var(--mk); transition: background-color 0.2s; }
/* where two marks cross, the one in focus lies on top: never a muddy mix of both */
.marks i.on { z-index: 1; }
.marks .m-comment { --mk: #c9e7e1; } .marks .m-comment.on { --mk: #acd8d1; }
.marks .m-yellow { --mk: #feeaa6; } .marks .m-yellow.on { --mk: #fbd968; }
.marks .m-green { --mk: #d2edc3; } .marks .m-green.on { --mk: #b5e0a0; }
.marks .m-blue { --mk: #cfe3f9; } .marks .m-blue.on { --mk: #aacef4; }
.marks .m-pink { --mk: #fcd5e1; } .marks .m-pink.on { --mk: #f7b6ca; }
.marks .m-del { --mk: #fce3db; } .marks .m-del.on { --mk: #f9d4c9; }
.marks .m-ins { --mk: #d5efd6; }
.marks .m-sel { --mk: transparent; }
.marks i.flash { animation: flash 1.2s var(--ease); }
/* where a defined term's definition stands, lit for a moment when the reader is taken there (Terms.tsx) */
.marks .m-def { --mk: #f6e3a1; animation: def-lit 1.8s var(--ease) forwards; }
@keyframes def-lit { 0% { opacity: 0; } 14% { opacity: 1; } 68% { opacity: 1; } 100% { opacity: 0; } }
/* the comparison's words come and gone are bubbles (paintPills): a gone word struck in the deletion's ink, a come word as it reads */
.flow .d-ins { text-decoration: none; }
@keyframes flash { 0%, 100% { filter: none; } 40% { filter: brightness(0.9) saturate(1.6); } }
.flow .flash { animation: flash 1.2s var(--ease); }

/* other people, on the text */
.peers-layer { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.peer-cur { position: absolute; left: 0; top: 0; transition: transform 0.12s linear; }
.peer-cur span { position: absolute; left: 14px; top: 14px; padding: 2px 8px; border-radius: 7px; color: #fff; font-family: "Season Sans", sans-serif; font-size: 12px; line-height: 18px; white-space: nowrap; }
.peer-sel { position: absolute; opacity: 0.22; border-radius: 2px; }

/* the toolbar over a selection */
.selbar {
  position: fixed; z-index: 60; display: flex; align-items: center; gap: 2px; padding: 5px; border-radius: 999px; background: #fdfcfa;
  box-shadow: var(--pop); animation: fade-in 0.14s var(--ease); font-size: 13.5px; white-space: nowrap;
}
/* on a phone: the two acts on one line, the colours on the next, never wider than the screen */
.m-phone .selbar { flex-wrap: wrap; justify-content: center; width: max-content; max-width: calc(100vw - 24px); border-radius: 22px; padding: 6px; }
.m-phone .selbar .sws { flex-basis: 100%; justify-content: center; padding: 6px 0 4px; }
.m-phone .selbar .sw { width: 30px; height: 30px; }
.selbar .tb { height: 34px; padding: 0 12px; }
.selbar .sw { width: 22px; height: 22px; border-radius: 999px; box-shadow: inset 0 0 0 0 rgba(45, 34, 25, 0.35); transition: box-shadow 0.15s; }
@media (hover: hover) { .selbar .sw:hover { box-shadow: inset 0 0 0 2px rgba(45, 34, 25, 0.35); } }
.selbar .sws { display: flex; gap: 5px; padding: 0 8px; }
.sw.yellow { background: #fbd968; } .sw.green { background: #b5e0a0; } .sw.blue { background: #aacef4; } .sw.pink { background: #f7b6ca; }

/* ── comments ────────────────────────────────────────────────────────────── */
.notes { position: relative; width: var(--notes); flex-shrink: 0; padding: 14px 20px 120px; border-left: 1px solid var(--line); min-height: calc(100vh - var(--band)); }
/* the column's name and its filter on one baseline, one size */
.notes-head { display: flex; align-items: baseline; gap: 8px; height: 40px; margin-bottom: 8px; }
/* THE COLUMN'S OTHER FACES: the activity, and a dialog. Their inside stays in
   view while the pages scroll (the comments, instead, ride level with their
   passages). A dialog is the column's name with its ×, then one white card
   with the fields and its acts at the foot, as a comment being written is. */
.notes .stick { position: sticky; top: calc(var(--band) + 14px); max-height: calc(100vh - var(--band) - 28px); overflow-y: auto; overscroll-behavior: contain; }
/* the panel and its feed give the rows' highlight room inside their own edges (8px each side), so a scrolling edge never cuts its round ends; the words stay on the column's line */
.notes.act .stick { display: flex; flex-direction: column; height: calc(100vh - var(--band) - 28px); overflow: hidden; margin: 0 -8px; padding: 0 8px; }
.notes.act .stick > .chat { flex: 1; min-height: 0; }
/* THE KEY TERMS (Keys.tsx), kept in view while the pages scroll, on the
   sidebar's grid: the groups' names and the clauses' numbers start where the
   column's name starts, a lit row reaches 12px past the words on each side,
   hairlines between the groups. A row: the clause's number, then the figure in
   the words around it, the figure in the ink of the text. */
.notes.keyc .stick { margin: 0 -12px; padding: 0 12px; }
.notes.keyc .keys { margin: 0 -12px; }
.key-rows { display: flex; flex-direction: column; gap: 2px; }
.key-row {
  display: grid; grid-template-columns: 34px minmax(0, 1fr); column-gap: 6px; align-items: start; width: 100%; padding: 6px 12px 7px;
  border-radius: 10px; text-align: left; font-size: 13.5px; line-height: 1.45; color: var(--ink-2); transition: background-color 0.18s;
}
@media (hover: hover) { .key-row:hover { background: var(--hover); } }
.key-row.on { background: var(--white); color: var(--ink); }
.key-n { font-variant-numeric: tabular-nums; white-space: nowrap; }
.key-t { min-width: 0; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; text-wrap: pretty; }
.key-t b { font-weight: 600; color: var(--ink); white-space: nowrap; }
.key-part { padding: 10px 12px 4px; font-size: 12.5px; color: var(--ink-3); }
/* THE ACTIVITY AS A CONVERSATION: messages whole, events one quiet line each (opened by a chevron), the box at the foot */
.chat { display: flex; flex-direction: column; min-height: 0; height: 100%; }
.chat-feed { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 2px; margin: 0 -8px; padding: 0 8px 4px; }
.chat-feed > .empty { margin: auto 0; }
.msg { padding: 10px 0 8px; }
.msg.pending { opacity: 0.6; }
.msg-who { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink); }
.msg-who b { font-weight: 600; }
.msg-who time { color: var(--ink-3); font-size: 12.5px; }
/* a long text folded to its first lines, opened and folded by its own press */
.clamp.shut { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: var(--lines, 6); overflow: hidden; }
.clamp-tg { display: inline-block; margin-top: 4px; padding: 2px 0; font-size: 13px; font-weight: 500; color: var(--acc-strong); }
@media (hover: hover) { .clamp-tg:hover { text-decoration: underline; text-underline-offset: 2px; } }
.msg-text { margin: 4px 0 0 32px; font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); }
.evr-line { display: flex; align-items: center; gap: 8px; width: calc(100% + 12px); min-height: 32px; margin: 0 -6px; padding: 4px 6px; border-radius: 8px; text-align: left; font-size: 13px; line-height: 1.35; color: var(--ink-3); }
.evr-line:disabled { cursor: default; color: var(--ink-3); }
.evr-line b { color: var(--ink-2); font-weight: 500; }
.evr-ic { width: 24px; height: 24px; display: grid; place-items: center; flex-shrink: 0; color: var(--ink-3); }
.evr-tx { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.evr-chev { flex-shrink: 0; transition: transform 0.15s var(--ease); }
.evr.open .evr-chev { transform: rotate(90deg); }
.evr-line time { flex-shrink: 0; font-size: 12px; }
.evr-said { margin: 2px 0 8px 32px; padding: 8px 11px; border-radius: 12px; background: var(--white); font-size: 13px; line-height: 1.45; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
@media (hover: hover) { .evr-line:not(:disabled):hover { background: var(--hover); } }
/* what the engine still owes (ours only), above the activity, drawn as its lines are */
.owed { display: flex; flex-direction: column; gap: 2px; margin: 0 0 10px; padding: 0 0 10px; border-bottom: 1px solid var(--line); }
.owed-row { display: flex; align-items: center; gap: 8px; min-height: 40px; font-size: 13px; line-height: 1.35; color: var(--ink-2); }
.owed-row.bad .evr-ic { color: var(--bad); }
.owed-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.owed-tx b { font-weight: 500; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.owed-tx small { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-box { flex-shrink: 0; display: flex; align-items: flex-end; gap: 8px; margin-top: 10px; padding: 6px 6px 6px 14px; border-radius: 20px; background: var(--white); box-shadow: inset 0 0 0 1px var(--line); }
/* (its edge is drawn inside it, so the panel it stands in can never cut its round ends) */
.chat-box .mention-wrap { flex: 1; min-width: 0; }
.chat-box .field.area { display: block; height: 36px; min-height: 0; max-height: 168px; padding: 8px 0; border-radius: 0; background: transparent; box-shadow: none; resize: none; line-height: 1.45; overflow-y: auto; }
.chat-send { width: 32px; height: 32px; flex-shrink: 0; border-radius: 999px; display: grid; place-items: center; background: var(--acc); color: var(--acc-paper); margin-bottom: 2px; transition: background-color 0.15s; }
.chat-send:disabled { background: #e9e5de; color: rgba(45, 34, 25, 0.4); cursor: default; }
.mention-wrap.up .mention-list { top: auto; bottom: calc(100% + 10px); }
/* in a panel from the side or the foot the conversation fills it, its box at the panel's foot */
.sheet-body:has(> .chat) { display: flex; flex-direction: column; overflow: hidden; }
.sheet.from-foot:has(.chat) { height: calc(100svh - 32px); }
.notes-head .dock-x { align-self: center; margin-right: -6px; color: var(--ink-3); }
.dock-card { border-radius: 20px; background: var(--white); padding: 16px 16px 12px; font-size: 14px; }
.dock-card .sub { margin: 0 0 12px; color: var(--ink-3); font-size: 13.5px; line-height: 1.45; }
/* in the card, a field is a line to write on: no box, a hairline under it, its words its own label */
.dock-card .lbl { font-size: 13px; font-weight: 500; color: var(--ink-3); margin: 14px 0 2px; }
.dock-card .lbl:first-child { margin-top: 0; }
.dock-card .lbl .opt { font-weight: 400; margin-left: 6px; }
.dock-card .field { height: 44px; padding: 0 2px; border-radius: 0; background: transparent; box-shadow: inset 0 -1px 0 var(--line); }
.dock-card .field:focus { box-shadow: inset 0 -1.5px 0 var(--ink-2); }
/* a box for a few lines keeps the line every field stands on, so an empty one is never an empty space */
.dock-card .field.area { height: auto; min-height: 120px; padding: 10px 2px; box-shadow: inset 0 -1px 0 var(--line); resize: none; }
.dock-card .field.area:focus { box-shadow: inset 0 -1.5px 0 var(--ink-2); }
.dock-card .field::placeholder { color: #a8927d; }
/* a person, filled in as a person: orb and name, then the address, a hairline between */
.person-fields { display: flex; flex-direction: column; margin: -4px 0 0; }
.pf-row { display: flex; align-items: center; gap: 12px; height: 48px; cursor: text; }
.pf-row + .pf-row { box-shadow: inset 0 1px 0 var(--line); }
.pf-orb { width: 28px; height: 28px; flex-shrink: 0; border-radius: 999px; border: 1.5px dashed rgba(51, 36, 29, 0.28); }
.pf-ic { width: 28px; display: grid; place-items: center; flex-shrink: 0; color: var(--ink-3); }
.pf-in { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: transparent; font: inherit; font-size: 14.5px; color: var(--ink); padding: 0; }
.pf-name { font-weight: 600; }
.pf-in::placeholder { color: #a8927d; font-weight: 500; }
.dock-card .check { font-size: 13.5px; }
.dock-card .check .box { background: #fff; box-shadow: inset 0 0 0 1px rgba(51, 36, 29, 0.24); }
.dock-card .check.on .box { background: var(--acc); box-shadow: none; }
.dock-card .pad { height: 160px; background: #fff; box-shadow: inset 0 0 0 1px rgba(51, 36, 29, 0.16); border-radius: 14px; }
.dock-card .linkrow code { background: var(--sunk); }
.dock-card .grid2 { grid-template-columns: 1fr; }
.dock-card .err { color: var(--bad); font-size: 13px; margin-top: 10px; }
.dock-foot { display: flex; gap: 4px; justify-content: flex-end; align-items: center; flex-wrap: wrap; margin: 14px -4px -2px; }
.dock-foot > .grow { flex: 1; }
.dock-foot .tb { height: 36px; padding: 0 14px; font-size: 13.5px; }
.dock-foot .tb.t-white { background: transparent; }
@media (hover: hover) { .dock-foot .tb.t-white:hover { background: var(--sunk); } }
/* a mid screen: the same card in a panel from the side */
.sheet.dlg { padding: 14px 20px 20px; overflow-y: auto; }
.sheet.dlg .notes-head { margin-bottom: 8px; }
.notes-head b { font-size: 13px; font-weight: 500; color: var(--ink-3); }
.notes-head .n { color: inherit; font-size: inherit; }
.notes-head .tb { gap: 5px; padding: 0 10px 0 14px; font-size: 13px; align-self: center; }
/* the name drawn exactly as the filter's words are: a 36px box, the text centred in it, so both sit on one baseline */
.notes-head b { align-self: center; display: inline-flex; align-items: center; height: 36px; line-height: 1.45; }
/* the same chevron as the document's name in the header: its size, its stroke, on the label's optical middle */
/* every chevron sits on the middle of its label's capitals (as the reference does), placed by measure */
.notes-head .tb .chev { color: var(--ink-3); position: relative; top: -0.15px; margin-left: 1px; }
.notes-list { position: relative; }
.card {
  position: absolute; left: 0; right: 0; border-radius: 20px; background: var(--panel); padding: 13px 14px 10px; font-size: 14px;
  transition: top 0.22s var(--ease), background-color 0.2s; cursor: pointer;
}
/* a note on its way: the shape it will have, its acts not yet pressable */
.card .foot.inert { pointer-events: none; opacity: 0.45; }
.card .menu-room { width: 30px; height: 30px; flex-shrink: 0; }
.card.on { background: var(--white); cursor: default; }
.card.done { opacity: 0.72; }
.flowing .card { position: relative; margin-bottom: 10px; }
.card .who { display: flex; align-items: center; gap: 9px; min-height: 30px; }
.card .who b { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .who time { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }
.card .quote {
  margin: 8px 0 0; font-family: "Act Serif", "Times New Roman", serif; font-size: 13.5px; line-height: 1.4; color: var(--ink-2);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card .quote::before { content: "„"; } .card .quote::after { content: "”"; }
.card .quote.del { color: var(--bad); text-decoration: line-through; text-decoration-thickness: 1.2px; }
.card .proposal { margin-top: 8px; }
.card .proposal ins { display: block; text-decoration: none; font-family: "Act Serif", "Times New Roman", serif; font-size: 14px; color: var(--acc-strong); background: rgba(48, 87, 85, 0.08); border-radius: 8px; padding: 6px 9px; white-space: pre-wrap; }
.card .body { margin-top: 8px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.card .state { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12.5px; color: var(--ink-3); }
.card .state + .state { margin-top: 3px; }
.card .replies { margin-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.card .reply .who { min-height: 24px; }
.card .reply .body { margin-top: 4px; }
.card .foot { display: flex; align-items: center; gap: 4px; margin: 8px -6px 0; flex-wrap: wrap; }
.card .like { display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 10px; border-radius: 999px; font-size: 13px; color: var(--ink-3); }
@media (hover: hover) { .card .like:hover { background: var(--sunk); } }
.card .like.on { color: var(--acc-strong); }
.card .composer { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.card .composer .field { background: var(--white); }
.card.on .composer .field { background: var(--panel); }
.card .composer .area { min-height: 72px; }
/* the proposed text: as tall as a few lines, scrolled inside past that */
.card .composer .area.proposal-box { max-height: 220px; overflow-y: auto; }
.card .composer .row { gap: 4px; flex-wrap: wrap; }
.card .composer .row.acts { margin: 0 -4px -2px; }
.empty-notes { color: var(--ink-3); font-size: 14px; padding: 6px 4px; line-height: 1.5; }
/* @ tags: the list under the box as it is typed, and the tag in what was said (yours stands out) */
.mention-wrap { position: relative; }
.mention-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; display: flex; flex-direction: column; gap: 2px; padding: 6px;
  border-radius: 16px; background: #fdfcfa; box-shadow: var(--pop); max-height: 236px; overflow-y: auto; cursor: default;
}
.mention-list .menurow { min-height: 36px; font-size: 13.5px; gap: 10px; }
.at { color: var(--acc-strong); font-weight: 500; background: var(--acc-tint); border-radius: 6px; padding: 0 3px; }
.at.me { color: var(--ink); background: #fbd968; }

/* ── the owner's editor ──────────────────────────────────────────────────── */
/* the editor's tools: a second band under the bar, solid like it, so the page scrolls under both */
.etools-band { position: sticky; top: var(--band); z-index: 24; display: flex; justify-content: center; padding: 10px 16px; background: var(--app); }
.etools {
  display: flex; align-items: center; gap: 2px; flex-wrap: wrap; width: fit-content; max-width: 100%; padding: 6px; border-radius: 22px; background: var(--panel);
}
.etools .sep { width: 8px; }
.etools .ib { color: var(--ink-2); }
.etools .tb { height: 36px; }
.etools .saving { font-size: 13px; color: var(--ink-3); padding: 0 10px; white-space: nowrap; }
.etools .saving.err { color: var(--bad); }
.flow.ProseMirror { white-space: pre-wrap; caret-color: var(--acc-strong); }
.flow.ProseMirror p.is-editor-empty:first-child::before { content: attr(data-placeholder); color: #a8998b; float: left; height: 0; pointer-events: none; }
.flow.ProseMirror .tableWrapper { overflow-x: auto; }
.flow.ProseMirror .selectedCell { background: rgba(163, 194, 193, 0.3); }
.flow.ProseMirror img.ProseMirror-selectednode { outline: 2px solid var(--acc-well); }
.flow.ProseMirror .column-resize-handle { position: absolute; right: -2px; top: 0; bottom: 0; width: 3px; background: var(--acc-well); pointer-events: none; }
.flow.ProseMirror td, .flow.ProseMirror th { position: relative; }
.slash { position: fixed; z-index: 80; width: 270px; padding: 6px; border-radius: 22px; background: #fdfcfa; box-shadow: var(--pop); animation: pop-in 0.16s var(--ease); }
.slash .menurow small { display: block; font-size: 12px; color: var(--ink-3); }
.ai-box { position: fixed; z-index: 80; width: 380px; padding: 14px; border-radius: 24px; background: #fdfcfa; box-shadow: var(--pop); animation: pop-in 0.16s var(--ease); }
.ai-box .out { margin-top: 10px; padding: 10px 12px; border-radius: 14px; background: var(--sunk); font-family: "Act Serif", serif; font-size: 14px; white-space: pre-wrap; max-height: 240px; overflow-y: auto; }

/* ── signatures on the page ──────────────────────────────────────────────── */
/* the paper's own lines and words come from the page CSS (src/paper.ts); here only what sits on them */
.sg-ink { position: absolute; }
.sg-ink img { display: block; width: 100%; height: 100%; object-fit: contain; object-position: 50% 100%; }
.sg-typed { position: absolute; text-align: center; white-space: nowrap; font-family: "Act Serif", serif; font-style: italic; color: #1a2a6b; }
.sg-day { position: absolute; white-space: nowrap; font-family: "Act Serif", serif; font-size: 10pt; line-height: 10pt; color: #141414; }
/* the box of the person whose turn it is: a wash over the space and its line in the accent, the press in the middle */
.sg-box.mine { background: var(--acc-paper); border-bottom-color: var(--acc-strong); border-radius: 2mm 2mm 0 0; }
.sg-act { position: absolute; left: 0; width: 78mm; display: grid; place-items: center; }
/* the act in the box is the screen's, not the paper's: the interface's own type, as in the bar */
.sg-act .tb { font-family: "Season Sans", system-ui, sans-serif; height: 40px; padding: 0 18px; font-size: 14px; }
.refusal-why { margin: 0 12px 8px; font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.sg-refused { font-family: "Season Sans", system-ui, sans-serif; font-size: 13px; color: var(--bad); }
/* a phone: each page of signatures is a card after the text's cards, its blocks one under another */
.sg-cards { margin: 14px 12px 0; }
.sg-card { position: relative; background: var(--paper); border-radius: 20px; padding: 26px 20px 44px; margin: 0 0 14px; }
.sg-card .sg-page.sg-flow { width: auto; height: auto; }
.sg-card .sg-page.sg-flow h2 { position: static; margin: 0 0 6mm; }
.sg-card .sg-block { position: relative; height: 56mm; margin: 0 auto 4mm; max-width: 100%; }
.sg-card .sg-block:last-child { margin-bottom: 0; }
.sg-card .pg-lab { position: absolute; left: 20px; right: 20px; bottom: 14px; font-size: 12px; color: var(--ink-3); display: flex; justify-content: space-between; gap: 10px; }
.sg-card .pg-lab span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* the copies to an address: the field and its button side by side, the field giving way on a phone so nothing leaves the screen */

/* ── the phone ───────────────────────────────────────────────────────────── */
.bottom {
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 40; display: flex; align-items: center; gap: 8px;
  padding: 7px; border-radius: 999px; background: rgba(251, 250, 248, 0.78); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
/* the act, or where the document stands, at the island's right end */
.bottom .tb:not(.t-plain), .bottom .tb.st { margin-left: auto; flex-shrink: 1; min-width: 0; }
/* on the island the words need the room more than the mark does */
.bottom .tb.st { padding: 0 12px 0 8px; }
.bottom .tb.st > svg { display: none; }
.bottom .tb.t-plain { padding: 0 14px; }
/* the narrowest phones: tighter, and the act's words whole rather than its tick */
@media (max-width: 360px) {
  .bottom { gap: 4px; }
  .bottom .tb.t-plain { padding: 0 10px; gap: 6px; }
  .bottom .tb.t-dark { padding: 0 16px; }
  .bottom .tb.t-dark > svg { display: none; }
}

/* ── the screens before the document ─────────────────────────────────────── */
.center { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.center .box { width: 100%; max-width: 420px; border-radius: 28px; background: var(--panel); padding: 30px; }
.center .ic { width: 52px; height: 52px; border-radius: 999px; background: var(--sunk); display: grid; place-items: center; color: var(--ink-2); margin-bottom: 18px; }
.center h2 { margin: 0 0 8px; font-size: 21px; font-weight: 600; letter-spacing: -0.01em; }
.center p { margin: 0 0 6px; color: var(--ink-3); font-size: 14.5px; }
.center .doc-name { color: var(--ink); font-weight: 600; margin-bottom: 4px; }
.center form { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.center .err { color: var(--bad); font-size: 13.5px; }
/* skeletons: shapes where content is coming, breathing, never spinning */
@keyframes breathe { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.skel { display: block; background: var(--sunk); border-radius: 6px; animation: breathe 1.6s ease-in-out infinite; }
.pg-sheet .skel, .card-pg .skel { background: #efece6; }
.skel-lines { position: absolute; left: 24mm; top: 24mm; width: 162mm; display: flex; flex-direction: column; gap: 13px; z-index: 2; }
.cards .skel-lines { position: relative; left: 0; top: 0; width: auto; padding: 26px 20px 44px; }
.skel-card { border-radius: 20px; background: var(--panel); padding: 14px; display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.skel-card .row { gap: 9px; }
.skel-rail { display: flex; flex-direction: column; gap: 12px; padding: 6px 12px; }

/* empty states: an icon in a soft circle, a few words, the act that fills it */
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 34px 16px; text-align: center; }
.empty .empty-ic { width: 48px; height: 48px; border-radius: 999px; background: var(--sunk); display: grid; place-items: center; color: var(--ink-3); }
.empty b { font-size: 14.5px; font-weight: 500; color: var(--ink-2); }
.empty .tb { margin-top: 4px; }
.empty.compact { padding: 14px 8px; flex-direction: row; justify-content: flex-start; gap: 12px; text-align: left; }
.empty.compact .empty-ic { width: 36px; height: 36px; }
.empty.compact b { font-size: 14px; }
.sheet-empty { position: absolute; left: 0; right: 0; top: 38%; z-index: 2; }
.sheet-empty.draft-empty { pointer-events: none; }
.sheet-empty.draft-empty .tb { pointer-events: auto; }

/* party links in the owner's dialog */
.prow { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; }
.prow + .prow { border-top: 0; }
.prow .nm { flex: 1; min-width: 0; }
.prow .nm b { display: block; font-weight: 600; font-size: 14.5px; }
.prow .nm small { display: block; color: var(--ink-3); font-size: 13px; }
.linkrow { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.linkrow code { flex: 1; min-width: 0; overflow-wrap: anywhere; word-break: break-all; line-height: 1.35; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; background: var(--white); border-radius: 12px; padding: 9px 12px; color: var(--ink-2); }
.act-list { display: flex; flex-direction: column; gap: 16px; }
.ev { display: flex; gap: 12px; font-size: 14px; }
.ev .ic { width: 28px; height: 28px; border-radius: 999px; background: var(--sunk); display: grid; place-items: center; flex-shrink: 0; color: var(--ink-2); }
.ev .tx { min-width: 0; flex: 1; padding-top: 3px; }
.ev .tx time { display: block; font-size: 12.5px; color: var(--ink-3); margin-top: 1px; }
.ev .said { margin-top: 6px; padding: 9px 12px; border-radius: 14px; background: var(--white); font-size: 13.5px; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.act-box { margin-bottom: 18px; }
.act-box .area { min-height: 70px; }
.flow tr.pg-row > td, .flow tr.pg-row > th { padding-top: calc(var(--pg) + 3pt); }

/* a note on its way to the record */
.card.pending { opacity: 0.78; }
.card.pending time::after { content: ""; display: inline-block; width: 9px; height: 9px; margin-left: 6px; border-radius: 999px; border: 1.5px solid currentColor; border-right-color: transparent; animation: spin 0.7s linear infinite; vertical-align: -1px; }
/* the comments arrive with the pages, and fade in where they belong */
@keyframes fade-in { from { opacity: 0; } }
.notes-list { animation: fade-in 0.25s var(--ease); }
.toc-row .pg:empty::after { content: ""; display: inline-block; width: 10px; }
.skel-row { pointer-events: none; }
/* a skeleton inside a line of text keeps the line's own height */
.skel.in { display: inline-block; vertical-align: middle; }
.bottom .grow { flex: 1; }
.skel-row .skel { height: 10px; }
/* the search box too: 16px wherever a finger is the pointer, so tapping it never zooms */
@media (pointer: coarse), (max-width: 719px) { .find .find-in { font-size: 16px; } }
/* a press that waits: the spinner stands where the icon stood */
.menurow .mr-spin { width: 16px; height: 16px; border-width: 1.8px; }
.menurow.busy, .tool.busy, .ib.busy, .tb.busy { cursor: progress; }
.tool .spin { width: 16px; height: 16px; border-width: 1.8px; }
.ib .spin { width: 16px; height: 16px; border-width: 1.8px; }

/* ── one place, no box in a box ─────────────────────────────────────────── */
/* the pad to sign on stands on its line, as the mark does on the page of signatures: no frame inside the panel's card */
.pad { display: block; width: 100%; max-width: 100%; touch-action: none; cursor: crosshair; }
.modal .pad, .dock-card .pad, .m-phone .pad { height: 150px; background: transparent; box-shadow: inset 0 -1px 0 var(--line); border-radius: 0; }
/* on a phone the editor's tools are one row that scrolls sideways, on the band itself */
.m-phone .etools-band { justify-content: flex-start; padding: 6px 4px; overflow-x: auto; scrollbar-width: none; }
.m-phone .etools-band::-webkit-scrollbar { display: none; }
.m-phone .etools { flex-wrap: nowrap; width: max-content; max-width: none; padding: 0; background: transparent; border-radius: 0; }
/* a party's link: the address in plain words, and the copy beside it */
.linkrow { display: flex; gap: 4px; align-items: center; margin-top: 4px; }
.linkrow .url { flex: 1; min-width: 0; font-size: 13px; color: var(--ink-2); overflow-wrap: anywhere; line-height: 1.4; }
/* adding a party: one field to a row, the order beside the role only where there is room */
.addp { display: flex; flex-direction: column; gap: 0; margin-top: 4px; }
.addp .pair { display: grid; grid-template-columns: 1fr 120px; gap: 12px; margin-top: 4px; }
.addp .acts { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }

/* ── THE CHAT ────────────────────────────────────────────────────────────────
   Laid after the agreement flow's stylesheet (satellites/agreement-flow/ws/
   app.css, read at build time), so the frame, the bar, the sidebar, the
   column at the right, the menus, the panels and the type are that page's
   own. What is here is what a chat has and a contract does not: the list's
   rows, the filters, the bubbles, the box at the foot, the details.
   The rules that stand: no scrollbar anywhere (the agreement's sheet already
   hides them all), nothing moves under the pointer (a hover changes a
   surface, never a place), no decorative motion. */

.chat-app { --side: 372px; --notes: 360px; height: 100vh; height: 100dvh; overflow: hidden; }
.chat-app .main { height: calc(100vh - var(--band)); height: calc(100dvh - var(--band)); }
.chat-app .canvas { height: 100%; }

/* ── the sidebar as a list ─────────────────────────────────────────────── */
.chat-rail .rail-head { gap: 6px; padding: 0 10px 0 8px; }
.chat-rail .rail-head .wordmark { margin-left: 4px; }
/* the dark round plus: the agreement's sidebar squares and greys its buttons, this one keeps Aria's shape and colour */
.chat-rail .rail-head .new-chat { margin-right: 2px; border-radius: 999px; color: var(--acc-paper); }
.chat-rail .rail-head > span { display: inline-flex; }
.chat-body { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.rail-tools { flex-shrink: 0; padding: 10px 10px 4px; }
.find.rail-find { width: 100%; height: 38px; }
.tool.sm { height: 28px; min-width: 28px; padding: 0 6px; }
.chips { display: flex; gap: 6px; margin-top: 10px; overflow-x: auto; }
/* Aria's chip, still under the pointer: its surface lights, its place stays */
.chip {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; height: 32px; padding: 0 12px; border-radius: 999px;
  background: var(--white); color: var(--ink-2); font-size: 13.5px; transition: background-color 0.15s, color 0.15s;
}
@media (hover: hover) { .chip:hover { background: #fff; color: var(--ink); } }
.chip.on { background: var(--acc); color: var(--acc-paper); }
@media (hover: hover) { .chip.on:hover { background: #26393a; color: var(--acc-paper); } }
.badge {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; flex-shrink: 0;
  background: var(--acc); color: var(--acc-paper); font-size: 11.5px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums;
}
.badge.light { background: var(--acc-paper); color: var(--acc); }
.badge.quiet { background: var(--acc-well); color: var(--acc); }
.chat-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 6px 10px 20px; }

.arch-row {
  display: flex; align-items: center; gap: 12px; width: 100%; height: 50px; padding: 0 12px; border-radius: 14px; text-align: left;
  font-size: 14.5px; color: var(--ink); transition: background-color 0.18s;
}
@media (hover: hover) { .arch-row:hover { background: var(--hover); } }
.arch-ic { display: grid; place-items: center; width: 46px; color: var(--acc-strong); }
.arch-row .n { font-size: 12.5px; font-weight: 600; color: var(--acc-strong); font-variant-numeric: tabular-nums; }

.chat-row {
  display: flex; align-items: center; gap: 12px; width: 100%; height: 70px; padding: 0 12px; border-radius: 14px; text-align: left;
  transition: background-color 0.18s;
}
.chat-row + .chat-row { margin-top: 2px; }
@media (hover: hover) { .chat-row:hover { background: var(--hover); } }
.chat-row.on { background: var(--white); }
.cr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cr-top, .cr-bottom { display: flex; align-items: center; gap: 6px; min-width: 0; }
.cr-name { min-width: 0; font-size: 15px; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cr-when { margin-left: auto; flex-shrink: 0; padding-left: 6px; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.cr-when.hot { color: var(--acc-strong); font-weight: 600; }
.cr-last { flex: 1; min-width: 0; font-size: 13.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-row.unread .cr-last { color: var(--ink-2); }
.cr-last .solar { vertical-align: -3px; margin-right: 2px; }
.cr-ic.fresh { color: var(--acc-strong); }
.cr-mark { flex-shrink: 0; color: var(--ink-3); }
.typing { color: var(--acc-strong); font-weight: 500; }
.draft { color: var(--bad); font-weight: 500; }
.verified { flex-shrink: 0; color: var(--acc-strong); }
.tk { flex-shrink: 0; color: var(--ink-3); }
.tk.read { color: var(--acc-strong); }
.tk.failed { color: var(--bad); }
/* a group's picture: Aria's accent well with its mark */
.g-av { display: inline-grid; place-items: center; flex-shrink: 0; border-radius: 999px; background: var(--acc-tint); color: var(--acc-strong); }
.rail-foot { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 18px 12px 4px; font-size: 12px; color: var(--ink-3); text-align: center; }
.none { padding: 28px 12px; text-align: center; font-size: 14px; color: var(--ink-3); }
.none b { color: var(--ink-2); font-weight: 500; }

/* the archive and a new chat: the column's own head, with its way back */
.sub-head { display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 10px 0 8px; flex-shrink: 0; }
.sub-head b { font-size: 16px; font-weight: 600; letter-spacing: -0.005em; }
.arch-note { margin: 2px 12px 14px; font-size: 13px; line-height: 1.45; color: var(--ink-3); }
.new-acts { display: flex; flex-direction: column; gap: 2px; margin-bottom: 6px; }
.new-row, .contact-row {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; padding: 6px 12px; border-radius: 14px; text-align: left;
  font-size: 14.5px; color: var(--ink); transition: background-color 0.18s;
}
@media (hover: hover) { .new-row:hover, .contact-row:hover { background: var(--hover); } }
.na-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 999px; flex-shrink: 0; background: var(--acc); color: var(--acc-paper); }
.new-row small, .contact-row small { display: block; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.contact-row b, .nr-t { display: block; font-weight: 500; font-size: 14.5px; }
.letter-head { padding: 12px 12px 4px; font-size: 12.5px; font-weight: 600; color: var(--acc-strong); }
.chat-list .menulabel { padding: 10px 12px 2px; }

/* ── the bar over a chat ───────────────────────────────────────────────── */
.chat-switch { height: 44px; gap: 10px; padding: 0 12px 0 4px; border-radius: 12px; }
.chat-switch .cs-t { display: flex; flex-direction: column; min-width: 0; text-align: left; }
.chat-switch b { display: flex; align-items: center; gap: 5px; font-size: 15px; }
.chat-switch small { font-size: 12.5px; line-height: 1.3; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* the orb and the mark keep their own place and colour inside the switch (the agreement lifts a switch's chevron by a pixel) */
.chat-switch .av svg, .chat-switch .g-av svg, .chat-switch .verified { position: static; top: 0; }
.chat-switch .g-av svg { color: var(--acc-strong); }
.chat-switch .verified { color: var(--acc-strong); }
.find.chat-find { width: min(300px, 26vw); }
.find.chat-find.ph { width: 100%; }
.acct { padding: 2px 12px 10px; }
.acct b { display: block; font-size: 15px; font-weight: 600; }
.acct small { display: block; font-size: 12.5px; color: var(--ink-3); }

/* ── a conversation ────────────────────────────────────────────────────── */
.conv { position: relative; flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; }
.feed { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 6px 0 12px; }
.feed-in { max-width: 920px; margin: 0 auto; padding: 0 28px; }
/* a day's name, in its place among the messages */
.day { display: flex; justify-content: center; margin: 14px 0 6px; }
.day span { padding: 5px 12px; border-radius: 9px; background: var(--white); font-size: 12.5px; color: var(--ink-2); }
.unread-bar { display: flex; justify-content: center; margin: 12px -28px 4px; padding: 6px 0; background: rgba(251, 250, 248, 0.6); }
.unread-bar span { padding: 4px 12px; border-radius: 9px; background: var(--white); font-size: 12.5px; font-weight: 500; color: var(--acc-strong); }
.sys { display: flex; justify-content: center; margin: 10px 0; }
.sys span { max-width: 80%; padding: 6px 12px; border-radius: 9px; background: var(--panel); font-size: 12.5px; color: var(--ink-3); text-align: center; }

.mrow { position: relative; display: flex; align-items: flex-start; gap: 8px; margin-top: 2px; }
.mrow.first { margin-top: 10px; }
.mrow.out { flex-direction: row-reverse; }
.mrow.reacted { margin-bottom: 16px; }
.mav { width: 30px; flex-shrink: 0; }
.bub {
  position: relative; max-width: min(560px, 72%); padding: 7px 10px 7px 11px; border-radius: 14px; background: var(--white); color: var(--ink);
  font-size: 14.5px; line-height: 1.45; overflow-wrap: anywhere;
}
.mrow.out .bub { background: var(--acc-tint); }
/* the first of a run has its corner cut on the side it came from */
.mrow.in.first .bub { border-top-left-radius: 4px; }
.mrow.out.first .bub { border-top-right-radius: 4px; }
.tx { margin: 0; white-space: pre-wrap; }
/* room on the last line for the time, so a short message keeps it beside its words */
.tx .sp { display: inline-block; height: 1px; vertical-align: baseline; }
.tx.clamp.shut { --lines: 9; }
.more { display: inline-block; margin-top: 2px; padding: 0 0 2px; font-size: 14px; font-weight: 500; color: var(--acc-strong); }
@media (hover: hover) { .more:hover { text-decoration: underline; text-underline-offset: 2px; } }
.meta {
  position: absolute; right: 9px; bottom: 6px; display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; line-height: 1;
  color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums;
}
.meta.line { position: static; display: flex; justify-content: flex-end; margin-top: 3px; }
.meta.over { right: 8px; bottom: 8px; padding: 4px 7px; border-radius: 999px; background: rgba(28, 22, 16, 0.42); color: #fff; }
.meta.over .tk, .meta.over .tk.read { color: #fff; }
.meta .st { color: var(--ink-3); }
.who { display: block; margin-bottom: 2px; font-size: 13px; font-weight: 600; }
.fwd { display: flex; align-items: center; gap: 4px; margin-bottom: 3px; font-size: 12.5px; font-style: italic; color: var(--ink-3); }
.quote {
  display: block; margin: 2px -3px 6px; padding: 6px 10px 7px 11px; border-radius: 8px; background: rgba(45, 34, 25, 0.05);
  box-shadow: inset 3px 0 0 var(--qc);
}
.mrow.out .quote { background: rgba(28, 42, 42, 0.07); }
.quote b { display: block; font-size: 12.5px; font-weight: 600; color: var(--qc); }
.quote span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: 13px; color: var(--ink-3); }
.lnk { color: var(--acc-strong); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
mark.hit { background: rgba(240, 207, 96, 0.5); color: inherit; border-radius: 3px; }
.bub.now mark.hit { background: #f0b429; color: #1d1305; }

/* a photo: the picture to the bubble's edge less a margin, its words under it */
.bub.k-photo { padding: 4px; }
.photo { position: relative; display: block; width: 330px; max-width: 100%; border-radius: 11px; overflow: hidden; background: var(--sunk); }
.photo.tall { width: 240px; }
.photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.bub.k-photo .tx { padding: 6px 7px 2px; }
.bub.k-photo .who { padding: 2px 7px 4px; margin: 0; }

/* a file: the first page when it has one, its name, its pages, its kind, its weight */
.bub.k-doc { width: 340px; max-width: 72%; padding: 4px; }
.doc { display: block; }
.doc-pv { display: block; height: 124px; overflow: hidden; padding: 14px 22px 0; border-radius: 10px 10px 0 0; background: rgba(45, 34, 25, 0.06); }
.mrow.out .doc-pv { background: rgba(28, 42, 42, 0.08); }
.pv-page { display: flex; flex-direction: column; gap: 7px; height: 200px; padding: 16px 18px; border-radius: 4px; background: var(--paper); }
.pv-page i { display: block; height: 4px; border-radius: 2px; background: #e6e0d7; }
.pv-page i.t { width: 46%; height: 6px; margin: 0 auto 6px; background: #d9d2c7; }
.pv-page i.gap { height: 2px; background: transparent; }
.doc-row { display: flex; align-items: center; gap: 10px; padding: 9px 4px 9px 8px; border-radius: 10px; background: rgba(45, 34, 25, 0.045); }
.mrow.out .doc-row { background: rgba(28, 42, 42, 0.07); }
.doc-pv + .doc-row { border-radius: 0 0 10px 10px; }
.doc-row .grow { min-width: 0; }
.doc-row b { display: block; font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-row small { display: block; font-size: 12px; color: var(--ink-3); }
.doc-ic { position: relative; display: grid; place-items: center; width: 34px; height: 40px; flex-shrink: 0; color: var(--ink-3); }
.doc-ic em {
  position: absolute; left: 50%; bottom: 3px; transform: translateX(-50%); padding: 1px 3px; border-radius: 3px;
  font-style: normal; font-size: 7.5px; font-weight: 700; line-height: 1.25; letter-spacing: 0.02em; white-space: nowrap; color: #fff; background: var(--bad);
}
.doc-ic.xlsx em { background: #2c6e49; }
.doc-ic.docx em { background: #2b565f; }
.bub.k-doc .tx { padding: 6px 6px 2px; }
.bub.k-doc .meta.line { margin: 4px 6px 2px 0; }

/* a voice note */
.bub.k-voice { width: 330px; max-width: 76%; padding: 8px 10px 6px; }
.voice { display: flex; align-items: center; gap: 10px; }
.wave { flex: 1; display: flex; align-items: center; gap: 2px; height: 30px; min-width: 0; overflow: hidden; }
.wave i { display: block; flex-shrink: 0; width: 3px; border-radius: 2px; background: rgba(45, 34, 25, 0.26); }
.mrow.out .wave i { background: rgba(28, 42, 42, 0.3); }
.wave i.on { background: var(--acc-strong); }
.vdur { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* a template from a business: its title, its words, its sender, its buttons under a hairline */
.bub.k-tpl { width: 380px; max-width: 76%; padding: 9px 12px 0; }
.tpl-t { display: block; margin-bottom: 3px; font-weight: 600; }
.tpl-f { display: block; margin-top: 6px; font-size: 12.5px; color: var(--ink-3); }
.bub.k-tpl .meta.line { margin: 2px 0 8px; }
.tpl-btns { margin: 0 -12px; }
.tpl-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 42px; font-size: 14px; font-weight: 500;
  color: var(--acc-strong); box-shadow: inset 0 1px 0 var(--line); transition: background-color 0.15s;
}
@media (hover: hover) { .tpl-btn:hover { background: rgba(45, 34, 25, 0.04); } }
.tpl-btn:last-child { border-radius: 0 0 14px 14px; }

/* reactions under the bubble's edge */
.reacts {
  position: absolute; bottom: -15px; display: flex; gap: 2px; padding: 1px 6px; border-radius: 999px; background: var(--white);
  box-shadow: 0 0 0 2px var(--app); font-size: 13px; line-height: 20px; white-space: nowrap;
}
.mrow.in .reacts { left: 10px; }
.mrow.out .reacts { right: 10px; }
.reacts b { margin-left: 3px; font-size: 11.5px; font-weight: 600; color: var(--ink-3); }

/* under the pointer: the react, the menu and the forward beside the bubble, shown by their surface alone */
.hover-acts { align-self: center; display: flex; gap: 4px; opacity: 0; transition: opacity 0.12s; }
.hover-acts .ib { color: var(--ink-2); }
@media (hover: hover) { .mrow:hover .hover-acts { opacity: 1; } }
.hover-acts:focus-within, .hover-acts:has(.on) { opacity: 1; }
@media (hover: none) { .hover-acts { display: none; } }
.react-pop { flex-direction: row; align-items: center; gap: 2px; padding: 5px 6px; border-radius: 999px; }
.emo { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; font-size: 22px; line-height: 1; transition: background-color 0.12s; }
@media (hover: hover) { .emo:hover { background: var(--sunk); } }
.to-end { position: absolute; right: 24px; bottom: 88px; z-index: 5; box-shadow: var(--pop); }

/* ── the box at the foot ───────────────────────────────────────────────── */
.composer { flex-shrink: 0; padding: 8px 28px 16px; }
.cbar { display: flex; align-items: flex-end; gap: 2px; max-width: 864px; margin: 0 auto; padding: 4px; border-radius: 26px; background: var(--white); }
.cbar .ib.t-plain { color: var(--ink-2); }
.cin {
  flex: 1; min-width: 0; height: 40px; max-height: 144px; padding: 9px 8px; border: 0; outline: none; resize: none; background: transparent;
  font-size: 15px; line-height: 22px; color: var(--ink);
}
.cin::placeholder { color: #9b8775; }
.attach-pop .att { gap: 14px; height: 42px; }
.att .solar { flex-shrink: 0; }
.a-doc .solar { color: #6b5fb5; }
.a-photo .solar { color: #3a76b8; }
.a-cam .solar { color: #c0446a; }
.a-audio .solar { color: #c8752a; }
.a-contact .solar { color: #2f86b5; }
.a-poll .solar { color: #b8901c; }
.a-event .solar { color: #c04a4a; }
.a-sticker .solar { color: #3f9065; }
.emoji-pop { padding: 10px; }
.emoji-head { padding: 2px 6px 8px; font-size: 12.5px; color: var(--ink-3); }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.emoji-grid .emo { width: auto; }
/* the 24-hour window, closed: the template in the box's place */
.shut-bar { display: flex; align-items: center; gap: 14px; max-width: 864px; margin: 0 auto; padding: 12px 12px 12px 14px; border-radius: 20px; background: var(--white); }
.shut-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 999px; flex-shrink: 0; background: var(--sunk); color: var(--ink-2); }
.shut-bar b { display: block; font-size: 14px; font-weight: 600; }
.shut-bar small { display: block; font-size: 13px; line-height: 1.4; color: var(--ink-3); }

/* ── a chat's details, in the column at the right ──────────────────────── */
.chat-app .notes.info-col { height: 100%; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px 20px 40px; }
.info-col .notes-head { align-items: center; margin-bottom: 0; }
.info-hero { display: flex; flex-direction: column; align-items: center; padding: 6px 0 18px; text-align: center; }
.info-hero h2 { display: flex; align-items: center; gap: 6px; margin: 14px 0 2px; font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.info-hero p { margin: 0; font-size: 14px; color: var(--ink-3); }
.info-acts { display: flex; justify-content: center; gap: 18px; margin-top: 18px; }
.info-act { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); }
.info-sec { padding: 4px 0; }
.info-sec + .info-sec::before { content: ""; display: block; height: 1px; margin: 4px 0 10px; background: var(--line); }
.info-lbl { padding: 6px 12px; font-size: 13px; font-weight: 500; color: var(--ink-3); }
.info-lbl.row { display: flex; align-items: center; gap: 8px; }
.info-about { margin: 0 12px 4px; font-size: 14.5px; line-height: 1.5; color: var(--ink); white-space: pre-wrap; }
.info-small { margin: 4px 12px 2px; font-size: 12.5px; color: var(--ink-3); }
.info-row {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 48px; padding: 7px 12px; border-radius: 12px; text-align: left;
  font-size: 14.5px; color: var(--ink);
}
.info-row.press, button.info-row { cursor: pointer; transition: background-color 0.18s; }
@media (hover: hover) { .info-row.press:hover, button.info-row:hover { background: var(--hover); } }
.info-row .grow { min-width: 0; }
.info-row .ir-ic { flex-shrink: 0; color: var(--ink-3); }
.info-row .ir-t { display: block; }
.info-row small { display: block; margin-top: 1px; font-size: 12.5px; line-height: 1.35; color: var(--ink-3); }
.info-row.member small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.info-row .chev { flex-shrink: 0; color: var(--ink-3); }
.info-row .v { font-size: 13.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.info-row.danger, .info-row.danger .ir-ic { color: var(--bad); }
.member .ir-t { font-weight: 500; }
.ir-well { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 999px; flex-shrink: 0; background: var(--acc); color: var(--acc-paper); }
.tag { flex-shrink: 0; padding: 3px 8px; border-radius: 999px; background: var(--acc-tint); color: var(--acc-strong); font-size: 11.5px; font-weight: 600; }
.thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 2px 12px 8px; }
.thumb { aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--sunk); }
.thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* a switch: its knob carried across, quickly, with no spring */
.switch { position: relative; flex-shrink: 0; width: 36px; height: 22px; border-radius: 999px; background: var(--active); transition: background-color 0.16s; }
.switch i { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 999px; background: #fff; box-shadow: 0 1px 2px rgba(31, 24, 18, 0.2); transition: transform 0.16s var(--ease); }
.switch.on { background: var(--acc); }
.switch.on i { transform: translateX(14px); }
.sheet .info { padding-bottom: 8px; }

/* ── no chat open ──────────────────────────────────────────────────────── */
.home { position: relative; flex: 1; min-width: 0; height: 100%; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.home-in { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 28px; padding: 24px 24px 170px; }
.home-card { display: flex; flex-direction: column; align-items: center; width: min(470px, 100%); padding: 28px 30px 24px; border-radius: 28px; background: var(--panel); text-align: center; }
.hc-ic { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 16px; border-radius: 999px; background: var(--sunk); color: var(--acc-strong); }
.home-card h2 { margin: 0 0 8px; font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.home-card p { margin: 0 0 18px; font-size: 14.5px; line-height: 1.5; color: var(--ink-3); text-wrap: pretty; }
.home-acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; }
.home-acts .info-act { width: 84px; font-size: 13px; text-align: center; }
/* the fan at the foot: conversations as cards, theirs and ours, still */
.fan-chat { position: absolute; left: 50%; bottom: -26px; width: 0; height: 200px; pointer-events: none; }
.fc {
  position: absolute; left: 0; bottom: 0; display: flex; flex-direction: column; gap: 9px; width: 220px; padding: 18px 18px 22px;
  border-radius: 22px 22px 22px 6px; background: var(--white); transform-origin: 50% 100%;
}
.fc.out { border-radius: 22px 22px 6px 22px; background: var(--acc-tint); }
.fc i { display: block; height: 7px; border-radius: 4px; background: rgba(45, 34, 25, 0.09); }
.fc.out i { background: rgba(28, 42, 42, 0.12); }
.fc-t { align-self: flex-end; width: 34px; height: 6px; margin-top: 2px; border-radius: 3px; background: rgba(45, 34, 25, 0.08); }
@media (max-height: 760px) { .fan-chat { bottom: -70px; } .home-in { padding-bottom: 110px; } }

/* ── a mid screen ──────────────────────────────────────────────────────── */
.m-mid .feed-in { padding: 0 20px; }
.m-mid .composer { padding: 8px 20px 14px; }
.m-mid .bub { max-width: 80%; }
.m-mid .find.chat-find { display: none; }

/* ── a phone: the list is the screen, a chat the next one ──────────────── */
.chat-rail.full { position: relative; width: 100%; height: 100vh; height: 100dvh; border-right: 0; }
.m-phone .chat-rail .rail-head { padding: 0 8px 0 14px; }
.m-phone .conv { height: calc(100vh - var(--band)); height: calc(100dvh - var(--band)); }
.m-phone .feed-in { padding: 0 10px; }
.m-phone .unread-bar { margin: 12px -10px 4px; }
.m-phone .bub { max-width: 84%; }
.m-phone .bub.k-doc, .m-phone .bub.k-voice, .m-phone .bub.k-tpl { max-width: 88%; }
.m-phone .composer { padding: 6px 8px calc(10px + env(safe-area-inset-bottom)); }
.m-phone .chat-switch { padding: 0 6px 0 2px; min-width: 0; }
.m-phone .chat-top .tools .tool { min-width: 34px; padding: 0 7px; }
.m-phone .to-end { right: 14px; bottom: 76px; }
.m-phone .shut-bar { flex-wrap: wrap; }
.m-phone .shut-bar .tb { width: 100%; justify-content: center; }
