/* Ligant web app. Palette and type from Ligant Brand Guidelines v1.1, as in the sandbox chat:
 * navy is authority, teal is the only interactive accent, red is errors only. Amber is not used in this
 * slice (design README: amber only for "Draft" marking and waiting for approval; the draft label here is
 * neutral grey with a dashed border so it never rests on colour). Small text uses --muted (5.9:1), never --dim. */
@font-face { font-family: 'Inter'; src: url('/fonts/inter-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/fonts/inter-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/fonts/inter-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/fonts/inter-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('/fonts/ibm-plex-mono-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }

:root {
  --navy: #1B2A4A; --teal: #0D7C66; --error: #C0392B;
  --bg: #FAF7F2; --card: #FFFFFF; --surface: #F0EBE0; --border: #E5DFD3; --border-strong: #D8D2C5;
  --text: #4F4943; --muted: #6B6357;
  --navy-tint: #E9EDF4; --error-tint: #FBE7E7;
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif; color: var(--text); background: var(--bg);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-size: 14px; line-height: 1.5; }
#app { display: flex; flex-direction: column; height: 100dvh; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--teal); }
h1, h2, h3, h4 { color: var(--navy); }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .pad { padding: 4px 16px; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.appbar :focus-visible { outline-color: #fff; }
.skip { position: absolute; left: -999px; top: 4px; background: #fff; padding: 6px 10px; z-index: 50; }
.skip:focus { left: 6px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

.appbar { height: 48px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 14px; background: var(--navy); color: #fff; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 15px; min-width: 0; }
.brand img { width: 26px; height: 26px; border-radius: 22%; }
.pill { font-weight: 500; font-size: 11px; border: 1px solid rgba(255,255,255,.55); border-radius: 999px; padding: 0 7px; white-space: nowrap; }
.pill.local { background: #fff; color: var(--navy); }
.who-menu { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.appbar .btn { background: transparent; color: #fff; border-color: rgba(255,255,255,.55); }
.appbar .btn svg { width: 14px; height: 14px; }

.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border-strong); background: var(--card); color: var(--navy); border-radius: 6px; padding: 6px 12px; min-height: 32px; font-size: 13px; font-weight: 500; text-decoration: none; }
.btn:hover:not(:disabled) { border-color: var(--teal); }
.btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.small { padding: 2px 10px; min-height: 28px; font-size: 12.5px; }
.btn:disabled { opacity: .55; cursor: default; }
.btn svg { width: 14px; height: 14px; }
.icon-btn { width: 36px; height: 36px; border: 0; background: transparent; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; color: var(--navy); }
.icon-btn:hover { background: var(--navy-tint); }
.icon-btn svg { width: 18px; height: 18px; }

.shell { flex: 1; min-height: 0; display: flex; }
.list { width: 320px; flex: none; background: var(--card); border-right: 1px solid var(--border); overflow-y: auto; }
.list-head { padding: 14px 14px 4px; } .list-head h2 { font-size: 18px; margin: 0; }
.rows { list-style: none; margin: 0; padding: 0 0 12px; }
.sec { font-size: 12px; font-weight: 600; color: var(--muted); padding: 12px 16px 4px; }
.item { display: block; padding: 8px 12px 8px 14px; margin: 0 6px; border-radius: 6px; text-decoration: none; color: var(--navy); min-height: 44px; }
.item:hover { background: var(--bg); } .item.on { background: var(--navy-tint); }
.nm-row { display: flex; gap: 10px; align-items: center; } .nm { font-weight: 600; }
.pv { display: block; font-size: 12.5px; color: var(--muted); margin-left: 42px; }
.av { width: 32px; height: 32px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; background: var(--navy); color: #fff; font-weight: 700; font-size: 13px; }
.av img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.av.lg { width: 40px; height: 40px; }
.av.group { background: var(--surface); color: var(--navy); border: 1px solid var(--border); } .av svg { width: 17px; height: 17px; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); overflow-y: auto; }

.space { flex: 1; min-height: 0; display: flex; }
.space-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chat-head { flex: none; background: var(--card); border-bottom: 1px solid var(--border); padding: 0 16px 8px; }
.chat-head .top { display: flex; align-items: center; gap: 10px; min-height: 56px; flex-wrap: wrap; }
.chat-head h1 { font-size: 16px; margin: 0; }
.title { flex: 1; min-width: 0; } .title span { display: block; font-size: 12px; color: var(--muted); }
.back { display: none; }
.space-badge { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--border-strong); border-radius: 999px; padding: 1px 9px; font-size: 12px; color: var(--muted); background: var(--bg); }
.space-badge svg { width: 13px; height: 13px; }
.badge-sentence, .ai-line { margin: 2px 0; font-size: 12.5px; color: var(--muted); }
.feed { flex: 1; overflow-y: auto; padding: 8px 0 16px; }
.feed-inner { max-width: 920px; margin: 0 auto; padding: 0 20px; }
.day { text-align: center; font-size: 12px; color: var(--muted); margin: 14px 0 6px; }
.msg { display: flex; gap: 10px; margin: 14px 0; align-items: flex-start; }
.msg .body { min-width: 0; max-width: calc(100% - 44px); }
.msg .meta { font-size: 12px; color: var(--muted); margin-bottom: 3px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.msg .meta b, .who-link { color: var(--navy); font-size: 13px; font-weight: 600; }
.who-link { border: 0; background: none; padding: 0; text-decoration: underline; }
.bubble { background: var(--card); border: 1px solid var(--border); border-radius: 4px 10px 10px 10px; padding: 10px 14px; overflow-wrap: anywhere; white-space: pre-wrap; }
.msg.me { justify-content: flex-end; } .msg.me .body { display: flex; flex-direction: column; align-items: flex-end; }
.msg.me .bubble { background: var(--navy-tint); border-color: #d6dcea; border-radius: 10px 4px 10px 10px; color: var(--navy); }
/* An agent's draft: a dashed left border is the shape cue; no tick, seal or green anywhere. */
.bubble.draft { border-left: 3px dashed var(--muted); }
.draft-label { display: inline-flex; gap: 4px; align-items: center; color: var(--muted); font-size: 12px; }
.validation-label { display: inline-flex; gap: 4px; align-items: center; max-width: 100%; color: var(--muted); font-size: 12px; font-weight: 600; border: 1px solid currentColor; border-radius: 4px; padding: 0 6px; overflow-wrap: anywhere; }
.validation-label svg { width: 12px; height: 12px; flex: none; }
.meta-break { display: none; }
.draft-label svg { width: 12px; height: 12px; }
.handoff { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.mention { color: var(--teal); font-weight: 600; }
.deleted { margin: 0; color: var(--muted); font-style: italic; }
.reply-btn { border: 0; background: none; color: var(--teal); padding: 6px 0; min-height: 28px; font-size: 12.5px; text-decoration: underline; }
.actions { display: flex; gap: 8px; align-items: center; margin-top: 4px; flex-wrap: wrap; }
.ra-status { font-size: 12.5px; color: var(--muted); margin-left: 6px; }

.receipt { border-top: 1px solid var(--border-strong); margin-top: 8px; padding-top: 6px; font-size: 13px; color: var(--muted); }
.receipt .label { font-weight: 600; }
.receipt-toggle { border: 0; background: none; color: var(--teal); text-decoration: underline; padding: 4px 8px; min-height: 28px; }
.receipt .check, .receipt .not-read { display: flex; gap: 6px; align-items: flex-start; margin: 2px 0; }
.receipt .check svg, .receipt .not-read svg { width: 14px; height: 14px; flex: none; margin-top: 3px; }
.receipt .not-read { border-left: 3px solid var(--navy); padding-left: 8px; color: var(--navy); }
.receipt-body h4 { margin: 8px 0 2px; font-size: 12.5px; } .receipt-body ul { margin: 2px 0; padding-left: 18px; } .receipt-body p { margin: 2px 0; }
.receipt.missing { border-top-style: dashed; }

.composer-slot { flex: none; }
.composer { background: var(--card); border-top: 1px solid var(--border); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); position: relative; }
.composer .row { display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { flex: 1; resize: none; border: 1px solid var(--border-strong); border-radius: 6px; padding: 8px 10px; font-size: 16px; background: var(--bg); max-height: 160px; }
.composer .send { min-height: 44px; min-width: 64px; justify-content: center; }
.composer.ro { color: var(--muted); }
.composer-status { min-height: 18px; font-size: 12.5px; color: var(--muted); } .hint { margin: 0; font-size: 12px; color: var(--muted); }
.mention-pop { position: absolute; left: 16px; bottom: 100%; background: var(--card); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 24px rgba(27,42,74,.14); list-style: none; margin: 0 0 4px; padding: 4px; min-width: 240px; }
.mention-pop li { padding: 6px 10px; border-radius: 5px; cursor: pointer; color: var(--navy); }
.mention-pop li.on { background: var(--navy-tint); }

.thread-panel { width: 380px; flex: none; border-left: 1px solid var(--border); background: var(--card); display: flex; flex-direction: column; min-height: 0; }
.thread-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--border); } .thread-head h2 { font-size: 15px; margin: 0; } .thread-head .icon-btn { margin-left: auto; }
.thread-feed { flex: 1; overflow-y: auto; padding: 4px 12px; }

.banner { margin: 8px 16px; padding: 10px 14px; border-radius: 6px; background: var(--card); border: 1px solid var(--border-strong); border-left: 4px solid var(--navy); color: var(--navy); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.banner.no-access, .banner.no-post, .banner.signed-out, .banner.unavailable, .banner.offline, .banner.slow-down, .banner.bad-request { border-left-color: var(--error); }
.banner b { color: var(--navy); }
.skel .bar { height: 14px; margin: 14px 0; background: var(--surface); border-radius: 4px; } .skel .bar:nth-child(2) { width: 70%; } .skel .bar:nth-child(3) { width: 45%; }
.empty-card, .card { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 16px 20px; margin: 16px auto; max-width: 640px; }
.examples { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.welcome { padding: 8px 0; }

.signin-page, .profile { max-width: 640px; width: 100%; margin: 0 auto; padding: 16px; overflow-y: auto; }
.signin-page label { display: block; margin-top: 10px; font-weight: 500; color: var(--navy); }
.signin-page input, .signin-page select { width: 100%; min-height: 40px; border: 1px solid var(--border-strong); border-radius: 6px; padding: 6px 10px; font-size: 16px; background: #fff; }
.card.dev { border: 2px dashed var(--navy); }
.dev-flag { background: var(--navy); color: #fff; padding: 8px 12px; border-radius: 6px; margin-top: 0; }
.form-error { color: var(--error); min-height: 20px; margin: 6px 0; }
.profile dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; } .profile dt { color: var(--muted); } .profile dd { margin: 0; color: var(--navy); }
.role-chip { border: 1px solid var(--border-strong); border-radius: 999px; padding: 1px 10px; text-transform: capitalize; }

.dlg { border: 1px solid var(--border); border-radius: 10px; padding: 18px; max-width: 480px; width: calc(100% - 32px); }
.dlg::backdrop { background: rgba(27,42,74,.45); } .dlg-head { display: flex; gap: 12px; align-items: center; } .dlg h2, .dlg h3 { margin: 0; font-size: 16px; } .dlg h3 { font-size: 13px; margin-top: 10px; }

/* Phone: one column at a time (design 5.6). List is home; a space replaces it; a thread replaces the space. */
@media (max-width: 760px) {
  .appbar .pill:not(.local) { display: none; }
  .shell.view-list .main, .shell.view-main .list { display: none; }
  .list { width: 100%; border-right: 0; }
  .back { display: inline-flex; }
  .item { min-height: 48px; }
  .btn, .reply-btn, .receipt-toggle { min-height: 44px; }
  body.thread-open .space-col { display: none; }
  .thread-panel { width: 100%; border-left: 0; }
  .msg .body { max-width: calc(100% - 42px); }
}

/* ---- Navigation rail (desktop) and bottom bar (phone): Chats, Documents, People, More ---- */
.rail { flex: none; width: 76px; background: var(--card); border-right: 1px solid var(--border); padding: 8px 4px; }
.rail-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.rail-item { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px; min-height: 52px; border-radius: 6px; color: var(--navy); text-decoration: none; font-size: 12px; font-weight: 500; border: 0; background: none; width: 100%; }
.rail-item:hover { background: var(--bg); } .rail-item.on { background: var(--navy-tint); font-weight: 700; }
.rail-item svg { width: 20px; height: 20px; }
.more-wrap { position: relative; }
.more-menu { position: absolute; left: 76px; bottom: 0; z-index: 30; background: var(--card); border: 1px solid var(--border-strong); border-radius: 8px; box-shadow: 0 8px 24px rgba(27,42,74,.14); list-style: none; margin: 0; padding: 4px; min-width: 210px; }
.more-menu a, .linklike { display: block; padding: 10px 12px; color: var(--navy); text-decoration: none; border-radius: 5px; border: 0; background: none; width: 100%; text-align: left; font-size: 14px; }
.more-menu a:hover, .linklike:hover { background: var(--navy-tint); }

/* ---- Document control (screens 18 to 27). Only Effective is solid; every other state is dashed. No green anywhere. ---- */
:root { --amber-fill: #FBF1DC; --amber-text: #5C4306; --amber-line: #B8860B; --grey-fill: #F0EDE6; }
.docs-page { max-width: 1040px; width: 100%; margin: 0 auto; padding: 16px; overflow-y: auto; }
.docs-page.narrow { max-width: 700px; }
.docs-shell .main { overflow-y: auto; }
.page-head { display: flex; align-items: center; gap: 12px; justify-content: space-between; flex-wrap: wrap; } .page-head h1 { margin: 8px 0; }
.mono, .hash, code { font-family: 'IBM Plex Mono', ui-monospace, monospace; }
.nowrap { white-space: nowrap; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; border: 1.5px dashed var(--muted); }
.chip svg { width: 12px; height: 12px; }
.chip.solid { border: 2px solid var(--navy); color: var(--navy); background: #fff; }
.chip.dashed.amber { background: var(--amber-fill); color: var(--amber-text); border-color: var(--amber-line); }
.chip.dashed.grey { background: var(--grey-fill); color: var(--text); border-color: var(--muted); }
.small-chip { font-size: 12px; text-transform: none; }
.band { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 14px; margin: 10px 0; border-radius: 6px; font-weight: 600; line-height: 1.4; }
.band svg { width: 18px; height: 18px; flex: none; }
.band.solid { border: 3px solid var(--navy); background: #fff; color: var(--navy); }
.band.amber { border: 2px dashed var(--amber-line); background: var(--amber-fill); color: var(--amber-text); }
.band.grey { border: 2px dashed var(--muted); background: var(--grey-fill); color: var(--text); }
.band.alert { border: 2px solid var(--error); background: var(--error-tint); color: #7a1f16; }
.doc-title { display: flex; flex-direction: column; } .doc-title h1 { margin: 4px 0; font-size: 20px; }
.ver-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.hash-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 0; }
.hash { overflow-wrap: anywhere; word-break: break-all; font-size: 12.5px; background: var(--surface); padding: 2px 6px; border-radius: 4px; user-select: all; }
.hash-label { font-weight: 600; color: var(--navy); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border-strong); margin-top: 12px; flex-wrap: wrap; }
.tab { border: 0; background: none; padding: 10px 14px; min-height: 44px; color: var(--navy); border-bottom: 3px solid transparent; font-weight: 500; }
.tab[aria-selected="true"] { border-bottom-color: var(--teal); font-weight: 700; }
.tabpanel-host { background: var(--card); border: 1px solid var(--border); border-top: 0; padding: 12px 16px; }
.doc-content { white-space: pre-wrap; overflow-wrap: anywhere; font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 13px; background: var(--card); margin: 0; max-height: 60vh; overflow-y: auto; }
.actions-panel, .date-panel { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 12px 16px; margin: 14px 0; }
.act-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
.act-disabled { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.btn.danger { background: var(--error); border-color: var(--error); color: #fff; }
.btn.danger-outline { border: 2px solid var(--error); color: #7a1f16; }
.btn[aria-disabled="true"] { opacity: .6; cursor: default; }
.note { border-left: 3px solid var(--navy); padding-left: 10px; color: var(--navy); }
.status-line { margin: 8px 0; padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--card); color: var(--navy); }
.boxed { border: 2px solid var(--navy); padding: 10px 12px; border-radius: 6px; background: #fff; }
.sign-card { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; background: var(--card); border: 1px solid var(--border-strong); border-radius: 8px; padding: 14px 16px; }
.sign-card dt { color: var(--muted); } .sign-card dd { margin: 0; color: var(--navy); min-width: 0; overflow-wrap: anywhere; }
.step-word { color: var(--muted); font-weight: 600; }
.sig-line { font-size: 16px; color: var(--navy); } .neutral-check { color: var(--navy); }
.waiting { font-size: 12.5px; color: var(--amber-text); font-weight: 600; }
.dev-flag { background: var(--navy); color: #fff; padding: 8px 12px; border-radius: 6px; }
.docs-page label { display: block; margin-top: 10px; font-weight: 500; color: var(--navy); }
.docs-page input[type="text"], .docs-page input[type="search"], .docs-page input[type="date"], .docs-page input[type="password"], .docs-page select, .docs-page textarea, .dlg input, .dlg select, .dlg textarea
  { width: 100%; min-height: 40px; border: 1px solid var(--border-strong); border-radius: 6px; padding: 6px 10px; font-size: 16px; background: #fff; }
.docs-page textarea, .dlg textarea { font-family: 'IBM Plex Mono', ui-monospace, monospace; }
.check-row { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; } .check-row input { width: 22px; height: 22px; margin-top: 2px; } .check-row label { margin: 0; font-weight: 400; }
.filter-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin: 8px 0; } .filter { min-width: 140px; margin: 0 !important; } .filter span { display: block; font-size: 12.5px; color: var(--muted); }
.filters summary { list-style: none; display: inline-flex; cursor: pointer; } .filters[open] summary { margin-bottom: 6px; }
.doc-table, .plain-table { width: 100%; border-collapse: collapse; background: var(--card); }
.doc-table th, .doc-table td, .plain-table th, .plain-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.doc-table thead th, .plain-table thead th { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.docrow { cursor: pointer; } .docrow:hover { background: var(--bg); }
.statement { border: 1px solid var(--border-strong); background: var(--card); border-radius: 6px; padding: 8px 14px; max-height: 40vh; overflow-y: auto; }
.steps { padding-left: 22px; } .steps h2 { font-size: 16px; margin: 6px 0 2px; }
.pick-list { padding-left: 20px; } .rules { color: var(--muted); font-size: 13px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; } .kv dd { margin: 0; }
.dlg.sheet { max-width: 560px; } .dlg-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.dlg-actions .btn { min-height: 44px; }
.release-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.history { padding-left: 20px; } .history li { margin: 6px 0; }
.sig-table .wrap { overflow-wrap: anywhere; word-break: break-all; }
.statement p { margin: 8px 0; }

/* Print: a copy that is not the version in force says so on every page, in words (a dashed outlined watermark). Black on white, 11 pt. */
.print-page { position: relative; max-width: 800px; margin: 0 auto; padding: 8px 16px 24px; overflow-y: auto; }
.print-head { display: flex; flex-direction: column; border-bottom: 2px solid #000; padding-bottom: 4px; margin-bottom: 10px; font-size: 12px; }
.print-foot { border-top: 1px solid #000; margin-top: 18px; padding-top: 6px; font-size: 11px; overflow-wrap: anywhere; }
.print-state { border: 2px dashed #000; padding: 6px 10px; font-weight: 800; letter-spacing: .04em; }
.watermark { position: fixed; top: 38%; left: 0; right: 0; text-align: center; font-size: 56px; font-weight: 800; transform: rotate(-30deg); color: transparent; -webkit-text-stroke: 2px rgba(92,67,6,.35); pointer-events: none; z-index: 5; }
@page { size: A4; margin: 16mm; @bottom-center { content: "Page " counter(page) " of " counter(pages); font-size: 9pt; } }
@media print {
  .appbar, .rail, .skip, .no-print, .list { display: none !important; }
  html, body, #app, .shell, .main { height: auto !important; overflow: visible !important; display: block !important; background: #fff; color: #000; }
  .print-page { overflow: visible; max-width: none; padding: 0; font-size: 11pt; }
  .print-head { position: fixed; top: 0; left: 0; right: 0; background: #fff; } .print-foot { position: fixed; bottom: 6mm; left: 0; right: 0; background: #fff; border-top: 1px solid #000; }
  .print-body { padding: 14mm 0 16mm; }
  .doc-content { max-height: none; overflow: visible; background: #fff; border: 0; font-size: 10.5pt; }
  .hash { background: none; }
  .watermark { -webkit-text-stroke: 2px rgba(0,0,0,.35); }
}

/* Phone: bottom bar, cards instead of tables, full-width sheets. No sideways scroll. */
@media (max-width: 760px) {
  .shell { padding-bottom: calc(56px + env(safe-area-inset-bottom)); position: relative; }
  .rail { position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: 100%; z-index: 20; border-right: 0; border-top: 1px solid var(--border-strong); padding: 0 0 env(safe-area-inset-bottom); }
  .rail-list { flex-direction: row; gap: 0; } .rail-list > li { flex: 1; } .rail-item { min-height: 56px; border-radius: 0; }
  .more-menu { left: auto; right: 4px; bottom: 58px; }
  .doc-table, .doc-table thead, .doc-table tbody, .doc-table tr, .doc-table th, .doc-table td, .plain-table, .plain-table thead, .plain-table tbody, .plain-table tr, .plain-table th, .plain-table td { display: block; }
  .doc-table thead, .plain-table thead { position: absolute; left: -9999px; }
  .doc-table tr, .sig-table tr { background: var(--card); border: 1px solid var(--border); border-radius: 8px; margin: 8px 0; padding: 4px 8px; }
  .doc-table td, .doc-table th, .sig-table td, .sig-table th { border-bottom: 0; padding: 3px 4px; }
  .doc-table td[data-label]::before, .doc-table th[data-label]::before, .sig-table td[data-label]::before, .sig-table th[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: 12.5px; }
  .dlg.sheet { position: fixed; bottom: 0; top: auto; margin: 0; width: 100%; max-width: none; border-radius: 12px 12px 0 0; }
  .dlg-actions { flex-direction: column; } .dlg-actions .btn { width: 100%; justify-content: center; }
  .docs-page { padding: 12px; } .docs-shell .main { padding-bottom: 8px; }
  .sign-card { grid-template-columns: 1fr; gap: 2px; } .sign-card dd { margin-bottom: 8px; }
  .btn { min-height: 44px; }
  .tabs { gap: 0; } .tab { flex: 1 1 45%; }
}

/* invitations and sign-up (T-0057) */
.once-field { width: 100%; min-height: 40px; font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 14px; border: 1px solid var(--border-strong); border-radius: 6px; padding: 6px 10px; background: #fff; }
.once .banner { margin-left: 0; margin-right: 0; }
.check-group { border: 0; padding: 0; margin: 12px 0 0; } .check-group legend { font-weight: 500; color: var(--navy); padding: 0; }
.signin-page h1:focus, .docs-page h1:focus, .once h2:focus { outline: none; }

/* ---- Receipt v2 (design 28) and agent task status (design 29) ---- */
.receipt-body li { overflow-wrap: anywhere; margin: 2px 0; }
.rc-top { display: flex; gap: 6px; align-items: flex-start; margin: 4px 0; color: var(--navy); font-weight: 600; }
.rc-top svg, .src-state svg, .not-read-tag svg { width: 13px; height: 13px; flex: none; margin-top: 2px; }
.not-read-tag, .src-state { display: inline-flex; gap: 4px; align-items: baseline; font-weight: 600; color: var(--navy); }
.went-in .ref { margin-left: 6px; color: var(--muted); font-size: 11px; opacity: .85; }
.titles-gap { margin: 4px 0; }
.task-block { display: flex; gap: 8px; margin: 6px 0 10px 40px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--card); color: var(--muted); font-size: 13px; }
.task-block .tb-body { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-width: 0; flex: 1; }
.task-block .tb-icon svg { width: 16px; height: 16px; margin-top: 2px; }
.task-block .tb-text { flex: 1; min-width: 0; overflow-wrap: anywhere; } .task-block p { margin: 0 0 2px; }
.task-block .tb-time { display: block; font-variant-numeric: tabular-nums; }
.task-block.rule { border: 2px solid var(--navy); color: var(--navy); }
.task-block.system-error { border-color: var(--error); color: #7a1f16; }
.task-block .tb-btn { min-height: 36px; }
.composer .wait { margin: 4px 0 0; font-size: 12.5px; color: var(--navy); }
@media (max-width: 760px) {
  .meta-break { display: block; flex-basis: 100%; height: 0; }
  .task-block { margin-left: 0; flex-direction: column; }
  .task-block .tb-body { flex-direction: column; align-items: stretch; }
  .task-block .tb-btn { width: 100%; min-height: 44px; }
}
