:root{font-family:system-ui,sans-serif;color:#142a24;background:#f0f5f2;line-height:1.55}*{box-sizing:border-box}[hidden]{display:none!important}body{margin:0}header{background:#174b85;color:white;padding:14px max(18px,calc((100% - 820px)/2));display:flex;justify-content:space-between;align-items:center;gap:16px}header a{color:white;text-decoration:none;font-weight:800}header a span{font-weight:500;margin-left:8px}main{width:min(820px,100% - 32px);margin:24px auto 60px}.notice{background:#fff5d4;padding:12px 16px;border-radius:10px;color:#523b06}.panel{background:white;border:1px solid #d9e6de;border-radius:16px;padding:clamp(18px,4vw,36px);margin:16px 0}.eyebrow{font-size:.78rem;font-weight:750;letter-spacing:.12em;color:#3a6656}h1,h2{line-height:1.15;margin:0 0 12px}h1{font-size:clamp(1.7rem,5vw,2.45rem)}h2{font-size:1.35rem}form+h2{margin-top:32px}p{margin:0 0 14px}.actions{display:flex;flex-wrap:wrap;gap:10px;margin:12px 0}button,.button{display:inline-flex;align-items:center;justify-content:center;min-height:44px;border:1px solid #1b5b46;border-radius:9px;background:#1b5b46;color:white;padding:8px 14px;font:inherit;font-weight:650;cursor:pointer;text-decoration:none}button.secondary,.button.secondary,#signout{background:white;color:#184c3b}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #599b7e;outline-offset:3px}label{display:block;font-weight:650;margin-top:12px}input,select{width:min(100%,420px);min-height:44px;font:inherit;padding:8px;border:1px solid #827f79;border-radius:8px;background:white;color:inherit}form button{display:flex;margin-top:12px}.records{list-style:none;padding:0}.records li{padding:12px 0;border-top:1px solid #d9e6de;overflow-wrap:anywhere}.records button,.records a{margin:8px 8px 0 0}.meta{display:block;color:#425a50;font-size:.9rem}#current-status{display:inline-block;margin-left:6px;background:#e3f4e8;padding:3px 9px;border-radius:8px}#timeline{padding-left:24px}#timeline li{padding-bottom:8px}#feedback:not(:empty){position:sticky;bottom:10px;background:#16372e;color:white;padding:12px 16px;border-radius:10px}#entry-actions button{flex:0 1 auto}@media(max-width:480px){.actions>button{flex:1 1 100%}header a span{display:block;margin-left:0;font-size:.76rem}}

/* Role colors match the AHL site palette. */
body[data-role="buyer"] {
  --portal-accent: #174b85;
}

body:is([data-role="staff"], :has(#staff-panel:not([hidden]))) {
  --portal-accent: #4fda32;
}

body:is([data-role="buyer"], [data-role="staff"]) header {
  border-block-end: 5px solid var(--portal-accent);
}

body:is([data-role="buyer"], [data-role="staff"]) #workspace .panel {
  border: 3px solid var(--portal-accent);
}

body:is([data-role="staff"], :has(#staff-panel:not([hidden]))) header {
  background-color: var(--portal-accent);
  color: #152c44;
  border-block-end: 0;
}

body:is([data-role="staff"], :has(#staff-panel:not([hidden]))) header a {
  color: inherit;
}

body[data-role="buyer"] header,
body[data-role="buyer"] #workspace button:not(.secondary) {
  background-color: var(--portal-accent);
}

body[data-role="buyer"] :is(#workspace button, #signout) {
  border-color: var(--portal-accent);
}

body[data-role="buyer"] :is(#workspace button.secondary, #signout) {
  color: var(--portal-accent);
}

body[data-role="buyer"] :is(#workspace button, #signout):focus-visible {
  outline-color: var(--portal-accent);
}

body[data-role="staff"] {
  color: #152c44;
  background: #f4f8f0;
}

body[data-role="staff"] :is(#workspace button, #workspace .button, #signout) {
  background-color: var(--portal-accent);
  border-color: #152c44;
  color: #152c44;
}

body[data-role="staff"] #feedback:not(:empty) {
  background-color: var(--portal-accent);
  color: #152c44;
}

body[data-role="staff"] :is(.eyebrow, .meta) {
  color: #465467;
}

body[data-role="staff"] #current-status {
  background-color: #e6f9dd;
}

body[data-role="staff"] :focus-visible {
  outline-color: #174b85;
}

#entry {
  border: 3px solid #174b85;
}

#buyer-login, #guest-login {
  background-color: #174b85;
  border-color: #174b85;
  color: white;
}

#staff-login {
  background-color: #4fda32;
  border-color: #4fda32;
  color: #152c44;
}

/* Lending team uses a wide, single-workspace layout. */
body[data-role="staff"] main{width:min(1660px,calc(100% - 48px))}
body[data-role="staff"] header{padding-inline:max(24px,calc((100% - 1660px)/2))}
body[data-role="staff"] .loan-workspaces{display:grid;grid-template-columns:260px minmax(0,1fr);gap:28px;padding:24px;align-items:start}
.loan-sidebar{min-width:0}.loan-sidebar input{width:100%}.loan-sidebar .records p{font-size:.875rem;margin:4px 0;overflow-wrap:anywhere}.loan-sidebar .records button{width:100%;text-align:left;justify-content:flex-start;margin:0}
.loan-editor{min-width:0}.loan-editor>h2{overflow-wrap:anywhere}.loan-tabs{display:flex;gap:10px;flex-wrap:wrap;margin:16px 0}.loan-tabs [aria-selected="false"]{background:white!important;border-color:#a8bbc8!important}.loan-tabs [aria-selected="true"]{box-shadow:inset 0 -4px 0 #174b85}
body[data-role="staff"] .loan-workspace-pane{padding:0;margin:0;border:0;background:transparent;border-radius:0;min-width:0}
.loan-workspace-frame{display:block;width:100%;height:83vh;min-height:600px;border:1px solid #c9d8df;border-radius:10px;background:white}
#investor-submission-entry select{width:min(100%,660px)}
@media(max-width:1050px){body[data-role="staff"] .loan-workspaces{grid-template-columns:1fr}.loan-sidebar .records{display:flex;gap:12px;overflow:auto;max-height:200px}.loan-sidebar .records li{flex:0 0 240px}.loan-workspace-frame{height:80vh;min-height:460px}}
@media(max-width:600px){body[data-role="staff"] main{width:calc(100% - 20px)}body[data-role="staff"] .loan-workspaces{padding:12px;gap:16px}.loan-tabs button{flex:1 1 auto;font-size:.9rem}.loan-workspace-frame{min-height:420px}}
.pipeline-views { margin-block: 18px; }
body[data-role="staff"] .pipeline-views button[aria-pressed="false"],
body[data-role="staff"] .loan-actions button.secondary { background: white; }
body[data-role="staff"] .loan-actions button.danger { color: #a02424; border-color: #a02424; }
.loan-confirm { border: 1px solid #9bb8a7; background: #f4f8f0; border-radius: 10px; padding: 14px; margin-top: 12px; }
.loan-confirm button { display: inline-flex; margin-right: 8px; }
.loan-confirm label { margin-top: 0; }
.loan-confirm select { display: block; margin: 6px 0 12px; }
.pipeline-notice:not(:empty) { padding: 12px; background: #e6f9dd; border-radius: 8px; margin-block: 12px; }

.loan-sidebar .loan-actions button { width: auto; text-align: center; justify-content: center; }
.loan-sidebar .loan-confirm select { width: 100%; }
@media(max-width:1050px){.loan-sidebar .records { max-height: 370px; }}
