/* Legal-controls branch styles; production rules below remain authoritative for shared selectors. */
:root {
	--portal-ink: #171817;
	--portal-muted: #6d706d;
	--portal-line: #dedfd9;
	--portal-paper: #ffffff;
	--portal-ground: #f3f3ef;
	--portal-blue: #3158e8;
	--portal-gold: #c3a16a;
	--portal-radius: 24px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body.portal-page { margin: 0; background: var(--portal-ground); color: var(--portal-ink); font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.portal-page a { color: inherit; }
.portal-page button, .portal-page input, .portal-page select, .portal-page textarea { font: inherit; }
.portal-brand { display: inline-flex; align-items: center; gap: 14px; text-decoration: none; }
.portal-brand__mark { display: grid; width: 46px; height: 46px; place-items: center; border: 1px solid currentColor; border-radius: 14px; font: 700 16px/1 Georgia, serif; letter-spacing: -.04em; }
.portal-brand__text { display: grid; gap: 2px; font-size: 13px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.portal-brand__text small { color: var(--portal-gold); font-size: 8px; letter-spacing: .16em; }
.portal-eyebrow { margin: 0 0 18px; color: var(--portal-muted); font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.portal-button { display: inline-flex; min-height: 54px; align-items: center; justify-content: center; border: 0; border-radius: 999px; padding: 0 28px; cursor: pointer; text-decoration: none; font-weight: 700; }
.portal-button--primary { background: var(--portal-ink); color: #fff !important; }
.portal-button--primary:hover { background: var(--portal-blue); }

.portal-login { display: grid; min-height: 100vh; grid-template-columns: minmax(0, 1fr) minmax(480px, .92fr); }
.portal-login__intro { display: flex; min-height: 100vh; flex-direction: column; justify-content: space-between; padding: clamp(38px, 5vw, 76px); background: var(--portal-ink); color: #fff; }
.portal-login__statement { max-width: 760px; padding: 80px 0; }
.portal-login__statement .portal-eyebrow { color: #c6c8c5; }
.portal-login__statement h1 { max-width: 680px; margin: 0 0 30px; font: 500 clamp(42px, 5vw, 76px)/.98 Georgia, "Times New Roman", serif; letter-spacing: -.045em; }
.portal-login__statement > p:last-child { max-width: 610px; margin: 0; color: #b9bcb8; font-size: 18px; line-height: 1.65; }
.portal-login__privacy { margin: 0; color: #8e928d; font-size: 13px; }
.portal-login__panel { display: grid; min-height: 100vh; place-items: center; padding: 48px; }
.portal-auth-card { width: min(100%, 480px); }
.portal-auth-card h2 { margin: 0 0 16px; font: 500 clamp(38px, 4vw, 58px)/1.02 Georgia, "Times New Roman", serif; letter-spacing: -.04em; }
.portal-auth-card__intro { margin: 0 0 38px; color: var(--portal-muted); font-size: 16px; line-height: 1.65; }
.portal-alert { margin: 0 0 26px; border-left: 3px solid var(--portal-blue); padding: 14px 16px; background: #fff; font-size: 14px; line-height: 1.5; }
.portal-form { display: grid; gap: 22px; }
.portal-form label { display: grid; gap: 9px; color: #444743; font-size: 13px; font-weight: 700; }
.portal-form input[type="email"], .portal-form input[type="password"] { width: 100%; height: 58px; border: 1px solid #cfd1cb; border-radius: 14px; outline: none; padding: 0 17px; background: #fff; color: var(--portal-ink); }
.portal-form input:focus { border-color: var(--portal-blue); box-shadow: 0 0 0 3px rgba(49,88,232,.12); }
.portal-password { position: relative; display: block; }
.portal-password input { padding-right: 98px !important; }
.portal-password button { position: absolute; top: 50%; right: 14px; border: 0; padding: 6px; background: transparent; color: var(--portal-muted); cursor: pointer; font-size: 12px; }
.portal-check { display: flex !important; grid-template-columns: auto 1fr; align-items: center; gap: 10px !important; font-weight: 500 !important; }
.portal-check input { width: 17px; height: 17px; accent-color: var(--portal-blue); }
.portal-auth-card__back { display: inline-block; margin-top: 24px; color: var(--portal-muted) !important; font-size: 14px; text-decoration: none; }
.portal-auth-card__back:hover { color: var(--portal-blue) !important; }

.portal-shell { min-height: 100vh; }
.portal-sidebar { position: fixed; z-index: 20; inset: 0 auto 0 0; display: flex; width: 292px; flex-direction: column; padding: 34px 28px; border-right: 1px solid #2b2d2b; background: var(--portal-ink); color: #fff; }
.portal-sidebar__brand { margin-bottom: 68px; }
.portal-nav { display: grid; gap: 6px; }
.portal-nav a { border-radius: 12px; padding: 14px 16px; color: #9da19c; font-size: 14px; text-decoration: none; }
.portal-nav a:hover, .portal-nav a.is-current { background: #272927; color: #fff; }
.portal-nav a.is-current::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 12px; border-radius: 50%; background: var(--portal-gold); vertical-align: 2px; }
.portal-sidebar__footer { margin-top: auto; color: #858985; font-size: 12px; line-height: 1.5; }
.portal-sidebar__footer a { color: #d9dcd8; text-decoration: none; }
.portal-main { min-height: 100vh; margin-left: 292px; }
.portal-topbar { display: flex; min-height: 92px; align-items: center; justify-content: space-between; padding: 18px clamp(28px, 4vw, 64px); border-bottom: 1px solid var(--portal-line); background: rgba(243,243,239,.96); }
.portal-topbar__context { margin: 0; color: var(--portal-muted); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.portal-user { display: flex; align-items: center; gap: 13px; }
.portal-user__avatar { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 50%; background: var(--portal-ink); color: #fff; font-size: 13px; }
.portal-user > span:nth-child(2) { display: grid; gap: 2px; }
.portal-user strong { max-width: 220px; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.portal-user small { color: var(--portal-muted); font-size: 11px; }
.portal-user > a { margin-left: 14px; color: var(--portal-muted); font-size: 12px; text-decoration: none; }
.portal-menu-button { display: none; border: 1px solid var(--portal-line); border-radius: 999px; padding: 10px 16px; background: transparent; }
.portal-content { width: min(100%, 1440px); margin: 0 auto; padding: clamp(38px, 5vw, 78px) clamp(28px, 4vw, 64px); }
.portal-welcome { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 60px; align-items: end; margin-bottom: 55px; }
.portal-welcome h1 { margin: 0 0 20px; font: 500 clamp(42px, 5vw, 70px)/.98 Georgia, "Times New Roman", serif; letter-spacing: -.045em; }
.portal-welcome > div > p:last-child { max-width: 750px; margin: 0; color: var(--portal-muted); font-size: 16px; line-height: 1.65; }
.portal-system-status { display: grid; grid-template-columns: 10px 1fr; gap: 5px 12px; border-top: 1px solid var(--portal-line); padding-top: 20px; }
.portal-system-status > span { width: 9px; height: 9px; margin-top: 4px; border-radius: 50%; background: var(--portal-gold); }
.portal-system-status strong { font-size: 13px; }
.portal-system-status small { grid-column: 2; color: var(--portal-muted); font-size: 11px; line-height: 1.5; }
.portal-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 54px; }
.portal-metric { min-height: 180px; border: 1px solid var(--portal-line); border-radius: 18px; padding: 24px; background: var(--portal-paper); }
.portal-metric__label { margin: 0 0 34px; color: var(--portal-muted); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.portal-metric__value { margin: 0 0 9px; font: 500 28px/1.1 Georgia, serif; }
.portal-metric__status { margin: 0; color: var(--portal-muted); font-size: 12px; line-height: 1.45; }
.portal-section { scroll-margin-top: 30px; margin-top: 18px; border: 1px solid var(--portal-line); border-radius: var(--portal-radius); padding: clamp(28px, 4vw, 52px); background: var(--portal-paper); }
.portal-section__heading { display: flex; align-items: start; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--portal-line); padding-bottom: 30px; }
.portal-section__heading h2 { margin: 0; font: 500 clamp(31px, 3vw, 46px)/1 Georgia, serif; letter-spacing: -.035em; }
.portal-section__heading > span { border: 1px solid var(--portal-line); border-radius: 999px; padding: 8px 12px; color: var(--portal-muted); font-size: 10px; text-transform: uppercase; white-space: nowrap; }
.portal-empty { display: grid; grid-template-columns: 84px 1fr; gap: 32px; padding-top: 38px; }
.portal-empty__number { margin: 0; color: var(--portal-gold); font: 500 24px/1 Georgia, serif; }
.portal-empty h3 { margin: 0 0 12px; font-size: 18px; }
.portal-empty div p { max-width: 760px; margin: 0; color: var(--portal-muted); line-height: 1.65; }
.portal-marketplace__meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-top: 36px; overflow: hidden; border: 1px solid var(--portal-line); border-radius: 16px; background: var(--portal-line); }
.portal-marketplace__meta > div { display: grid; min-height: 104px; align-content: space-between; gap: 16px; padding: 20px; background: var(--portal-paper); }
.portal-marketplace__meta span { color: var(--portal-muted); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.portal-marketplace__meta strong { font-size: 13px; line-height: 1.45; }
.portal-marketplace__metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 14px; }
.portal-marketplace-card { display: grid; min-height: 190px; align-content: space-between; gap: 24px; border: 1px solid var(--portal-line); border-radius: 18px; padding: 24px; background: #f8f8f5; }
.portal-marketplace-card > span { color: var(--portal-muted); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.portal-marketplace-card > strong { font: 500 clamp(24px, 2.2vw, 36px)/1 Georgia, serif; letter-spacing: -.025em; }
.portal-marketplace-card > small { color: var(--portal-muted); font-size: 11px; line-height: 1.5; }
.portal-marketplace-card--accent { border-color: #c7d0f7; background: #f4f6ff; }
.portal-marketplace__columns { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr); gap: 54px; margin-top: 48px; }
.portal-marketplace__columns h3 { margin: 0 0 24px; font: 500 25px/1.15 Georgia, serif; }
.portal-data-list { margin: 0; border-top: 1px solid var(--portal-line); }
.portal-data-list > div { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; padding: 15px 0; border-bottom: 1px solid var(--portal-line); }
.portal-data-list dt { color: var(--portal-muted); font-size: 13px; }
.portal-data-list dd { margin: 0; font-size: 13px; font-weight: 700; white-space: nowrap; }
.portal-tax-status { border-left: 1px solid var(--portal-line); padding-left: 42px; }
.portal-tax-status h3 { margin-bottom: 18px; }
.portal-tax-status__value { margin: 0 0 16px !important; color: var(--portal-ink) !important; font: 500 25px/1.15 Georgia, serif; }
.portal-tax-status > p:last-child { margin: 0; color: var(--portal-muted); font-size: 13px; line-height: 1.65; }
.portal-report-history { margin-top: 48px; }
.portal-report-history h3 { margin: 0 0 22px; font: 500 25px/1.15 Georgia, serif; }
.portal-report-history__head, .portal-report-history__row { display: grid; grid-template-columns: 1.2fr repeat(3, 1fr); gap: 18px; align-items: center; }
.portal-report-history__head { padding: 0 16px 12px; color: var(--portal-muted); font-size: 10px; letter-spacing: .09em; text-transform: uppercase; }
.portal-report-history__row { min-height: 58px; border-top: 1px solid var(--portal-line); padding: 12px 16px; font-size: 12px; }
.portal-report-history__row strong { font-size: 12px; }
.portal-marketplace__notice { margin: 42px 0 0; border-top: 1px solid var(--portal-line); padding-top: 24px; color: var(--portal-muted); font-size: 12px; line-height: 1.65; }
.portal-integration { display: flex; align-items: center; justify-content: space-between; gap: 30px; padding-top: 38px; }
.portal-integration + .portal-integration { margin-top: 32px; border-top: 1px solid var(--portal-line); }
.portal-integration__name { margin: 0 0 8px; font-weight: 700; }
.portal-integration div p:last-child { max-width: 720px; margin: 0; color: var(--portal-muted); line-height: 1.6; }
.portal-integration > span { color: var(--portal-muted); font-size: 12px; }
.portal-content__footer { padding: 38px 0 0; color: var(--portal-muted); font-size: 12px; line-height: 1.6; }
.portal-ai-form { display: grid; gap: 20px; padding-top: 34px; }
.portal-ai-form label { display: grid; gap: 8px; color: var(--portal-muted); font-size: 12px; font-weight: 700; }
.portal-ai-form select, .portal-ai-form textarea, .portal-ai-form input { width: 100%; border: 1px solid var(--portal-line); border-radius: 12px; padding: 13px 14px; background: #fff; color: var(--portal-ink); }
.portal-ai-form textarea { resize: vertical; line-height: 1.55; }
.portal-ai-form__meta { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.portal-ai-form .portal-button { justify-self: start; }
.portal-ai-form__note, .portal-ai-disabled { margin: 0; color: var(--portal-muted); font-size: 12px; line-height: 1.6; }
.portal-ai-disabled { padding-top: 30px; }
.portal-ai-result { margin-top: 28px; border: 1px solid var(--portal-line); border-radius: 18px; padding: 24px; background: #f8f8f5; }
.portal-ai-result header { display: flex; justify-content: space-between; gap: 20px; }
.portal-ai-result header strong { color: #8b5b14; }
.portal-ai-result header span { color: var(--portal-muted); font-size: 11px; }
.portal-ai-result dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 22px 0; }
.portal-ai-result dl div { border-top: 1px solid var(--portal-line); padding-top: 10px; }
.portal-ai-result dt { color: var(--portal-muted); font-size: 10px; text-transform: uppercase; }
.portal-ai-result dd { margin: 5px 0 0; font-size: 12px; font-weight: 700; }
.portal-ai-result__text { font-size: 15px; line-height: 1.65; }
.portal-ai-warning { margin-top: 22px; border-left: 3px solid var(--portal-gold); padding: 16px 18px; background: #fff; color: var(--portal-muted); font-size: 12px; line-height: 1.6; }
.portal-ai-warning p { margin: 0; }
.portal-ai-warning p + p { margin-top: 10px; }

@media (max-width: 1120px) {
	.portal-metrics { grid-template-columns: repeat(2, 1fr); }
	.portal-welcome { grid-template-columns: 1fr; gap: 32px; }
	.portal-marketplace__meta, .portal-marketplace__metrics { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
	.portal-login { grid-template-columns: 1fr; }
	.portal-login__intro { min-height: auto; padding: 34px 28px 48px; }
	.portal-login__statement { padding: 80px 0 60px; }
	.portal-login__panel { min-height: auto; padding: 72px 28px; }
	.portal-sidebar { transform: translateX(-100%); transition: transform .25s ease; }
	.portal-sidebar.is-open { transform: translateX(0); }
	.portal-main { margin-left: 0; }
	.portal-menu-button { display: inline-flex; }
	.portal-topbar__context { display: none; }
}
@media (max-width: 620px) {
	.portal-login__statement h1 { font-size: 42px; }
	.portal-login__statement > p:last-child { font-size: 16px; }
	.portal-login__panel { padding: 58px 22px; }
	.portal-topbar { padding: 14px 18px; }
	.portal-user > span:nth-child(2), .portal-user > a { display: none; }
	.portal-content { padding: 42px 18px; }
	.portal-welcome h1 { font-size: 42px; }
	.portal-metrics { grid-template-columns: 1fr; }
	.portal-metric { min-height: 150px; }
	.portal-section { border-radius: 18px; padding: 28px 22px; }
	.portal-section__heading { display: grid; }
	.portal-section__heading > span { justify-self: start; }
	.portal-empty { grid-template-columns: 1fr; gap: 18px; }
	.portal-integration { align-items: start; flex-direction: column; }
	.portal-marketplace__meta, .portal-marketplace__metrics, .portal-marketplace__columns { grid-template-columns: 1fr; }
	.portal-ai-form__meta, .portal-ai-result dl { grid-template-columns: 1fr; }
	.portal-marketplace__meta { gap: 1px; }
	.portal-marketplace-card { min-height: 160px; }
	.portal-marketplace__columns { gap: 36px; }
	.portal-tax-status { border-top: 1px solid var(--portal-line); border-left: 0; padding-top: 32px; padding-left: 0; }
	.portal-report-history__head { display: none; }
	.portal-report-history__row { grid-template-columns: 1fr 1fr; gap: 18px 24px; padding: 18px 0; }
	.portal-report-history__row > * { display: grid; gap: 5px; }
	.portal-report-history__row > *::before { content: attr(data-label); color: var(--portal-muted); font-size: 9px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }
}
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.portal-sidebar { transition: none; }
}

/* Production 1.0.0 styles. */
:root {
	--portal-ink: #171817;
	--portal-muted: #6d706d;
	--portal-line: #dedfd9;
	--portal-paper: #ffffff;
	--portal-ground: #f3f3ef;
	--portal-blue: #3158e8;
	--portal-gold: #c3a16a;
	--portal-radius: 24px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body.portal-page { margin: 0; background: var(--portal-ground); color: var(--portal-ink); font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.portal-page a { color: inherit; }
.portal-page button, .portal-page input { font: inherit; }
.portal-brand { display: inline-flex; align-items: center; gap: 14px; text-decoration: none; }
.portal-brand__mark { display: grid; width: 46px; height: 46px; place-items: center; border: 1px solid currentColor; border-radius: 14px; font: 700 16px/1 Georgia, serif; letter-spacing: -.04em; }
.portal-eyebrow { margin: 0 0 18px; color: var(--portal-muted); font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.portal-button { display: inline-flex; min-height: 54px; align-items: center; justify-content: center; border: 0; border-radius: 999px; padding: 0 28px; cursor: pointer; text-decoration: none; font-weight: 700; }
.portal-button--primary { background: var(--portal-ink); color: #fff !important; }
.portal-button--primary:hover { background: var(--portal-blue); }
.portal-button--secondary { min-height: 42px; border: 1px solid var(--portal-line); padding: 0 20px; background: var(--portal-paper); color: var(--portal-ink); font-size: 12px; }
.portal-button--secondary:hover { border-color: var(--portal-blue); color: var(--portal-blue); }
.portal-page a:focus-visible, .portal-page button:focus-visible, .portal-page input:focus-visible, .portal-page select:focus-visible { outline: 3px solid rgba(49,88,232,.3); outline-offset: 3px; }

.portal-login { display: grid; min-height: 100vh; grid-template-columns: minmax(0, 1fr) minmax(480px, .92fr); }
.portal-login__intro { display: flex; min-height: 100vh; flex-direction: column; justify-content: space-between; padding: clamp(38px, 5vw, 76px); background: var(--portal-ink); color: #fff; }
.portal-login__statement { max-width: 760px; padding: 80px 0; }
.portal-login__statement .portal-eyebrow { color: #c6c8c5; }
.portal-login__statement h1 { max-width: 680px; margin: 0 0 30px; font: 500 clamp(42px, 5vw, 76px)/.98 Georgia, "Times New Roman", serif; letter-spacing: -.045em; }
.portal-login__statement > p:last-child { max-width: 610px; margin: 0; color: #b9bcb8; font-size: 18px; line-height: 1.65; }
.portal-login__privacy { margin: 0; color: #8e928d; font-size: 13px; }
.portal-login__panel { display: grid; min-height: 100vh; place-items: center; padding: 48px; }
.portal-auth-card { width: min(100%, 480px); }
.portal-auth-card h2 { margin: 0 0 16px; font: 500 clamp(38px, 4vw, 58px)/1.02 Georgia, "Times New Roman", serif; letter-spacing: -.04em; }
.portal-auth-card__intro { margin: 0 0 38px; color: var(--portal-muted); font-size: 16px; line-height: 1.65; }
.portal-alert { margin: 0 0 26px; border-left: 3px solid var(--portal-blue); padding: 14px 16px; background: #fff; font-size: 14px; line-height: 1.5; }
.portal-form { display: grid; gap: 22px; }
.portal-form label { display: grid; gap: 9px; color: #444743; font-size: 13px; font-weight: 700; }
.portal-form input[type="email"], .portal-form input[type="password"] { width: 100%; height: 58px; border: 1px solid #cfd1cb; border-radius: 14px; outline: none; padding: 0 17px; background: #fff; color: var(--portal-ink); }
.portal-form input:focus { border-color: var(--portal-blue); box-shadow: 0 0 0 3px rgba(49,88,232,.12); }
.portal-password { position: relative; display: block; }
.portal-password input { padding-right: 98px !important; }
.portal-password button { position: absolute; top: 50%; right: 14px; border: 0; padding: 6px; background: transparent; color: var(--portal-muted); cursor: pointer; font-size: 12px; }
.portal-check { display: flex !important; grid-template-columns: auto 1fr; align-items: center; gap: 10px !important; font-weight: 500 !important; }
.portal-check input { width: 17px; height: 17px; accent-color: var(--portal-blue); }
.portal-auth-card__back { display: inline-block; margin-top: 24px; color: var(--portal-muted) !important; font-size: 14px; text-decoration: none; }
.portal-auth-card__back:hover { color: var(--portal-blue) !important; }

.portal-shell { min-height: 100vh; }
.portal-sidebar { position: fixed; z-index: 20; inset: 0 auto 0 0; display: flex; width: 292px; flex-direction: column; padding: 34px 28px; border-right: 1px solid #2b2d2b; background: var(--portal-ink); color: #fff; }
.portal-sidebar__brand { margin-bottom: 68px; }
.portal-nav { display: grid; gap: 6px; }
.portal-nav a { border-radius: 12px; padding: 14px 16px; color: #9da19c; font-size: 14px; text-decoration: none; }
.portal-nav a:hover, .portal-nav a.is-current { background: #272927; color: #fff; }
.portal-nav a.is-current::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 12px; border-radius: 50%; background: var(--portal-gold); vertical-align: 2px; }
.portal-sidebar__footer { margin-top: auto; color: #858985; font-size: 12px; line-height: 1.5; }
.portal-sidebar__footer a { color: #d9dcd8; text-decoration: none; }
.portal-main { min-height: 100vh; margin-left: 292px; }
.portal-topbar { display: flex; min-height: 92px; align-items: center; justify-content: space-between; padding: 18px clamp(28px, 4vw, 64px); border-bottom: 1px solid var(--portal-line); background: rgba(243,243,239,.96); }
.portal-topbar__context { margin: 0; color: var(--portal-muted); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.portal-user { display: flex; align-items: center; gap: 13px; }
.portal-user__avatar { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 50%; background: var(--portal-ink); color: #fff; font-size: 13px; }
.portal-user > span:nth-child(2) { display: grid; gap: 2px; }
.portal-user strong { max-width: 220px; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.portal-user small { color: var(--portal-muted); font-size: 11px; }
.portal-user > a { margin-left: 14px; color: var(--portal-muted); font-size: 12px; text-decoration: none; }
.portal-menu-button { display: none; border: 1px solid var(--portal-line); border-radius: 999px; padding: 10px 16px; background: transparent; }
.portal-organization-switcher { display: flex; align-items: end; gap: 10px; }
.portal-organization-switcher label { display: grid; gap: 4px; }
.portal-organization-switcher label span { color: var(--portal-muted); font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.portal-organization-switcher select { width: min(32vw, 360px); height: 42px; border: 1px solid var(--portal-line); border-radius: 12px; padding: 0 38px 0 13px; background: var(--portal-paper); color: var(--portal-ink); }
.portal-organization-switcher button { min-height: 42px; border: 0; border-radius: 999px; padding: 0 18px; background: var(--portal-ink); color: #fff; cursor: pointer; }
.portal-content { width: min(100%, 1440px); margin: 0 auto; padding: clamp(38px, 5vw, 78px) clamp(28px, 4vw, 64px); }
.portal-welcome { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 60px; align-items: end; margin-bottom: 55px; }
.portal-welcome h1 { margin: 0 0 20px; font: 500 clamp(42px, 5vw, 70px)/.98 Georgia, "Times New Roman", serif; letter-spacing: -.045em; }
.portal-welcome > div > p:last-child { max-width: 750px; margin: 0; color: var(--portal-muted); font-size: 16px; line-height: 1.65; }
.portal-system-status { display: grid; grid-template-columns: 10px 1fr; gap: 5px 12px; border-top: 1px solid var(--portal-line); padding-top: 20px; }
.portal-system-status > span { width: 9px; height: 9px; margin-top: 4px; border-radius: 50%; background: var(--portal-gold); }
.portal-system-status strong { font-size: 13px; }
.portal-system-status small { grid-column: 2; color: var(--portal-muted); font-size: 11px; line-height: 1.5; }
.portal-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 54px; }
.portal-metric { min-height: 180px; border: 1px solid var(--portal-line); border-radius: 18px; padding: 24px; background: var(--portal-paper); }
.portal-metric__label { margin: 0 0 34px; color: var(--portal-muted); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.portal-metric__value { margin: 0 0 9px; font: 500 28px/1.1 Georgia, serif; }
.portal-metric__status { margin: 0; color: var(--portal-muted); font-size: 12px; line-height: 1.45; }
.portal-section { scroll-margin-top: 30px; margin-top: 18px; border: 1px solid var(--portal-line); border-radius: var(--portal-radius); padding: clamp(28px, 4vw, 52px); background: var(--portal-paper); }
.portal-section__heading { display: flex; align-items: start; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--portal-line); padding-bottom: 30px; }
.portal-section__heading h2 { margin: 0; font: 500 clamp(31px, 3vw, 46px)/1 Georgia, serif; letter-spacing: -.035em; }
.portal-section__heading > span { border: 1px solid var(--portal-line); border-radius: 999px; padding: 8px 12px; color: var(--portal-muted); font-size: 10px; text-transform: uppercase; white-space: nowrap; }
.portal-section__action { display: inline-flex; min-height: 38px; align-items: center; border: 1px solid var(--portal-line); border-radius: 999px; padding: 0 16px; color: var(--portal-muted) !important; font-size: 11px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.portal-section__action:hover { border-color: var(--portal-blue); color: var(--portal-blue) !important; }
.portal-empty { display: grid; grid-template-columns: 84px 1fr; gap: 32px; padding-top: 38px; }
.portal-empty__number { margin: 0; color: var(--portal-gold); font: 500 24px/1 Georgia, serif; }
.portal-empty h3 { margin: 0 0 12px; font-size: 18px; }
.portal-empty div p { max-width: 760px; margin: 0; color: var(--portal-muted); line-height: 1.65; }
.portal-state { min-height: 340px; }
.portal-state h1 { max-width: 760px; margin: 0 0 22px; font: 500 clamp(38px, 5vw, 68px)/1 Georgia, serif; letter-spacing: -.04em; }
.portal-state > p:last-child { max-width: 720px; color: var(--portal-muted); font-size: 16px; line-height: 1.65; }
.portal-table-wrap { overflow-x: auto; margin-top: 30px; }
.portal-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.portal-table th { padding: 0 14px 13px; color: var(--portal-muted); font-size: 9px; letter-spacing: .1em; text-align: left; text-transform: uppercase; }
.portal-table td { min-width: 110px; padding: 18px 14px; border-top: 1px solid var(--portal-line); vertical-align: top; line-height: 1.45; }
.portal-table td:first-child { min-width: 190px; }
.portal-table td > strong, .portal-table td > span, .portal-table td > small { display: block; }
.portal-table td small { margin-top: 5px; color: var(--portal-muted); font-size: 10px; line-height: 1.45; }
.portal-status { display: inline-flex; width: fit-content; border-radius: 999px; padding: 6px 9px; background: #f0f1ed; color: #4f534e; font-size: 9px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.portal-status--accepted, .portal-status--paid, .portal-status--completed { background: #e9f5ed; color: #23643b; }
.portal-status--rejected, .portal-status--overdue { background: #fbecec; color: #9c2d2d; }
.portal-status--clarification_required, .portal-status--partially_paid { background: #fff3dc; color: #8a5b09; }
.portal-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 30px; }
.portal-record-card { border: 1px solid var(--portal-line); border-radius: 18px; padding: 24px; background: #fafaf7; }
.portal-record-card__head { display: flex; align-items: start; justify-content: space-between; gap: 18px; margin-bottom: 24px; }
.portal-record-card__head h3 { margin: 0; font: 500 26px/1.1 Georgia, serif; }
.portal-record-card__meta { margin: 20px 0 0; color: var(--portal-muted); font-size: 11px; line-height: 1.55; }
.portal-record-card > p:last-child:not(.portal-record-card__meta) { margin: 14px 0 0; font-size: 13px; line-height: 1.55; }
.portal-timeline { margin-top: 28px; }
.portal-timeline article { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 28px; align-items: start; padding: 22px 0; border-bottom: 1px solid var(--portal-line); }
.portal-timeline article:last-child { border-bottom: 0; }
.portal-timeline time { color: var(--portal-muted); font-size: 12px; font-weight: 700; }
.portal-timeline h3, .portal-document-list h3, .portal-notification-list h3 { margin: 0 0 8px; font-size: 17px; }
.portal-timeline p, .portal-document-list p, .portal-notification-list p { margin: 0; color: var(--portal-muted); font-size: 13px; line-height: 1.55; }
.portal-timeline small, .portal-document-list small { display: block; margin-top: 9px; color: var(--portal-muted); font-size: 10px; line-height: 1.5; }
.portal-document-list, .portal-notification-list { margin-top: 28px; }
.portal-document-list article, .portal-notification-list article { display: flex; align-items: center; justify-content: space-between; gap: 28px; padding: 22px 0; border-bottom: 1px solid var(--portal-line); }
.portal-document-list article:last-child, .portal-notification-list article:last-child { border-bottom: 0; }
.portal-document-list .portal-eyebrow, .portal-notification-list .portal-eyebrow { margin-bottom: 8px; }
.portal-notification-list article.is-unread { border-left: 3px solid var(--portal-blue); padding-left: 18px; }
.portal-notification-list article.is-read { opacity: .72; }
.portal-live-status { min-height: 20px; margin-top: 18px; color: #23643b; font-size: 12px; }
.portal-journal { display: grid; gap: 0; margin: 26px 0 0; padding: 0; list-style: none; }
.portal-journal li { display: grid; grid-template-columns: 10px 1fr; gap: 14px; align-items: start; padding: 14px 0; border-bottom: 1px solid var(--portal-line); }
.portal-journal li > span { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--portal-gold); }
.portal-journal li div { display: flex; justify-content: space-between; gap: 20px; }
.portal-journal strong { font-size: 13px; }
.portal-journal small { color: var(--portal-muted); font-size: 11px; white-space: nowrap; }
.portal-marketplace-providers { display: grid; gap: 18px; margin-top: 30px; }
.portal-marketplace-provider { border: 1px solid var(--portal-line); border-radius: 20px; padding: clamp(22px, 3vw, 34px); background: #fafaf7; }
.portal-marketplace-provider__heading { display: flex; align-items: start; justify-content: space-between; gap: 24px; }
.portal-marketplace-provider__heading h3 { margin: 0; font: 500 clamp(26px, 2.4vw, 36px)/1.05 Georgia, serif; letter-spacing: -.03em; }
.portal-marketplace-provider .portal-status--connected { background: #e9f5ed; color: #23643b; }
.portal-marketplace-provider + .portal-marketplace-provider { margin-top: 0; }
.portal-marketplace-provider .portal-empty--compact { padding-top: 28px; }
.portal-marketplace__meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-top: 36px; overflow: hidden; border: 1px solid var(--portal-line); border-radius: 16px; background: var(--portal-line); }
.portal-marketplace__meta > div { display: grid; min-height: 104px; align-content: space-between; gap: 16px; padding: 20px; background: var(--portal-paper); }
.portal-marketplace__meta span { color: var(--portal-muted); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.portal-marketplace__meta strong { font-size: 13px; line-height: 1.45; }
.portal-marketplace__metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 14px; }
.portal-marketplace-card { display: grid; min-height: 190px; align-content: space-between; gap: 24px; border: 1px solid var(--portal-line); border-radius: 18px; padding: 24px; background: #f8f8f5; }
.portal-marketplace-card > span { color: var(--portal-muted); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.portal-marketplace-card > strong { font: 500 clamp(24px, 2.2vw, 36px)/1 Georgia, serif; letter-spacing: -.025em; }
.portal-marketplace-card > small { color: var(--portal-muted); font-size: 11px; line-height: 1.5; }
.portal-marketplace-card--accent { border-color: #c7d0f7; background: #f4f6ff; }
.portal-marketplace__columns { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr); gap: 54px; margin-top: 48px; }
.portal-marketplace__columns h3 { margin: 0 0 24px; font: 500 25px/1.15 Georgia, serif; }
.portal-marketplace__columns h4, .portal-report-history h4 { margin: 0 0 24px; font: 500 25px/1.15 Georgia, serif; }
.portal-marketplace__columns--single { grid-template-columns: 1fr; }
.portal-data-list { margin: 0; border-top: 1px solid var(--portal-line); }
.portal-data-list > div { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; padding: 15px 0; border-bottom: 1px solid var(--portal-line); }
.portal-data-list dt { color: var(--portal-muted); font-size: 13px; }
.portal-data-list dd { margin: 0; font-size: 13px; font-weight: 700; white-space: nowrap; }
.portal-report-history { margin-top: 48px; }
.portal-report-history h3 { margin: 0 0 22px; font: 500 25px/1.15 Georgia, serif; }
.portal-report-history__head, .portal-report-history__row { display: grid; grid-template-columns: 1.2fr repeat(3, 1fr); gap: 18px; align-items: center; }
.portal-report-history__head { padding: 0 16px 12px; color: var(--portal-muted); font-size: 10px; letter-spacing: .09em; text-transform: uppercase; }
.portal-report-history__row { min-height: 58px; border-top: 1px solid var(--portal-line); padding: 12px 16px; font-size: 12px; }
.portal-report-history__row strong { font-size: 12px; }
.portal-marketplace__notice { margin: 42px 0 0; border-top: 1px solid var(--portal-line); padding-top: 24px; color: var(--portal-muted); font-size: 12px; line-height: 1.65; }
.portal-content__footer { padding: 38px 0 0; color: var(--portal-muted); font-size: 12px; line-height: 1.6; }

@media (max-width: 1120px) {
	.portal-metrics { grid-template-columns: repeat(2, 1fr); }
	.portal-welcome { grid-template-columns: 1fr; gap: 32px; }
	.portal-card-grid { grid-template-columns: 1fr; }
	.portal-marketplace__meta, .portal-marketplace__metrics { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
	.portal-login { grid-template-columns: 1fr; }
	.portal-login__intro { min-height: auto; padding: 34px 28px 48px; }
	.portal-login__statement { padding: 80px 0 60px; }
	.portal-login__panel { min-height: auto; padding: 72px 28px; }
	.portal-sidebar { transform: translateX(-100%); transition: transform .25s ease; }
	.portal-sidebar.is-open { transform: translateX(0); }
	.portal-main { margin-left: 0; }
	.portal-menu-button { display: inline-flex; }
	.portal-topbar__context { display: none; }
	.portal-organization-switcher { margin: 0 auto; }
	.portal-organization-switcher select { width: min(44vw, 360px); }
}
@media (max-width: 620px) {
	.portal-login__statement h1 { font-size: 42px; }
	.portal-login__statement > p:last-child { font-size: 16px; }
	.portal-login__panel { padding: 58px 22px; }
	.portal-topbar { padding: 14px 18px; }
	.portal-organization-switcher button { display: none; }
	.portal-organization-switcher select { width: 48vw; }
	.portal-user > span:nth-child(2), .portal-user > a { display: none; }
	.portal-content { padding: 42px 18px; }
	.portal-welcome h1 { font-size: 42px; }
	.portal-metrics { grid-template-columns: 1fr; }
	.portal-metric { min-height: 150px; }
	.portal-section { border-radius: 18px; padding: 28px 22px; }
	.portal-section__heading { display: grid; }
	.portal-section__heading > span { justify-self: start; }
	.portal-section__action { justify-self: start; }
	.portal-empty { grid-template-columns: 1fr; gap: 18px; }
	.portal-marketplace-provider__heading { flex-direction: column; }
	.portal-marketplace__meta, .portal-marketplace__metrics, .portal-marketplace__columns { grid-template-columns: 1fr; }
	.portal-marketplace__meta { gap: 1px; }
	.portal-marketplace-card { min-height: 160px; }
	.portal-marketplace__columns { gap: 36px; }
	.portal-report-history__head { display: none; }
	.portal-report-history__row { grid-template-columns: 1fr 1fr; gap: 18px 24px; padding: 18px 0; }
	.portal-report-history__row > * { display: grid; gap: 5px; }
	.portal-report-history__row > *::before { content: attr(data-label); color: var(--portal-muted); font-size: 9px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }
	.portal-table thead { display: none; }
	.portal-table, .portal-table tbody, .portal-table tr, .portal-table td { display: block; width: 100%; }
	.portal-table tr { border-top: 1px solid var(--portal-line); padding: 14px 0; }
	.portal-table td { display: grid; min-width: 0 !important; grid-template-columns: 100px minmax(0, 1fr); gap: 16px; border: 0; padding: 7px 0; }
	.portal-table td::before { content: attr(data-label); color: var(--portal-muted); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
	.portal-timeline article { grid-template-columns: 1fr; gap: 10px; }
	.portal-document-list article, .portal-notification-list article { align-items: start; flex-direction: column; }
	.portal-journal li div { align-items: start; flex-direction: column; gap: 5px; }
}
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.portal-sidebar { transition: none; }
}

/* Public legal documents must reflow independently of the sign-in card. */
.portal-legal-page .portal-login {
	grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
}
.portal-legal-page .portal-login__intro,
.portal-legal-page .portal-login__panel {
	min-width: 0;
	min-height: auto;
}
.portal-legal-page .portal-login__intro {
	justify-content: flex-start;
	gap: 48px;
}
.portal-legal-page .portal-login__statement { padding: 0; }
.portal-legal-page .portal-login__statement h1 {
	font-size: clamp(32px, 4vw, 56px);
	line-height: 1.08;
	overflow-wrap: anywhere;
}
.portal-legal-page .portal-login__panel { align-items: start; }
.portal-legal-document {
	min-width: 0;
	width: 100%;
	max-width: 760px;
	line-height: 1.7;
	overflow-wrap: anywhere;
}
.portal-legal-document h2 {
	margin: 36px 0 16px;
	font-size: clamp(24px, 2.5vw, 34px);
	line-height: 1.15;
}
@media (max-width: 900px) {
	.portal-legal-page .portal-login { grid-template-columns: minmax(0, 1fr); }
}
