/* Shared page components: restrained density, clear actions, readable forms. */
.portal-wrap :is(.section-hint, .section-empty) {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}
.portal-wrap .section-empty { margin: 0; max-width: 58ch; }
.portal-wrap .section-hint { margin-bottom: 18px; }

:is(.workspace-page, .delivery-page, .project-page, .review-page, .enquiry-page, .action-page, .operations-page, .agent-shell, .agent-explorer) .portal-heading {
  margin: 24px 0 32px;
}
:is(.workspace-page, .delivery-page, .project-page, .review-page, .enquiry-page, .action-page, .operations-page, .agent-shell, .agent-explorer) .portal-heading h1 {
  max-width: 24ch;
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1.15;
  letter-spacing: -.045em;
  text-wrap: balance;
  margin: 12px 0 16px;
}
:is(.workspace-page, .delivery-page, .project-page, .review-page, .enquiry-page) .portal-heading > p:last-child {
  font-size: 17px;
  max-width: 65ch;
  color: var(--muted);
}
.portal-wrap .back-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  font-size: 14px;
}
.portal-wrap .section-heading {
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-bottom: 12px;
}
.portal-wrap .section-heading h2 { margin: 0; }
.portal-wrap .section-heading > :is(span, a) { font-size: 14px; }
.portal-wrap .record-row { gap: 20px; padding: 17px 0; }
.portal-wrap .record-row > :is(a, span) { font-size: 14px; }
.portal-wrap .record-row p { font-size: 15px; line-height: 1.55; }
.portal-wrap .record-row .kicker { font-size: 11px; letter-spacing: .07em; }
.portal-wrap .record-row h3 { font-size: 18px; margin: 6px 0; }
.portal-wrap a.record-row:hover h3 { text-decoration: underline; text-underline-offset: 5px; }
.portal-wrap .record-row small { font-size: 13px; }
.portal-wrap .empty-state { padding: 22px 24px; border: 1px solid var(--line); }
.portal-wrap .empty-state h2 { font-size: 22px; margin: 0 0 10px; }
.portal-wrap .empty-state p:last-child { margin-bottom: 0; }
.portal-wrap .account-note { font-size: 14px; line-height: 1.7; }
.portal-wrap .status-label { font-size: 12px; line-height: 1.4; padding: 5px 9px; }

.workspace-projects { margin-top: 34px; }
.workspace-overview { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 28px; align-items: start; margin-top: 30px; }
.workspace-overview .workspace-projects { margin-top: 0; }
.workspace-overview .project-grid { grid-template-columns: minmax(0, 1fr); }
.workspace-next { min-width: 0; }
.workspace-next .attention-row { grid-template-columns: minmax(0, 1fr); }
.workspace-next .attention-row__action { grid-column: 1; grid-row: auto; margin-top: 5px; }
.workspace-page .project-grid,
.delivery-page .project-grid { gap: 14px; }
.workspace-page .project-card,
.delivery-page .project-card { padding: 24px; background: var(--surface-tint); }
.workspace-page .project-card h2,
.delivery-page .project-card h3 { font-size: 22px; line-height: 1.35; margin: 16px 0 8px; }
.workspace-page .project-card p,
.delivery-page .project-card p { font-size: 15px; color: var(--muted); }
.workspace-page .project-card .text-link,
.delivery-page .project-card > span:last-child { font-size: 14px; }
.workspace-account { padding-top: 24px; border-top: 1px solid var(--line); }
.delivery-page .desk-pulse { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 26px 0; }
.delivery-page .desk-pulse a { padding: 20px; gap: 15px; }
.delivery-page .desk-pulse strong { font-size: 32px; font-variant-numeric: tabular-nums; }
.delivery-page .desk-pulse span { font-size: 14px; max-width: 17ch; }
.delivery-page .desk-filter { padding: 18px 0 24px; }
.delivery-page .desk-filter label { font-size: 14px; }
.delivery-page .desk-filter .button { margin: 0; }
.delivery-page .desk-section { margin: 36px 0; }
.delivery-page .desk-links { gap: 15px 26px; font-size: 14px; }

.project-page .project-tabs {
  gap: 8px;
  padding: 0 0 18px;
  margin-bottom: 26px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: thin;
}
.project-page .project-tabs a {
  flex: 0 0 auto;
  padding: 9px 13px;
  border-radius: 5px;
  background: var(--surface-tint);
  font-size: 14px;
  white-space: nowrap;
}
.project-page .project-tabs a:hover { background: var(--sage); }
.project-page .project-request-entry { padding: 18px 22px; border-radius: 8px; margin: 0 0 24px; }
.project-page .project-request-entry p { font-size: 14px; line-height: 1.6; }
.project-page .next-action-panel { padding: 26px; gap: 24px; }
.project-page .next-action-panel h2 { font-size: 28px; margin-bottom: 12px; max-width: 28ch; }
.project-page .next-action-panel p:last-child { margin-bottom: 0; }
.project-page .action-list { gap: 0; }
.project-page .action-list a { padding: 11px 0; font-size: 15px; border-bottom: 1px solid #e2e5da; }
.project-page .action-list a:last-child { border-bottom: 0; }
.project-page .note-item { padding: 17px 0; }
.project-page .surface > article + article { margin-top: 22px; }
.project-page .note-item form { margin: 8px 0 0; }
.project-page .version-details summary { font-size: 13px; }
.review-page .surface > h3 { margin-top: 24px; }
.review-page .callout { font-size: 15px; margin-bottom: 0; }
.enquiry-page .summary-facts,
.enquiry-status .summary-facts { display: grid; grid-template-columns: minmax(105px, 1fr) 2fr; gap: 12px 20px; margin: 24px 0; }
.enquiry-page .summary-facts dt,
.enquiry-status .summary-facts dt { font-size: 14px; color: var(--muted); }
.enquiry-page .summary-facts dd,
.enquiry-status .summary-facts dd { margin: 0; line-height: 1.6; }
.enquiry-triage hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }
.enquiry-triage > form + form { margin-top: 8px; }

.portal-form .field > label,
.portal-form .field-group label { margin-top: 0; }
.portal-form .field { margin-bottom: 22px; }
.portal-form :is(input, select, textarea) { min-width: 0; }
.portal-form .field--checkbox label {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  font-weight: 400;
  line-height: 1.6;
  cursor: pointer;
}
.portal-form .field--checkbox input[type="checkbox"] { flex: 0 0 auto; margin: 4px 0 0; }
.portal-form label .checkbox-copy { font: inherit; color: inherit; margin: 0; }
.portal-form .field--checkbox .helptext { margin-left: 29px; }
.portal-form .field-group { min-width: 0; }
.portal-form .helptext { font-size: 14px; line-height: 1.6; }
.portal-form .errorlist { margin: 8px 0 0; padding-left: 20px; color: var(--danger-text); font-size: 14px; line-height: 1.6; }
.portal-form .invalid :is(input, select, textarea) { border-color: #ad5539; }
.portal-form .form-errors p { font-size: 14px; }
.portal-wrap .form-action-row,
.portal-wrap .recovery-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 16px 24px; }
.portal-wrap .form-action-row { margin-top: 28px; }
.portal-wrap .form-action-row .button { margin: 0; }
.action-page .action-form { padding: 28px; }
.invitation-page > h1,
.recovery-page h1 { max-width: 25ch; text-wrap: balance; }
.invitation-page > p { max-width: 62ch; }
.invitation-page .portal-form { margin-top: 24px; }
.recovery-page .error-reference { padding: 16px 20px; border: 1px solid var(--line); border-radius: 6px; margin: 0 0 24px; }
.recovery-page .error-reference code { display: block; margin-top: 6px; }
.privacy-page h2 { margin-top: 32px; }
.privacy-page small { display: block; margin-top: 24px; color: var(--muted); }

@media (max-width: 800px) {
  .workspace-overview { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  .portal-wrap .record-row { gap: 14px; }
  .delivery-page .desk-pulse { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .delivery-page .desk-pulse a { align-items: flex-start; flex-direction: column; gap: 10px; padding: 18px; }
  .delivery-page .desk-pulse span { max-width: none; }
  .project-page .next-action-panel { padding: 22px; }
  .project-page .next-action-panel h2 { font-size: 25px; }
  .enquiry-page .summary-facts { grid-template-columns: 1fr; gap: 4px; }
  .enquiry-page .summary-facts dd { margin-bottom: 12px; }
}
@media (max-width: 480px) {
  .portal-wrap .record-row { align-items: flex-start; }
  .portal-wrap .record-row > :is(a, span) { font-size: 13px; padding-top: 7px; }
  .portal-wrap .form-action-row { align-items: stretch; flex-direction: column; gap: 18px; }
  .action-page .action-form { padding: 22px 18px; }
  .project-page .project-request-entry { padding: 18px; }
  .workspace-page .project-card, .delivery-page .project-card { padding: 22px; }
}

/* Short labels stay compact; instructions have enough room to read naturally. */
.portal-page :is(h1,h2,h3){text-wrap:balance}
.portal-page :is(.portal-heading>p,.empty-state p,.section-hint,.section-empty,.form-intro p,.auth-help,.inbox-intro){text-wrap:pretty}
.portal-page .portal-heading>p{line-height:1.65}
.portal-page .auth-help{font-size:15px;line-height:1.7}
.portal-wrap .record-row .kicker{font-size:12px}
