:root {
  --navy: #250C40; --lilac: #CDBDDD; --purple: #9871B1; --plum: #9956A2;
  --paper: #F7F6F8; --ink: #1F1F1F; --mute: #5B5B5B; --line: #E8E4EE; --good: #1f7a4d; --bad: #b3261e;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: 'Open Sans', system-ui, sans-serif; background: var(--paper); color: var(--ink); font-size: 15px; line-height: 1.5; }
.top { background: var(--navy); color: #fff; }
.top-inner { max-width: 1180px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; gap: 12px; }
.logo { font-weight: 700; letter-spacing: .16em; font-size: 16px; line-height: 1.15; text-transform: uppercase; white-space: nowrap; }
.logo small { display: block; color: var(--lilac); letter-spacing: .22em; font-size: 9px; font-weight: 600; margin-top: 4px; }
.who { display: flex; align-items: center; gap: 12px; font-size: 13px; margin: 0; min-width: 0; }
.who-email { color: var(--lilac); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.link { background: none; border: 0; color: #fff; text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }
main { max-width: 1180px; margin: 0 auto; padding: 24px; }
footer { text-align: center; color: var(--mute); font-size: 12px; padding: 24px; }
h1 { font-size: 26px; margin: 0 0 4px; color: var(--navy); }
h2 { font-size: 17px; margin: 0; color: var(--navy); }
.mute { color: var(--mute); }
.small { font-size: 12.5px; }
.hello { margin-bottom: 18px; }
.pill { display: inline-block; background: var(--lilac); color: var(--navy); border-radius: 999px; padding: 1px 10px; font-size: 12px; font-weight: 600; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: 0 1px 2px rgba(37,12,64,.05); }
.card.wide { grid-column: 1 / -1; }
.card.narrow { max-width: 460px; margin: 40px auto; }
.card-bar { height: 5px; background: linear-gradient(90deg, var(--navy), var(--purple)); }
.card-body { padding: 18px 20px 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.card.disabled { opacity: .55; filter: grayscale(.7); }
.card.disabled .card-bar { background: #cfcad6; }
.soon { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; background: #ece8f1; color: var(--mute); border-radius: 999px; padding: 2px 10px; }
.btn { display: inline-block; background: var(--navy); color: #fff; border: 0; border-radius: 999px; padding: 9px 18px; font: 600 14px 'Open Sans', sans-serif; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: #3A1860; }
.btn.sm { padding: 5px 14px; font-size: 13px; }
.btn-disabled, .btn-disabled:hover { background: #b9b3c2; cursor: not-allowed; pointer-events: none; }
input, select { font: inherit; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: #fff; color: var(--ink); min-width: 0; }
input:focus, select:focus { outline: 2px solid var(--lilac); border-color: var(--purple); }
.pc-form { display: grid; grid-template-columns: 1.6fr .8fr .9fr auto; gap: 8px; margin: 10px 0 6px; }
.lender-sel { font-size: 13px; color: var(--mute); display: flex; align-items: center; gap: 6px; }
.disclaimer { background: #fbf6e9; border: 1px solid #efe1b8; color: #6b5314; border-radius: 10px; padding: 7px 12px; margin: 6px 0 12px; font-size: 13px; }
.chat { border: 1px solid var(--line); border-radius: 12px; background: var(--paper); padding: 12px; max-height: 560px; min-height: 160px; position: relative; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 92%; border-radius: 12px; padding: 8px 12px; }
.msg p { margin: 4px 0; }
.msg.me { align-self: flex-end; background: var(--navy); color: #fff; }
.msg.bot { align-self: flex-start; background: #fff; border: 1px solid var(--line); }
.answer { margin-bottom: 8px; }
.passages { margin: 4px 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.passages li { border-left: 3px solid var(--lilac); padding-left: 10px; }
.cite { font-weight: 700; color: var(--plum); font-size: 13px; }
details summary { cursor: pointer; color: var(--ink); font-size: 13.5px; }
details pre { white-space: pre-wrap; font: 12.5px/1.45 ui-monospace, Menlo, Consolas, monospace; background: var(--paper); border-radius: 8px; padding: 8px; max-height: 260px; overflow: auto; }
.ask { display: flex; gap: 8px; margin-top: 10px; }
.ask input { flex: 1; }
.filters { display: flex; gap: 8px; margin: 8px 0 10px; flex-wrap: wrap; }
.filters input { flex: 1; min-width: 200px; }
.count { color: var(--mute); font-size: 13px; }
.table-wrap { overflow-x: auto; }
table.portals { width: 100%; border-collapse: collapse; font-size: 14px; }
table.portals th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--mute); border-bottom: 1px solid var(--line); padding: 8px; }
table.portals td { border-bottom: 1px solid var(--line); padding: 9px 8px; vertical-align: middle; }
td.act { text-align: right; }
.stage { background: #f1ecf6; color: var(--navy); border-radius: 999px; padding: 2px 9px; font-size: 12px; white-space: nowrap; }
.alert.bad { color: var(--bad); }
.g_id_signin { margin: 16px 0 6px; }
@media (max-width: 760px) {
  main { padding: 14px; }
  .grid { grid-template-columns: 1fr; }
  .pc-form { grid-template-columns: 1fr 1fr; }
  .pc-form input[name=suburb] { grid-column: 1 / -1; }
  .who-email { display: none; }
  table.portals thead { display: none; }
  table.portals tr { display: block; border-bottom: 1px solid var(--line); padding: 8px 0; }
  table.portals td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 3px 4px; }
  table.portals td[data-l]::before { content: attr(data-l); color: var(--mute); font-size: 12px; }
  td.act { justify-content: flex-end; }
}
/* hub switcher + credit hub */
.switch { display: flex; background: rgba(255,255,255,.1); border-radius: 999px; padding: 3px; gap: 2px; margin-left: auto; }
.switch a { color: var(--lilac); text-decoration: none; font-size: 13px; font-weight: 600; padding: 5px 14px; border-radius: 999px; }
.switch a.on { background: #fff; color: var(--navy); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stats.in-card { margin: 4px 0 14px; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(105px, 1fr)); }
.stats.in-card .stat { padding: 8px 10px; background: #faf8fc; }
.stats.in-card .stat .n { font-size: 20px; }
.stat.zero .n { color: var(--mute); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; margin-left: 12px; }
.seg button { border: 0; background: #fff; color: var(--navy); padding: 4px 14px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.seg button.on { background: var(--navy); color: #fff; }
.pinned { border-left: 4px solid var(--purple); background: #f6f1fa; border-radius: 8px; padding: 8px 12px; margin: 6px 0 10px; font-size: 13.5px; }
.pinned p { margin: 2px 0; }
.pinned strong { color: var(--navy); }
.msg .notice { border-left: 4px solid #d9a400; background: #fff8e1; border-radius: 8px; padding: 8px 12px; margin: 6px 0 10px; font-size: 13.5px; }
.team { font-size: 12.5px; line-height: 1.35; }
.lender-tag { display: inline-block; font-size: 11px; font-weight: 700; color: var(--purple); text-transform: uppercase; letter-spacing: .03em; margin-right: 4px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; text-align: left; cursor: pointer; font: inherit; color: var(--ink); display: flex; flex-direction: column; }
.stat .n { font-size: 24px; font-weight: 700; color: var(--navy); line-height: 1.1; }
.stat .l { font-size: 12.5px; color: var(--mute); }
.stat.on { border-color: var(--purple); box-shadow: 0 0 0 2px var(--lilac); }
.due { background: #fdecea; color: var(--bad); border-radius: 999px; padding: 2px 9px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.stage.g-lender { background: #e8f3ee; color: var(--good); }
.stage.g-hold { background: #eee; color: var(--mute); }
.stage.g-docs { background: #fbf6e9; color: #6b5314; }
@media (max-width: 760px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .switch a { padding: 4px 10px; }
  .logo small { letter-spacing: .16em; }
}
/* long lists scroll inside the card so the tools below stay in reach */
.table-wrap { max-height: 560px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
table.portals thead th { position: sticky; top: 0; background: #fff; z-index: 1; }
@media (max-width: 760px) { .table-wrap { max-height: 70vh; } }
[hidden] { display: none !important; }
.card.wide .pc-form { max-width: 760px; }
