/* Athena tokens (subset of athenaTheme.css) plus the few components the
   simplified Home needs. Identical in both spikes. Phone-first at 390px. */

/* The typefaces, shipped with the theme (ATHENA-STYLE.md, "Icons and fonts"): Figtree for text in
   three weights, JetBrains Mono for figures, both SIL Open Font License 1.1 (fonts/*-OFL.txt),
   copied from Fund OS's athenaTheme. Until these shipped, --sans named Figtree and every browser
   drew Helvetica or Arial instead. */
@font-face { font-family: 'Figtree'; font-style: normal; font-weight: 100 549; font-display: swap; src: url('fonts/Figtree-Medium.woff2') format('woff2'); }
@font-face { font-family: 'Figtree'; font-style: normal; font-weight: 550 749; font-display: swap; src: url('fonts/Figtree-Bold.woff2') format('woff2'); }
@font-face { font-family: 'Figtree'; font-style: normal; font-weight: 750 900; font-display: swap; src: url('fonts/Figtree-ExtraBold.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 100 800; font-display: swap; src: url('fonts/JetBrainsMono-Latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
	--ac-black-rock: #04062c;
	--ac-ink-900: #04062c;
	--ac-ink-600: #2c3475;
	--ac-ink-500: #545d99;
	--ac-ink-450: #666d91;
	--ac-ink-420: #7f86ae;
	--ac-ink-200: #c9cee0;
	--ac-ink-100: #dfe4ea;
	--ac-ink-50: #f1f2f6;
	--ac-ink-25: #f8f9fb;
	--ac-white: #ffffff;
	--ac-mystic: #dfe4ea;
	--ac-royal-700: #2a36c9;
	--ac-royal-600: #3847ef;
	--ac-royal-500: #5256e3;
	--ac-royal-50: #f1f3fe;
	--ac-green-500: #99e9a5;
	--ac-green-50: #effdf2;
	--ac-amber-700: #8a5a13;
	--ac-amber-500: #f0a73c;
	--ac-amber-100: #fde7c5;
	--ac-red-800: #a02a30;
	--ac-red-100: #fbdcdd;

	--bg: var(--ac-ink-25);
	--surface: var(--ac-white);
	--surface-2: var(--ac-ink-25);
	--surface-3: var(--ac-ink-50);
	--border: var(--ac-mystic);
	--border-soft: #eef0f4;
	--text: var(--ac-ink-900);
	--text-dim: var(--ac-ink-500);
	--text-mute: var(--ac-ink-450);
	--accent: var(--ac-royal-600);
	--accent-hi: var(--ac-royal-700);
	--accent-soft: var(--ac-royal-50);
	--accent-text: var(--ac-royal-700);
	--on-accent: var(--ac-white);
	--green: #1f7a3a;
	--green-soft: var(--ac-green-50);
	--amber: var(--ac-amber-700);
	--amber-soft: var(--ac-amber-100);
	--red: var(--ac-red-800);
	--red-soft: var(--ac-red-100);
	--focus-ring: var(--ac-royal-700);

	--sans: 'Figtree', 'Helvetica Neue', Arial, sans-serif;
	--mono: 'JetBrains Mono', 'SFMono-Regular', ui-monospace, Menlo, Consolas, monospace;

	--type-size-caption: 12px; --type-lh-caption: 16px;
	--type-size-body: 14px;    --type-lh-body: 20px;
	--type-size-title: 17px;   --type-lh-title: 24px;
	--type-size-heading: 22px; --type-lh-heading: 28px;
	--type-size-display: 28px; --type-lh-display: 32px;
	--type-weight-text: 500; --type-weight-strong: 700; --type-weight-display: 800; --type-weight-figure: 600;
	--type-track-caps: .06em; --type-track-heading: -.01em; --type-track-display: -.02em;

	--space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 20px; --space-6: 24px; --space-8: 32px;
	--page-gutter: 16px;
	--radius-xs: 4px; --radius-sm: 6px; --radius: 14px; --radius-md: 10px; --radius-pill: 999px; --radius-round: 50%;
	--shadow-sm: 0 1px 3px rgba(4, 6, 44, .06), 0 1px 2px rgba(4, 6, 44, .04);
	--shadow-focus: 0 0 0 3px color-mix(in srgb, var(--focus-ring) 28%, transparent);
	--control-h: 32px; --control-h-lg: 40px; --touch: 44px;
	--tabbar-h: 64px;
	--rail-w: 248px;
	--rail-w-folded: 80px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font: var(--type-weight-text) var(--type-size-body) / var(--type-lh-body) var(--sans);
	padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
}
a { color: var(--accent-text); }
button { font: inherit; }
:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.num { font-family: var(--mono); font-weight: var(--type-weight-figure); font-variant-numeric: tabular-nums; }
.caption { font-size: var(--type-size-caption); line-height: var(--type-lh-caption); color: var(--text-mute); }
.caps { font-size: var(--type-size-caption); line-height: var(--type-lh-caption); letter-spacing: var(--type-track-caps); text-transform: uppercase; font-weight: var(--type-weight-strong); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header */
.hdr { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--page-gutter); background: var(--surface); border-bottom: 1px solid var(--border-soft); position: sticky; top: 0; z-index: 10; }
/* The customer's logo in the header, as the prototype shows it beside the firm's name. */
.mark-logo { height: 36px; width: auto; max-width: 140px; object-fit: contain; flex: none; }
.mark { width: 32px; height: 32px; border-radius: var(--radius-sm); background: var(--ac-black-rock); color: var(--ac-white); display: grid; place-items: center; font-weight: var(--type-weight-display); flex: none; }
.hdr-text { flex: 1; min-width: 0; }
.hdr-name { font-weight: var(--type-weight-strong); line-height: var(--type-lh-body); }
.entity { display: inline-flex; align-items: center; gap: var(--space-1); background: none; border: 0; padding: 0; color: var(--text-dim); font-size: var(--type-size-caption); line-height: var(--type-lh-caption); min-height: 24px; }
/* Account's Language and region: the date and number format and the time zone grouped, their preview
   under them in the group, so it is plain which settings it shows. */
.settings-group { display: grid; gap: var(--space-3); margin: 0; padding: var(--space-3) var(--space-4) var(--space-4); border: 1px solid var(--border-soft); border-radius: var(--radius-md); min-width: 0; }
.settings-group-title { padding: 0 var(--space-1); font-weight: var(--type-weight-strong); color: var(--text); }
.settings-preview { display: grid; gap: 2px; margin: 0; padding: var(--space-3); border-radius: var(--radius-sm); background: var(--surface-2); }
.settings-preview .caps { color: var(--text-dim); }
.settings-preview-value { font-weight: var(--type-weight-strong); overflow-wrap: anywhere; }
/* Account's password change: the form fills its card as the page's other forms do, at every width;
   on a phone Save takes the whole row with Cancel under it, side by side from 640px. */
.password-form { justify-self: stretch; width: 100%; }
.password-form .rq-actions { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-2); }
.password-form .rq-actions .btn { width: 100%; justify-content: center; }
@media (min-width: 640px) {
	.password-form .rq-actions { display: flex; }
	.password-form .rq-actions .btn { width: auto; }
}
/* Account's photo: the label is the button; the file field itself is visually hidden but reachable. */
.photo-form { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.photo-file { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.photo-form label.btn:focus-within, .photo-file:focus-visible + * { box-shadow: var(--shadow-focus); }
.photo-form:focus-within label.btn { box-shadow: var(--shadow-focus); }
/* The user's photo over their initials, which show through when there is none. */
.avatar { position: relative; overflow: hidden; }
.avatar-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.avatar { width: 36px; height: 36px; border-radius: var(--radius-round); background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center; font-weight: var(--type-weight-strong); font-size: var(--type-size-caption); border: 0; flex: none; }
/* The header's three controls and the panels they open (the LP Portal Athena design: header-avatar-menu,
   header-notifications and header-concierge). Each panel is a popover the button names with
   popovertarget, so it opens without JavaScript, Escape or a click outside closes it, and focus
   goes back to the button. The same in both trees. */
:root { --shadow-pop: 0 12px 32px rgba(4, 6, 44, .12), 0 1px 3px rgba(4, 6, 44, .06); --scrim: rgba(4, 6, 44, .32); }
.hdr-ai, .hdr-icon, .hdr-avatar { flex: none; display: grid; place-items: center; width: var(--touch); height: var(--touch); padding: 0; border: 0; border-radius: var(--radius-md); cursor: pointer; }
.hdr-ai { background: var(--ac-black-rock); color: var(--ac-green-500); }
.hdr-icon { background: none; color: var(--accent-text); }
.hdr-avatar { border-radius: var(--radius-round); box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--border); font-size: var(--type-size-body); }
.hdr-ai:focus-visible, .hdr-icon:focus-visible, .hdr-avatar:focus-visible { box-shadow: var(--shadow-focus); }
.hdr-pop { position: fixed; inset: calc(var(--touch) + 2 * var(--space-3) + var(--space-2)) var(--page-gutter) auto auto; margin: 0; padding: 0; max-height: calc(100dvh - var(--touch) - 2 * var(--space-3) - var(--tabbar-h) - var(--space-4)); overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); box-shadow: var(--shadow-pop); }
/* A closed panel stays out of sight even where a page rule (section's grid) would show it, and in a
   browser without popovers. */
.hdr [popover]:not(:popover-open) { display: none; }
@supports not selector(:popover-open) { .hdr [popover] { display: none; } }
/* The avatar menu: the name, then the account's actions. */
.menu { min-width: 240px; max-width: calc(100vw - 2 * var(--page-gutter)); padding: var(--space-2) 0; }
.menu:popover-open { display: grid; }
.menu-who { display: grid; gap: 2px; padding: var(--space-2) var(--space-4) var(--space-3); border-bottom: 1px solid var(--border-soft); margin-bottom: var(--space-1); }
.menu-name { font-weight: var(--type-weight-strong); color: var(--text); overflow-wrap: anywhere; }
.menu-form { margin: 0; display: grid; }
.menu-item { display: flex; align-items: center; min-height: var(--touch); padding: 0 var(--space-4); border: 0; background: none; color: var(--text); font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.menu-item:hover { background: var(--surface-2); }
.menu-item:focus-visible { box-shadow: inset var(--shadow-focus); }
.menu-item[aria-disabled='true'] { color: var(--text-mute); cursor: not-allowed; background: none; }
.menu-sign-out { color: var(--accent-text); }
/* The bell's panel: Notifications with Unread and Read, then News and updates. */
.notif { left: var(--page-gutter); width: auto; }
.notif:popover-open { display: grid; }
.notif-part { display: grid; gap: var(--space-2); padding: var(--space-3) var(--space-4) var(--space-4); }
.notif-part + .notif-part { border-top: 1px solid var(--border-soft); }
.notif-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.notif-head .caps { color: var(--text-mute); margin: 0; }
.notif-link { display: inline-flex; align-items: center; min-height: var(--touch); padding: 0; border: 0; background: none; color: var(--accent-text); font: inherit; font-size: var(--type-size-body); font-weight: var(--type-weight-strong); text-decoration: none; cursor: pointer; }
.notif-tabs { display: flex; gap: var(--space-5); border-bottom: 1px solid var(--border-soft); }
/* Tabs in a header panel (Notifications, Concierge): the current one underlined in the accent. */
.pop-tab { display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--touch); padding: 0; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--ac-ink-600); font: inherit; font-weight: var(--type-weight-strong); text-decoration: none; white-space: nowrap; cursor: pointer; }
.pop-tab[aria-current='true'] { color: var(--accent-text); border-bottom-color: var(--accent); }
.pop-tab:focus-visible, .notif-link:focus-visible { box-shadow: var(--shadow-focus); }
.hdr-pop [aria-disabled='true'] { color: var(--text-mute); cursor: not-allowed; }
/* The AI button's panel: Concierge, a sheet from the foot of a phone, a drawer on the right from 1024px. */
.concierge { inset: auto 0 calc(var(--tabbar-h) + env(safe-area-inset-bottom)) 0; width: 100%; max-width: none; max-height: 88dvh; border-radius: var(--radius) var(--radius) 0 0; border-width: 1px 0 0; }
.concierge:popover-open { display: flex; flex-direction: column; }
.concierge::backdrop { background: var(--scrim); }
.cg-head { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-5) var(--space-4) var(--space-4); border-bottom: 1px solid var(--border-soft); }
.cg-mark { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: var(--radius-md); background: var(--ac-black-rock); color: var(--ac-green-500); }
.cg-mark svg { width: 20px; height: 20px; }
.cg-title { flex: 1; min-width: 0; display: grid; gap: 2px; }
.cg-title h2 { margin: 0; font-size: var(--type-size-title); line-height: var(--type-lh-title); }
.cg-title p { margin: 0; }
.cg-close { display: grid; place-items: center; flex: none; width: var(--touch); height: var(--touch); padding: 0; border: 0; border-radius: var(--radius-md); background: none; color: var(--text-dim); cursor: pointer; }
.cg-close:focus-visible { box-shadow: var(--shadow-focus); }
.cg-close svg { width: 20px; height: 20px; }
.cg-tabs { display: flex; gap: var(--space-6); padding: 0 var(--space-4); border-bottom: 1px solid var(--border-soft); overflow-x: auto; scrollbar-width: none; }
.cg-body { flex: 1; display: grid; align-content: start; gap: var(--space-3); padding: var(--space-4); overflow-y: auto; }
.cg-body > p { margin: 0; color: var(--text-dim); }
.cg-suggestions { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.cg-suggestion { display: flex; align-items: center; width: 100%; min-height: var(--touch); padding: var(--space-3) var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); color: var(--text); font: inherit; font-weight: var(--type-weight-strong); text-align: left; cursor: pointer; }
.hdr-pop .cg-suggestion[aria-disabled='true'] { color: var(--text-mute); }
.cg-foot { display: grid; gap: var(--space-2); padding: var(--space-3) var(--space-4) var(--space-4); border-top: 1px solid var(--border-soft); }
.cg-ask { display: flex; gap: var(--space-2); }
.cg-ask input { flex: 1; min-width: 0; min-height: 48px; padding: 0 var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); color: var(--text); font: inherit; font-size: 16px; }
.cg-ask input[aria-disabled='true'] { background: var(--surface-2); }
.cg-send { display: grid; place-items: center; flex: none; width: 48px; height: 48px; padding: 0; border: 0; border-radius: var(--radius-md); background: var(--accent); color: var(--on-accent); cursor: pointer; }
.hdr-pop .cg-send[aria-disabled='true'] { opacity: .55; color: var(--on-accent); }
.cg-send svg { width: 20px; height: 20px; }
.cg-own { display: inline-flex; align-items: center; gap: var(--space-1); min-height: var(--touch); color: var(--accent-text); font-size: var(--type-size-caption); font-weight: var(--type-weight-strong); text-decoration: none; }
.cg-own svg { width: 14px; height: 14px; flex: none; }
@media (min-width: 640px) {
	.notif { left: auto; width: 400px; }
}
@media (min-width: 1024px) {
	.concierge { inset: 0 0 0 auto; width: 440px; max-height: none; height: 100dvh; border-radius: var(--radius) 0 0 var(--radius); border-width: 0 0 0 1px; }
}

/* Page */
main { padding: var(--space-5) var(--page-gutter) var(--space-6); display: grid; gap: var(--space-6); }
h1 { margin: var(--space-1) 0 0; font-size: var(--type-size-heading); line-height: var(--type-lh-heading); letter-spacing: var(--type-track-heading); font-weight: var(--type-weight-display); }
h2 { margin: 0; font-size: var(--type-size-title); line-height: var(--type-lh-title); font-weight: var(--type-weight-strong); display: flex; align-items: center; gap: var(--space-2); }
section { display: grid; gap: var(--space-3); }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.sec-head a { font-size: var(--type-size-body); font-weight: var(--type-weight-strong); text-decoration: none; min-height: var(--touch); display: inline-flex; align-items: center; }

/* Cards and pills */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: var(--space-4); display: grid; gap: var(--space-3); }
.card.attention { border-color: var(--ac-amber-500); }
.pill { display: inline-flex; align-items: center; height: 20px; padding: 0 var(--space-2); border-radius: var(--radius-pill); font-size: var(--type-size-caption); font-weight: var(--type-weight-strong); line-height: 1; }
.pill.count { background: var(--red-soft); color: var(--red); }
.pill.due { background: var(--amber-soft); color: var(--amber); }
.pill.due.urgent { background: var(--red-soft); color: var(--red); }
.pill.new { background: var(--green-soft); color: var(--green); }
.pill.ok { background: var(--green-soft); color: var(--green); }

/* Obligation card */
.ob-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.ob-kind { color: var(--amber); }
.ob-title { font-size: var(--type-size-title); line-height: var(--type-lh-title); font-weight: var(--type-weight-strong); margin: 0; }
.ob-amount { font-size: var(--type-size-display); line-height: var(--type-lh-display); letter-spacing: var(--type-track-display); }
.bar { height: 6px; border-radius: var(--radius-pill); background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--ac-amber-500); border-radius: inherit; }
.bar.royal > i { background: var(--ac-royal-600); }
.bar.perano > i { background: var(--ac-royal-500); }
.bar.green > i { background: var(--ac-green-500); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.steps li { display: flex; align-items: center; gap: var(--space-2); color: var(--text-dim); }
.steps li.done { color: var(--green); }
.steps li.next { color: var(--text); font-weight: var(--type-weight-strong); }
.step-dot { width: 20px; height: 20px; border-radius: var(--radius-round); border: 2px solid var(--ac-ink-200); display: grid; place-items: center; font-size: 11px; flex: none; }
.done .step-dot { background: var(--green); border-color: var(--green); color: var(--ac-white); }
.next .step-dot { border-color: var(--accent); color: var(--accent-text); }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.actions form { display: contents; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: var(--control-h-lg); padding: 0 var(--space-4); border-radius: var(--radius-md); font-weight: var(--type-weight-strong); text-decoration: none; border: 1px solid transparent; cursor: pointer; }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-hi); }
.btn.secondary { background: var(--surface); color: var(--accent-text); border-color: var(--border); }
.btn[aria-busy='true'] { opacity: .6; }
/* A control the server cannot honor yet: greyed, not hidden; aria-disabled and the title say why. */
.btn[aria-disabled='true'] { opacity: .55; cursor: not-allowed; }
.btn.primary[aria-disabled='true']:hover { background: var(--accent); }

/* Portfolio */
.nav-figure { font-size: var(--type-size-display); line-height: var(--type-lh-display); letter-spacing: var(--type-track-display); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.stat { background: var(--surface-2); border-radius: var(--radius-md); padding: var(--space-2) var(--space-3); display: grid; gap: 2px; }
.stat .num { font-size: var(--type-size-title); line-height: var(--type-lh-title); }
.seg { display: inline-flex; background: var(--surface-3); border-radius: var(--radius-pill); padding: 2px; }
.seg a, .seg button { min-height: 36px; padding: 0 var(--space-3); border-radius: var(--radius-pill); border: 0; background: none; color: var(--text-dim); font-weight: var(--type-weight-strong); text-decoration: none; display: inline-flex; align-items: center; }
.seg [aria-pressed='true'], .seg [aria-current='true'] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.rows { display: grid; gap: var(--space-3); }
.row { display: grid; grid-template-columns: 1fr auto; gap: 2px var(--space-3); align-items: baseline; }
.row .name { font-weight: var(--type-weight-strong); }
.row .bar { grid-column: 1 / -1; margin-top: var(--space-1); }
.row .caption { grid-column: 1; }
.row .num { text-align: right; }
.row .share { grid-row: 2; grid-column: 2; text-align: right; }

/* Documents */
.docs { list-style: none; margin: 0; padding: 0; display: grid; }
.docs li { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) 0; border-top: 1px solid var(--border-soft); min-height: var(--touch); }
.docs li:first-child { border-top: 0; padding-top: 0; }
.doc-icon { width: 36px; height: 36px; border-radius: var(--radius-sm); background: var(--surface-3); color: var(--text-dim); display: grid; place-items: center; font-size: 10px; font-weight: var(--type-weight-strong); flex: none; }
.doc-text { flex: 1; min-width: 0; }
.doc-name { font-weight: var(--type-weight-strong); text-decoration: none; color: var(--text); display: block; }

/* Ask button and drawer (a bottom sheet on the phone) */
.ask-btn { display: inline-flex; align-items: center; gap: var(--space-1); min-height: 36px; padding: 0 var(--space-3); border-radius: var(--radius-pill); background: var(--ac-black-rock); color: var(--ac-white); font-weight: var(--type-weight-strong); font-size: var(--type-size-caption); text-decoration: none; border: 0; flex: none; }
.sheet { position: fixed; inset: 0; margin: auto 0 0; width: 100%; max-width: 100%; max-height: 88vh; border: 0; padding: 0; border-radius: var(--radius) var(--radius) 0 0; background: var(--surface); color: var(--text); display: flex; flex-direction: column; }
.sheet:not([open]) { display: none; }
.sheet::backdrop { background: rgba(4, 6, 44, .5); }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-2); padding: var(--space-4) var(--space-4) var(--space-2); }
.sheet-head p { margin: 0; }
.icon-btn { width: var(--touch); height: var(--touch); border-radius: var(--radius-round); border: 0; background: var(--surface-3); color: var(--text); font-size: 22px; line-height: 1; flex: none; }
.thread { flex: 1; overflow: auto; padding: var(--space-2) var(--space-4); display: grid; gap: var(--space-2); align-content: start; }
.thread:empty { display: none; }
.bubble { padding: var(--space-2) var(--space-3); border-radius: 12px; max-width: 92%; }
.bubble.user { justify-self: end; background: var(--accent); color: var(--on-accent); }
.bubble.ai { justify-self: start; width: 92%; background: var(--surface-2); display: grid; gap: var(--space-1); }
.bubble.ai .answer { margin: 0; }
.sources { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-1); }
.sources:empty { display: none; }
.sources a { display: inline-block; font-size: var(--type-size-caption); line-height: var(--type-lh-caption); padding: 2px var(--space-2); border-radius: var(--radius-pill); background: var(--surface); border: 1px solid var(--border); text-decoration: none; }
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); padding: var(--space-2) var(--space-4); }
.chip { min-height: 36px; padding: 0 var(--space-3); border-radius: var(--radius-pill); border: 1px solid var(--border); background: var(--surface); color: var(--accent-text); font-weight: var(--type-weight-strong); text-decoration: none; display: inline-flex; align-items: center; cursor: pointer; }
.ask-form { display: flex; gap: var(--space-2); padding: var(--space-2) var(--space-4); }
.ask-form input { flex: 1; min-width: 0; min-height: var(--touch); border: 1px solid var(--border-input); border-radius: var(--radius-md); padding: 0 var(--space-3); font: inherit; font-size: 16px; background: var(--surface); color: var(--text); }
.ask-ir { display: block; text-align: center; padding: var(--space-2) var(--space-4) calc(var(--space-4) + env(safe-area-inset-bottom)); font-weight: var(--type-weight-strong); text-decoration: none; }
.ask-page { display: grid; gap: var(--space-3); }

/* Tab bar */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--border-soft); display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; z-index: 10; }
.tab { display: grid; justify-items: center; align-content: center; gap: 2px; text-decoration: none; color: var(--text-dim); font-size: var(--type-size-caption); line-height: var(--type-lh-caption); font-weight: var(--type-weight-strong); position: relative; }
.tab[aria-current='page'] { color: var(--accent-text); }
/* The current section, unmistakable on a phone: a bar on the tab's top edge and a tinted pill behind its icon. */
.tab[aria-current='page']::before { content: ''; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
.tab[aria-current='page'] svg { box-sizing: content-box; padding: 4px 16px; margin: -4px 0; border-radius: var(--radius-pill); background: var(--accent-soft); }
.tab svg { width: 24px; height: 24px; }
.tab-long, .rail-hide, .rail-learn { display: none; }
/* Each section's count in the prototype's color: obligations red, new funds green, new documents the accent. */
.tab[href='/offerings'] .badge { background: var(--green); }
.tab[href='/documents'] .badge { background: var(--accent); }
.tab .badge { position: absolute; top: 8px; left: calc(50% + 6px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: var(--radius-pill); background: var(--red); color: var(--ac-white); font-size: 10px; display: grid; place-items: center; }

/* Home in the LP Portal Athena design (docs/design/handoff/lp-portal-athena-mobile/home-*.png):
   the greeting, then cards in the design's order. A card whose data the API does not serve yet
   says so in its body; it is never left out and never filled with figures it does not have. */
.greeting { margin: 0; font-size: var(--type-size-display); line-height: var(--type-lh-display); letter-spacing: var(--type-track-display); font-weight: var(--type-weight-strong); color: var(--text); overflow-wrap: anywhere; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: var(--space-5); display: grid; gap: var(--space-3); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.panel-title { margin: 0; display: flex; align-items: center; gap: var(--space-2); font-size: var(--type-size-title); line-height: var(--type-lh-title); font-weight: var(--type-weight-strong); color: var(--text); }
.panel-title svg { width: 20px; height: 20px; flex: none; }
.panel-unavailable { margin: 0; color: var(--text-mute); }
.panel.attention { padding: 0; overflow: hidden; border: 2px solid var(--ac-amber-500); box-shadow: var(--shadow-sm); }
.panel.attention .panel-head { background: var(--ac-amber-500); padding: var(--space-3) var(--space-5); }
.panel.attention .panel-title { color: var(--ac-ink-900); }
.panel.attention .panel-unavailable { padding: var(--space-4) var(--space-5) var(--space-5); }
.panel.ai .panel-title svg { color: var(--accent); }

/* Home with its data (spec 001), in the design's look. */
:root { --chart-1: var(--ac-royal-600); --chart-2: var(--ac-black-rock); --chart-3: #7b3fe4; --chart-4: #8c94f2; --chart-5: var(--ac-ink-420); }
/* The design's urgency dots: brighter than the text reds and greens, each with a pale halo. Never used for text. */
:root { --dot-urgent: #e5484d; --dot-urgent-halo: #fbdcdd; --dot-soon: var(--ac-amber-500); --dot-soon-halo: var(--ac-amber-100); --dot-later: #30a46c; --dot-later-halo: #d6f5e3; }
.greeting-block { display: grid; gap: var(--space-1); }
.figures-line { margin: 0; color: var(--text-mute); font-size: var(--type-size-body); }
.greeting-intro { margin: 0; color: var(--text-dim); font-size: var(--type-size-title); line-height: var(--type-lh-title); }
.count-pill { flex: none; padding: 2px var(--space-3); border-radius: var(--radius-pill); background: var(--ac-black-rock); color: var(--ac-white); font-size: var(--type-size-caption); font-weight: var(--type-weight-strong); }
.panel-head .btn { min-height: var(--control-h-lg); }
.panel-head-start { display: grid; justify-content: start; gap: var(--space-1); }
.obligations { list-style: none; margin: 0; padding: 0; display: grid; }
.obligation { display: grid; gap: var(--space-3); padding: var(--space-4) var(--space-5); border-top: 1px solid var(--border-soft); }
.obligation:first-child { border-top: 0; }
.obligation-top { display: flex; gap: var(--space-3); align-items: flex-start; }
.obligation-title { display: grid; gap: 2px; min-width: 0; }
.obligation-heading { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: var(--space-2); }
.kind-label { font-size: var(--type-size-caption); letter-spacing: var(--type-track-caps); text-transform: uppercase; font-weight: var(--type-weight-strong); color: var(--amber); }
.obligation-fund { font-size: var(--type-size-title); line-height: var(--type-lh-title); font-weight: var(--type-weight-strong); overflow-wrap: anywhere; }
.meta-line { color: var(--text-dim); font-size: var(--type-size-body); }
.dot { flex: none; width: 12px; height: 12px; margin-top: 4px; border-radius: var(--radius-round); }
.dot.urgent { background: var(--dot-urgent); box-shadow: 0 0 0 4px var(--dot-urgent-halo); }
.dot.soon { background: var(--dot-soon); box-shadow: 0 0 0 4px var(--dot-soon-halo); }
.dot.later { background: var(--dot-later); box-shadow: 0 0 0 4px var(--dot-later-halo); }
.obligation-figures { display: grid; grid-template-columns: auto 1fr; gap: var(--space-5); align-items: end; }
.figure { display: grid; gap: 2px; }
.figure-value { font-size: var(--type-size-title); font-weight: var(--type-weight-strong); }
.countdown { display: grid; gap: var(--space-1); }
/* The countdown is amber whatever the band, as in the design; the dot carries the urgency. */
.days { font-size: var(--type-size-body); font-weight: var(--type-weight-strong); color: var(--amber); }
.days-count { font-size: var(--type-size-heading); line-height: var(--type-lh-heading); }
.days.overdue { color: var(--red); }
.bar-fill { display: block; height: 100%; border-radius: inherit; background: var(--ac-amber-500); }
.bar-fill.overdue { background: var(--red); }
.w-0 { width: 0%; }
.w-5 { width: 5%; }
.w-10 { width: 10%; }
.w-15 { width: 15%; }
.w-20 { width: 20%; }
.w-25 { width: 25%; }
.w-30 { width: 30%; }
.w-35 { width: 35%; }
.w-40 { width: 40%; }
.w-45 { width: 45%; }
.w-50 { width: 50%; }
.w-55 { width: 55%; }
.w-60 { width: 60%; }
.w-65 { width: 65%; }
.w-70 { width: 70%; }
.w-75 { width: 75%; }
.w-80 { width: 80%; }
.w-85 { width: 85%; }
.w-90 { width: 90%; }
.w-95 { width: 95%; }
.w-100 { width: 100%; }
.obligation-actions { display: flex; justify-content: flex-end; gap: var(--space-2); }
.obligation-actions .btn, .call-actions .btn { min-height: var(--touch); border-radius: var(--radius); }
.btn.dismiss { width: var(--touch); padding: 0; color: var(--text-mute); }
.btn.dismiss svg { width: 18px; height: 18px; }
.countdown .bar { background: color-mix(in srgb, var(--ac-amber-500) 14%, var(--surface)); }
/* Outstanding capital calls (home-01, home-02): a row per call, its urgency dot, then the legend. */
.panel-head-rule { padding-bottom: var(--space-3); border-bottom: 1px solid var(--border-soft); }
.count-dot { flex: none; min-width: 28px; height: 28px; padding: 0 var(--space-2); border-radius: var(--radius-pill); background: var(--surface-3); color: var(--text-dim); font-size: var(--type-size-caption); font-weight: var(--type-weight-strong); display: grid; place-items: center; }
.calls { list-style: none; margin: 0; padding: 0; display: grid; }
.call { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "dot text amount" "actions actions actions"; column-gap: var(--space-3); row-gap: var(--space-3); align-items: start; padding: var(--space-3) 0; border-top: 1px solid var(--border-soft); }
.call:first-child { border-top: 0; padding-top: 0; }
.call > .dot { grid-area: dot; margin-top: 6px; }
.call-text { grid-area: text; display: grid; gap: 2px; }
.call-name { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); font-size: var(--type-size-title); line-height: var(--type-lh-title); font-weight: var(--type-weight-strong); overflow-wrap: anywhere; }
.call-amount { grid-area: amount; font-size: var(--type-size-title); line-height: var(--type-lh-title); font-weight: var(--type-weight-strong); }
.call-actions { grid-area: actions; display: flex; }
.pill.urgent { height: 24px; padding: 0 var(--space-2); background: var(--red-soft); color: var(--red); border: 1px solid color-mix(in srgb, var(--red) 45%, transparent); font-weight: var(--type-weight-text); }
.legend { list-style: none; margin: 0; padding: var(--space-3) 0 0; border-top: 1px solid var(--border-soft); display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); color: var(--text-mute); font-size: var(--type-size-caption); line-height: var(--type-lh-caption); }
.legend li { display: inline-flex; align-items: center; gap: var(--space-1); }
.legend .dot { width: 8px; height: 8px; margin: 0; box-shadow: none; }
/* Portfolio view (home-02, home-03): the hint under the title, the bordered four-way switch, the ring and its funds. */
.panel-head-text { display: grid; gap: 2px; min-width: 0; }
.panel-head-text .caption { margin: 0; font-size: var(--type-size-body); line-height: var(--type-lh-body); }
.portfolio-card > .panel-head { align-items: flex-start; }
.portfolio-card > .panel-head .btn { border-radius: var(--radius); flex: none; }
.seg.measure-seg { display: flex; flex-wrap: wrap; gap: 0; width: 100%; padding: var(--space-1); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); }
.measure-seg .seg-option { flex: 1 1 auto; justify-content: center; padding: 0 var(--space-2); border: 0; background: none; border-radius: var(--radius-sm); color: var(--text-dim); }
.measure-seg .seg-option[aria-disabled='true'] { opacity: .55; cursor: not-allowed; }
.donut-wrap { position: relative; justify-self: center; width: 216px; height: 216px; }
.donut-wrap .donut { width: 100%; height: 100%; }
.donut-center .caps { font-weight: var(--type-weight-text); letter-spacing: .03em; color: var(--text-mute); }

.fund-rows > li { display: grid; }
a.fund-row { color: var(--text); text-decoration: none; border-radius: var(--radius); padding: var(--space-3) var(--space-4); }
a.fund-row:hover { border-color: var(--accent); }
/* Hovering or focusing a fund brings its segment forward in the ring. */
.measure .arc { transition: opacity .15s; }
.measure:has(.fund-row:is(:hover, :focus-visible)) .arc { opacity: .3; }
.measure:has(.fund-row.c1:is(:hover, :focus-visible)) .arc.c1, .measure:has(.fund-row.c2:is(:hover, :focus-visible)) .arc.c2, .measure:has(.fund-row.c3:is(:hover, :focus-visible)) .arc.c3, .measure:has(.fund-row.c4:is(:hover, :focus-visible)) .arc.c4, .measure:has(.fund-row.c5:is(:hover, :focus-visible)) .arc.c5 { opacity: 1; }
/* Since you last visited, News and updates, New investment opportunities. */
.panel-head-inline { justify-content: flex-start; flex-wrap: wrap; }
.pill.ai-pill { gap: var(--space-1); height: 26px; padding: 0 var(--space-3); background: var(--accent-soft); color: var(--accent-text); font-weight: var(--type-weight-text); }
.pill.ai-pill svg { width: 12px; height: 12px; }
.home button.panel-link { border: 0; background: none; padding: 0; }
.home .panel-link[aria-disabled='true'] { opacity: .55; cursor: not-allowed; }
.offerings-head { justify-content: stretch; }
.offerings-caption { margin: 0; justify-self: end; text-align: right; font-size: var(--type-size-body); line-height: var(--type-lh-body); }
.measures { display: grid; gap: var(--space-4); }
.seg-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg-option { min-height: 36px; padding: 0 var(--space-4); border-radius: var(--radius-pill); color: var(--text-dim); font-weight: var(--type-weight-strong); display: inline-flex; align-items: center; cursor: pointer; }
.seg-input:checked + .seg-option { background: var(--ac-black-rock); color: var(--ac-white); }
.seg-input:focus-visible + .seg-option { box-shadow: var(--shadow-focus); }
.measure { display: grid; gap: var(--space-4); }
.measures:has(#measure-commitment:checked) .measure-nav, .measures:has(#measure-nav:checked) .measure-commitment { display: none; }
.donut { width: 216px; height: 216px; justify-self: center; }
.arc.c1 { stroke: var(--chart-1); } .arc.c2 { stroke: var(--chart-2); } .arc.c3 { stroke: var(--chart-3); } .arc.c4 { stroke: var(--chart-4); } .arc.c5 { stroke: var(--chart-5); }
.donut-center { position: absolute; inset: 0; margin: 0; display: grid; place-content: center; justify-items: center; gap: 2px; text-align: center; pointer-events: none; }
.donut-total { font-size: var(--type-size-heading); line-height: var(--type-lh-heading); font-weight: var(--type-weight-figure); }
/* Inside the ring's hole: a caption longer than the hole wraps instead of running over the ring. */
.donut-center > * { max-width: 140px; }
.fund-rows, .doc-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.fund-row { display: grid; grid-template-columns: 14px 1fr auto; grid-template-areas: "swatch name share" "swatch amount share"; column-gap: var(--space-3); padding: var(--space-3) var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-md); }
.swatch { grid-area: swatch; width: 14px; height: 14px; margin-top: 3px; border-radius: 3px; }
.swatch.c1 { background: var(--chart-1); } .swatch.c2 { background: var(--chart-2); } .swatch.c3 { background: var(--chart-3); } .swatch.c4 { background: var(--chart-4); } .swatch.c5 { background: var(--chart-5); }
.fund-name { grid-area: name; font-weight: var(--type-weight-strong); overflow-wrap: anywhere; }
.fund-amount { grid-area: amount; font-weight: var(--type-weight-strong); }
.fund-share { grid-area: share; align-self: end; color: var(--text-dim); }
.doc-row { display: grid; grid-template-columns: auto 1fr auto; gap: var(--space-3); align-items: center; padding: var(--space-3) 0; border-top: 1px solid var(--border-soft); }
.doc-row:first-child { border-top: 0; }
.doc-row .doc-icon { width: 36px; height: 40px; border-radius: var(--radius-xs); background: var(--red); color: var(--ac-white); font-size: 10px; font-weight: var(--type-weight-strong); display: grid; place-items: center; }
.doc-text { display: grid; gap: 2px; min-width: 0; }
.doc-title { font-weight: var(--type-weight-strong); overflow-wrap: anywhere; }
.doc-row .btn { min-height: var(--control-h-lg); }
.pill.new { margin-left: var(--space-2); background: var(--accent-soft); color: var(--accent-text); }
.pill.new-count { height: 26px; padding: 0 var(--space-3); background: var(--ac-green-500); color: var(--ac-ink-900); text-transform: uppercase; letter-spacing: var(--type-track-caps); justify-self: start; }
.offer { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.offer-band { min-height: 120px; padding: var(--space-4); display: grid; align-content: end; gap: var(--space-2); background: linear-gradient(160deg, var(--ac-ink-600), var(--ac-black-rock)); color: var(--ac-white); }
.pill.new-band { justify-self: start; background: var(--ac-green-500); color: var(--ac-ink-900); }
.offer-name { margin: 0; font-size: var(--type-size-title); line-height: var(--type-lh-title); }
.offer-facts { margin: 0; padding: var(--space-4); display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-3); }
.offer-facts dd { margin: 0; font-weight: var(--type-weight-strong); }
.offer-actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); padding: 0 var(--space-4) var(--space-4); }
.offer-actions .btn { min-height: var(--touch); }

.countdown .bar { display: block; }

/* Documents (spec 004; docs-01-filters.png, docs-02-list.png) */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.documents { display: grid; gap: var(--space-4); }
.documents h1 { margin: 0; }
/* The header's search: centered on wide screens only, greyed until search is built. */
.hdr-search { display: none; min-height: 40px; border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 0 var(--space-4); font: inherit; background: var(--surface-2); color: var(--text-mute); cursor: not-allowed; }
@media (min-width: 1024px) {
	/* In the header's own row, between the logo and the buttons, centered in the space between them,
	   so it can never cover either. */
	.hdr-text { flex: 0 0 auto; }
	.hdr-search { display: block; flex: 0 1 480px; min-width: 200px; margin: 0 auto; }
}
.doc-filters { gap: var(--space-4); }
.doc-field { display: grid; gap: var(--space-2); }
.doc-field-label { font-size: var(--type-size-caption); line-height: var(--type-lh-caption); letter-spacing: var(--type-track-caps); text-transform: uppercase; font-weight: var(--type-weight-strong); color: var(--text-mute); }
.doc-field input, .doc-field select { min-height: var(--touch); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 0 var(--space-3); font: inherit; font-size: 16px; background: var(--surface); color: var(--text); width: 100%; }
.doc-field input:focus-visible, .doc-field select:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.doc-types { border: 0; border-top: 1px solid var(--border-soft); margin: 0; padding: var(--space-4) 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.doc-types legend { float: left; margin-right: var(--space-2); padding: 0; }
.doc-type { position: relative; display: inline-flex; }
.doc-type .chip { min-height: var(--touch); }
.doc-type .seg-input:checked + .chip { background: var(--ac-black-rock); border-color: var(--ac-black-rock); color: var(--ac-white); }
.doc-type .seg-input:focus-visible + .chip { box-shadow: var(--shadow-focus); }
.doc-filter-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); }
.doc-filter-foot .caption { margin: 0; color: var(--accent-text); }
.doc-filter-actions { display: flex; gap: var(--space-2); }
.doc-list { gap: 0; padding-top: var(--space-3); padding-bottom: var(--space-3); }
.doc-bulk { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding-bottom: var(--space-3); border-bottom: 1px solid var(--border-soft); }
.doc-check { display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--touch); color: var(--text); cursor: pointer; }
.doc-check input, .doc-select { width: 20px; height: 20px; margin: 0; }
.doc-list-row { grid-template-columns: auto auto 1fr auto; }
.doc-list-row:first-child { border-top: 0; }
.doc-list .doc-text { display: grid; gap: 2px; min-width: 0; }
.doc-list .doc-title { color: var(--text); text-decoration: none; }
.doc-list .doc-title:hover { text-decoration: underline; }
.doc-icon.word { background: var(--accent); }
.doc-icon.sheet, .doc-icon.csv { background: var(--green); }
.doc-icon.image, .doc-icon.other { background: var(--ac-ink-200); color: var(--text); }
.doc-empty { display: grid; gap: var(--space-3); justify-items: start; padding: var(--space-4) 0; }
.doc-pager { display: flex; justify-content: space-between; gap: var(--space-2); padding-top: var(--space-3); border-top: 1px solid var(--border-soft); }
.doc-back { font-weight: var(--type-weight-strong); text-decoration: none; min-height: var(--touch); display: inline-flex; align-items: center; justify-self: start; }
.doc-head { display: flex; align-items: center; gap: var(--space-3); }
.doc-head .doc-icon { width: 36px; height: 40px; border-radius: var(--radius-xs); background: var(--red); color: var(--ac-white); font-size: 10px; font-weight: var(--type-weight-strong); display: grid; place-items: center; flex: none; }
.doc-head .doc-icon.word { background: var(--accent); }
.doc-head .doc-icon.sheet, .doc-head .doc-icon.csv { background: var(--green); }
.doc-head .doc-icon.image, .doc-head .doc-icon.other { background: var(--ac-ink-200); color: var(--text); }
.doc-facts { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-2) var(--space-4); margin: 0; }
.doc-facts dt { color: var(--text-mute); }
.doc-facts dd { margin: 0; overflow-wrap: anywhere; }
.panel-link { font-size: var(--type-size-caption); font-weight: var(--type-weight-strong); color: var(--accent-text); text-decoration: none; min-height: var(--touch); display: inline-flex; align-items: center; }
.doc-problem { margin: 0; padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--amber-soft); color: var(--text); }
.doc-bulk .btn[disabled] { opacity: .55; cursor: not-allowed; }
/* The prototype's details (docs-01-filters.png, docs-02-list.png): a magnifier in Name contains,
   square-cornered type chips, the list's rows banded edge to edge, icons in Download all and View. */
.doc-input-icon { position: relative; display: block; }
.doc-input-icon svg { position: absolute; left: var(--space-3); top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--text-mute); pointer-events: none; }
.doc-field .doc-input-icon input { padding-left: calc(var(--space-3) + 18px + var(--space-2)); }
.doc-type .chip { border-radius: var(--radius-md); color: var(--ac-ink-600); font-weight: var(--type-weight-text); }
/* The filter card's Apply and Clear filters are the no-JavaScript fallback; the page's script hides them. */
.doc-filter-actions[hidden] { display: none; }
.doc-list .btn, .doc-bulk .btn { gap: var(--space-2); }
.doc-list .btn svg { width: 18px; height: 18px; flex: none; }
.doc-bulk .btn.secondary { color: var(--text); }
.doc-list-row { margin: 0 calc(-1 * var(--space-5)); padding: var(--space-4) var(--space-5); border-top: 0; }
.doc-list-row:nth-child(even) { background: var(--surface-2); }
.doc-list .doc-rows { gap: 0; }
.doc-list .doc-text .caption { color: var(--text-dim); }
.doc-title-line { display: flex; align-items: flex-start; gap: var(--space-2); }
.doc-title-line .pill.new { margin-left: 0; flex: none; }
.doc-title-line .doc-title { min-width: 0; }
.doc-list .doc-title { font-weight: var(--type-weight-text); }

/* The terms gate (spec 000, slice 2) */
.terms { max-width: 560px; justify-self: center; gap: var(--space-4); }
.terms h1 { margin: 0; }
.terms p { margin: 0; }
.terms-link { font-weight: var(--type-weight-strong); color: var(--accent-text); min-height: var(--touch); display: inline-flex; align-items: center; }
.terms-form { display: grid; gap: var(--space-3); }
.terms-check { display: flex; align-items: center; gap: var(--space-3); min-height: var(--touch); cursor: pointer; }
.terms-check input { width: 20px; height: 20px; margin: 0; flex: none; }

/* Portfolio, investments, funds, opportunities and activity (specs 003 and 005; portfolio-01.png, portfolio-02-reports.png, funds-01.png, funds-02.png) */
:root { --shadow-card: 0 6px 20px color-mix(in srgb, var(--ac-black-rock) 8%, transparent), 0 1px 2px color-mix(in srgb, var(--ac-black-rock) 4%, transparent); }
.portfolio { display: grid; gap: var(--space-4); }
.portfolio h1, .portfolio h2 { margin: 0; }
.portfolio-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat strong { font-size: var(--type-size-title); line-height: var(--type-lh-title); }
.investment-cards { display: grid; gap: var(--space-3); }
.investment-card { display: grid; gap: 2px; padding: var(--space-4) var(--space-4) var(--space-4) var(--space-5); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); text-decoration: none; position: relative; }
.investment-card::before { content: ''; position: absolute; left: var(--space-4); top: var(--space-4); width: 5px; height: 40px; border-radius: var(--radius-pill); background: var(--chart-1); }
.investment-card.accent-2::before { background: var(--chart-2); }
.investment-card.accent-3::before { background: var(--chart-3); }
.investment-card.accent-4::before { background: var(--chart-4); }
.investment-card.accent-5::before { background: var(--chart-5); }
.investment-card:hover { border-color: var(--accent); }
.investment-card:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.investment-name { font-weight: var(--type-weight-strong); font-size: var(--type-size-title); padding-left: var(--space-3); }
.investment-card > .caption { padding-left: var(--space-3); }
.investment-figures { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); margin-top: var(--space-3); }
.investment-figures .stat { background: none; padding: 0; }
.investment-figures .caps { color: var(--text-mute); font-weight: var(--type-weight-text); letter-spacing: 0; }
.investment-figures strong { font-weight: var(--type-weight-figure); }
/* Reports (portfolio-02-reports.png): the CSV button under the line, then the choices on a tinted panel. */
.report-csv { justify-self: start; gap: var(--space-2); min-height: var(--touch); border-radius: var(--radius); }
.report-csv svg { width: 18px; height: 18px; }
.report-choice { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); align-items: end; padding: var(--space-4); background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: var(--radius); }
.report-choice .report-kind { grid-column: 1 / -1; }
.report-choice noscript { grid-column: 1 / -1; display: grid; }
.report-choice .btn { grid-column: 1 / -1; min-height: var(--touch); }
.chart { margin: 0; display: grid; gap: var(--space-2); }
.chart svg { width: 100%; height: auto; display: block; }
.chart-grid { stroke: var(--border-soft); stroke-width: 1; }
.chart-axis { fill: var(--text-mute); font-size: 11px; }
.chart-bar.paid, .legend.paid::before { fill: var(--chart-1); background: var(--chart-1); }
.chart-bar.distributed, .legend.distributed::before { fill: var(--chart-3); background: var(--chart-3); }
.chart-bar.nav, .legend.nav::before { fill: var(--chart-2); background: var(--chart-2); }
.chart-line polyline { fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart-line circle { fill: currentColor; }
.chart-line.paid { color: var(--chart-1); }
.chart-line.distributed { color: var(--chart-3); }
.chart-line.nav { color: var(--chart-2); }
.chart-legend { display: flex; gap: var(--space-4); font-size: var(--type-size-caption); color: var(--text-dim); }
.legend { display: inline-flex; align-items: center; gap: var(--space-1); }
.legend::before { content: ''; width: 10px; height: 10px; border-radius: 2px; }
.movement-rows { list-style: none; margin: 0; padding: 0; display: grid; }
.movement-row { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); padding: var(--space-3) 0; border-top: 1px solid var(--border-soft); min-height: var(--touch); }
.movement-row:first-child { border-top: 0; }
.movement-text, .movement-amount { display: grid; gap: 2px; }
.movement-amount { justify-items: end; text-align: end; }
.pill.pending { background: var(--amber-soft); color: var(--amber); }
.pill.cancelled { background: var(--surface-3); color: var(--text-dim); }
.pill.sent, .pill.complete { background: var(--green-soft); color: var(--green); }
.pill.status { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.fund-image { width: 100%; max-height: 220px; object-fit: cover; border-radius: 18px; background: var(--surface-3); }
.fund-head { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.prose p { margin: 0; }
.prose { gap: var(--space-2); }
.video-links { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-1); }
.video-links a { overflow-wrap: anywhere; min-height: var(--touch); display: inline-flex; align-items: center; }
.interest-form .btn { width: 100%; min-height: var(--touch); }
/* Funds and the opportunity card (funds-01.png, funds-02.png, home-05-opportunities.png): the image
   under its tags, name and line; target, minimum and closes; percent raised and the days to close;
   View opportunity and Express interest side by side, Invest across the row below. */
.offers { display: grid; gap: var(--space-5); }
.offers-head { display: grid; gap: var(--space-2); }
.offers-title { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2) var(--space-3); font-size: var(--type-size-title); line-height: var(--type-lh-title); font-weight: var(--type-weight-display); letter-spacing: var(--type-track-heading); }
.offers-title .pill.new-count { height: 26px; padding: 0 var(--space-3); text-transform: uppercase; letter-spacing: var(--type-track-caps); }
.offers-firm { margin: 0; justify-self: end; text-align: end; font-size: var(--type-size-body); line-height: var(--type-lh-body); }
.offer { display: grid; background: var(--surface); border: 0; box-shadow: var(--shadow-card); }
.offer-hero { position: relative; display: flex; flex-direction: column; justify-content: space-between; min-height: 164px; background: linear-gradient(160deg, var(--ac-ink-600), var(--ac-black-rock)); color: var(--ac-white); overflow: hidden; }
.offer-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: var(--surface-3); }
.offer-tags { position: relative; display: flex; align-items: flex-start; gap: var(--space-2); padding: var(--space-3); }
.offer-tags .pill { height: 24px; padding: 0 var(--space-3); }
.offer-tags .pill.new-band { text-transform: uppercase; letter-spacing: var(--type-track-caps); }
.offer-tags .pill.status { margin-left: auto; background: var(--ac-white); color: var(--ac-ink-900); border: 0; }
.offer-hero .offer-band { position: relative; min-height: 0; gap: 2px; padding: var(--space-6) var(--space-4) var(--space-3); background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--ac-black-rock) 78%, transparent)); }
.offer-name { color: var(--ac-white); overflow-wrap: anywhere; }
.offer-line { margin: 0; color: var(--ac-white); font-size: var(--type-size-body); line-height: var(--type-lh-body); }
.offer-facts { padding: var(--space-4) var(--space-4) var(--space-3); }
.offer-facts dt { color: var(--text-mute); }
.offer-facts dd { overflow-wrap: anywhere; }
.offer-unavailable { color: var(--text-mute); font-weight: var(--type-weight-text); cursor: help; }
.offer-progress { display: grid; gap: var(--space-2); padding: 0 var(--space-4) var(--space-4); }
.offer-progress-text { margin: 0; display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--space-1) var(--space-3); color: var(--text-dim); }
.offer-actions .btn { border-radius: var(--radius); }
.offer-actions .btn.secondary { border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.offer-actions form { display: contents; }
/* With Invest, a card has three actions: the third takes the whole row. */
.offer-actions > form:nth-child(3) .btn, .offer-actions > :nth-child(3):not(form) { grid-column: 1 / -1; }
.fund-actions { display: grid; gap: var(--space-2); }
.interest-done { margin: 0; align-self: center; }
.chip-row { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.chip-row .chip { min-height: var(--touch); }
.chip-row .chip[aria-current='true'] { background: var(--ac-black-rock); border-color: var(--ac-black-rock); color: var(--ac-white); }
@media (min-width: 1024px) {
	.portfolio-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.investment-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.investment-cards h2 { grid-column: 1 / -1; }
	.offers { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
	.offers-head { grid-template-columns: 1fr auto; align-items: center; }
	.report-choice { grid-template-columns: 2fr repeat(3, minmax(0, 1fr)); }
	.report-choice .report-kind { grid-column: auto; }
}
.activity-fund { display: grid; grid-template-columns: 1fr auto; gap: var(--space-2); align-items: end; }
.activity-fund .btn { min-height: var(--touch); }

/* The scope switcher (spec 001, criterion 6): under the header on the scoped sections. */
.scope-switch { display: flex; align-items: end; gap: var(--space-2); padding: var(--space-3) var(--page-gutter) 0; max-width: 1200px; margin: 0 auto; }
.scope-field { flex: 1; display: grid; gap: 2px; min-width: 0; }
.scope-field select { min-height: var(--touch); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 0 var(--space-3); font: inherit; font-size: 16px; background: var(--surface); color: var(--text); width: 100%; }
.scope-field select:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.scope-switch .btn { min-height: var(--touch); }

/* Wide screens (docs/design/screens/home.md, "Layout at 1440"): the rail on the left replaces the
   bottom tab bar, with the current section marked by a bar on its inner edge; Home sets
   obligations beside the portfolio card, the greeting and every other card full width. */
@media (min-width: 1024px) {
	/* The design prototype's sidebar (decision 0019): the longer names, each count as a pill on the
	   right, the current section on a tinted row, Hide to fold it to its icons, and the Learn card. */
	body:has(.tabbar) { padding-bottom: 0; padding-left: var(--rail-w); }
	.tabbar { top: 0; right: auto; width: var(--rail-w); height: auto; padding: var(--space-4) var(--space-3); border-top: 0; border-right: 1px solid var(--border-soft); display: flex; flex-direction: column; gap: var(--space-1); overflow-y: auto; }
	.tab { display: flex; align-items: center; justify-content: flex-start; gap: var(--space-3); min-height: 48px; padding: 0 var(--space-3); border-radius: var(--radius-md); font-size: var(--type-size-body); line-height: var(--type-lh-body); }
	.tab:hover { background: var(--surface-2); }
	.tab[aria-current='page'] { background: var(--accent-soft); }
	.tab[aria-current='page']::before { display: none; }
	.tab[aria-current='page'] svg { padding: 0; margin: 0; background: none; }
	.tab-short { display: none; }
	.tab-long { display: inline; flex: 1; text-align: left; }
	.tab .badge { position: static; min-width: 24px; height: 24px; font-size: var(--type-size-caption); }
	.rail-hide { display: flex; align-items: center; gap: var(--space-2); min-height: 44px; margin-bottom: var(--space-2); padding: 0 var(--space-3); border: 1px solid var(--border-soft); border-radius: var(--radius-md); background: var(--surface); color: var(--text-dim); font: inherit; font-weight: var(--type-weight-strong); cursor: pointer; }
	.rail-hide svg { width: 20px; height: 20px; }
	.rail-learn { display: grid; gap: var(--space-2); margin-top: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--border-soft); }
	.rail-learn .caps { color: var(--text-dim); padding: 0 var(--space-1); }
	.rail-guide { display: flex; gap: var(--space-3); padding: var(--space-3); border: 1px dashed var(--border); border-radius: var(--radius-md); color: var(--text); text-decoration: none; }
	.rail-guide[aria-disabled='true'] { opacity: 0.55; cursor: not-allowed; }
	.rail-guide-icon { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: var(--radius-md); background: var(--accent); color: var(--ac-white); }
	.rail-guide-icon svg { width: 20px; height: 20px; }
	.rail-guide-text { display: grid; gap: 2px; }
	.pill.guide { font-size: 10px; vertical-align: middle; }
	/* Folded with Hide: the icons alone. */
	:root[data-rail-folded] body:has(.tabbar) { padding-left: var(--rail-w-folded); }
	:root[data-rail-folded] .tabbar { width: var(--rail-w-folded); padding: var(--space-4) var(--space-2); }
	:root[data-rail-folded] .tab { justify-content: center; padding: 0; position: relative; }
	:root[data-rail-folded] .tab-long, :root[data-rail-folded] .rail-hide span, :root[data-rail-folded] .rail-learn { display: none; }
	:root[data-rail-folded] .tab .badge { position: absolute; top: 4px; right: 6px; min-width: 16px; height: 16px; font-size: 10px; }
	:root[data-rail-folded] .rail-hide { justify-content: center; padding: 0; }
	:root[data-rail-folded] .rail-hide svg { transform: rotate(180deg); }
	body:has(.tabbar) .stack-label { left: calc(var(--rail-w) + var(--space-2)); }
	/* Home: what needs doing side by side, then the portfolio's ring beside its funds. */
	.home { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
	.home > :not(.attention):not(.calls-card) { grid-column: 1 / -1; }
	.portfolio-card .measure { grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: var(--space-8); }
	.portfolio-card .fund-rows { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}

/* Requests to the GP (spec 008): the request pages and their forms, the same in both trees. */
.requests { display: grid; gap: var(--space-4); max-width: 640px; margin: 0 auto; width: 100%; }
.rq-form { display: grid; gap: var(--space-3); }
.rq-field { display: grid; gap: var(--space-1); min-width: 0; }
.rq-label { font-size: var(--type-size-body); line-height: var(--type-lh-body); color: var(--text-dim); }
.rq-field input, .rq-field select, .rq-field textarea { font: inherit; font-size: 16px; width: 100%; min-height: var(--touch); padding: 0 var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); color: var(--text); }
.rq-field textarea { min-height: 120px; padding: var(--space-2) var(--space-3); resize: vertical; }
.rq-field [aria-invalid='true'] { border-color: var(--red); }
.rq-error { color: var(--red); font-size: var(--type-size-caption); line-height: var(--type-lh-caption); }
.rq-status { margin: 0; padding: var(--space-3); border-radius: var(--radius-md); background: var(--green-soft); color: var(--green); }
.rq-status.failed { background: var(--amber-soft); color: var(--amber); }
.rq-open { margin: 0; padding: var(--space-3); border-left: 3px solid var(--accent); border-radius: var(--radius-sm); background: var(--surface-2); display: grid; gap: var(--space-1); }
.rq-open p { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.rq-links { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-1); }
.rq-links a { min-height: var(--touch); display: flex; align-items: center; font-weight: var(--type-weight-strong); text-decoration: none; }
.rq-address { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.rq-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.rq-actions .btn, .rq-form .btn { min-height: var(--touch); }
.rq-actions form { display: contents; }

/* Onboarding (spec 009): Fund OS's onboarding wizard in the portal, on the request pages' forms. */
/* The summary: each answer under its question on a phone, the two side by side from 640px, wrapping
   within their columns so a long question never pushes the answers off the card. */
.ob-summary { display: grid; grid-template-columns: minmax(0, 1fr); margin: 0; }
.ob-summary dt { color: var(--text-mute); padding-top: var(--space-3); border-top: 1px solid var(--border-soft); overflow-wrap: anywhere; }
.ob-summary dt:first-of-type { border-top: 0; padding-top: 0; }
.ob-summary dd { margin: 0 0 var(--space-1); padding-bottom: var(--space-2); font-weight: var(--type-weight-strong); overflow-wrap: anywhere; }
@media (min-width: 640px) {
	.ob-summary { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); column-gap: var(--space-4); }
	.ob-summary dt, .ob-summary dd { padding: var(--space-2) 0; border-top: 1px solid var(--border-soft); margin: 0; }
	.ob-summary dt:first-of-type, .ob-summary dt:first-of-type + dd { border-top: 0; }
}
.ob-choices { border: 0; margin: 0; padding: 0; }
.ob-choice { display: flex; align-items: center; gap: var(--space-2); min-height: var(--touch); cursor: pointer; }
.ob-choice input { width: 20px; height: 20px; min-height: 0; margin: 0; }
.ob-address { border: 0; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.ob-section { display: grid; gap: var(--space-1); padding-top: var(--space-2); border-top: 1px solid var(--border-soft); }
.ob-section h2, .ob-section h3 { margin: 0; }
.ob-section.depth-2 { border-top: 0; padding-left: var(--space-3); }
.ob-info { display: grid; gap: var(--space-1); padding: var(--space-3); border-radius: var(--radius-md); background: var(--surface-2); }
[hidden] { display: none !important; }
.ob-unavailable .rq-label { color: var(--text-mute); }
