:root {
  color-scheme: light;
  --ink: #19352e;
  --muted: #65756e;
  --line: #dce3dc;
  --paper: #f5f6f0;
  --green: #205c46;
  --on-accent: #ffffff;
  --green-hover: #174b37;
  --surface: #ffffff;
  --soft: #eef2eb;
  --link: #205c46;
  --focus: #bd750d;
  --portal-font: system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.6 var(--portal-font); }
a { color: var(--link); text-underline-offset: 4px; text-decoration-thickness: 1px; }
button, input, select, textarea { font: inherit; }
button, .button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 10px 18px; border: 1px solid var(--green);
  border-radius: 5px; background: var(--green); color: var(--on-accent);
  font-size: 14px; font-weight: 600; line-height: 1.4; text-align: center;
  text-decoration: none; cursor: pointer;
}
button:hover, .button:hover { background: var(--green-hover); }
.secondary { background: var(--surface); color: var(--link); border-color: var(--line); }
.secondary:hover { background: var(--soft); color: var(--ink); border-color: var(--muted); }
.quiet { background: transparent; color: var(--ink); border-color: var(--line); font-size: 12px; padding: 8px 12px; min-height: 36px; }
.quiet:hover { background: var(--soft); color: var(--ink); border-color: var(--muted); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
#main:focus { outline: none; }

/* Shared shell: identity, navigation and account each have their own place. */
.top { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 32px; padding: 22px 4vw 0; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: flex; flex-direction: column; align-items: flex-start; max-width: 360px; margin-bottom: 20px; color: var(--ink); font-size: 24px; font-weight: 700; letter-spacing: -.8px; line-height: 1.2; text-decoration: none; overflow-wrap: anywhere; }
.brand span { margin-top: 4px; font-size: 11px; font-weight: 500; letter-spacing: 1.2px; }
.brand-logo { display: block; max-width: 180px; max-height: 56px; object-fit: contain; margin-bottom: 8px; }
.top nav { display: flex; flex: 1; align-self: stretch; align-items: stretch; flex-wrap: wrap; gap: 0 22px; }
.top nav a { display: flex; align-items: center; min-height: 44px; padding: 0 0 20px; border-bottom: 3px solid transparent; color: var(--muted); font-size: 13px; line-height: 1.5; text-decoration: none; }
.top nav a:hover { color: var(--ink); }
.top nav a[aria-current] { border-color: var(--green); color: var(--ink); font-weight: 650; }
.mobile-menu { display: none; }
.logout { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 20px auto; font-size: 12px; }
.logout span { overflow-wrap: anywhere; color: var(--muted); }
main { max-width: 1320px; margin: 0 auto; padding: 44px 4vw 80px; min-height: calc(100vh - 174px); }
h1 { margin: 0 0 14px; font-size: clamp(28px, 3vw, 38px); font-weight: 600; letter-spacing: -1.1px; line-height: 1.2; overflow-wrap: anywhere; }
h2 { margin: 0 0 10px; font-size: 19px; font-weight: 600; letter-spacing: -.35px; line-height: 1.35; }
p { margin: 0 0 18px; }
.lead { max-width: 68ch; margin-bottom: 36px; color: var(--muted); font-size: 16px; }
.eyebrow { color: var(--muted); font-size: 13px; }
footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; border-top: 1px solid var(--line); padding: 24px 4vw; color: var(--muted); font-size: 12px; }
footer a { color: inherit; }
.footer-links { display: flex; flex-wrap: wrap; gap: 12px 24px; }
.footer-links:empty { display: none; }
.legal-content { max-width: 72ch; overflow-wrap: anywhere; }
.legal-content p { margin-bottom: 24px; }
textarea { resize: vertical; line-height: 1.6; }
.skip { position: absolute; top: -90px; left: 20px; z-index: 3; background: var(--surface); padding: 12px; }
.skip:focus { top: 10px; }

/* The workspace is a short index of real tasks, rather than dashboard tiles. */
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin: 28px 0 18px; }
.section-head h2 { margin: 0; }
.workspace-tasks { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); overflow: hidden; }
.workspace-task { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 28px 30px; }
.workspace-task + .workspace-task { border-top: 1px solid var(--line); }
.workspace-task p { max-width: 58ch; margin: 0; color: var(--muted); font-size: 14px; }
.workspace-task .button { flex-shrink: 0; max-width: 300px; }
.primary-task { border-left: 4px solid var(--green); padding-left: 26px; }
.vendor-list { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.vendor-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 24px 28px; text-decoration: none; color: var(--ink); }
.vendor-row + .vendor-row { border-top: 1px solid var(--line); }
.vendor-row:hover { background: var(--soft); }
.vendor-row h2 { margin-bottom: 6px; }
.vendor-row p { margin: 0; color: var(--muted); font-size: 13px; }
.workspace-open { display: flex; align-items: center; gap: 16px; color: var(--link); font-size: 13px; font-weight: 600; }
.workspace-open svg { flex-shrink: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 28px; margin-bottom: 24px; }
.narrow { max-width: 680px; }

/* Dense information stays aligned, with scrolling contained to the table. */
.tabs { display: flex; gap: 28px; border-bottom: 1px solid var(--line); overflow: auto; }
.tabs a { white-space: nowrap; min-height: 48px; padding: 12px 2px; border-bottom: 3px solid transparent; text-decoration: none; color: var(--muted); }
.tabs [aria-current] { color: var(--ink); border-color: var(--green); font-weight: 600; }
.table-wrap { border: 1px solid var(--line); border-radius: 8px; overflow: auto; background: var(--surface); }
table { width: 100%; border-collapse: collapse; white-space: nowrap; text-align: left; }
th { padding: 13px 20px; color: var(--muted); background: var(--soft); font-size: 12px; font-weight: 600; }
td { padding: 19px 20px; border-top: 1px solid var(--line); font-size: 14px; }
tbody tr:hover { background: var(--soft); }
td small { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.numeric { font-variant-numeric: tabular-nums; white-space: nowrap; }
th.numeric, td.numeric { text-align: right; }
.strong { font-weight: 650; }
.empty { padding: 44px 28px; text-align: center; white-space: normal; color: var(--muted); }
.empty strong { display: block; color: var(--ink); }
.empty p { max-width: 60ch; margin: 8px auto 0; }
.hint { max-width: 80ch; margin: 16px 0 28px; color: var(--muted); font-size: 12px; }
.badge { display: inline-block; border: 1px solid #cadfcf; border-radius: 4px; padding: 3px 8px; background: #edf5ee; color: #245638; font-size: 12px; white-space: nowrap; }
.badge.hold-complete { background: var(--green); color: var(--on-accent); border-color: var(--green); }
.badge.muted { background: #faf2de; color: #745519; border-color: #eadbb4; }
.pagination { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-top: 20px; color: var(--muted); font-size: 13px; }
.pagination a { margin-left: 20px; }
.partner-list td { vertical-align: top; }
.partner-list .partner-name { min-width: 160px; max-width: 240px; white-space: normal; overflow-wrap: anywhere; }
.partner-list .partner-address { min-width: 220px; white-space: normal; overflow-wrap: anywhere; }
.partner-address address { font-style: normal; }
.partner-address address + address { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }

/* Inputs and feedback share one rhythm across login, filters and management. */
form label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 600; }
input:not([type=checkbox]):not([type=radio]), select, textarea { display: block; width: 100%; min-height: 44px; border: 1px solid var(--muted); border-radius: 5px; padding: 10px 12px; background: var(--surface); color: var(--ink); }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; vertical-align: middle; accent-color: var(--green); }
input[type=file] { white-space: normal; font-size: 13px; }
input::file-selector-button { margin-right: 12px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 3px; background: var(--soft); color: var(--ink); font: inherit; cursor: pointer; }
form p { margin-bottom: 22px; }
form .helptext { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.errorlist { color: #8f231b; background: #fff1ed; border-left: 3px solid #a22c24; padding: 10px 12px 10px 28px; font-size: 13px; }
[aria-invalid=true] { border-color: #a22c24 !important; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; margin-top: 28px; }
.actions > a { font-size: 14px; }
.message { border: 1px solid #bdd4bd; border-radius: 5px; padding: 14px 18px; background: #edf5e8; color: #19352e; }
.message.error { color: #8f231b; background: #fff1ed; border-color: #e1b7ae; }
.filters, .inline-form { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 16px; }
.filters { background: transparent; padding: 0; border: 0; margin-bottom: 24px; }
.filters p { flex: 1; min-width: 160px; margin: 0; }
.filters > a { padding: 10px 0; font-size: 13px; }
.inline-form label { margin-bottom: 0; }
.inline-form input { margin-top: 7px; }
.metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.metric { margin: 14px 0 0; font-size: clamp(26px, 3vw, 36px); font-weight: 550; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.metric small { font-size: 15px; color: var(--muted); }
dl { display: grid; grid-template-columns: minmax(180px, 1fr) 2fr; gap: 16px 24px; margin-bottom: 0; }
dt { color: var(--muted); font-size: 13px; }
dd { margin: 0; overflow-wrap: anywhere; font-size: 14px; }
.integration-grant { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(220px, 1fr) auto; align-items: start; gap: 20px; }
.integration-grant p { margin: 0; }
.integration-grant button { margin-top: 28px; }
.integration-grant > .errorlist { grid-column: 1/-1; }
.integration-access-table td { vertical-align: top; }
.connector-email, .integration-audit { max-width: 280px; white-space: normal; overflow-wrap: anywhere; }
.integration-audit > div { margin-top: 12px; }

/* Design settings are grouped by the choices the vendor is making. */
.design-layout { display: grid; grid-template-columns: minmax(0, 720px) minmax(210px, 280px); align-items: start; gap: 40px; }
.design-form { min-width: 0; }
.form-section { min-width: 0; margin: 0 0 24px; padding: 22px 24px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.form-section legend { padding: 0 8px; font-size: 16px; font-weight: 600; }
.field { min-width: 0; margin-bottom: 20px; overflow-wrap: anywhere; }
.field .helptext { margin: 0 0 8px; }
.color-control { display: flex; align-items: center; gap: 10px; }
.color-control input[type=color] { flex: 0 0 48px; width: 48px; height: 44px; padding: 4px; cursor: pointer; }
.color-control input[type=color][hidden] { display: none; }
.color-control input[type=text] { min-width: 0; }
.color-control + .helptext { margin: 6px 0 0; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
.design-note { border-top: 2px solid var(--green); padding-top: 20px; }
.design-note h2 { font-size: 16px; }
.design-note p, .domain-list { color: var(--muted); font-size: 13px; }
.domain-list { list-style: none; margin: 0; padding: 0; }
.domain-list li { padding: 14px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.domain-list strong { display: block; margin-bottom: 8px; color: var(--ink); font-weight: 500; }

/* Sign-in has one task and a compact reading width. */
.portal-auth .top { padding-bottom: 22px; }
.portal-auth .brand { margin-bottom: 0; }
.portal-auth main { width: 100%; max-width: 432px; padding: 56px 24px 64px; }
.portal-auth h1 { font-size: 32px; }
.login-content .lead { margin-bottom: 30px; }
.login-content button { width: 100%; margin-top: 4px; }
.login-recovery { margin: 20px 0 0; text-align: center; font-size: 14px; }

@media (min-width: 1100px) {
  .portal-sidebar .top { position: fixed; inset: 0 auto 0 0; width: 264px; overflow-y: auto; display: flex; flex-direction: column; align-items: stretch; gap: 20px; padding: 32px 20px 24px; border-right: 1px solid var(--line); border-bottom: 0; }
  .portal-sidebar .brand { margin: 0 12px 16px; }
  .portal-sidebar .top nav { flex: 0; order: 0; flex-direction: column; align-items: stretch; gap: 6px; }
  .portal-sidebar .top nav a { border: 0; border-left: 3px solid transparent; border-radius: 0 4px 4px 0; padding: 12px; }
  .portal-sidebar .top nav a[aria-current] { background: var(--soft); border-left-color: var(--green); }
  .portal-sidebar .logout { margin: auto 12px 0; padding-top: 24px; border-top: 1px solid var(--line); flex-direction: column; align-items: flex-start; gap: 12px; }
  .portal-sidebar main { margin-left: 264px; max-width: 1510px; padding: 48px 4vw 80px; }
  .portal-sidebar footer { margin-left: 264px; }
  .portal-sidebar.portal-auth main { max-width: 432px; padding: 56px 24px 64px; }
}
@media (max-width: 1200px) {
  .top nav { order: 3; flex-basis: 100%; }
  .top nav a { padding-bottom: 14px; }
  .design-layout { gap: 24px; grid-template-columns: minmax(0, 1fr) 220px; }
}
@media (max-width: 760px) {
  body { font-size: 14px; }
  .top { gap: 0 16px; padding: 20px 20px 0; }
  .brand { max-width: calc(100% - 100px); font-size: 21px; margin-bottom: 18px; }
  .brand-logo { max-width: 140px; max-height: 48px; }
  .logout { margin-bottom: 18px; }
  .logout span { display: none; }
  .top .desktop-navigation { display: none; }
  .mobile-menu { display: block; order: 3; width: 100%; border-top: 1px solid var(--line); }
  .mobile-menu summary { min-height: 44px; padding: 12px 0; cursor: pointer; font-size: 13px; font-weight: 600; }
  .mobile-menu nav { flex-direction: column; align-items: stretch; gap: 4px; padding-bottom: 16px; }
  .mobile-menu nav a { min-height: 44px; border: 0; border-left: 3px solid transparent; padding: 10px 12px; font-size: 14px; }
  .mobile-menu nav a[aria-current] { background: var(--soft); border-left-color: var(--green); }
  main { min-width: 0; padding: 28px 20px 52px; }
  h1 { font-size: 28px; letter-spacing: -.7px; }
  .lead { margin-bottom: 28px; font-size: 15px; }
  .section-head { align-items: flex-start; flex-direction: column; gap: 14px; }
  .panel { padding: 22px 18px; }
  .workspace-task { flex-direction: column; align-items: flex-start; gap: 20px; padding: 24px 20px; }
  .primary-task { padding-left: 16px; }
  .workspace-task .button { max-width: 100%; }
  .vendor-row { gap: 12px; padding: 22px 20px; }
  .vendor-row h2 { font-size: 17px; overflow-wrap: anywhere; }
  .workspace-open { font-size: 0; gap: 0; }
  .tabs { gap: 24px; font-size: 13px; }
  .metric-grid { grid-template-columns: 1fr; gap: 0; }
  dl { grid-template-columns: 1fr; gap: 6px; }
  dd { margin-bottom: 14px; }
  .filters { padding: 0; }
  .filters p { min-width: 100%; }
  .integration-grant { grid-template-columns: 1fr; }
  .integration-grant button { margin-top: 0; justify-self: start; }
  .design-layout { grid-template-columns: 1fr; gap: 36px; }
  .form-section { padding: 18px 16px 0; }
  .field-grid { grid-template-columns: 1fr; }
  footer { padding: 22px 20px; font-size: 11px; }
  .portal-auth .brand { max-width: 100%; }
  .portal-auth main { padding: 44px 20px 52px; }
}
@media (prefers-reduced-motion: no-preference) {
  button, .button, .vendor-row { transition: background-color .12s ease, border-color .12s ease; }
}

/* Partner details use independent forms so partial setup can be saved. */
.onboarding-help-link { margin: 20px 0 0; }
.onboarding-dialog {
  width: min(640px, calc(100% - 32px)); max-height: calc(100dvh - 40px);
  padding: clamp(24px, 4vw, 36px); border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--ink); overflow-y: auto;
}
.onboarding-dialog::backdrop { background: rgb(0 0 0 / .45); }
.onboarding-dialog h2 { margin-bottom: 12px; font-size: 25px; }
.onboarding-dialog > p { color: var(--muted); }
.onboarding-steps { margin: 24px 0; padding-left: 24px; }
.onboarding-steps li { padding-left: 8px; }
.onboarding-steps li + li { margin-top: 18px; }
.onboarding-steps li::marker { color: var(--link); font-weight: 600; }
.onboarding-steps strong { display: block; font-weight: 600; }
.onboarding-steps p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.onboarding-checkbox { display: flex; align-items: flex-start; gap: 10px; margin: 24px 0; }
.onboarding-checkbox input { flex-shrink: 0; margin-top: 6px; }
.onboarding-fallback { max-width: 640px; margin-bottom: 24px; }
.onboarding-fallback summary { cursor: pointer; }
.details-selector { max-width: 760px; margin-bottom: 36px; }
.details-selector select { flex: 1; min-width: 0; }
.details-selector .actions { flex-wrap: nowrap; }
.details-layout { display: grid; grid-template-columns: 180px minmax(0, 760px); gap: 40px; }
.details-sections { display: flex; flex-direction: column; gap: 12px; align-self: start; }
.details-sections a { padding: 8px 0; }
.details-forms { min-width: 0; }
.contract-preparation { max-width: 900px; }
.contract-preparation summary { cursor: pointer; font-weight: 600; margin-bottom: 18px; }
.contract-preparation .field-grid { margin-top: 18px; }
.details-forms .field-requirement { display: inline; margin-left: 6px; color: var(--muted); font-size: 12px; font-weight: 400; }
.details-section { padding-bottom: 36px; scroll-margin-top: 24px; }
.details-section + .details-section { padding-top: 32px; border-top: 1px solid var(--line); }
.details-section h2 { margin-bottom: 24px; }
.details-sharing { margin: 24px 0; }
.details-sharing label { display: flex; align-items: flex-start; gap: 10px; }
.details-sharing input { flex-shrink: 0; margin-top: 6px; }
.details-activation { max-width: 980px; margin: 24px 0 32px; padding: 16px 20px; border-left: 3px solid var(--green); background: var(--soft); }
.details-activation p { margin: 6px 0 0; }
.profile-review { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(0, 2fr); gap: 10px 24px; max-width: 760px; }
.profile-review dt { color: var(--muted); }
.profile-review dd { margin: 0; overflow-wrap: anywhere; }
.administrative-action { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.administrative-action summary { cursor: pointer; }
.details-section input:disabled { background: var(--soft); color: var(--muted); cursor: not-allowed; }
@media (max-width: 760px) {
  .details-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .details-sections { flex-direction: row; flex-wrap: wrap; gap: 8px 20px; }
  .details-section .field-grid { grid-template-columns: minmax(0, 1fr); }
  .profile-review { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .profile-review dd { margin-bottom: 14px; }
}
