/* it-1060: the outside partner portal — its own bare page (templates/layouts/portal.html).
   it-1500 (BPDGo#546): BPDGo Connect on the web — the shell (bar, lender picker, you, the phone's tab bar), Contacts
   (the list beside the open contact) and a contact's header and Details, at three widths: phone under 37.5rem, tablet
   37.5–67.5rem, desktop 67.5rem and up (an iPad in landscape gets desktop). Rem only; scroll areas draw no scrollbar.
   The Notes, Account and sign-in screens' own styles are connect-pages.css (BPDGo#561); the older rules they still use
   follow the shell's. */
.portal { --cx-ground: rgb(242 242 247); --cx-card: #fff; --cx-sep: rgb(220 220 225); --cx-sep2: rgb(236 236 240);
  --cx-fill: rgb(118 118 128 / 0.12); --cx-fg2: rgb(86 86 93); --cx-muted: rgb(102 102 108); --cx-tint-c: rgb(244 230 250);
  --cx-on-tint-c: rgb(60 20 80); --cx-red: rgb(196 39 29);
  margin: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  background: var(--cx-ground); color: var(--md-sys-color-on-surface); }
.portal__main { flex: 1 1 auto; width: 100%; max-width: 60rem; margin: 0 auto; padding: var(--space-6, 1.5rem); display: grid; gap: var(--space-4, 1rem); box-sizing: border-box; }
.portal__main--split { max-width: none; padding: 0; display: block; min-height: 0; }

/* ---------- the bar ---------- */
.portal__bar { flex: 0 0 auto; height: 4rem; box-sizing: border-box; display: flex; align-items: center; gap: 0.375rem;
  padding: 0 1.25rem; background: var(--cx-card); border-bottom: 1px solid var(--cx-sep); position: relative; z-index: 5; }
.portal__brand { display: flex; align-items: center; gap: 0.5625rem; margin-right: 1.125rem; flex: 0 0 auto; color: inherit; text-decoration: none; }
.portal__brand img { height: 1.5625rem; width: auto; display: block; }
.portal__brand b { font-size: 1.1875rem; font-weight: 650; color: var(--md-sys-color-primary); letter-spacing: -0.015em; line-height: 1; }
.portal__lender { color: var(--cx-fg2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.portal__nav { display: flex; gap: 0.125rem; align-self: stretch; }
.portal__nav-link { display: flex; align-items: center; gap: 0.5rem; padding: 0 0.875rem; font-weight: 600; font-size: 0.9375rem;
  color: var(--cx-fg2); text-decoration: none; position: relative; }
.portal__nav-link:hover { color: var(--md-sys-color-on-surface); }
.portal__nav-link.portal__nav--on { color: var(--md-sys-color-primary); }
.portal__nav-link.portal__nav--on .material-symbols-rounded { font-variation-settings: 'FILL' 1; }
.portal__nav-link.portal__nav--on::after { content: ""; position: absolute; left: 0.625rem; right: 0.625rem; bottom: -1px; height: 0.1875rem;
  border-radius: 0.1875rem 0.1875rem 0 0; background: var(--md-sys-color-primary); }
.portal__count { min-width: 1.25rem; height: 1.25rem; padding: 0 0.375rem; box-sizing: border-box; border-radius: 62.5rem; display: inline-grid;
  place-items: center; font-size: 0.72rem; font-weight: 700; line-height: 1; background: var(--cx-red); color: #fff; }
.portal__spacer { flex: 1 1 auto; }
.portal__menu { position: relative; flex: 0 0 auto; }
.portal__pick { height: 2.5rem; padding: 0 0.5rem 0 0.625rem; border-radius: 0.625rem; border: 1px solid var(--cx-sep); background: none;
  display: inline-flex; align-items: center; gap: 0.5rem; font: inherit; font-weight: 600; font-size: 0.90625rem; color: inherit; cursor: pointer; max-width: 18rem; }
.portal__pick:hover, .portal__pick[aria-expanded="true"] { background: var(--cx-ground); }
.portal__pick .material-symbols-rounded { color: var(--cx-fg2); }
.portal__pick-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.portal__me-btn { height: 2.75rem; padding: 0 0.375rem 0 0.25rem; margin-left: 0.375rem; border-radius: 62.5rem; border: 0; background: none;
  display: inline-flex; align-items: center; gap: 0.5rem; font: inherit; font-weight: 600; font-size: 0.90625rem; color: inherit; cursor: pointer; }
.portal__me-btn:hover, .portal__me-btn[aria-expanded="true"] { background: var(--cx-ground); }
.portal__me-btn .material-symbols-rounded { color: var(--cx-fg2); }
.portal__pop { position: absolute; right: 0; top: calc(100% + 0.375rem); z-index: 20; box-sizing: border-box; padding: 0.5rem;
  background: var(--cx-card); border-radius: 1rem; box-shadow: 0 0.625rem 2.125rem rgb(30 10 40 / 0.2), 0 2px 6px rgb(0 0 0 / 0.08); }
.portal__pop--picker { width: 22rem; }
.portal__pop--me { width: 16rem; }
.portal__picker-list { list-style: none; margin: 0; padding: 0 0 0.375rem; border-bottom: 1px solid var(--cx-sep2); }
.portal__picker-list a { display: flex; align-items: center; gap: 0.75rem; padding: 0.625rem 0.75rem; border-radius: 0.75rem; color: inherit; text-decoration: none; }
.portal__picker-list a:hover { background: var(--cx-ground); }
.portal__picker-list a[aria-current="page"] { background: var(--cx-ground); }
.portal__pick-lab { flex: 1 1 auto; min-width: 0; display: grid; }
.portal__pick-t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.portal__pick-s { font-size: 0.8125rem; color: var(--cx-muted); }
.portal__pick-check { color: var(--md-sys-color-primary); }
.portal__pick-more { display: flex; align-items: center; gap: 0.625rem; padding: 0.75rem 0.75rem 0.375rem; font-weight: 600; color: var(--md-sys-color-primary); text-decoration: none; }
.portal__pick-fine { margin: 0; padding: 0.25rem 0.75rem 0.5rem; font-size: 0.78rem; line-height: 1.45; color: var(--cx-muted); }
.portal__pop-item { width: 100%; display: flex; align-items: center; gap: 0.75rem; padding: 0.625rem 0.75rem; border-radius: 0.625rem; border: 0;
  background: none; font: inherit; font-weight: 500; color: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.portal__pop-item:hover { background: var(--cx-ground); }
.portal__pop-item .material-symbols-rounded { color: var(--cx-fg2); }
.portal__pop form { margin: 0; }
.portal__tabs { display: none; }

/* ---------- marks and avatars ---------- */
.cx-mark { width: 2.5rem; height: 2.5rem; border-radius: 0.625rem; display: inline-grid; place-items: center; flex: 0 0 auto; box-sizing: border-box;
  font-weight: 800; font-size: 0.875rem; letter-spacing: -0.02em; line-height: 1; background: var(--cx-mark, rgb(18 70 120)); color: var(--cx-on-mark, #fff); }
.cx-mark--xs { width: 1.375rem; height: 1.375rem; border-radius: 0.375rem; font-size: 0.5625rem; }
.cx-mark--sm { width: 1.75rem; height: 1.75rem; border-radius: 0.4375rem; font-size: 0.65625rem; }
.cx-mark--lg { width: 4rem; height: 4rem; border-radius: 1rem; font-size: 1.375rem; }
.cx-mark--all { background: var(--md-sys-color-surface-container-high, rgb(229 229 234)); color: var(--cx-fg2); }
.cx-mark--all .material-symbols-rounded { font-size: 0.9375rem; }
.cx-mark--sm.cx-mark--all .material-symbols-rounded { font-size: 1.125rem; }
.cx-mark--logo { object-fit: contain; background: #fff; border: 1px solid var(--cx-sep2); }
.cx-av { width: 2.5rem; height: 2.5rem; border-radius: 62.5rem; display: inline-grid; place-items: center; flex: 0 0 auto;
  font-weight: 700; font-size: 0.9375rem; line-height: 1; background: var(--cx-tint-c); color: var(--cx-on-tint-c); }
.cx-av--sm { width: 2rem; height: 2rem; font-size: 0.78rem; }
.cx-av--xl { width: 4.75rem; height: 4.75rem; font-size: 1.6875rem; }
.cx-av--t1 { background: rgb(220 234 255); color: rgb(6 48 95); }
.cx-av--t2 { background: rgb(220 243 227); color: rgb(11 61 28); }
.cx-av--t3 { background: rgb(253 233 212); color: rgb(107 51 0); }
.cx-av--t4 { background: rgb(229 229 234); color: var(--cx-fg2); }

/* ---------- the list beside the open contact ---------- */
.cx-small { font-size: 0.8125rem; color: var(--cx-muted); }
.cx-split { height: 100%; display: grid; grid-template-columns: 23.75rem minmax(0, 1fr); }
.cx-list { min-height: 0; display: flex; flex-direction: column; background: var(--cx-card); border-right: 1px solid var(--cx-sep); position: relative; }
.cx-list__notice { margin: 0.75rem 1.25rem 0; }
.cx-list__head { flex: 0 0 auto; padding: 1.25rem 1.25rem 0.625rem; display: flex; flex-direction: column; gap: 0.75rem; }
.cx-list__title { display: flex; align-items: baseline; gap: 0.625rem; }
.cx-list__title h1 { margin: 0; font-size: 1.625rem; font-weight: 750; letter-spacing: -0.02em; line-height: 1.15; }
.cx-search { position: relative; margin: 0; }
.cx-search__bar { height: 2.75rem; border-radius: 0.75rem; background: var(--cx-fill); display: flex; align-items: center; gap: 0.25rem; padding: 0 0.25rem; color: var(--cx-muted); }
.cx-search__bar input { flex: 1 1 auto; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 0.96875rem; color: var(--md-sys-color-on-surface); }
.cx-search__bar input::-webkit-search-cancel-button { cursor: pointer; }
.cx-icb { width: 2.25rem; height: 2.25rem; border-radius: 0.5625rem; border: 0; background: none; display: inline-grid; place-items: center;
  color: var(--md-sys-color-primary); flex: 0 0 auto; position: relative; cursor: pointer; }
.cx-icb:hover { background: var(--cx-fill); }
.cx-icb--plain { color: var(--cx-muted); }
.cx-icb--on { background: var(--cx-tint-c); color: var(--cx-on-tint-c); }
.cx-icb__dot { position: absolute; top: 0.375rem; right: 0.375rem; width: 0.5rem; height: 0.5rem; border-radius: 62.5rem; background: var(--md-sys-color-primary); box-shadow: 0 0 0 2px var(--cx-tint-c); }
.cx-filter { position: absolute; left: -0.375rem; right: -0.375rem; top: calc(100% + 0.5rem); z-index: 10; padding: 0.5rem 1rem 0.75rem;
  background: var(--cx-card); border-radius: 1rem; box-shadow: 0 0.625rem 2.125rem rgb(30 10 40 / 0.2), 0 2px 6px rgb(0 0 0 / 0.08); }
.cx-filter__group { border: 0; margin: 0; padding: 0.5rem 0; border-bottom: 1px solid var(--cx-sep2); }
.cx-filter__group legend { padding: 0.5rem 0 0.25rem; font-size: 0.75rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.05em; color: var(--cx-muted); }
.cx-radio { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 0; cursor: pointer; }
.cx-radio input { width: 1.125rem; height: 1.125rem; margin: 0; accent-color: var(--md-sys-color-primary); }
.cx-filter__fine { margin: 0.25rem 0 0.25rem; font-size: 0.8125rem; line-height: 1.45; color: var(--cx-muted); }
.cx-filter__switch { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.875rem 0; border-bottom: 1px solid var(--cx-sep2); cursor: pointer; }
.cx-switch { appearance: none; width: 2.875rem; height: 1.75rem; margin: 0; border-radius: 62.5rem; background: var(--cx-sep); position: relative; cursor: pointer; flex: 0 0 auto; transition: background 0.15s; }
.cx-switch::before { content: ""; position: absolute; top: 0.125rem; left: 0.125rem; width: 1.5rem; height: 1.5rem; border-radius: 62.5rem; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 0.2); transition: transform 0.15s; }
.cx-switch:checked { background: var(--md-sys-color-primary); }
.cx-switch:checked::before { transform: translateX(1.125rem); }
.cx-switch:focus-visible { outline: 2px solid var(--md-sys-color-primary); outline-offset: 2px; }
.cx-filter__foot { display: flex; justify-content: flex-end; align-items: center; gap: 0.5rem; padding-top: 0.75rem; }
.cx-btn { height: 2.5rem; padding: 0 1.125rem; border-radius: 0.625rem; border: 0; display: inline-flex; align-items: center; justify-content: center;
  font: inherit; font-weight: 600; font-size: 0.9375rem; text-decoration: none; cursor: pointer; }
.cx-btn--filled { background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); }
.cx-btn--text { background: none; color: var(--md-sys-color-primary); }
.cx-btn--text:hover { background: var(--cx-tint-c); }
.cx-chips { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.cx-chip { height: 2rem; padding: 0 0.8125rem; border-radius: 62.5rem; border: 1px solid var(--cx-sep); background: var(--cx-card); display: inline-flex;
  align-items: center; font-size: 0.84375rem; font-weight: 600; white-space: nowrap; color: inherit; text-decoration: none; box-sizing: border-box; }
.cx-chip:hover { background: var(--cx-ground); }
.cx-chip--on, .cx-chip--on:hover { background: var(--md-sys-color-primary); border-color: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); }
.cx-list__rows { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 0.125rem 0.625rem 0.625rem; scrollbar-width: none; }
.cx-list__rows::-webkit-scrollbar { display: none; }
.cx-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.625rem 0.75rem; border-radius: 0.75rem; min-height: 4.125rem; box-sizing: border-box; color: inherit; text-decoration: none; }
.cx-row:hover { background: var(--cx-ground); }
.cx-row--open, .cx-row--open:hover { background: var(--cx-tint-c); }
.cx-row--open .cx-row__s { color: var(--cx-on-tint-c); }
.cx-row__lab { flex: 1 1 auto; min-width: 0; }
.cx-row__lab > * { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-row__t { font-weight: 600; font-size: 0.9375rem; }
.cx-row--unread .cx-row__t { font-weight: 750; }
.cx-row__s { font-size: 0.84375rem; color: var(--cx-fg2); }
.cx-row__end { margin-left: auto; flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 0.375rem; font-size: 0.78rem; color: var(--cx-muted); font-variant-numeric: tabular-nums; }
.cx-dot { width: 0.5625rem; height: 0.5625rem; border-radius: 62.5rem; background: var(--md-sys-color-primary); flex: 0 0 auto; }
.cx-list__none { padding: 2rem 1rem; text-align: center; display: grid; justify-items: center; gap: 0.5rem; }
.cx-list__none p { margin: 0; }
.cx-none__icon { width: 4rem; height: 4rem; border-radius: 62.5rem; background: var(--cx-fill); display: grid; place-items: center; color: var(--cx-fg2); }
.cx-none__icon .material-symbols-rounded { font-size: 1.875rem; }
.cx-none__t { font-weight: 700; font-size: 1.0625rem; }
.cx-list__foot { flex: 0 0 auto; padding: 0.625rem 1.25rem 0.75rem; font-size: 0.78rem; color: var(--cx-muted); border-top: 1px solid var(--cx-sep2); display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.cx-pager { display: inline-flex; gap: 0.75rem; }
.cx-pager a { display: inline-flex; align-items: center; color: var(--md-sys-color-primary); font-weight: 600; text-decoration: none; }
.cx-pager .material-symbols-rounded { font-size: 1.125rem; }

/* ---------- the open contact ---------- */
.cx-detail { min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.cx-detail--none { align-items: center; justify-content: center; }
.cx-pick { display: grid; justify-items: center; gap: 0.5rem; text-align: center; padding: 2rem; }
.cx-pick p { margin: 0; }
.cx-detail__in { flex: 1 1 auto; min-height: 0; width: 100%; max-width: 72.5rem; margin: 0 auto; padding: 1.375rem 2rem 0; box-sizing: border-box;
  display: flex; flex-direction: column; gap: 1.125rem; }
.cx-back { display: none; }
.cx-head { flex: 0 0 auto; display: flex; align-items: center; gap: 1.125rem; }
.cx-head__lab { min-width: 0; }
.cx-head h1 { margin: 0; font-size: 1.75rem; font-weight: 750; letter-spacing: -0.02em; line-height: 1.15; overflow-wrap: anywhere; }
.cx-head__meta { display: flex; align-items: center; gap: 0.625rem; flex-wrap: wrap; margin-top: 0.375rem; font-size: 0.875rem; color: var(--cx-fg2); }
.cx-head__lender { display: inline-flex; align-items: center; gap: 0.4375rem; }
.cx-tag { min-height: 1.5rem; padding: 0.125rem 0.5625rem; box-sizing: border-box; border-radius: 0.4375rem; display: inline-flex; align-items: center; gap: 0.25rem;
  font-size: 0.78rem; font-weight: 700; background: rgb(233 233 238); color: var(--cx-fg2); }
.cx-tag--role { background: var(--cx-tint-c); color: var(--cx-on-tint-c); }
.cx-seg { display: none; }
.cx-cols { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); gap: 1.5rem; }
.cx-cols--one { grid-template-columns: minmax(0, 45rem); }
.cx-col { min-height: 0; display: flex; flex-direction: column; }
.cx-colh { flex: 0 0 auto; display: flex; align-items: center; gap: 0.625rem; min-height: 2rem; margin-bottom: 0.5rem; }
.cx-colh h2 { margin: 0; font-size: 1.0625rem; font-weight: 700; letter-spacing: -0.01em; }
.cx-colh .cx-small { margin-left: auto; }
.cx-col__body { flex: 1 1 auto; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 0.75rem; padding-bottom: 1.5rem; scrollbar-width: none; }
.cx-col__body::-webkit-scrollbar { display: none; }
.cx-sec { display: flex; flex-direction: column; gap: 0.5rem; flex: 0 0 auto; }
.cx-hdr { margin: 0.375rem 0.25rem 0; font-size: 0.75rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.05em; color: var(--cx-muted); }
.cx-tabhdr { margin: 0.75rem 0.25rem 0; font-size: 0.9375rem; font-weight: 700; }
.cx-grp { background: var(--cx-card); border-radius: 0.875rem; overflow: hidden; flex: 0 0 auto; box-shadow: 0 1px 2px rgb(0 0 0 / 0.04); }
.cx-kv { margin: 0; }
.cx-kv__row { display: grid; grid-template-columns: 9.375rem minmax(0, 1fr); border-top: 1px solid var(--cx-sep2); }
.cx-kv__row:first-child { border-top: 0; }
.cx-kv dt, .cx-kv dd { margin: 0; padding: 0.8125rem 0; font-size: 0.90625rem; min-height: 3rem; box-sizing: border-box; display: flex; align-items: center; }
.cx-kv dt { color: var(--cx-fg2); padding-left: 1.125rem; padding-right: 0.75rem; }
.cx-kv dd { font-weight: 550; padding-right: 1.125rem; min-width: 0; overflow-wrap: anywhere; }
.cx-kv dd.long-text__body--plain { display: block; white-space: pre-line; }
.cx-kv__chips { flex-wrap: wrap; gap: 0.375rem; }
.cx-kv__empty { color: var(--cx-muted); font-weight: 400; }
.cx-kv__link { color: var(--md-sys-color-primary); display: inline-flex; align-items: center; gap: 0.375rem; text-decoration: none; min-width: 0; }
.cx-kv__link:hover { text-decoration: underline; }
.cx-kv__link .material-symbols-rounded { font-size: 1rem; }
.cx-person { display: flex; align-items: center; gap: 0.75rem; padding: 0 1.125rem; min-height: 3.25rem; position: relative; }
.cx-person + .cx-person::before { content: ""; position: absolute; top: 0; right: 0; left: 1.125rem; border-top: 1px solid var(--cx-sep2); }
.cx-person__lab { flex: 1 1 auto; min-width: 0; padding: 0.75rem 0; display: grid; }
.cx-person__t { font-weight: 600; }
.cx-person__s { font-size: 0.84375rem; color: var(--cx-fg2); }
.cx-foot { margin: 0 0.25rem; font-size: 0.8125rem; line-height: 1.45; color: var(--cx-muted); }
.cx-nameonly { display: grid; justify-items: center; gap: 0.5rem; text-align: center; padding: 3rem 2rem; }
.cx-nameonly p { margin: 0; max-width: 28rem; }
.cx-nameonly .cx-small { font-size: 0.875rem; line-height: 1.5; }

/* ---------- tablet: 37.5–67.5rem ---------- */
@media (max-width: 67.4375rem) {
  .portal__me-name { display: none; }
  .cx-split { grid-template-columns: 19.75rem minmax(0, 1fr); }
  .cx-detail__in { padding: 1.375rem 1.5rem 0; }
  .cx-seg { flex: 0 0 auto; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); padding: 0.1875rem; border-radius: 0.625rem; background: var(--cx-fill); }
  .cx-seg button { height: 2.1875rem; border: 0; border-radius: 0.5rem; background: none; font: inherit; font-size: 0.875rem; font-weight: 600; color: inherit; cursor: pointer; }
  .cx-seg button.cx-seg--on { background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 0.12); }
  .cx-cols, .cx-cols--one { grid-template-columns: minmax(0, 1fr); }
  .cx-cols[data-tab="details"] .cx-col--notes, .cx-cols[data-tab="notes"] .cx-col--details { display: none; }
  .cx-cols[data-tab] .cx-colh h2 { display: none; }
  .cx-cols[data-tab] .cx-colh .cx-small { margin-left: 0.25rem; }
}

/* ---------- phone: under 37.5rem — the app's screens, one pane at a time ---------- */
@media (max-width: 37.4375rem) {
  .portal { height: auto; padding-bottom: calc(4rem + env(safe-area-inset-bottom, 0px)); } /* reset.css's 100% body would end at the viewport */
  .portal__bar { height: 3.25rem; padding: 0 1rem; background: transparent; border-bottom: 0; }
  .portal__bar:has(.portal__picker) .portal__brand, .portal__nav, .portal__me, .portal__spacer { display: none; }
  .portal__pick { border: 0; padding: 0; color: var(--md-sys-color-primary); background: none; font-size: 1rem; }
  .portal__pick:hover, .portal__pick[aria-expanded="true"] { background: none; }
  .portal__pick .material-symbols-rounded { color: var(--md-sys-color-primary); }
  .portal__pop--picker { position: fixed; left: 0.75rem; right: 0.75rem; top: 3.25rem; width: auto; }
  .portal:has(.cx-split--open) .portal__bar { display: none; }
  .portal__tabs { display: grid; grid-template-columns: repeat(3, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
    height: calc(4rem + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px); box-sizing: border-box;
    background: rgb(249 249 249 / 0.94); backdrop-filter: blur(1rem); border-top: 1px solid var(--cx-sep); }
  .portal__tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.125rem; font-size: 0.6875rem; font-weight: 600;
    color: var(--cx-fg2); text-decoration: none; }
  .portal__tabs a .material-symbols-rounded { font-size: 1.625rem; }
  .portal__tabs a.portal__tab--on { color: var(--md-sys-color-primary); }
  .portal__tabs a.portal__tab--on .material-symbols-rounded { font-variation-settings: 'FILL' 1; }
  .portal__tab-icon { position: relative; display: inline-flex; }
  .portal__tab-icon .portal__count { position: absolute; top: -0.375rem; right: -0.75rem; box-shadow: 0 0 0 2px rgb(249 249 249); }
  .portal__main { padding: 1rem; }
  .portal__main--split { padding: 0; }
  .cx-split { display: block; height: auto; }
  .cx-split--open > .cx-list, .cx-split:not(.cx-split--open) > .cx-detail { display: none; }
  .cx-list { background: transparent; border-right: 0; }
  .cx-list__head { padding: 0 1rem 0.75rem; }
  .cx-list__title { flex-direction: column; gap: 0.125rem; }
  .cx-list__title h1 { font-size: 2.125rem; }
  .cx-filter { left: 0; right: 0; }
  .cx-list__rows { overflow: visible; margin: 0 1rem; padding: 0; background: var(--cx-card); border-radius: 0.875rem; }
  .cx-row { border-radius: 0; padding: 0.625rem 1rem; position: relative; }
  .cx-row + .cx-row::before { content: ""; position: absolute; top: 0; right: 0; left: 4.25rem; border-top: 1px solid var(--cx-sep2); }
  .cx-row--open { background: none; }
  .cx-list__foot { border-top: 0; padding: 0.75rem 2rem; justify-content: center; flex-wrap: wrap; }
  .cx-detail { overflow: visible; }
  .cx-detail__in { padding: 0 1rem 1rem; gap: 1rem; }
  .cx-back { display: flex; align-items: center; gap: 1.5rem; position: sticky; top: 0; z-index: 4; margin: 0 -1rem; padding: 0 1rem; height: 3.25rem;
    background: rgb(249 249 249 / 0.94); backdrop-filter: blur(1rem); border-bottom: 1px solid var(--cx-sep); }
  .cx-back a { display: inline-flex; align-items: center; color: var(--md-sys-color-primary); font-size: 1.0625rem; text-decoration: none; margin-left: -0.375rem; }
  .cx-back__t { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cx-head { align-items: flex-start; gap: 0.875rem; }
  .cx-av--xl { width: 4rem; height: 4rem; font-size: 1.4375rem; }
  .cx-head h1 { font-size: 1.5rem; }
  .cx-head__meta { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .cx-col__body { overflow: visible; padding-bottom: 0.5rem; }
  .cx-kv__row { grid-template-columns: 7.5rem minmax(0, 1fr); }
  .cx-kv dt { padding-left: 1rem; }
  .cx-kv dd { padding-right: 1rem; }
}

.portal__links { display: inline-flex; gap: var(--space-3, 0.75rem); }
.portal__narrow { max-width: 26rem; margin: var(--space-8, 2rem) auto 0; display: grid; gap: var(--space-4, 1rem); }
.portal__narrow h1 { margin: 0; font-size: 1.5rem; }
.portal__stack { display: grid; gap: var(--space-3, 0.75rem); }
.portal__or { text-align: center; }
/* it-1450: the sign-in with a code */
.portal__card { padding: var(--space-6, 1.5rem); }
.portal__lede { margin: 0; }
.portal__fine { margin: 0; font-size: 0.8125rem; }
.portal__back { justify-self: start; }
.portal__h2 { margin: 0; font-size: 1.1rem; }
.portal__actions--center { justify-content: center; }
/* it-1490: Delete my sign-in */
.portal__danger { color: var(--md-sys-color-error); justify-self: start; }
.portal__danger-btn { background: var(--md-sys-color-error); color: var(--md-sys-color-on-error); }
.portal__list { margin: 0; padding-left: 1.25rem; display: grid; gap: var(--space-1, 0.25rem); }
.portal__toolbar { display: flex; align-items: center; gap: var(--space-3, 0.75rem); flex-wrap: wrap; }
.portal__toolbar h1 { margin: 0 auto 0 0; font-size: 1.5rem; }
.portal__toolbar .pill-search { min-width: 16rem; }
.portal__rows { list-style: none; margin: 0; padding: 0; }
.portal__row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4, 1rem); padding: var(--space-3, 0.75rem) 0; border-bottom: 1px solid var(--md-sys-color-outline-variant); }
.portal__row:last-child { border-bottom: 0; }
.portal__row a { font-weight: 500; }
.portal__pager { display: flex; justify-content: space-between; }
.portal__account dl { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-2, 0.5rem) var(--space-4, 1rem); margin: 0; }
.portal__account dt { color: var(--md-sys-color-on-surface-variant); }
.portal__account dd { margin: 0; }
.portal__actions { display: flex; gap: var(--space-2, 0.5rem); flex-wrap: wrap; }
.portal__actions form { margin: 0; }
.portal-note { padding: var(--space-3, 0.75rem) 0; border-bottom: 1px solid var(--md-sys-color-outline-variant); }
.portal-note:last-child { border-bottom: 0; }

/* it-1440 (BPDGo#550): what's new for a partner — the Notes count, unread dots, the order, the Notes inbox. */
.portal__when { display: inline-flex; align-items: center; gap: var(--space-2, 0.5rem); min-width: 5.5rem; justify-content: flex-end; font-size: 0.85rem; color: var(--md-sys-color-on-surface-variant); white-space: nowrap; }
.portal__dot { width: 0.5625rem; height: 0.5625rem; border-radius: 62.5rem; background: var(--md-sys-color-primary); flex: 0 0 auto; }
.portal__row.portal__row--unread > a, .portal__row--unread .portal__inbox-who { font-weight: 700; }
.portal__new { display: inline-block; padding: 0 0.375rem; border-radius: 0.375rem; font-size: 0.72rem; font-weight: 700; background: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container); }
.portal__seg { display: inline-flex; margin-left: auto; padding: 0.1875rem; border-radius: 0.625rem; background: var(--md-sys-color-surface-container-high); }
.portal__seg a { padding: 0.375rem 0.875rem; border-radius: 0.5rem; font-weight: 600; font-size: 0.9rem; color: var(--md-sys-color-on-surface); text-decoration: none; }
.portal__seg a.portal__seg--on { background: var(--md-sys-color-surface); box-shadow: var(--md-sys-elevation-level1, 0 1px 2px rgb(0 0 0 / 0.12)); }
.portal__inbox { padding: 0.5rem 1.5rem; }
.portal__inbox-row { border-bottom: 1px solid var(--md-sys-color-outline-variant); }
.portal__inbox-row:last-child { border-bottom: 0; }
.portal__inbox-row a { display: grid; gap: 0.125rem; padding: var(--space-3, 0.75rem) 0; color: inherit; text-decoration: none; }
.portal__inbox-head { display: flex; align-items: baseline; gap: var(--space-3, 0.75rem); }
.portal__inbox-who { margin-right: auto; font-weight: 600; }
.portal__snippet { color: var(--md-sys-color-on-surface-variant); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.portal__kind { font-size: 0.8rem; }
.portal__empty { padding: 1rem 0; margin: 0; }
@media (max-width: 45rem) { .portal__seg { margin-left: 0; } .portal__when { min-width: 0; } }

/* it-1460 (BPDGo#533): the partner writes notes and replies. */
.portal-compose { display: grid; gap: var(--space-2, 0.5rem); padding: var(--space-2, 0.5rem) 0 var(--space-3, 0.75rem); border-bottom: 1px solid var(--md-sys-color-outline-variant); }
.portal-compose__label { font-weight: 600; font-size: 0.9rem; }
.portal-compose textarea, .portal-note__act textarea { width: 100%; box-sizing: border-box; padding: 0.625rem 0.75rem; border-radius: 0.75rem; border: 1px solid var(--md-sys-color-outline); background: var(--md-sys-color-surface); color: var(--md-sys-color-on-surface); font: inherit; resize: vertical; }
.portal-compose textarea:focus, .portal-note__act textarea:focus { outline: 2px solid var(--md-sys-color-primary); outline-offset: -1px; }
.portal-compose__bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3, 0.75rem); flex-wrap: wrap; }
.portal-compose__who { display: inline-flex; align-items: center; gap: 0.375rem; font-size: 0.82rem; }
.portal-compose__who .material-symbols-rounded { font-size: 1.05rem; }
.portal-note__head { display: flex; align-items: center; gap: var(--space-2, 0.5rem); font-size: 0.85rem; flex-wrap: wrap; }
.portal-note__kind { margin-left: auto; padding: 0 0.5rem; border-radius: 0.375rem; font-size: 0.75rem; font-weight: 700; background: var(--md-sys-color-surface-container-high); color: var(--md-sys-color-on-surface-variant); }
.portal-note--own { background: var(--md-sys-color-primary-container); border-radius: 0.75rem; padding-left: var(--space-3, 0.75rem); padding-right: var(--space-3, 0.75rem); }
.portal-note__reply { font-size: 0.82rem; font-style: italic; margin: 0.125rem 0 0.25rem; }
.portal-note__act { margin-top: var(--space-2, 0.5rem); }
.portal-note__act summary { cursor: pointer; color: var(--md-sys-color-primary); font-weight: 600; font-size: 0.88rem; width: max-content; }
.portal-note__act form { display: grid; gap: var(--space-2, 0.5rem); margin-top: var(--space-2, 0.5rem); }
