/* The manage screens' own styles (WEB-06; docs/47 §UX audit, findings G-, A-, E-, T-,
 * AD-, RP-): Home, Agreements, envelope details, Templates and template use, Admin and
 * Reports. Loaded after app.css by app.html; it only adds or overrides for these
 * screens, so the editor and the signing page are untouched. Sizes in rem (docs/47
 * §Root size); 1 px hairlines kept. */

.os-page-head__stack { display: grid; gap: var(--os-s1); }
.os-col-hash code { color: var(--os-muted); }
.os-col-check { width: 2.75rem; padding-right: 0 !important; }
.os-list__more { display: flex; justify-content: center; margin-top: var(--os-s4); }
.os-list__more:empty { display: none; }
.os-timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; position: relative; }
.os-timeline__item { position: relative; padding: var(--os-s4) 0 var(--os-s4) var(--os-s8); border-bottom: 1px solid var(--os-border); }
.os-timeline__item:last-child { border-bottom: 0; }
.os-timeline__item::before { content: ""; position: absolute; left: 0.6875rem; top: 0; bottom: 0; width: 0.125rem; background: var(--os-border); }
.os-timeline__item:first-child::before { top: var(--os-s6); }
.os-timeline__item:last-child::before { bottom: calc(100% - var(--os-s6)); }
.os-timeline__item .os-order { position: absolute; left: 0; top: var(--os-s4); background: var(--os-raised); border: 0.125rem solid var(--os-border-strong); }
.os-timeline__item.is-completed .os-order { border-color: var(--os-success); color: var(--os-success); }
.os-timeline__who { display: flex; align-items: center; gap: var(--os-s3); flex-wrap: wrap; }
.os-timeline__who > div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.os-steps { list-style: none; display: flex; flex-wrap: wrap; gap: var(--os-s2) var(--os-s6); padding: 0; margin: var(--os-s3) 0 0; color: var(--os-muted); }
.os-steps li { display: flex; align-items: center; gap: var(--os-s1); }
.os-steps li.is-done { color: var(--os-text); }
.os-steps li.is-done svg { color: var(--os-success); }
/* Home drop zone */
.os-dropzone {
  display: flex; align-items: center; gap: var(--os-s4); padding: var(--os-s6);
  border: 0.125rem dashed var(--os-border-strong); border-radius: var(--os-radius-lg); background: var(--os-raised);
  transition: border-color var(--os-dur) var(--os-ease), background var(--os-dur) var(--os-ease);
}
.os-dropzone.is-dropping { border-color: var(--os-accent-fill); background: var(--os-accent-soft); }
.os-dropzone__icon { display: inline-grid; place-items: center; width: 3rem; height: 3rem; border-radius: 0.75rem; background: var(--os-accent-soft); color: var(--os-accent); flex: none; }
.os-dropzone__text { flex: 1; min-width: 0; }
.os-dropzone__title { font-size: var(--os-fs-16); font-weight: 600; margin-bottom: 0.125rem; }
.os-home__grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(17.5rem, 1fr); gap: var(--os-s4); align-items: start; margin-top: var(--os-s2); }
.os-recent { list-style: none; margin: 0; padding: 0; }
.os-recent__item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--os-s3); align-items: center; padding: var(--os-s3) var(--os-s6); border-top: 1px solid var(--os-border); }
.os-recent__item:first-child { border-top: 0; }
.os-recent__icon { display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 0.5rem; background: var(--os-surface); color: var(--os-muted); }
.os-recent__main { display: grid; min-width: 0; }
.os-recent__main .os-row-link { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Agreements: folder rail + table */
.os-manage { display: grid; grid-template-columns: 14.5rem minmax(0, 1fr); gap: var(--os-s8); align-items: start; }
.os-rail { position: sticky; top: calc(var(--os-topbar-h) + var(--os-s6)); }
.os-rail__group { font-size: var(--os-fs-12); font-weight: 600; color: var(--os-muted); margin: var(--os-s4) 0 var(--os-s1) var(--os-s3); }
.os-rail__group:first-child { margin-top: 0; }
.os-rail__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.125rem; }
.os-rail__link {
  display: flex; align-items: center; gap: var(--os-s3); min-height: 2.25rem; padding: 0 var(--os-s3);
  border-radius: var(--os-radius); color: var(--os-text); text-decoration: none; font-weight: 500;
}
.os-rail__link > svg { color: var(--os-muted); }
.os-rail__link:hover { background: var(--os-surface-2); color: var(--os-text); }
.os-rail__link[aria-current="page"] { background: var(--os-raised); box-shadow: var(--os-shadow); font-weight: 600; }
.os-rail__link[aria-current="page"] > svg { color: var(--os-accent); }
.os-rail__label { flex: 1; }
.os-rail__count { font-size: var(--os-fs-12); color: var(--os-muted); font-variant-numeric: tabular-nums; }
.os-manage__content { min-width: 0; }
.os-bulk { display: flex; flex-wrap: wrap; align-items: center; gap: var(--os-s2); padding: var(--os-s2) var(--os-s4); margin-bottom: var(--os-s3); border-radius: var(--os-radius-lg); background: var(--os-text); color: var(--os-bg); box-shadow: var(--os-shadow-md); animation: os-pop var(--os-dur-fast) var(--os-ease); }
.os-bulk strong { margin-right: var(--os-s2); }
.os-bulk .os-btn { background: transparent; color: var(--os-bg); border-color: color-mix(in srgb, var(--os-bg) 45%, transparent); }
.os-bulk .os-btn:hover { background: color-mix(in srgb, var(--os-bg) 14%, transparent); color: var(--os-bg); }
.os-table--manage .os-col-actions { width: 3.5rem; }
@media (max-width: 68.75em) {
  .os-home__grid { grid-template-columns: minmax(0, 1fr); }
  .os-manage { grid-template-columns: 12.5rem minmax(0, 1fr); gap: var(--os-s4); }
}
@media (max-width: 60em) {
  .os-manage { grid-template-columns: minmax(0, 1fr); }
  .os-rail { position: static; display: flex; gap: var(--os-s2); overflow-x: auto; padding-bottom: var(--os-s1); }
  .os-rail__group { display: none; }
  .os-rail__list { display: flex; gap: var(--os-s1); }
  .os-rail__link { white-space: nowrap; border: 1px solid var(--os-border); background: var(--os-raised); }
}
@media (max-width: 47.5em) {
  .os-dropzone { flex-wrap: wrap; }
}
@media (max-width: 47.5em) {
  .os-dropzone { flex-direction: column; align-items: stretch; text-align: center; gap: var(--os-s3); padding: var(--os-s4); }
  .os-dropzone__icon { align-self: center; }
  .os-recent__item { padding: var(--os-s3) var(--os-s4); }
}
@media (max-width: 47.5em) {
  .os-table--manage .os-col-actions { width: 2.5rem; }
}
@media (max-width: 47.5em) {
  .os-col-hash { display: none; }
}

/* ---- G-02: no horizontal scroll at 320 px ------------------------------------------ */
/* Titles wrap between words only; a page head's actions drop under the title first. */
.os-page-head .os-page-title { overflow-wrap: normal; word-break: normal; }
.os-page-head > .os-page-head__main { flex: 1 1 14rem; }
@media (max-width: 22.5em) {
  .os-topbar { gap: var(--os-s1); padding: 0 var(--os-s2); }
  .os-brand { margin-right: 0; }
  #theme-btn { display: none; } /* the account menu has Light, Dark and System */
}

/* Tables become cards below 37.5em. A cell shows its column's name from `data-label`;
   the check and the actions sit beside the main cell. */
@media (max-width: 37.5em) {
  .os-table--cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .os-table--cards, .os-table--cards tbody { display: block; width: 100%; }
  .os-table--cards tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--os-s3); row-gap: var(--os-s1); padding: var(--os-s3) var(--os-s4); border-bottom: 1px solid var(--os-border); }
  .os-table--cards tbody tr:last-child { border-bottom: 0; }
  .os-table--cards td { display: block; height: auto; padding: 0; border: 0; grid-column: 1; min-width: 0; text-align: left; white-space: normal; }
  .os-table--cards td.os-col-date { display: block; }
  .os-table--cards td[data-label]::before { content: attr(data-label) ": "; color: var(--os-muted); font-size: var(--os-fs-12); font-weight: 600; }
  .os-table--cards td.os-col-actions { grid-column: 2; grid-row: 1; align-self: start; }
  .os-table--cards.has-check tr { grid-template-columns: auto minmax(0, 1fr) auto; }
  .os-table--cards.has-check td { grid-column: 2; }
  .os-table--cards.has-check td.os-col-check { grid-column: 1; grid-row: 1 / span 5; align-self: start; padding-top: 0.125rem; }
  .os-table--cards.has-check td.os-col-actions { grid-column: 3; grid-row: 1; }
  .os-table--cards .os-actions--row { flex-wrap: wrap; justify-content: flex-end; }
  .os-table--cards td.os-col-hash { display: none; }
  .os-table--cards td.os-col-num { display: none; }
}

/* ---- G-03 Home: recent templates instead of a second Start menu -------------------- */
.os-recent__icon--tpl { background: var(--os-accent-soft); color: var(--os-accent); }
.os-home__none { display: grid; gap: var(--os-s2); justify-items: start; padding: var(--os-s4) var(--os-s6) var(--os-s6); }
.os-recent__item > a.os-btn { text-decoration: none; }
@media (max-width: 47.5em) { .os-recent__item { padding: var(--os-s3) var(--os-s4); } }
.os-card__head .os-link { white-space: nowrap; }
@media (max-width: 25em) {
  /* One counter per row: icon, label and number on one line. */
  .os-counters { grid-template-columns: minmax(0, 1fr); gap: var(--os-s2); }
  .os-counter { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "icon label n"; padding: var(--os-s3) var(--os-s4); }
  .os-counter__n { font-size: var(--os-fs-20); }
  .os-recent__item { grid-template-columns: minmax(0, 1fr) auto; }
  .os-recent__icon { display: none; }
}

/* ---- A-01 Agreements: filters, sortable columns, a status line in words ------------ */
.os-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--os-s2) var(--os-s3); margin: 0 0 var(--os-s3); }
.os-filters .os-label { margin: 0 0 var(--os-s1); font-size: var(--os-fs-12); color: var(--os-muted); }
.os-filters .os-select { min-width: 9rem; }
.os-filters__custom { display: flex; flex-wrap: wrap; gap: var(--os-s2); }
.os-filters__note { margin: var(--os-s2) 0 0; }
.os-sort { display: inline-flex; align-items: center; gap: var(--os-s1); min-height: var(--os-target-min); padding: 0; border: 0; background: none; color: inherit; font: inherit; font-weight: 600; cursor: pointer; border-radius: var(--os-radius-sm); }
.os-sort:hover { color: var(--os-text); }
.os-sort__icon { opacity: 0; transition: transform var(--os-dur-fast) var(--os-ease); }
.os-sort:hover .os-sort__icon, .os-sort:focus-visible .os-sort__icon { opacity: 0.6; }
.os-sort__icon.is-desc, .os-sort__icon.is-asc { opacity: 1; color: var(--os-accent); }
.os-sort__icon.is-asc { transform: rotate(180deg); }
.os-col-status .os-badge { margin-bottom: 0.125rem; }
.os-row__line { display: block; color: var(--os-muted); max-width: 16rem; overflow-wrap: anywhere; }
.os-row__line:empty { display: none; }
.os-table--manage .os-col-date { min-width: 9rem; }
@media (max-width: 77.5em) { .os-table--manage .os-col-opt { display: none; } }
@media (max-width: 37.5em) {
  .os-table--manage.os-table--cards td.os-col-sender, .os-table--manage.os-table--cards .os-col-changed .os-block { display: none; }
  .os-table--manage.os-table--cards td.os-col-expires:has(time) { display: block; }
  .os-table--manage.os-table--cards td.os-col-date, .os-table--manage.os-table--cards td.os-col-expires { font-size: var(--os-fs-12); color: var(--os-muted); }
  .os-table--manage.os-table--cards td.os-col-status { display: flex; flex-wrap: wrap; align-items: center; gap: var(--os-s2); }
  .os-row__line { max-width: none; }
  .os-filters .os-fieldrow { flex: 1 1 8rem; }
  .os-filters .os-select { min-width: 0; width: 100%; }
}

/* ---- Envelope details (E-02 to E-05) ----------------------------------------------- */
.os-detail__line { flex-basis: 100%; margin: 0; }
.os-timeline__who > .os-btn { flex: none; }
.os-timeline__who > div { flex: 1 1 12rem; }
.os-chainhead { overflow-wrap: anywhere; }
.os-audit td { overflow-wrap: anywhere; }
@media (max-width: 37.5em) {
  .os-audit.os-table--cards tr { padding: var(--os-s2) 0; }
  .os-audit .os-audit__event { font-weight: 600; }
}

/* ---- E-01 Correct: one block per recipient ---------------------------------------- */
.os-correct { list-style: none; margin: var(--os-s3) 0 0; padding: 0; display: grid; gap: var(--os-s3); }
.os-correct__item { border: 1px solid var(--os-border); border-left: 0.25rem solid var(--os-rc, var(--os-r1)); border-radius: var(--os-radius); padding: var(--os-s3) var(--os-s4); background: var(--os-raised); }
.os-correct__item.os-r1 { --os-rc: var(--os-r1); } .os-correct__item.os-r2 { --os-rc: var(--os-r2); } .os-correct__item.os-r3 { --os-rc: var(--os-r3); }
.os-correct__item.os-r4 { --os-rc: var(--os-r4); } .os-correct__item.os-r5 { --os-rc: var(--os-r5); } .os-correct__item.os-r6 { --os-rc: var(--os-r6); }
.os-correct__item.is-acted { background: var(--os-surface); }
.os-correct__head { display: flex; align-items: center; gap: var(--os-s2); flex-wrap: wrap; }
.os-correct__item .os-check { margin-top: var(--os-s3); }

/* ---- E-06: toasts never over row actions or table columns -------------------------- */
/* Bottom left and narrow, away from the actions and the status and date columns on the
   right; the page keeps room below its content so a last row scrolls clear of one. */
.os-app:not(.is-frame) .os-toasts { right: auto; left: var(--os-s4); width: min(20rem, calc(100vw - 2 * var(--os-s4))); }
.os-app:not(.is-frame) .os-main { padding-bottom: 7rem; }
@media (max-width: 47.5em) { .os-app:not(.is-frame) .os-toasts { right: var(--os-s4); width: auto; } }

/* ==== UX-07: Home, Agreements and the envelope page ================================= */

/* ---- Agreements: a fixed, dense table (rows of 64 px or less at 1440) -------------- */
.os-table--manage { table-layout: fixed; }
.os-table--manage th.os-col-check { width: 2.75rem; }
.os-table--manage th:nth-child(3) { width: 14rem; } /* status */
.os-table--manage.has-sender th.os-col-opt:not(.os-col-date) { width: 8rem; }
.os-table--manage th.os-col-date { width: 11.5rem; min-width: 0; } /* "Yesterday, 10:05 PM" */
.os-table--manage th.os-col-date.os-col-opt { width: 8.5rem; } /* expires: "Nov 15" or "No expiry" */
.os-table--manage th.os-col-actions { width: 3.5rem; }
.os-table--manage td { padding-top: var(--os-s1); padding-bottom: var(--os-s1); }
.os-table--manage .os-col-subject { display: grid; min-width: 0; }
.os-table--manage .os-col-subject > *, .os-table--manage .os-row__line, .os-table--manage .os-col-sender {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%;
}
.os-table--manage .os-col-subject .os-row-link { display: block; min-height: 0; padding: 0; line-height: 1.5rem; }
.os-table--manage .os-row__line { overflow-wrap: normal; }
.os-table--manage td.os-col-date { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.os-table--manage td.os-col-date time { font-variant-numeric: tabular-nums; }
.os-table--manage .os-row { cursor: pointer; }
/* A 24 px target or more around each row checkbox (WCAG 2.2 SC 2.5.8). */
.os-hit { display: inline-grid; place-items: center; min-width: 2rem; min-height: 2rem; margin: -0.25rem; cursor: pointer; }

/* ---- The bulk bar stays in view (UX-07) ------------------------------------------ */
.os-bulk { position: sticky; top: calc(var(--os-topbar-h) + var(--os-s2)); z-index: 5; }
/* Destructive stays visibly destructive on the dark bar: the danger hue, lightened. */
.os-bulk .os-btn--danger { color: color-mix(in srgb, var(--os-danger) 35%, var(--os-bg)); border-color: color-mix(in srgb, var(--os-danger) 55%, var(--os-bg)); }
.os-bulk .os-btn--danger:hover { background: var(--os-danger-fill); border-color: var(--os-danger-fill); color: var(--os-on-danger); }

/* ---- Phones: a folder select, Filters and Select toggles ------------------------- */
.os-manage__phonebar { display: none; }
.os-count-badge { display: inline-grid; place-items: center; min-width: 1.25rem; height: 1.25rem; padding: 0 0.25rem; border-radius: 62.4375rem; background: var(--os-info); color: var(--os-bg); font-size: var(--os-fs-12); font-weight: 600; }
@media (max-width: 47.5em) {
  .os-manage .os-rail { display: none; }
  .os-manage__phonebar { display: grid; gap: var(--os-s2); margin: 0 0 var(--os-s3); }
  .os-manage__phonebar .os-fieldrow { margin: 0; }
  .os-manage__toggles { display: flex; gap: var(--os-s2); }
  .os-manage__toggles .os-btn { flex: 1; justify-content: center; }
  .os-manage__toggles .os-btn[aria-pressed="true"] { background: var(--os-select-soft); border-color: var(--os-info); }
  .os-filters { display: none; }
  .os-filters.is-open { display: flex; }
  .os-manage__content:not(.is-selecting) .os-table--manage .os-col-check { display: none; }
  .os-bulk { position: fixed; top: auto; left: var(--os-s2); right: var(--os-s2); bottom: calc(var(--os-s2) + env(safe-area-inset-bottom, 0px)); margin: 0; z-index: 20; }
}
@media (max-width: 37.5em) {
  /* One card per envelope: subject, recipients, then status · date on one line. */
  .os-table--manage.os-table--cards td.os-col-main { grid-row: 1; }
  .os-table--manage.os-table--cards td.os-col-status { flex-wrap: nowrap; min-width: 0; }
  .os-table--manage.os-table--cards td.os-col-status .os-row__line { flex: 1; min-width: 0; }
  .os-table--manage.os-table--cards td.os-col-changed::before { content: none; }
  .os-manage__content:not(.is-selecting) .os-table--cards.has-check tr { grid-template-columns: minmax(0, 1fr) auto; }
  .os-manage__content:not(.is-selecting) .os-table--cards.has-check td { grid-column: 1; }
  .os-manage__content:not(.is-selecting) .os-table--cards.has-check td.os-col-actions { grid-column: 2; }
  .os-table--manage.os-table--cards.has-check td.os-col-check { grid-row: 1 / span 4; }
}

/* ---- Envelope page: header, callout, summary, evidence (UX-07) -------------------- */
.os-detail__actions { flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 47.5em) {
  /* One full-width primary, then the secondary and More side by side. */
  .os-detail__head > .os-detail__actions { flex: 1 1 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--os-s2); }
  .os-detail__actions > .os-btn--primary { grid-column: 1 / -1; justify-content: center; }
  .os-detail__actions > .os-btn--secondary { justify-content: center; }
}
.os-callout--ended { background: var(--os-surface); border: 1px solid var(--os-border); border-left: 0.25rem solid var(--os-border-strong); margin: var(--os-s2) 0 0; }
.os-callout--ended.is-declined { border-left-color: var(--os-danger); }
.os-callout--ended.is-expired { border-left-color: var(--os-warning); }
.os-callout--ended > svg { flex: none; margin-top: 0.125rem; color: var(--os-muted); }
.os-callout--ended.is-declined > svg { color: var(--os-danger); }
.os-callout--ended.is-expired > svg { color: var(--os-warning); }
.os-callout--ended p { margin: 0; }
.os-callout--ended p + p { margin-top: var(--os-s1); }
.os-envsum { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--os-s4) var(--os-s8); }
.os-envsum__title { font-size: var(--os-fs-14); font-weight: 600; color: var(--os-muted); margin: 0 0 var(--os-s3); }
.os-envsum__message { white-space: pre-line; }
.os-envid { display: flex; align-items: center; gap: var(--os-s1); min-width: 0; }
.os-envid code { font-family: var(--os-font-mono); font-size: var(--os-fs-12); overflow-wrap: anywhere; }
.os-envsum__docs { display: flex; flex-wrap: wrap; gap: var(--os-s1) var(--os-s3); }
.os-linkbtn { border: 0; background: none; padding: 0; font: inherit; color: var(--os-accent); text-decoration: underline; text-underline-offset: 0.15em; cursor: pointer; min-height: 1.5rem; text-align: left; }
.os-linkbtn:hover { color: var(--os-accent-hover); }
@media (max-width: 60em) { .os-envsum { grid-template-columns: minmax(0, 1fr); } }
.os-evidence__head { display: flex; align-items: center; gap: var(--os-s3); margin-bottom: var(--os-s2); }
.os-evidence__head .os-card__title { margin: 0; }
.os-evidence__icon { display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: var(--os-radius); background: color-mix(in srgb, var(--os-success) 10%, var(--os-bg)); color: var(--os-success); }
.os-evidence__chain { display: flex; align-items: center; flex-wrap: wrap; gap: var(--os-s2); margin-top: var(--os-s3); }
.os-evidence__chain .os-label { margin: 0; }
.os-evidence__chain code { font-family: var(--os-font-mono); font-size: var(--os-fs-12); overflow-wrap: anywhere; min-width: 0; }
.os-evidence__actions { margin-top: var(--os-s3); flex-wrap: wrap; }
.os-evidence .os-help { margin-top: var(--os-s2); }

/* ---- History panel: a timeline (UX-07) -------------------------------------------- */
.os-histline { list-style: none; margin: 0; padding: 0; }
.os-histline__item { position: relative; display: grid; gap: 0.125rem; padding: var(--os-s2) 0 var(--os-s3) var(--os-s6); }
.os-histline__item::before { content: ""; position: absolute; left: 0.3125rem; top: 0.875rem; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--os-border-strong); }
.os-histline__item::after { content: ""; position: absolute; left: 0.5625rem; top: 1.5rem; bottom: -0.375rem; width: 1px; background: var(--os-border); }
.os-histline__item:last-child::after { display: none; }
.os-histline__details summary { cursor: pointer; color: var(--os-muted); font-size: var(--os-fs-12); width: max-content; }
.os-histline__hash { display: flex; align-items: center; gap: var(--os-s1); }
.os-histline__hash code { font-family: var(--os-font-mono); font-size: var(--os-fs-12); overflow-wrap: anywhere; min-width: 0; }

/* ---- Correct panel: add, remove, order, expiry, reminders (UX-07) ---------------- */
.os-correct__section { font-size: var(--os-fs-14); font-weight: 600; margin: var(--os-s6) 0 0; }
.os-correct__pair { display: flex; flex-wrap: wrap; gap: var(--os-s3); }
.os-correct__pair > div { display: grid; flex: 1 1 8rem; }
.os-correct__order { max-width: 6rem; }
.os-correct__item.is-removed { background: var(--os-surface); border-style: dashed; }
.os-correct__item.is-removed strong { text-decoration: line-through; }
.os-correct__item.is-new { border-left-color: var(--os-info); }
.os-correct__add { margin-top: var(--os-s3); }
.os-correct__settings { display: grid; margin-top: var(--os-s2); }

/* ---- Home: a slim drop zone; recent envelopes with who, where and when (UX-07) ---- */
@media (min-width: 68.76em) { .os-counters--home { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (min-width: 47.51em) and (max-width: 68.75em) { .os-counters--home { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.os-home__head + .os-counters { margin-bottom: var(--os-s4); }
.os-dropzone { padding: var(--os-s2) var(--os-s4); min-height: 3.5rem; gap: var(--os-s3); border-width: 1px; }
.os-dropzone__icon { width: 2rem; height: 2rem; border-radius: var(--os-radius); }
.os-dropzone__text { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--os-s2); }
.os-dropzone__title { font-size: var(--os-fs-14); margin: 0; }
.os-dropzone__text .os-muted { margin: 0; font-size: var(--os-fs-12); }
.os-recent__item--env { grid-template-columns: auto minmax(0, 1fr) minmax(0, 14rem) 9rem; cursor: pointer; }
.os-recent__item--env:hover { background: var(--os-surface); }
.os-recent__to, .os-recent__line { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.os-recent__state { display: grid; justify-items: start; gap: 0.125rem; min-width: 0; max-width: 100%; }
.os-recent__line { max-width: 100%; }
.os-recent__when { text-align: right; white-space: nowrap; }
@media (max-width: 47.5em) {
  .os-dropzone { flex-direction: row; text-align: left; align-items: center; padding: var(--os-s2) var(--os-s3); }
  .os-dropzone__icon { align-self: center; }
  .os-dropzone__text .os-muted { display: none; }
  .os-recent__item--env { grid-template-columns: minmax(0, 1fr) auto; }
  .os-recent__item--env .os-recent__icon { display: none; }
  .os-recent__item--env .os-recent__state { grid-column: 1; grid-row: 2; display: flex; align-items: center; gap: var(--os-s2); }
  .os-recent__item--env .os-recent__when { grid-column: 2; grid-row: 1; }
}

/* ==== WEB-17: Agreements, the inspector, the envelope page and Home on the approved ====
 * canvas (docs/assets/design-canvas/Main.dc.html). Sizes and colours are the canvas's,
 * through the foundation's tokens. */

/* The Agreements screen fills the content card edge to edge: the list scrolls under its
 * own header, the inspector is docked on the right. */
.os-main:has(> .os-view > .os-agr) { padding: 0; overflow: hidden; }
.os-main > .os-view:has(> .os-agr) { height: 100%; }
.os-agr { display: flex; height: 100%; min-height: 0; position: relative; font-size: var(--os-fs-14); }
.os-agr__main { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; container: agrmain / inline-size; }
.os-agr__head { display: flex; align-items: center; gap: 0.75rem; min-height: 3.25rem; padding: 0 1.25rem; border-bottom: 1px solid var(--os-hairline); }
.os-agr__title { margin: 0; font-size: var(--os-fs-15); font-weight: 600; letter-spacing: 0; white-space: nowrap; flex: none; }
.os-agr__head > .os-tabs--pill { margin-left: 0.5rem; min-width: 0; flex: 0 1 auto; overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; }
.os-agr__head > .os-tabs--pill::-webkit-scrollbar { display: none; }
.os-agr__head .os-tabs--pill .os-tab { font-size: var(--os-fs-13); font-weight: 500; white-space: nowrap; flex: none; }
.os-agr__tools { margin-left: auto; display: flex; align-items: center; gap: 0.375rem; flex: none; }
.os-agr__tools .os-btn--ghost { height: 1.875rem; color: var(--os-text-2); box-shadow: none; }
.os-agr__tools .os-btn--ghost:hover { background: color-mix(in srgb, var(--os-text) 6%, transparent); }
.os-agr__tools .os-btn--ghost svg { width: 0.875rem; height: 0.875rem; }
.os-agr__new { margin-left: 0.25rem; height: 1.875rem; padding: 0 0.375rem 0 0.75rem; gap: 0.5rem; box-shadow: var(--os-shadow-primary); }
.os-agr__new > svg { display: none; }
.os-agr__new kbd { font-family: var(--os-font-mono); font-size: var(--os-fs-11); padding: 0.0625rem 0.3125rem; border-radius: 0.25rem; background: rgba(255, 255, 255, .18); color: inherit; }
.os-agr__tools .os-count-badge { min-width: 1rem; height: 1rem; font-size: var(--os-fs-11); background: var(--os-strong); }
.os-agr__searchrow { display: flex; align-items: center; gap: 0.5rem; height: 2.75rem; padding: 0 0.75rem 0 1.25rem; border-bottom: 1px solid var(--os-hairline); color: var(--os-muted); animation: os-fade var(--os-dur) var(--os-ease-state) both; }
.os-agr__searchrow[hidden] { display: none; }
.os-agr__searchinput { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; font: inherit; font-size: var(--os-fs-14); color: var(--os-text); }
.os-agr__searchrow:focus-within { box-shadow: inset 0 -2px 0 var(--os-focus); }
.os-agr__filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.5rem 0.75rem; padding: 0.75rem 1.25rem; border-bottom: 1px solid var(--os-hairline); background: var(--os-surface); animation: os-pop var(--os-dur-slow) var(--os-ease-out) both; }
.os-agr__filters[hidden] { display: none; }
.os-agr__filters .os-fieldrow { margin: 0; }
.os-agr__filters .os-label { margin: 0 0 0.25rem; font-size: var(--os-fs-12); color: var(--os-muted); }
.os-agr__note { margin: 0; padding: 0.5rem 1.25rem; font-size: var(--os-fs-12); color: var(--os-muted); border-bottom: 1px solid var(--os-hairline); }
.os-agr__note[hidden] { display: none; }
.os-agr__bulk { margin: 0.5rem 1rem; position: sticky; top: 0; z-index: 3; }
.os-agr__bulk[hidden] { display: none; }
.os-agr__panel { flex: 1; min-height: 0; overflow: auto; outline: none; }
.os-agr__scroll { min-height: 100%; display: flex; flex-direction: column; }
.os-agr__scroll > .os-empty { flex: 1; min-height: 24rem; }
.os-agr__scroll > .os-empty .os-actions { justify-content: center; }

/* A narrower list keeps every tab: Filter and Display drop to their icons, then the N hint. */
@container agrmain (max-width: 56rem) {
  .os-agr__tools .os-agr__hbtn > span:not(.os-count-badge) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .os-agr__tools .os-agr__hbtn { width: 1.875rem; padding: 0; }
  .os-agr__new kbd { display: none; }
  .os-agr__new { padding: 0 0.75rem; }
}
@container agrmain (max-width: 50rem) {
  .os-agr__new { width: 1.875rem; padding: 0; }
  .os-agr__new > svg { display: inline; }
  .os-agr__new .os-agr__btnlabel { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .os-agr__head .os-tabs--pill .os-tab { padding: 0 0.625rem; }
  .os-agr__head { gap: 0.5rem; }
}

/* Rows: thumbnail and name | recipients | progress | status | time (canvas grid). */
.os-agr-grid { display: block; }
.os-agr-row, .os-agr-group { --os-agr-cols: minmax(0, 3fr) 5.5rem minmax(0, 1fr) minmax(0, 1.9fr) 4.5rem; }
.os-agr-grid.is-selecting .os-agr-row { --os-agr-cols: 1.5rem minmax(0, 3fr) 5.5rem minmax(0, 1fr) minmax(0, 1.9fr) 4.5rem; }
.os-agr-group {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; height: 2.25rem; padding: 0 1.25rem;
  background: var(--os-surface); border-bottom: 1px solid rgba(24, 24, 27, .05); font-size: var(--os-fs-13); font-weight: 500; color: var(--os-text-2);
}
.os-agr-group__cell { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.os-agr-group__n { color: var(--os-muted); font-weight: 400; font-variant-numeric: tabular-nums; }
.os-dot--danger { background: var(--os-danger); }
.os-agr-row {
  display: grid; grid-template-columns: var(--os-agr-cols); align-items: center; gap: 1rem; height: 3.5rem; padding: 0 1.25rem;
  border-bottom: 1px solid rgba(24, 24, 27, .05); cursor: default; outline: none; position: relative;
  transition: background var(--os-dur-fast) var(--os-ease-state);
  animation: os-rise var(--os-dur-enter) var(--os-ease-out) both;
}
.os-agr-row:hover { background: var(--os-surface); }
.os-agr-row.is-selected { background: var(--os-select-soft); box-shadow: inset 0.125rem 0 0 var(--os-accent); }
.os-agr-row.is-picked { background: color-mix(in srgb, var(--os-accent) 4%, var(--os-bg)); }
.os-agr-row:focus-visible { box-shadow: inset 0 0 0 0.125rem var(--os-focus); }
.os-agr-row.is-selected:focus-visible { box-shadow: inset 0.125rem 0 0 var(--os-accent), inset 0 0 0 0.125rem var(--os-focus); }
.os-agr-cell { display: flex; align-items: center; min-width: 0; }
.os-agr-cell--main { gap: 0.75rem; }
.os-agr-cell__text { display: flex; flex-direction: column; min-width: 0; text-align: left; }
.os-agr-name { font-weight: 500; color: var(--os-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.os-agr-sub { font-size: var(--os-fs-12); color: var(--os-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.os-agr-cell--status { gap: 0.375rem; }
.os-agr-cell--status .os-badge { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 0 1 auto; padding: 0 0.5rem; }
.os-agr-cell--status .os-badge > span { overflow: hidden; text-overflow: ellipsis; }
.os-agr-cell--when { justify-content: flex-end; }
.os-when { font-size: var(--os-fs-13); color: var(--os-muted); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* The 18 px box in a 44 px hit area (SC 2.5.8 and the touch size), as in tables: the
 * padding is taken back by a negative margin, inside the row's padding and the gap. */
.os-agr-cell--check .os-checkbox {
  --os-check-pad: calc((var(--os-target-touch) - 1.125rem) / 2 + 0.25px); /* px-ok: a sub-pixel rounding guard */
  padding: var(--os-check-pad); margin: calc(-1 * var(--os-check-pad)); position: relative; z-index: 1;
}

/* The page thumbnail, its signature line in the status tone. */
.os-thumb {
  width: 1.75rem; height: 2.125rem; flex: none; box-sizing: border-box; border-radius: 0.25rem; background: #fff;
  box-shadow: 0 0 0 1px rgba(24, 24, 27, .1), 0 1px 0.125rem rgba(24, 24, 27, .06);
  display: flex; flex-direction: column; gap: 0.1875rem; padding: 0.375rem 0.3125rem;
}
.os-thumb > span { height: 0.125rem; border-radius: 1px; background: #e4e4e7; }
.os-thumb__l1 { background: #d4d4d8 !important; }
.os-thumb__l2 { width: 70%; }
.os-thumb__sig { height: 0.1875rem !important; width: 55%; margin-top: auto; background: var(--os-st-draft) !important; }
.os-thumb--you .os-thumb__sig { background: var(--os-st-you) !important; }
.os-thumb--wait .os-thumb__sig { background: var(--os-st-wait) !important; }
.os-thumb--done .os-thumb__sig { background: var(--os-st-done) !important; }
.os-thumb--danger .os-thumb__sig { background: var(--os-danger) !important; }

/* Signing progress segments. */
.os-prog { display: inline-flex; align-items: center; gap: 0.5rem; }
.os-prog__segs { display: flex; gap: 0.1875rem; }
.os-prog__seg { width: 0.875rem; height: 0.25rem; border-radius: 0.125rem; background: #e4e4e7; }
.os-prog__seg.is-done { background: var(--os-st-done); }
.os-prog__n { font-size: var(--os-fs-12); color: var(--os-muted); font-variant-numeric: tabular-nums; }

/* The violet "n suggestions" chip. */
.os-sugg-chip { display: inline-flex; align-items: center; gap: 0.25rem; flex: none; height: 1.375rem; padding: 0 0.4375rem; border-radius: 0.375rem; background: var(--os-ml-soft); color: var(--os-ml); font-size: var(--os-fs-12); font-weight: 500; }

/* Skeleton rows in the same grid. */
.os-agr-skel__head { width: 9rem; height: 0.625rem; }
.os-agr-skel__prog { width: 3.5rem; height: 0.5rem; }
.os-agr-skel__when { width: 3rem; height: 0.625rem; margin-left: auto; }
.os-agr-row--skel { animation: none; }
.os-agr-row--skel:hover { background: none; }
.os-skel--overlap { margin-left: -0.375rem; }
.os-agr-row--skel .os-skel { background: linear-gradient(90deg, var(--os-skeleton) 0%, var(--os-skeleton-hi) 40%, var(--os-skeleton) 80%); background-size: 200% 100%; animation: os-shimmer 1.4s cubic-bezier(.4, 0, .2, 1) infinite; }
.os-agr-row--skel .os-skel-lines .os-skel { height: 0.625rem; }
.os-agr-row--skel .os-skel-lines .os-skel--sub { height: 0.5rem; }

/* ---- The inspector -------------------------------------------------------------------- */
.os-insp { width: 23.5rem; flex: none; display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--os-hairline); background: var(--os-bg); }
.os-insp__head { padding: 1.125rem 1.25rem 0.875rem; display: flex; flex-direction: column; gap: 0.625rem; position: relative; }
.os-insp__close { display: none !important; position: absolute; top: 0.75rem; right: 0.75rem; }
.os-insp__pill:empty { display: none; }
.os-insp__pill .os-badge { align-self: flex-start; max-width: 100%; }
.os-insp__title { margin: 0; font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; overflow-wrap: anywhere; }
.os-insp__sub { margin: 0; font-size: var(--os-fs-13); color: var(--os-muted); }
.os-insp__actions { display: flex; gap: 0.375rem; margin-top: 0.25rem; flex-wrap: wrap; }
.os-insp__actions:empty { display: none; }
.os-insp__actions .os-btn { height: 2rem; padding: 0 0.75rem; font-size: var(--os-fs-14); }
.os-insp__actions .os-btn--icon { width: 2rem; padding: 0; }
.os-insp__body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.os-insp__tabset { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.os-insp__tabset > .os-tabs { gap: 1.125rem; padding: 0 1.25rem; margin: 0; border-bottom: 1px solid var(--os-hairline); flex: none; }
.os-insp__tabset > .os-tabs .os-tab { height: 2.5rem; padding: 0; margin-bottom: -1px; font-size: var(--os-fs-13); white-space: nowrap; }
.os-insp__tabset > .os-tabs .os-tab__badge { margin-left: 0.3125rem; }
.os-insp__tabset > .os-tabs .os-tab__badge[hidden] { display: none; }
.os-insp__tabset > .os-tabpanel { flex: 1; min-height: 0; overflow: auto; padding: 1rem 1.25rem; display: flex; flex-direction: column; gap: 0.875rem; outline: none; }
.os-insp__none { margin: 0; font-size: var(--os-fs-13); }
.os-insp > .os-insp__body > .os-insp__none { padding: 1.25rem; }

/* Recipients in signing order. */
.os-ordl { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.875rem; }
.os-ord { display: flex; gap: 0.75rem; align-items: flex-start; }
.os-ord__badge { width: 1.5rem; height: 1.5rem; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: var(--os-fs-11); font-weight: 600; background: var(--os-surface-2); color: var(--os-muted); }
.os-ord__badge.is-done { background: var(--os-st-done-soft); color: var(--os-st-done); }
.os-ord__badge.is-you { background: var(--os-accent-fill); color: var(--os-on-accent); }
.os-ord__badge.is-wait { background: var(--os-st-wait-soft); color: var(--os-st-wait); box-shadow: 0 0 0 0.09375rem #f2c98f; }
.os-ord__badge.is-declined { background: color-mix(in srgb, var(--os-danger) 10%, var(--os-bg)); color: var(--os-danger); }
.os-ord__main { display: flex; flex-direction: column; gap: 0.125rem; min-width: 0; flex: 1; }
.os-ord__name strong { font-weight: 500; }
.os-ord__detail { font-size: var(--os-fs-12); color: var(--os-muted); }
.os-ordl.is-detailed .os-ord { padding-bottom: 0.875rem; border-bottom: 1px solid var(--os-hairline); }
.os-ordl.is-detailed .os-ord:last-child { border-bottom: 0; padding-bottom: 0; }
.os-ordl.is-detailed .os-ord__name { overflow-wrap: anywhere; }
.os-ordl.is-detailed .os-steps { margin-top: 0.375rem; gap: 0.25rem 1rem; font-size: var(--os-fs-12); }
.os-ord > .os-btn { flex: none; }

/* Activity lines. */
.os-activity { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.875rem; }
.os-activity__item { display: flex; gap: 0.75rem; font-size: var(--os-fs-13); }
.os-activity__t { width: 3rem; flex: none; color: var(--os-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.os-activity__text { min-width: 0; overflow-wrap: anywhere; }
.os-activity-wrap { display: flex; flex-direction: column; gap: 0.875rem; align-items: flex-start; }

/* Insights. */
.os-insights { display: flex; flex-direction: column; gap: 0.875rem; }
.os-insights__body { display: flex; flex-direction: column; gap: 0.875rem; }
.os-reading { border-radius: 0.75rem; background: #faf9ff; box-shadow: inset 0 0 0 1px rgba(109, 40, 217, .14); padding: 1.25rem; display: flex; flex-direction: column; align-items: center; gap: 0.875rem; text-align: center; }
.os-reading__page { position: relative; width: 5.5rem; height: 7rem; box-sizing: border-box; border-radius: 0.375rem; background: #fff; box-shadow: 0 0 0 1px rgba(24, 24, 27, .1), 0 0.5rem 1.25rem -10px rgba(109, 40, 217, .35); overflow: hidden; padding: 0.75rem 0.625rem; display: flex; flex-direction: column; gap: 0.4375rem; }
.os-reading__line { height: 0.1875rem; border-radius: 1px; background: #e4e4e7; }
.os-reading__line.w60 { width: 60%; height: 0.25rem; background: #d4d4d8; }
.os-reading__line.w85 { width: 85%; }
.os-reading__line.w70 { width: 70%; }
.os-reading__line.w50 { width: 50%; }
.os-reading__line.is-hit { background: #ddd6fe; }
.os-reading__band { position: absolute; left: 0; right: 0; top: 0.375rem; height: 1.25rem; background: linear-gradient(180deg, rgba(139, 92, 246, 0), rgba(139, 92, 246, .22), rgba(139, 92, 246, 0)); border-bottom: 0.09375rem solid #8b5cf6; }
.os-reading__text { display: flex; flex-direction: column; gap: 0.25rem; }
.os-reading__text .os-muted { font-size: var(--os-fs-13); }
.os-pii { border-radius: 0.625rem; background: var(--os-pii-soft); box-shadow: inset 0 0 0 1px var(--os-pii-edge); padding: 0.75rem 0.875rem; display: flex; flex-direction: column; gap: 0.375rem; }
.os-pii__title { font-weight: 600; color: var(--os-pii); }
.os-pii__text { font-size: var(--os-fs-13); color: var(--os-pii-text); line-height: 1.45; }
.os-pii__btn { align-self: flex-start; height: 1.75rem; padding: 0 0.625rem; border: 0; border-radius: 0.375rem; background: var(--os-bg); box-shadow: inset 0 0 0 1px rgba(180, 83, 9, .25); color: var(--os-pii); font: inherit; font-size: var(--os-fs-12); font-weight: 500; cursor: pointer; white-space: nowrap; }
.os-pii__btn:hover { background: #fff7e6; }
.os-pii__list { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.25rem; }

/* Evidence. */
.os-evid { display: flex; flex-direction: column; gap: 0.875rem; }
.os-evid__card { border-radius: 0.625rem; background: color-mix(in srgb, var(--os-success) 7%, var(--os-bg)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--os-success) 25%, transparent); padding: 0.875rem; display: flex; flex-direction: column; gap: 0.5rem; }
.os-evid__card.is-broken { background: var(--os-pii-soft); box-shadow: 0 0 0 1px var(--os-pii-edge); }
.os-evid__title { display: flex; align-items: center; gap: 0.5rem; color: var(--os-st-done); font-weight: 600; }
.os-evid__card.is-broken .os-evid__title { color: var(--os-pii); }
.os-evid__text { font-size: var(--os-fs-13); color: var(--os-text-2); line-height: 1.5; }
.os-evid__field { display: flex; flex-direction: column; gap: 0.25rem; }
.os-evid__label { font-size: var(--os-fs-12); color: var(--os-muted); }
.os-evid__hashrow { display: flex; gap: 0.25rem; align-items: flex-start; }
.os-evid__hash { flex: 1; min-width: 0; font-family: var(--os-font-mono); font-size: var(--os-fs-12); color: var(--os-text-2); overflow-wrap: anywhere; background: var(--os-surface-2); padding: 0.5rem 0.625rem; border-radius: 0.375rem; }
.os-evid__actions { display: flex; flex-wrap: wrap; gap: 0.375rem; }

/* Sidebar Views. */
.os-navview .os-dot { margin: 0 0.25rem; }
/* --os-text-2, not --os-muted: muted is 4.3:1 on the hovered or current row (#e9e8e5), under AA (axe, E2E-13). */
.os-navview__n { margin-left: auto; font-size: var(--os-fs-12); color: var(--os-text-2); font-variant-numeric: tabular-nums; }

/* Below 75rem the inspector slides over the list; on phones it is a full page. */
.os-agr__scrim { display: none; }
.os-agr.is-empty > .os-insp { display: none; }
@media (max-width: 74.999em) {
  .os-insp {
    position: absolute; top: 0; right: 0; bottom: 0; z-index: 20; width: min(23.5rem, 100%); box-shadow: var(--os-shadow-pop);
    display: none;
  }
  /* It slides in (os-slide on the element) each time it is shown; closed, it takes no room. */
  .os-agr.is-inspecting .os-insp { display: flex; }
  .os-agr.is-inspecting .os-agr__scrim { display: block; position: absolute; inset: 0; z-index: 19; background: var(--os-overlay); animation: os-fade var(--os-dur-fast) var(--os-ease-state); }
  .os-insp__close { display: inline-flex !important; }
  .os-insp__head { padding-right: 3.25rem; }
}
@media (max-width: 60em) {
  .os-main:has(> .os-view > .os-agr) { overflow: visible; }
  .os-main > .os-view:has(> .os-agr) { height: auto; }
  .os-agr { height: auto; }
  .os-agr__panel { overflow: visible; }
  .os-agr-group { top: var(--os-topbar-h); }
  .os-insp { position: fixed; top: 0; bottom: 0; z-index: 80; width: 100%; border-left: 0; }
  .os-insp__tabset > .os-tabpanel { overflow: auto; }
  .os-agr.is-inspecting .os-agr__scrim { position: fixed; z-index: 79; }
}
@media (max-width: 64em) {
  .os-agr-row, .os-agr-group { --os-agr-cols: minmax(0, 3fr) 5.5rem minmax(0, 1.6fr) 4.5rem; }
  .os-agr-grid.is-selecting .os-agr-row { --os-agr-cols: 1.5rem minmax(0, 3fr) 5.5rem minmax(0, 1.6fr) 4.5rem; }
  .os-agr-cell--progress { display: none; }
}
@media (max-width: 47.999em) {
  .os-agr__head { flex-wrap: wrap; gap: 0.5rem; padding: 0.75rem 1rem 0.5rem; }
  .os-agr__head > .os-tabs--pill { order: 3; flex: 1 1 100%; min-width: 0; margin: 0; padding: 0; }
  .os-agr__btnlabel { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .os-agr__new { padding: 0 0.5rem; }
  .os-agr__new > svg { display: inline; }
  .os-agr__new kbd { display: none; }
  .os-agr__tools .os-agr__hbtn > span:not(.os-count-badge) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .os-agr__tools .os-agr__hbtn { width: 2.75rem; height: 2.75rem; padding: 0; }
  .os-agr__tools .os-btn { min-height: 2.75rem; }
  .os-agr__new { height: 2.75rem; min-width: 2.75rem; justify-content: center; }
  .os-agr-group { padding: 0 1rem; }
  .os-agr-row, .os-agr-grid.is-selecting .os-agr-row {
    grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main main" "status when"; height: auto; gap: 0.5rem 0.75rem; padding: 0.75rem 1rem;
  }
  .os-agr-grid.is-selecting .os-agr-row { grid-template-columns: 1.5rem minmax(0, 1fr) auto; grid-template-areas: "check main main" "check status when"; }
  .os-agr-cell--check { grid-area: check; }
  .os-agr-cell--main { grid-area: main; }
  .os-agr-cell--status { grid-area: status; padding-left: 2.5rem; }
  .os-agr-cell--when { grid-area: when; }
  .os-agr-cell--people, .os-agr-cell--progress { display: none; }
  .os-agr-group { top: var(--os-topbar-h); }
  .os-agr__searchrow, .os-agr__note, .os-agr__filters { padding-left: 1rem; padding-right: 1rem; }
  .os-insp__actions .os-btn { height: 2.75rem; } .os-insp__actions .os-btn--icon { width: 2.75rem; }
  .os-insp__tabset > .os-tabs .os-tab { height: 2.75rem; }
  .os-agr__tools .os-btn--icon { width: 2.75rem; height: 2.75rem; }
}

/* ---- The envelope page in the same language (WEB-17) ------------------------------------ */
.os-env { display: flex; flex-direction: column; gap: 1rem; }
.os-env > .os-back { align-self: flex-start; }
.os-env__head { margin-bottom: 0; align-items: flex-start; }
.os-env__title { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
.os-env__pillrow { display: flex; align-items: center; gap: 0.625rem; flex-wrap: wrap; min-width: 0; }
.os-env__line { font-size: var(--os-fs-13); color: var(--os-muted); }
.os-env__title .os-page-title { font-size: 1.375rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; margin: 0; }
.os-env__sub { margin: 0; font-size: var(--os-fs-13); color: var(--os-muted); }
.os-env__grid { display: grid; grid-template-columns: minmax(0, 1fr) 23.5rem; gap: 1rem; align-items: start; }
.os-env__main, .os-env__side { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.os-env__card .os-card__title, .os-env__docs .os-card__title { font-size: var(--os-fs-14); margin-bottom: 0.875rem; }
.os-env__docs .os-pdfprev, .os-env__docs > [data-doc] { max-height: 36rem; }
.os-env__skelhead { padding: 0.5rem 0 1rem; max-width: 30rem; }
@media (max-width: 74.999em) { .os-env__grid { grid-template-columns: minmax(0, 1fr); } }

/* ---- Home in the same language (WEB-17) ------------------------------------------------- */
.os-home2 { display: flex; flex-direction: column; gap: 1.25rem; }
.os-home2__head { display: flex; flex-direction: column; gap: 0.25rem; }
.os-home2__title { margin: 0; font-size: var(--os-fs-15); font-weight: 600; color: var(--os-text); }
.os-home2__hello { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem; }
.os-home2__greet { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.015em; }
.os-home2__stats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.625rem; }
.os-stat {
  display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; align-items: center; gap: 0.25rem 0.5rem;
  padding: 0.75rem 0.875rem; border-radius: 0.625rem; background: var(--os-bg); box-shadow: var(--os-shadow); color: var(--os-text); text-decoration: none;
  transition: box-shadow var(--os-dur-fast) var(--os-ease-state), transform var(--os-dur-fast) var(--os-ease-state);
}
.os-stat:hover { color: var(--os-text); box-shadow: var(--os-shadow-md); }
.os-stat > .os-dot { grid-area: 1 / 1; }
.os-stat .os-counter__label { grid-area: 1 / 2; font-weight: 500; font-size: var(--os-fs-13); color: var(--os-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.os-stat .os-counter__n { grid-area: 2 / 1 / 3 / 3; letter-spacing: -0.01em; font-size: 1.375rem; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.2; }
.os-stat .os-counter__n .os-skel--short { display: block; width: 2.5rem; height: 1.375rem; }
.os-home2__grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(17.5rem, 1fr); gap: 1rem; align-items: start; }
.os-home2__col { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.os-home2__card .os-card__head { padding: 0.875rem 1.125rem; border-bottom: 1px solid var(--os-hairline); margin: 0; }
.os-home2__card .os-card__title { font-size: var(--os-fs-14); margin: 0; }
.os-home2__card.is-dropping { box-shadow: inset 0 0 0 0.125rem var(--os-accent-fill); background: var(--os-accent-soft); }
.os-hrows { list-style: none; margin: 0; padding: 0; }
.os-hrow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 0.75rem; min-height: 3.5rem; padding: 0.5rem 1.125rem; border-bottom: 1px solid rgba(24, 24, 27, .05); cursor: pointer; transition: background var(--os-dur-fast) var(--os-ease-state); }
.os-hrow:last-child { border-bottom: 0; }
.os-hrow:hover { background: var(--os-surface); }
.os-hrows--skel .os-hrow { cursor: default; grid-template-columns: auto minmax(0, 1fr) auto; }
.os-hrow__main { display: flex; flex-direction: column; min-width: 0; }
.os-hrow__name { font-weight: 500; color: var(--os-text); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.os-hrow__name:hover { color: var(--os-accent); }
.os-hrow__line { font-size: var(--os-fs-12); color: var(--os-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.os-hrow .os-badge { max-width: 12rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.os-hrow--tpl { grid-template-columns: auto minmax(0, 1fr) auto; cursor: default; }
.os-hrow__icon { width: 1.75rem; height: 1.75rem; display: inline-grid; place-items: center; border-radius: 0.4375rem; background: var(--os-accent-soft); color: var(--os-accent); }
.os-home2__none { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.125rem; }
.os-home2__none .os-illus { width: 5rem; flex: none; }
.os-home2__none p { margin: 0; }
.os-home2__none-title { font-weight: 600; }
.os-quick { list-style: none; margin: 0; padding: 0.375rem; display: flex; flex-direction: column; gap: 0.125rem; }
.os-quick__item { width: 100%; display: flex; align-items: center; gap: 0.75rem; padding: 0.625rem 0.75rem; border: 0; border-radius: 0.5rem; background: transparent; color: var(--os-text); text-align: left; text-decoration: none; font: inherit; cursor: pointer; }
.os-quick__item:hover { background: var(--os-surface-2); color: var(--os-text); }
.os-quick__icon { width: 2rem; height: 2rem; flex: none; display: inline-grid; place-items: center; border-radius: 0.5rem; background: var(--os-surface-2); color: var(--os-text-2); }
.os-quick__text { display: flex; flex-direction: column; min-width: 0; }
.os-quick__title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.os-quick__line { font-size: var(--os-fs-12); color: var(--os-muted); }
@media (max-width: 64em) { .os-home2__stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } .os-home2__grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 47.999em) {
  .os-home2__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .os-hrow { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "thumb main when" "thumb pill pill"; padding: 0.625rem 1rem; }
  .os-hrow > .os-thumb { grid-area: thumb; }
  .os-hrow > .os-hrow__main { grid-area: main; }
  .os-hrow > .os-badge { grid-area: pill; justify-self: start; }
  .os-hrow > .os-when { grid-area: when; }
  .os-hrow--tpl { grid-template-areas: none; }
}

