/* =============================================================================
   19z — CLIENT PORTAL · QUALITY / POLISH PASS (2026-10-08)
   -----------------------------------------------------------------------------
   Loads LAST among the client partials (glob loader sorts "19z-" after "19-").
   Every rule is scoped to  body.portal-shell.portal-dash-body  (client shell
   only: the firm shell and the login page never carry .portal-dash-body), so it
   cannot leak to the firm dashboard or the marketing site.

   Re-skin only. Fixes the leaks/collisions that made the July re-skin look off:
     - style.css's marketing mega-menu `.panel{padding:28px 30px}` leaking into
       every portal card (the "huge gap above panel headings");
     - global h3 margins inside .panel-head;
     - `.sb-nav li a span{flex:1}` stretching the count badges into wide pills;
     - topbar flex-shrinking to 42px inside the overflow:hidden .main column;
     - two competing search-pill skins (wrapper pill + bordered input).
   Plus a consistent spacing/radius scale, compact mobile tables, focus rings.

   Scale: 4 · 8 · 12 · 16 · 20 · 24 · 32   Radii: card 14 · control 10 · pill 999
   ============================================================================= */

body.portal-shell.portal-dash-body{
	--cp-card-r:14px;
	--cp-ctl-r:10px;
	--cp-pad:22px;
	--cp-gap:20px;
	--cp-ring:0 0 0 3px rgba(38,64,141,.28);
	background:#f5f6fa;
}

/* ---------- Focus visibility (WCAG 2.4.7) --------------------------------- */
body.portal-shell.portal-dash-body a:focus-visible,
body.portal-shell.portal-dash-body button:focus-visible,
body.portal-shell.portal-dash-body summary:focus-visible,
body.portal-shell.portal-dash-body [tabindex]:focus-visible{
	outline:2px solid var(--blue);outline-offset:2px;border-radius:6px;
}
body.portal-shell.portal-dash-body .sidebar a:focus-visible,
body.portal-shell.portal-dash-body .mob-sidebar a:focus-visible,
body.portal-shell.portal-dash-body .mob-sidebar button:focus-visible{
	outline:2px solid #fff;outline-offset:-2px;
}

/* =============================================================================
   1. SHELL — columns, sidebar
   ============================================================================= */
body.portal-shell.portal-dash-body .portal{grid-template-columns:256px minmax(0,1fr)}
/* overflow:hidden made .main a scroll container, which (a) let the topbar shrink
   and (b) broke position:sticky. clip keeps the horizontal guard without that. */
body.portal-shell.portal-dash-body .main{overflow:clip;overflow-x:clip}
@supports not (overflow:clip){
	body.portal-shell.portal-dash-body .main{overflow:visible}
}

body.portal-shell.portal-dash-body .sidebar{padding:24px 14px 18px}
body.portal-shell.portal-dash-body .sb-logo{padding:0 10px 20px;margin-bottom:16px}
body.portal-shell.portal-dash-body .sb-section{padding:0 12px 8px;font-size:10.5px;letter-spacing:.14em}

body.portal-shell.portal-dash-body .sb-nav{gap:2px}
body.portal-shell.portal-dash-body .sb-nav li a{
	gap:12px;padding:10px 12px;min-height:42px;box-sizing:border-box;
	font-size:14px;line-height:1.3;border-radius:9px;
}
/* Label: one line, never squeezed by the badge. */
body.portal-shell.portal-dash-body .sb-nav li a > span:not(.sb-badge){
	flex:1 1 auto;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
/* Count chip: compact, neutral by default; red only for things needing action. */
body.portal-shell.portal-dash-body .sb-nav li a .sb-badge{
	flex:0 0 auto;margin-left:auto;min-width:20px;height:20px;padding:0 6px;box-sizing:border-box;
	display:inline-flex;align-items:center;justify-content:center;
	border-radius:999px;font-size:11px;font-weight:700;line-height:1;letter-spacing:0;
	font-variant-numeric:tabular-nums;
	background:rgba(255,255,255,.14);color:#fff;
}
body.portal-shell.portal-dash-body .sb-nav li a .sb-badge--urgent{background:var(--red);color:#fff}
body.portal-shell.portal-dash-body .sb-nav li a.active .sb-badge:not(.sb-badge--urgent){background:rgba(255,255,255,.22)}
body.portal-shell.portal-dash-body .sb-nav li a.active{background:rgba(237,28,36,.2)}
body.portal-shell.portal-dash-body .sb-nav li a:hover{background:rgba(255,255,255,.08)}
/* Sign Out sits apart from the destinations. */
body.portal-shell.portal-dash-body .sb-nav li.sb-nav-signout{margin-top:10px;padding-top:10px;border-top:1px solid rgba(255,255,255,.08)}
body.portal-shell.portal-dash-body .sb-nav li.sb-nav-signout a{color:rgba(255,255,255,.66)}
body.portal-shell.portal-dash-body .sb-nav li.sb-nav-signout a:hover{color:#fff}

/* Sidebar footer: full person name (2 lines allowed) + organisation. */
body.portal-shell.portal-dash-body .sb-bottom{padding:14px 6px 0}
body.portal-shell.portal-dash-body .sb-user{gap:10px;padding:6px;align-items:center}
body.portal-shell.portal-dash-body .sb-user-info{flex:1;min-width:0}
body.portal-shell.portal-dash-body .sb-user-info .name{
	white-space:normal;line-height:1.3;font-size:13.5px;
	display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;
}
body.portal-shell.portal-dash-body .sb-user-info .role{
	white-space:normal;line-height:1.35;margin-top:2px;color:rgba(255,255,255,.62);
	display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;
}

/* =============================================================================
   2. TOPBAR
   ============================================================================= */
body.portal-shell.portal-dash-body .topbar{
	flex:0 0 auto;height:72px;min-height:72px;box-sizing:border-box;
	padding:0 32px;gap:24px;box-shadow:none;border-bottom:1px solid var(--hair);
	background:rgba(255,255,255,.96);
}
@supports (backdrop-filter:blur(8px)){
	body.portal-shell.portal-dash-body .topbar{background:rgba(255,255,255,.88);backdrop-filter:saturate(1.4) blur(10px)}
}
/* A partial set overflow:hidden on the topbar, clipping the search + bell dropdowns. */
body.portal-shell.portal-dash-body .topbar{overflow:visible}
body.portal-shell.portal-dash-body .topbar-left{min-width:0;display:flex;flex-direction:column;justify-content:center;gap:3px}
body.portal-shell.portal-dash-body .topbar-greeting{
	font-size:19px;line-height:1.2;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
body.portal-shell.portal-dash-body .topbar-date{font-size:12.5px;line-height:1.3;color:var(--mid)}
body.portal-shell.portal-dash-body .topbar-right{gap:12px;flex-shrink:0}

/* Search — ONE pill: the input is the pill, the wrapper is just positioning. */
body.portal-shell.portal-dash-body .tb-search,
body.portal-shell.portal-dash-body .tb-search[data-finlaw-search]{
	position:relative;display:block;width:300px;min-width:0;padding:0;margin:0;
	background:transparent;border:0;border-radius:0;box-shadow:none;
}
body.portal-shell.portal-dash-body .tb-search:focus-within{background:transparent;box-shadow:none;border:0}
body.portal-shell.portal-dash-body .tb-search > svg{
	position:absolute;left:14px;top:50%;transform:translateY(-50%);z-index:1;
	width:16px;height:16px;color:var(--mid);pointer-events:none;
}
body.portal-shell.portal-dash-body .tb-search input,
body.portal-shell.portal-dash-body .tb-search[data-finlaw-search] input{
	display:block;width:100%;height:40px;box-sizing:border-box;margin:0;
	padding:0 16px 0 40px;border:1px solid var(--hair);border-radius:999px;
	background:var(--grey-50);font-size:14px;line-height:38px;color:var(--ink);
	box-shadow:none;transition:border-color .18s var(--ease),background .18s var(--ease),box-shadow .18s var(--ease);
}
body.portal-shell.portal-dash-body .tb-search input::placeholder{color:#6b7280;opacity:1}
body.portal-shell.portal-dash-body .tb-search input:hover{border-color:#cfd5e3}
body.portal-shell.portal-dash-body .tb-search input:focus,
body.portal-shell.portal-dash-body .tb-search[data-finlaw-search] input:focus{
	outline:none;background:#fff;border-color:var(--blue);box-shadow:var(--cp-ring);
}

/* Bell + avatar: same 40px hit area, aligned on the same centre line. */
body.portal-shell.portal-dash-body .topbar .tb-icon,
body.portal-shell.portal-dash-body .topbar .fl-bell{
	width:40px;height:40px;border-radius:50%;border:1px solid transparent;background:transparent;
}
body.portal-shell.portal-dash-body .topbar .tb-icon:hover,
body.portal-shell.portal-dash-body .topbar .fl-bell:hover{background:var(--grey-50);border-color:var(--hair)}
body.portal-shell.portal-dash-body .topbar .tb-icon svg{color:var(--blue-ink)}
body.portal-shell.portal-dash-body .tb-avatar-fallback{
	width:36px;height:36px;font-size:12.5px;letter-spacing:.02em;
	background:var(--blue-ink);color:#fff;cursor:default;
}

/* =============================================================================
   3. CONTENT FRAME + PAGE HEADER
   ============================================================================= */
body.portal-shell.portal-dash-body .content{padding:32px 36px 56px;box-sizing:border-box;width:100%;max-width:1400px}
body.portal-shell.portal-dash-body .content .section-eyebrow{margin:0 0 8px;font-size:11.5px;line-height:1.2}
body.portal-shell.portal-dash-body .content .section-title{margin:0 0 24px;font-size:30px;line-height:1.15}
body.portal-shell.portal-dash-body .content .section-eyebrow a{color:inherit}
body.portal-shell.portal-dash-body .content .section-eyebrow a:hover{color:var(--blue-ink)}

/* =============================================================================
   4. PANELS (the shared .panel / .panel-head used by every client view)
   ============================================================================= */
body.portal-shell.portal-dash-body .content .panel{
	padding:0;margin:0 0 var(--cp-gap);border-radius:var(--cp-card-r);
	border:1px solid var(--hair);background:#fff;
	box-shadow:0 1px 2px rgba(21,34,77,.05);
}
body.portal-shell.portal-dash-body .content .panel:empty{display:none !important}
body.portal-shell.portal-dash-body .content .panel-head{
	display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;
	padding:16px var(--cp-pad);min-height:60px;box-sizing:border-box;margin:0;
	border-bottom:1px solid var(--hair);
}
body.portal-shell.portal-dash-body .content .panel-head h2,
body.portal-shell.portal-dash-body .content .panel-head h3{
	margin:0;padding:0;font-size:17px;line-height:1.3;
}
body.portal-shell.portal-dash-body .content .panel-head .view-all{
	margin-left:auto;display:inline-flex;align-items:center;gap:5px;
	font-size:13px;font-weight:600;line-height:1.3;color:var(--blue);
	padding:6px 10px;margin-right:-10px;border-radius:8px;
}
body.portal-shell.portal-dash-body .content .panel-head .view-all:hover{background:var(--blue-pale);color:var(--blue-ink)}

/* Empty states — one recipe everywhere. */
body.portal-shell.portal-dash-body .content .portal-empty{
	padding:40px 24px;display:flex;flex-direction:column;align-items:center;text-align:center;gap:10px;
}
body.portal-shell.portal-dash-body .content .portal-empty svg{
	width:44px;height:44px;padding:11px;box-sizing:border-box;margin:0;
	border-radius:12px;background:var(--grey-50);color:#8a93a6;
}
body.portal-shell.portal-dash-body .content .portal-empty p{margin:0;font-size:14px;color:var(--mid);max-width:360px;line-height:1.5}

/* =============================================================================
   5. DATA TABLES
   ============================================================================= */
body.portal-shell.portal-dash-body .content .data-table th{
	background:#fafbfd;padding:11px 16px;font-size:11px;letter-spacing:.07em;font-weight:600;
	color:var(--mid);border-bottom:1px solid var(--hair);white-space:nowrap;
}
body.portal-shell.portal-dash-body .content .data-table td{padding:14px 16px;font-size:14px;line-height:1.45;vertical-align:middle}
body.portal-shell.portal-dash-body .content .data-table th:first-child,
body.portal-shell.portal-dash-body .content .data-table td:first-child{padding-left:var(--cp-pad)}
body.portal-shell.portal-dash-body .content .data-table th:last-child,
body.portal-shell.portal-dash-body .content .data-table td:last-child{padding-right:var(--cp-pad)}
body.portal-shell.portal-dash-body .content .data-table tbody tr:last-child td{border-bottom:0}
body.portal-shell.portal-dash-body .content .data-table tbody tr{transition:background .15s var(--ease)}
body.portal-shell.portal-dash-body .content .data-table tbody tr:hover td{background:#fafbfd}

/* Status pills + relative dates never wrap. */
body.portal-shell.portal-dash-body .content .badge,
body.portal-shell.portal-dash-body .content .rd-badge{white-space:nowrap;line-height:1.4;padding:3px 10px;font-size:12px}
body.portal-shell.portal-dash-body .content .data-table td[data-label="Status"],
body.portal-shell.portal-dash-body .content .data-table td[data-label="Updated"],
body.portal-shell.portal-dash-body .content .data-table td[data-label="Last Update"]{white-space:nowrap}
body.portal-shell.portal-dash-body .content .data-table td[data-label="Updated"],
body.portal-shell.portal-dash-body .content .data-table td[data-label="Last Update"]{font-size:13px;color:var(--mid)}

/* Badge palette — AA contrast on their tints (amber/green darkened a step). */
body.portal-shell.portal-dash-body .content .badge-pending,
body.portal-shell.portal-dash-body .content .rd-badge--pending{background:#fdf1dc;color:#9a5b05}
body.portal-shell.portal-dash-body .content .badge-active,
body.portal-shell.portal-dash-body .content .badge-paid,
body.portal-shell.portal-dash-body .content .rd-badge--active,
body.portal-shell.portal-dash-body .content .rd-badge--paid{background:#e6f4ec;color:#17704a}
body.portal-shell.portal-dash-body .content .badge-review,
body.portal-shell.portal-dash-body .content .rd-badge--review{background:#e9eef9;color:#26408d}
body.portal-shell.portal-dash-body .content .badge-closed,
body.portal-shell.portal-dash-body .content .rd-badge--closed{background:#eef0f4;color:#4b5263}
body.portal-shell.portal-dash-body .content .badge-due,
body.portal-shell.portal-dash-body .content .rd-badge--due{background:#fdecec;color:#b3141b}
body.portal-shell.portal-dash-body .content .rd-badge--overdue{background:#b3141b;color:#fff}

/* Matter title cell (dashboard + list). */
body.portal-shell.portal-dash-body .content .dt-title,
body.portal-shell.portal-dash-body .content .matter-title{font-weight:600;color:var(--blue-ink);font-size:14px;line-height:1.4}
body.portal-shell.portal-dash-body .content a.matter-title:hover{color:var(--red)}
body.portal-shell.portal-dash-body .content .dt-ref,
body.portal-shell.portal-dash-body .content .matter-ref{display:block;font-size:12px;color:var(--mid);margin-top:3px;font-variant-numeric:tabular-nums;letter-spacing:.01em}

/* =============================================================================
   6. DASHBOARD
   ============================================================================= */
body.portal-shell.portal-dash-body .view-dashboard .stat-grid{
	grid-template-columns:repeat(4,minmax(0,1fr));gap:var(--cp-gap);margin:0 0 24px;
}
body.portal-shell.portal-dash-body .view-dashboard .stat-card{
	padding:20px 22px;border-radius:var(--cp-card-r);box-shadow:0 1px 2px rgba(21,34,77,.05);
	display:grid;grid-template-columns:1fr auto;grid-template-areas:"num icon" "label label" "sub sub";align-items:start;
}
body.portal-shell.portal-dash-body .view-dashboard .stat-card .stat-icon{grid-area:icon;margin:0;width:36px;height:36px;border-radius:10px}
body.portal-shell.portal-dash-body .view-dashboard .stat-card .stat-icon svg{width:18px;height:18px}
body.portal-shell.portal-dash-body .view-dashboard .stat-card .stat-num{grid-area:num;font-size:34px;line-height:1;margin:2px 0 0}
body.portal-shell.portal-dash-body .view-dashboard .stat-card .stat-label{grid-area:label;margin-top:14px;font-size:13.5px;font-weight:600;line-height:1.3}
body.portal-shell.portal-dash-body .view-dashboard .stat-card .stat-sub{grid-area:sub;margin-top:3px;font-size:12.5px;line-height:1.4;color:var(--mid)}
body.portal-shell.portal-dash-body .view-dashboard .stat-card[data-accent="red"] .stat-sub{color:#b3141b;font-weight:600}

body.portal-shell.portal-dash-body .view-dashboard .dash-grid{
	grid-template-columns:minmax(0,1.65fr) minmax(300px,1fr);gap:var(--cp-gap);align-items:start;margin-bottom:var(--cp-gap);
}
body.portal-shell.portal-dash-body .view-dashboard .dash-grid > .panel{margin:0}

/* Recent matters: fixed columns so nothing reflows awkwardly. */
body.portal-shell.portal-dash-body .view-dashboard .data-table{table-layout:fixed;width:100%}
body.portal-shell.portal-dash-body .view-dashboard .data-table th:nth-child(1){width:40%}
body.portal-shell.portal-dash-body .view-dashboard .data-table th:nth-child(2){width:23%}
body.portal-shell.portal-dash-body .view-dashboard .data-table th:nth-child(3){width:18%}
body.portal-shell.portal-dash-body .view-dashboard .data-table th:nth-child(4){width:19%;text-align:right}
body.portal-shell.portal-dash-body .view-dashboard .data-table td:nth-child(2){font-size:13.5px;color:#3d4454;overflow-wrap:anywhere}
body.portal-shell.portal-dash-body .view-dashboard .data-table td:nth-child(4){text-align:right}
body.portal-shell.portal-dash-body .view-dashboard .data-table tbody tr{cursor:default}

/* Appointment + message lists on cards. */
body.portal-shell.portal-dash-body .content .appt-list,
body.portal-shell.portal-dash-body .content .msg-list,
body.portal-shell.portal-dash-body .content .doc-list{list-style:none;margin:0;padding:6px 0}
body.portal-shell.portal-dash-body .content .appt-item{padding:14px var(--cp-pad);gap:14px;align-items:flex-start;border-bottom:1px solid var(--grey-50)}
body.portal-shell.portal-dash-body .content .appt-item:last-child{border-bottom:0}
body.portal-shell.portal-dash-body .content .appt-date{width:52px;min-width:52px;height:56px;border-radius:12px;background:var(--blue-pale);gap:2px}
body.portal-shell.portal-dash-body .content .appt-date .day{font-size:21px;font-weight:800;color:var(--blue-ink)}
body.portal-shell.portal-dash-body .content .appt-date .mon{font-size:10.5px;color:var(--blue);letter-spacing:.08em}
body.portal-shell.portal-dash-body .content .appt-item--past .appt-date{background:var(--grey-50)}
body.portal-shell.portal-dash-body .content .appt-item--past .appt-date .day{color:#4b5263}
body.portal-shell.portal-dash-body .content .appt-item--past .appt-date .mon{color:var(--mid)}
body.portal-shell.portal-dash-body .content .appt-info{flex:1;min-width:0}
body.portal-shell.portal-dash-body .content .appt-info .title{font-size:14.5px;line-height:1.4;font-weight:600;color:var(--blue-ink)}
body.portal-shell.portal-dash-body .content .appt-info .sub{font-size:13px;line-height:1.45;margin-top:3px;color:var(--mid);display:flex;align-items:center;gap:5px;flex-wrap:wrap}
body.portal-shell.portal-dash-body .content .appt-info .sub svg{margin:0;flex-shrink:0}

body.portal-shell.portal-dash-body .content .msg-item{
	padding:14px var(--cp-pad);gap:12px;align-items:flex-start;border-left:0;border-bottom:1px solid var(--grey-50);
	background:#fff;position:relative;
}
body.portal-shell.portal-dash-body .content .msg-item:last-child{border-bottom:0}
body.portal-shell.portal-dash-body .content .msg-item:hover{background:#fafbfd}
body.portal-shell.portal-dash-body .content .msg-item.unread,
body.portal-shell.portal-dash-body .content .msg-item.unread:hover{background:#f6f8fd;border-left:0}
body.portal-shell.portal-dash-body .content .msg-item.unread::before{
	content:"";position:absolute;left:0;top:12px;bottom:12px;width:3px;border-radius:0 3px 3px 0;background:var(--red);
}
body.portal-shell.portal-dash-body .content .msg-av{width:38px;height:38px;background:var(--blue-pale);color:var(--blue)}
body.portal-shell.portal-dash-body .content .msg-item.unread .msg-av{background:var(--blue-ink);color:#fff}
body.portal-shell.portal-dash-body .content .msg-top{align-items:baseline;gap:12px}
body.portal-shell.portal-dash-body .content .msg-name{font-size:14px;font-weight:600;color:var(--blue-ink);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body.portal-shell.portal-dash-body .content .msg-item.unread .msg-name{font-weight:700}
body.portal-shell.portal-dash-body .content .msg-time{font-size:12px;color:var(--mid);white-space:nowrap}
body.portal-shell.portal-dash-body .content .msg-preview{font-size:13.5px;line-height:1.45;margin-top:3px;color:#4b5263}
body.portal-shell.portal-dash-body .content .msg-item.unread .msg-preview{color:var(--ink)}
/* Dashboard + inbox unread marker: a small dot (count pill only when it has text). */
body.portal-shell.portal-dash-body .view-dashboard .unread-dot{
	width:8px;height:8px;min-width:8px;padding:0;border-radius:50%;background:var(--red);
	margin:0;font-size:0;flex-shrink:0;align-self:center;
}

/* =============================================================================
   7. MATTERS LIST + DETAIL
   ============================================================================= */
body.portal-shell.portal-dash-body .content .matters-toolbar{margin:0 0 16px;gap:12px;align-items:center}
body.portal-shell.portal-dash-body .content .mt-chip,
body.portal-shell.portal-dash-body .content .activity-chip,
body.portal-shell.portal-dash-body .content .inv-chip{
	height:34px;padding:0 14px;border-radius:999px;font-size:13px;font-weight:600;line-height:32px;box-sizing:border-box;
}
body.portal-shell.portal-dash-body .content .mt-practice{
	height:38px;padding:0 36px 0 14px;border-radius:var(--cp-ctl-r);border:1px solid var(--hair);font-size:13.5px;
	background-color:#fff;max-width:280px;
}
body.portal-shell.portal-dash-body .content .mt-count{font-size:13px;color:var(--mid);white-space:nowrap}
body.portal-shell.portal-dash-body .content .matters-table td[data-label="Lawyer"]{white-space:nowrap}
body.portal-shell.portal-dash-body .content .matters-table td[data-label="Practice Area"]{font-size:13.5px;color:#3d4454}
body.portal-shell.portal-dash-body .content .matters-table td:last-child{text-align:right}
body.portal-shell.portal-dash-body .content .matters-table th:last-child{text-align:right}

/* Matter detail: key/value table reads like a definition list. */
body.portal-shell.portal-dash-body .content .panel > .data-table:not(.matters-table) tbody td:first-child[style]{
	width:200px;font-size:12px !important;text-transform:uppercase;letter-spacing:.07em;color:var(--mid) !important;
}

/* Documents */
body.portal-shell.portal-dash-body .content .doc-item{padding:12px var(--cp-pad);gap:14px;border-bottom:1px solid var(--grey-50)}
body.portal-shell.portal-dash-body .content .doc-item:last-child{border-bottom:0}
body.portal-shell.portal-dash-body .content .doc-item:hover{background:#fafbfd}
body.portal-shell.portal-dash-body .content .doc-icon{width:40px;height:40px;border-radius:10px;background:var(--blue-pale);color:var(--blue);flex-shrink:0;display:flex;align-items:center;justify-content:center}
body.portal-shell.portal-dash-body .content .doc-info{flex:1;min-width:0}
body.portal-shell.portal-dash-body .content .doc-name{font-size:14px;font-weight:600;color:var(--blue-ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body.portal-shell.portal-dash-body .content .doc-meta{font-size:12.5px;color:var(--mid);margin-top:3px;line-height:1.4}
body.portal-shell.portal-dash-body .content .doc-dl{
	width:36px;height:36px;border-radius:10px;border:1px solid var(--hair);background:#fff;color:var(--blue);
	display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;transition:all .15s var(--ease);
}
body.portal-shell.portal-dash-body .content .doc-dl:hover{border-color:var(--blue);background:var(--blue-pale);color:var(--blue-ink)}
body.portal-shell.portal-dash-body .content .doc-group .panel-head h3{font-family:'Inter',system-ui,sans-serif;font-size:15px;font-weight:600}

/* Lawyer cell (photo + name) */
body.portal-shell.portal-dash-body .content .matter-lawyer img{display:block;flex-shrink:0;box-shadow:0 0 0 2px #fff,0 0 0 3px var(--hair)}
body.portal-shell.portal-dash-body .content .matter-lawyer-name{line-height:1.25;font-size:13.5px}

/* Invoices (markup owned by the features agent — styling only) */
body.portal-shell.portal-dash-body .content .portal-notice#inv-offline-note{
	font-size:14px;line-height:1.55;color:#3d4454;border-radius:var(--cp-ctl-r) !important;
	border-left-width:3px !important;padding:14px 18px !important;
}
body.portal-shell.portal-dash-body .content .inv-table .inv-num{white-space:nowrap;font-variant-numeric:tabular-nums}
body.portal-shell.portal-dash-body .content .inv-table .inv-date{white-space:nowrap;font-size:13px;color:var(--mid)}
body.portal-shell.portal-dash-body .content .inv-table td.rd-num{white-space:nowrap}

/* Notices + inline table links */
body.portal-shell.portal-dash-body .content .portal-notice{font-size:14px;line-height:1.55;color:#3d4454}
body.portal-shell.portal-dash-body .content .panel > .portal-notice{padding:14px var(--cp-pad) !important}
body.portal-shell.portal-dash-body .content .data-table td a:not([class]){color:var(--blue);font-weight:600}
body.portal-shell.portal-dash-body .content .data-table td a:not([class]):hover{color:var(--red)}

/* Matter-detail invoice actions (PDF / How to pay / Pay Now) */
body.portal-shell.portal-dash-body .content .data-table td.matter-inv-actions{text-align:right;white-space:nowrap}
body.portal-shell.portal-dash-body .content .data-table td.matter-inv-actions .fl-inv-actions{justify-content:flex-end}
body.portal-shell.portal-dash-body .content .panel > .portal-notice .fl-wa-btn,
body.portal-shell.portal-dash-body .content .panel > .portal-notice .fl-wa-wrap{margin-top:10px}

/* Profile identity card keeps its own padding (panel padding is reset above). */
body.portal-shell.portal-dash-body .content .panel.pf-identity{padding:20px var(--cp-pad)}

/* Activity feed: calmer unread state, readable rhythm. */
body.portal-shell.portal-dash-body .content .activity-card{border-radius:var(--cp-card-r);overflow:hidden;box-shadow:0 1px 2px rgba(21,34,77,.05)}
body.portal-shell.portal-dash-body .content .activity-item{padding:14px var(--cp-pad);align-items:center}
body.portal-shell.portal-dash-body .content .activity-item.is-unread{background:#f6f8fd}
body.portal-shell.portal-dash-body .content .activity-item:hover,
body.portal-shell.portal-dash-body .content .activity-item.is-unread:hover{background:#eef2fa}
body.portal-shell.portal-dash-body .content .activity-msg{display:block;font-size:14px;line-height:1.45;font-weight:500}
body.portal-shell.portal-dash-body .content .activity-item.is-unread .activity-msg{font-weight:600;color:var(--blue-ink)}
body.portal-shell.portal-dash-body .content .activity-icon{width:36px;height:36px}
body.portal-shell.portal-dash-body .content .activity-daylabel{font-size:11px;letter-spacing:.1em;color:var(--mid)}

/* Profile + activity measures: a little wider than July (cards felt cramped). */
body.portal-shell.portal-dash-body .content .pf-profile{max-width:760px}
body.portal-shell.portal-dash-body .content .activity-wrap,
body.portal-shell.portal-dash-body .content .activity-head,
body.portal-shell.portal-dash-body .content .activity-toolbar,
body.portal-shell.portal-dash-body .content .activity-empty{max-width:880px}
body.portal-shell.portal-dash-body .content .activity-head .section-title{margin:0}

/* Forms inside client panels — 40px+ controls, one radius, visible focus. */
body.portal-shell.portal-dash-body .content .field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
body.portal-shell.portal-dash-body .content .field select,
body.portal-shell.portal-dash-body .content .field textarea,
body.portal-shell.portal-dash-body .content .msg-compose select,
body.portal-shell.portal-dash-body .content .msg-compose textarea{
	border-radius:var(--cp-ctl-r);border:1px solid #d6dbe6;font-size:14.5px;
}
body.portal-shell.portal-dash-body .content .field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
body.portal-shell.portal-dash-body .content .field select,
body.portal-shell.portal-dash-body .content .msg-compose select{min-height:44px}
body.portal-shell.portal-dash-body .content .field input:focus,
body.portal-shell.portal-dash-body .content .field select:focus,
body.portal-shell.portal-dash-body .content .field textarea:focus,
body.portal-shell.portal-dash-body .content .msg-compose select:focus,
body.portal-shell.portal-dash-body .content .msg-compose textarea:focus{
	outline:none;border-color:var(--blue);box-shadow:var(--cp-ring);
}
body.portal-shell.portal-dash-body .content .field label{font-size:13px;font-weight:600;color:var(--blue-ink)}
body.portal-shell.portal-dash-body .content .btn-view{border-radius:var(--cp-ctl-r);height:36px;padding:0 14px;box-sizing:border-box;white-space:nowrap}

/* =============================================================================
   8. RESPONSIVE
   ============================================================================= */
@media (max-width:1240px){
	body.portal-shell.portal-dash-body .view-dashboard .stat-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
	body.portal-shell.portal-dash-body .tb-search,
	body.portal-shell.portal-dash-body .tb-search[data-finlaw-search]{width:240px}
}
@media (max-width:1100px){
	body.portal-shell.portal-dash-body .view-dashboard .dash-grid{grid-template-columns:minmax(0,1fr)}
}
@media (max-width:900px){
	body.portal-shell.portal-dash-body .portal{grid-template-columns:minmax(0,1fr)}
	body.portal-shell.portal-dash-body .topbar{padding:0 20px 0 24px;height:64px;min-height:64px}
	body.portal-shell.portal-dash-body .content{padding:24px 24px 48px}
	body.portal-shell.portal-dash-body .mob-menu-btn{width:40px;height:40px;border-radius:10px}
	body.portal-shell.portal-dash-body .mob-sidebar{width:280px;max-width:86vw;padding:20px 14px 24px}
	body.portal-shell.portal-dash-body .mob-sidebar .sb-logo{padding-top:44px !important}
	body.portal-shell.portal-dash-body .mob-sb-close{width:40px;height:40px;border-radius:10px;top:12px;right:12px}
}
@media (max-width:760px){
	/* Compact stacked rows instead of "LABEL ……… value" pseudo tables. */
	body.portal-shell.portal-dash-body .content .data-table tr{
		display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:12px;row-gap:6px;
		padding:14px 18px;border-bottom:1px solid var(--grey-50);
	}
	body.portal-shell.portal-dash-body .content .data-table tbody tr:last-child{border-bottom:0}
	body.portal-shell.portal-dash-body .content .data-table td,
	body.portal-shell.portal-dash-body .content .data-table td:first-child,
	body.portal-shell.portal-dash-body .content .data-table td:last-child{
		display:block;width:auto;padding:0;border:0;text-align:left;white-space:normal;
	}
	body.portal-shell.portal-dash-body .content .data-table td::before{display:none;content:none}
	body.portal-shell.portal-dash-body .content .data-table td:first-child{grid-column:1 / -1}
	body.portal-shell.portal-dash-body .content .data-table td[data-label="Status"]{grid-column:1;align-self:center}
	body.portal-shell.portal-dash-body .content .data-table td[data-label="Updated"],
	body.portal-shell.portal-dash-body .content .data-table td[data-label="Last Update"]{grid-column:2;text-align:right;align-self:center;white-space:nowrap}
	body.portal-shell.portal-dash-body .content .data-table td[data-label="Practice Area"],
	body.portal-shell.portal-dash-body .content .data-table td[data-label="Lawyer"]{grid-column:1 / -1;font-size:13px;color:var(--mid)}
	/* Matter detail key/value table keeps label + value side by side. */
	body.portal-shell.portal-dash-body .content .panel > .data-table:not(.matters-table) tbody tr{grid-template-columns:120px minmax(0,1fr)}
	body.portal-shell.portal-dash-body .content .panel > .data-table:not(.matters-table) tbody td:first-child{grid-column:1;width:auto;text-align:left;white-space:normal;align-self:center}
	body.portal-shell.portal-dash-body .content .panel > .data-table:not(.matters-table) tbody td + td{text-align:left;font-size:14px;color:var(--ink)}
	body.portal-shell.portal-dash-body .content .panel > .data-table:not(.matters-table) tbody td + td{grid-column:2}
	body.portal-shell.portal-dash-body .view-dashboard .data-table{table-layout:auto}
	body.portal-shell.portal-dash-body .content .matters-toolbar{flex-wrap:wrap}
	body.portal-shell.portal-dash-body .content .mt-chips{overflow-x:auto;flex-wrap:nowrap;max-width:100%;padding-bottom:2px;-webkit-overflow-scrolling:touch}
	body.portal-shell.portal-dash-body .content .mt-chip{flex:0 0 auto}
}
@media (max-width:760px){
	/* Invoice rows as compact cards: number + status / matter / amount + action / dates. */
	body.portal-shell.portal-dash-body .content .inv-table thead{display:none}
	body.portal-shell.portal-dash-body .content .inv-table,
	body.portal-shell.portal-dash-body .content .inv-table tbody{display:block;width:100%}
	body.portal-shell.portal-dash-body .content .inv-table tr.inv-row{
		display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);column-gap:12px;row-gap:4px;
		padding:14px 16px;border-bottom:1px solid var(--grey-50);
	}
	body.portal-shell.portal-dash-body .content .inv-table tr.inv-row td{display:block;padding:0;border:0;text-align:left;background:none}
	body.portal-shell.portal-dash-body .content .inv-table tr.inv-row td::before{display:none;content:none}
	body.portal-shell.portal-dash-body .content .inv-table tr.inv-row td:nth-child(1){grid-column:1;grid-row:1;font-weight:700;color:var(--blue-ink)}
	body.portal-shell.portal-dash-body .content .inv-table tr.inv-row td:nth-child(6){grid-column:2;grid-row:1;text-align:right}
	body.portal-shell.portal-dash-body .content .inv-table tr.inv-row td:nth-child(2){grid-column:1 / -1;grid-row:2;font-size:13.5px;color:#3d4454}
	body.portal-shell.portal-dash-body .content .inv-table tr.inv-row td:nth-child(3){grid-column:1 / -1;grid-row:3;font-size:16px;margin:4px 0 2px}
	body.portal-shell.portal-dash-body .content .inv-table tr.inv-row td:nth-child(3)::after{content:" TZS";font-size:11px;font-weight:600;color:var(--mid);letter-spacing:.04em}
	body.portal-shell.portal-dash-body .content .inv-table tr.inv-row td:nth-child(7){grid-column:1 / -1;grid-row:5;text-align:left;margin-top:8px}
	body.portal-shell.portal-dash-body .content .inv-table tr.inv-row td:nth-child(7) > *{vertical-align:middle;margin:0 12px 0 0}
	body.portal-shell.portal-dash-body .content .inv-table tr.inv-row td:nth-child(7):empty{display:none}
	body.portal-shell.portal-dash-body .content .inv-table tr.inv-row td:nth-child(4),
	body.portal-shell.portal-dash-body .content .inv-table tr.inv-row td:nth-child(5){grid-row:4;font-size:13px;white-space:nowrap}
	body.portal-shell.portal-dash-body .content .inv-table tr.inv-row td:nth-child(4){grid-column:1}
	body.portal-shell.portal-dash-body .content .inv-table tr.inv-row td:nth-child(5){grid-column:2;text-align:right}
	body.portal-shell.portal-dash-body .content .inv-table tr.inv-row td:nth-child(4)::before{display:block;content:"Issued";font-size:10.5px;font-weight:600;letter-spacing:.07em;text-transform:uppercase;color:var(--mid)}
	body.portal-shell.portal-dash-body .content .inv-table tr.inv-row td:nth-child(5)::before{display:block;content:"Due";font-size:10.5px;font-weight:600;letter-spacing:.07em;text-transform:uppercase;color:var(--mid)}
	body.portal-shell.portal-dash-body .content .inv-table tr.inv-empty-row:not([hidden]){display:block}
	body.portal-shell.portal-dash-body .content .inv-outstanding{max-width:none}
	body.portal-shell.portal-dash-body .content .data-table td.matter-inv-actions{grid-column:1 / -1;text-align:left;white-space:normal}
	body.portal-shell.portal-dash-body .content .data-table td.matter-inv-actions .fl-inv-actions{justify-content:flex-start}
	body.portal-shell.portal-dash-body .content .data-table td.matter-inv-actions:not(:has(a)){display:none}
}
@media (max-width:640px){
	body.portal-shell.portal-dash-body{--cp-pad:16px;--cp-gap:16px}
	body.portal-shell.portal-dash-body .content .doc-icon{align-self:flex-start}
	body.portal-shell.portal-dash-body .content .matters-toolbar .mt-right{width:100%;display:flex;align-items:center;gap:10px}
	body.portal-shell.portal-dash-body .content .matters-toolbar .mt-practice{flex:1 1 auto;min-width:0;max-width:none}
	body.portal-shell.portal-dash-body .content .activity-item{flex-wrap:wrap;align-items:flex-start;row-gap:2px}
	body.portal-shell.portal-dash-body .content .activity-body{flex:1 1 calc(100% - 60px)}
	body.portal-shell.portal-dash-body .content .activity-meta{margin-left:50px;padding-top:0}
	body.portal-shell.portal-dash-body .content .activity-head{align-items:center}
	body.portal-shell.portal-dash-body .topbar{padding:0 12px 0 16px;gap:10px;height:60px;min-height:60px}
	body.portal-shell.portal-dash-body .topbar-greeting{font-size:16px}
	body.portal-shell.portal-dash-body .topbar-date{font-size:11.5px}
	body.portal-shell.portal-dash-body .topbar-right{gap:6px}
	body.portal-shell.portal-dash-body .tb-avatar-fallback{display:none}
	body.portal-shell.portal-dash-body .content{padding:20px 16px 40px}
	body.portal-shell.portal-dash-body .content .section-title{font-size:25px;margin-bottom:18px}
	body.portal-shell.portal-dash-body .view-dashboard .stat-grid{gap:12px;margin-bottom:18px}
	body.portal-shell.portal-dash-body .view-dashboard .stat-card{padding:16px}
	body.portal-shell.portal-dash-body .view-dashboard .stat-card .stat-icon{width:30px;height:30px;border-radius:8px}
	body.portal-shell.portal-dash-body .view-dashboard .stat-card .stat-icon svg{width:16px;height:16px}
	body.portal-shell.portal-dash-body .view-dashboard .stat-card .stat-num{font-size:28px}
	body.portal-shell.portal-dash-body .view-dashboard .stat-card .stat-label{margin-top:10px;font-size:13px}
	body.portal-shell.portal-dash-body .view-dashboard .stat-card .stat-sub{font-size:12px}
	body.portal-shell.portal-dash-body .content .panel-head{min-height:54px;padding:12px 16px}
	body.portal-shell.portal-dash-body .content .panel-head .view-all{margin-right:-6px;padding:6px}
	body.portal-shell.portal-dash-body .content .doc-item{flex-wrap:wrap;row-gap:8px}
	body.portal-shell.portal-dash-body .content .doc-item .doc-info{flex-basis:calc(100% - 110px)}
	body.portal-shell.portal-dash-body .content .doc-item .badge{margin-left:54px !important;margin-right:auto !important}
	body.portal-shell.portal-dash-body .content .doc-name{white-space:normal;overflow-wrap:anywhere}
	body.portal-shell.portal-dash-body .content .appt-item{display:grid;grid-template-columns:52px minmax(0,1fr);column-gap:14px;row-gap:10px;align-items:start}
	body.portal-shell.portal-dash-body .content .appt-item > .appt-date{grid-column:1;grid-row:1 / span 2}
	body.portal-shell.portal-dash-body .content .appt-item > .appt-info{grid-column:2}
	body.portal-shell.portal-dash-body .content .appt-item > .btn-view{grid-column:2;justify-self:start;margin:0}
	body.portal-shell.portal-dash-body .content .appt-item > .appt-actions{grid-column:1 / -1;margin:0;width:auto}
}
@media (max-width:520px){
	/* Phone topbar: search takes the row (greeting is repeated by the page title). */
	body.portal-shell.portal-dash-body .topbar-left{display:none}
	body.portal-shell.portal-dash-body .topbar-right{flex:1 1 auto;min-width:0}
	body.portal-shell.portal-dash-body .tb-search,
	body.portal-shell.portal-dash-body .tb-search[data-finlaw-search]{display:block;flex:1 1 auto;width:auto;min-width:0}
	body.portal-shell.portal-dash-body .finlaw-search-panel{position:fixed;left:12px;right:12px;top:66px;width:auto;max-width:none}
}
@media (prefers-reduced-motion:reduce){
	body.portal-shell.portal-dash-body *{transition:none !important}
}
