/* House style: bright sky-and-blush backdrop, frosted glass panels, navy ink, sapphire accent,
   champagne-gold detail. Serif headlines, ledger tables. */
:root {
  color-scheme: light;
  --bg: #eef3fb;
  --glass: rgba(255, 255, 255, 0.58);
  --glass-strong: rgba(255, 255, 255, 0.78);
  --glass-soft: rgba(255, 255, 255, 0.36);
  --glass-edge: rgba(255, 255, 255, 0.85);
  --blur: blur(22px) saturate(170%);
  --shadow: 0 1px 1px rgba(20, 33, 61, 0.04), 0 10px 30px rgba(20, 33, 61, 0.08);
  --shadow-lift: 0 2px 4px rgba(20, 33, 61, 0.05), 0 18px 44px rgba(20, 33, 61, 0.14);
  --line: rgba(20, 33, 61, 0.09);
  --line2: rgba(20, 33, 61, 0.2);
  --rule: rgba(20, 33, 61, 0.14);
  --ink: #14213d;
  --ink2: #3f4b63;
  --mute: #6b7489;
  --accent: #2456c9;
  --accent-hover: #1b45a6;
  --accent-soft: rgba(36, 86, 201, 0.1);
  --gold: #a07a2c;
  --jade: #0f8a6a;
  --series-1: #2a78d6;
  --grid: rgba(20, 33, 61, 0.1);
  --good: #0ca30c;
  --warn: #fab219;
  --serious: #ec835a;
  --crit: #d03b3b;
  --up: #006300;
  --r: 18px;
  --r-sm: 10px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); }
body {
  margin: 0; color: var(--ink); font-size: 15px; line-height: 1.5; min-height: 100vh;
  /* Soft colour wash the glass panels blur over. Fixed so it reads like a wallpaper. */
  background:
    radial-gradient(900px 620px at 8% -8%, rgba(96, 150, 220, 0.5), transparent 62%),
    radial-gradient(760px 560px at 100% 4%, rgba(88, 110, 150, 0.4), transparent 60%),
    radial-gradient(900px 700px at 78% 100%, rgba(196, 168, 118, 0.42), transparent 62%),
    radial-gradient(820px 640px at 0% 92%, rgba(70, 150, 160, 0.4), transparent 62%),
    linear-gradient(160deg, #eaf0f7 0%, #eceff3 50%, #f1efea 100%);
  background-attachment: fixed;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; }
h1, h2 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 30px; line-height: 1.15; }
h2 { font-size: 20px; }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 0; }
.mute { color: var(--mute); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.eyebrow { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.eyebrow.alt { color: var(--jade); }

/* Shared glass surface */
.glass, .card, .tbl-wrap, .door, .screen, .memo, .choice button, .side, .top, .chat, .note, .photo {
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--shadow);
}

/* ---------- Brand ---------- */
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); font-family: var(--serif); font-size: 19px; font-weight: 600; letter-spacing: 0.01em; line-height: 1.1; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(145deg, #1e3a73, #14213d); color: #f3e6c6; font-family: var(--serif); font-size: 21px; font-weight: 600; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18), 0 4px 12px rgba(20, 33, 61, .25); flex: none; }
.brand small { display: block; font-family: system-ui, "Segoe UI", sans-serif; font-weight: 600; color: var(--mute); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; margin-top: 3px; }

/* ---------- Buttons & inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border-radius: var(--r-sm); border: 1px solid var(--line2); background: var(--glass-strong); color: var(--ink); font: inherit; font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer; transition: background .15s, color .15s, border-color .15s, box-shadow .15s, transform .15s; white-space: nowrap; }
.btn:hover { background: #fff; border-color: var(--ink); text-decoration: none; box-shadow: var(--shadow); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 6px 18px rgba(36, 86, 201, .28); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); transform: translateY(-1px); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 7px 12px; font-size: 11px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
input, select, textarea { width: 100%; padding: 10px 12px; border-radius: var(--r-sm); border: 1px solid var(--line2); background: rgba(255, 255, 255, .82); color: var(--ink); font: inherit; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(36, 86, 201, .25); outline-offset: 0; border-color: var(--accent); }
input:disabled { background: rgba(255, 255, 255, .45); }
textarea { min-height: 110px; resize: vertical; }
label { display: block; font-size: 12px; color: var(--ink2); margin-bottom: 6px; font-weight: 600; letter-spacing: 0.02em; }
label .req { color: var(--crit); }
.field { margin-bottom: 16px; }
.field.bad input, .field.bad select, .field.bad textarea, .field.bad .drop { border-color: var(--crit); background: #fff3f2; }
.field .err { display: none; color: #a52323; font-size: 12px; margin-top: 5px; font-weight: 600; }
.field.bad .err { display: block; }
.row { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.row.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: rgba(20, 33, 61, .07); }
.seg button { border: 0; border-radius: 9px; background: transparent; color: var(--ink2); padding: 6px 14px; font: inherit; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; cursor: pointer; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(20, 33, 61, .15); }
.drop { border: 1.5px dashed var(--line2); border-radius: var(--r-sm); padding: 22px; text-align: center; background: rgba(255, 255, 255, .6); cursor: pointer; }
.drop:hover { border-color: var(--accent); }
.drop.has { border-style: solid; border-color: var(--jade); background: rgba(15, 138, 106, .08); }
.drop input { display: none; }

/* ---------- Cards / layout ---------- */
.card { border-radius: var(--r); padding: 20px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stack > * + * { margin-top: 16px; }
.kpi .l { font-size: 10.5px; color: var(--mute); text-transform: uppercase; letter-spacing: .16em; font-weight: 700; }
.kpi .v { font-family: var(--serif); font-size: clamp(22px, 2.2vw, 32px); font-weight: 600; letter-spacing: -0.01em; margin-top: 6px; line-height: 1.15; }
.kpi .s { font-size: 13px; color: var(--ink2); margin-top: 2px; }

/* ---------- Portal shell ---------- */
body.portal { display: grid; grid-template-columns: 262px minmax(0, 1fr); }
.side { margin: 14px 0 14px 14px; border-radius: 22px; padding: 22px 14px; position: sticky; top: 14px; height: calc(100vh - 28px); display: flex; flex-direction: column; gap: 26px; }
.side .brand { padding: 0 8px; }
.side nav { display: flex; flex-direction: column; gap: 3px; }
.side nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--ink2); font-weight: 500; font-size: 14px; }
.side nav a:hover { color: var(--ink); background: rgba(255, 255, 255, .6); text-decoration: none; }
.side nav a.on { color: var(--accent); background: #fff; font-weight: 650; box-shadow: 0 2px 10px rgba(20, 33, 61, .08); }
.side nav svg { width: 16px; height: 16px; flex: none; }
.side .who { margin-top: auto; border-top: 1px solid var(--line); padding: 14px 8px 0; font-size: 13px; }
.side .who b { display: block; font-family: var(--serif); font-size: 16px; }
.main { padding: 30px 36px 96px; min-width: 0; }
.page-h { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; padding-bottom: 16px; border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
.page-h p { color: var(--ink2); margin-top: 4px; }
.banner { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); padding: 6px 12px; border-radius: 999px; background: rgba(255, 248, 230, .8); border: 1px solid rgba(160, 122, 44, .3); }

/* ---------- Tabs / filters / tables ---------- */
.tabs { display: inline-flex; gap: 3px; padding: 4px; border-radius: 14px; background: rgba(20, 33, 61, .07); margin-bottom: 16px; flex-wrap: wrap; }
.tabs button { background: none; border: 0; border-radius: 10px; color: var(--ink2); font: inherit; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: 9px 16px; cursor: pointer; }
.tabs button.on { color: var(--ink); background: #fff; box-shadow: 0 1px 6px rgba(20, 33, 61, .14); }
.tabs .ct { font-size: 11px; margin-left: 7px; opacity: .6; font-variant-numeric: tabular-nums; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.filters > * { width: auto; min-width: 150px; flex: 0 1 auto; }
.filters input[type=search] { min-width: 220px; flex: 1 1 220px; }
.tbl-wrap { overflow-x: auto; border-radius: var(--r); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--mute); font-weight: 700; padding: 12px 14px; border-bottom: 1px solid var(--line2); white-space: nowrap; background: rgba(255, 255, 255, .45); }
th.sort { cursor: pointer; }
th.sort:hover { color: var(--accent); }
td { padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255, 255, 255, .55); }
td.r, th.r { text-align: right; }
td.wrap { white-space: normal; min-width: 220px; color: var(--ink2); }
.empty { padding: 34px; text-align: center; color: var(--mute); }
.pill { display: inline-flex; align-items: center; gap: 6px; font-family: system-ui, "Segoe UI", sans-serif; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink); white-space: nowrap; vertical-align: middle; background: rgba(255, 255, 255, .85); }
.pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--mute); }
.pill.good i { background: var(--good); } .pill.warn i { background: var(--warn); }
.pill.serious i { background: var(--serious); } .pill.crit i { background: var(--crit); } .pill.blue i { background: var(--series-1); }
.tag { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: rgba(20, 33, 61, .07); color: var(--ink2); letter-spacing: .02em; }

/* ---------- Loan cards with milestone tracker ---------- */
.loan { display: grid; gap: 16px; }
.loan-top { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.loan-top .amt { font-family: var(--serif); font-size: 24px; font-weight: 600; }
.track { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: relative; }
.track .st { text-align: center; position: relative; font-size: 10px; font-weight: 600; color: var(--mute); letter-spacing: .1em; padding-top: 20px; }
.track .st::before { content: ""; position: absolute; top: 5px; left: -50%; width: 100%; height: 2px; background: rgba(20, 33, 61, .12); }
.track .st:first-child::before { display: none; }
.track .st::after { content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid rgba(20, 33, 61, .22); }
.track .st.done::before, .track .st.now::before { background: var(--accent); }
.track .st.done::after { background: var(--accent); border-color: var(--accent); }
.track .st.now::after { background: #fff; border: 3px solid var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.track .st.now { color: var(--accent); font-weight: 800; }
.track .st.done { color: var(--ink); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; border-top: 1px solid var(--line); padding-top: 14px; font-size: 14px; }
.facts div span { display: block; font-size: 10px; font-weight: 700; color: var(--mute); text-transform: uppercase; letter-spacing: .14em; }

/* ---------- Charts ---------- */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; }
.chart svg line { stroke: var(--grid); }
.chart text { fill: var(--mute); font-size: 11px; font-family: system-ui, "Segoe UI", sans-serif; }
.chart .bar { fill: var(--series-1); transition: opacity .12s; }
.chart .hit { fill: transparent; cursor: default; }
.chart .dim .bar { opacity: .4; }
.chart .dim .bar.hot { opacity: 1; }
.tip { position: absolute; pointer-events: none; background: rgba(20, 33, 61, .92); color: #fff; padding: 8px 10px; border-radius: 10px; font-size: 12px; white-space: nowrap; transform: translate(-50%, -100%); opacity: 0; transition: opacity .1s; z-index: 5; }
.tip b { display: block; font-size: 13px; }
.hbars { display: grid; gap: 11px; }
.hbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 10px; align-items: baseline; font-size: 13px; }
.hbar > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.hbar > div { grid-column: 1 / -1; grid-row: 2; background: rgba(20, 33, 61, .07); height: 7px; border-radius: 4px; }
.hbar .t { height: 7px; border-radius: 4px; background: var(--series-1); min-width: 2px; }
.hbar .n { color: var(--ink2); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Assistant ---------- */
.fab { position: fixed; right: 24px; bottom: 24px; z-index: 40; padding: 14px 22px; border-radius: 999px; }
.chat { position: fixed; right: 24px; bottom: 84px; width: 380px; max-width: calc(100vw - 32px); height: 520px; max-height: calc(100vh - 110px); border-radius: 22px; background: var(--glass-strong); display: none; flex-direction: column; z-index: 41; box-shadow: var(--shadow-lift); overflow: hidden; }
.chat.open { display: flex; }
.chat-h { padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.chat-h b { font-family: var(--serif); font-size: 17px; }
.chat-b { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 88%; padding: 10px 14px; font-size: 14px; background: #fff; border-radius: 16px 16px 16px 5px; align-self: flex-start; box-shadow: 0 1px 3px rgba(20, 33, 61, .08); }
.msg.me { align-self: flex-end; background: var(--accent); color: #fff; border-radius: 16px 16px 5px 16px; }
.chat-f { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.cite { margin-top: 10px; border-left: 3px solid var(--gold); background: rgba(255, 248, 230, .7); border-radius: 0 10px 10px 0; padding: 10px 12px; font-size: 13px; color: var(--ink2); }
.cite b { color: var(--ink); font-family: var(--serif); font-size: 15px; }

/* ---------- Public site ---------- */
.ticker { background: rgba(20, 33, 61, .9); color: #d6deeb; font-size: 12px; letter-spacing: .06em; }
.ticker .wrap { display: flex; gap: 26px; align-items: center; padding-top: 8px; padding-bottom: 8px; flex-wrap: wrap; }
.ticker b { color: #fff; font-variant-numeric: tabular-nums; font-size: 13px; }
.ticker .lbl { text-transform: uppercase; letter-spacing: .14em; font-size: 10.5px; font-weight: 700; color: #f0d9a0; margin-right: 8px; }
.ticker .live { display: inline-flex; align-items: center; gap: 6px; }
.ticker .live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #5fd08a; }
.top { display: flex; justify-content: space-between; align-items: center; padding: 14px 40px; position: sticky; top: 0; z-index: 20; gap: 16px; border-width: 0 0 1px; border-radius: 0; background: rgba(255, 255, 255, .62); }
.top nav { display: flex; gap: 22px; align-items: center; }
.top nav a:not(.btn) { color: var(--ink2); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.top nav a.on:not(.btn), .top nav a:not(.btn):hover { color: var(--accent); text-decoration: none; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 32px; }
.hero { padding: 56px 0 60px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(38px, 4.6vw, 60px); line-height: 1.04; letter-spacing: -0.02em; }
.hero h1 em { font-style: italic; background: linear-gradient(100deg, #1d4fbf 10%, #16727a 90%); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: .06em; }
.hero p.lead { font-size: 18px; color: var(--ink2); max-width: 52ch; margin: 20px 0 28px; }
.dateline { font-size: 11px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--mute); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 8px 0; margin-bottom: 26px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.doors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.door { display: block; padding: 20px; border-radius: var(--r); color: var(--ink); transition: box-shadow .15s, transform .15s, background .15s; }
.door:hover { background: var(--glass-strong); box-shadow: var(--shadow-lift); transform: translateY(-2px); text-decoration: none; }
.door b { display: block; font-family: var(--serif); font-size: 21px; margin: 6px 0 4px; }
.door span { color: var(--ink2); font-size: 14px; }
.door .go { color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; margin-top: 14px; display: block; }
section.band { padding: 60px 0; border-top: 1px solid rgba(255, 255, 255, .7); }
section.band.tint { background: rgba(255, 255, 255, .28); }
.sec-h { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 32px; align-items: end; margin-bottom: 28px; }
.sec-h h2 { font-size: clamp(26px, 3vw, 36px); line-height: 1.12; margin-top: 8px; }
.sec-h p { color: var(--ink2); }
/* Framed "screen" used for the sample views */
.screen { border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow-lift); }
.screen-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 16px; background: rgba(255, 255, 255, .55); border-bottom: 1px solid var(--line); color: var(--ink2); font-size: 10.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.screen-h::before { content: ""; width: 42px; height: 10px; flex: none; background: radial-gradient(circle at 5px 5px, #ff6159 4px, transparent 4.5px), radial-gradient(circle at 21px 5px, #ffbd2e 4px, transparent 4.5px), radial-gradient(circle at 37px 5px, #28c941 4px, transparent 4.5px); }
.screen-h span:first-child { margin-right: auto; }
.screen-h span:last-child { color: var(--gold); }
.screen-b { padding: 18px; }
.screen .tbl-wrap { border: 0; border-radius: 0; box-shadow: none; background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
.screen .track .st { font-size: 8.5px; letter-spacing: .02em; }
.samples { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 960px) { .samples { grid-template-columns: 1fr; } }
.screen.tight th, .screen.tight td { padding: 9px 9px; font-size: 12.5px; }
.screen.tight th { font-size: 10px; letter-spacing: .1em; }
.mini-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.mini-kpis > div { padding: 0 14px 14px; border-left: 1px solid var(--line); }
.mini-kpis > div:first-child { border-left: 0; padding-left: 0; }
.ledger { border-top: 1px solid var(--rule); }
.ledger > div { display: grid; grid-template-columns: 56px minmax(0, 220px) minmax(0, 1fr); gap: 18px; padding: 16px 0; border-bottom: 1px solid var(--rule); align-items: baseline; }
.ledger .ix { font-family: var(--serif); font-size: 20px; color: var(--gold); }
.ledger h3 { font-family: var(--serif); font-size: 18px; font-weight: 600; }
.ledger p { color: var(--ink2); }
/* Treasury quote */
.quote .big { font-family: var(--serif); font-size: 64px; line-height: 1; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.quote .big sup { font-size: 26px; vertical-align: top; position: relative; top: 8px; margin-left: 2px; }
.delta { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-variant-numeric: tabular-nums; font-size: 14px; }
.delta.up { color: #a52323; } .delta.down { color: var(--up); } .delta.flat { color: var(--mute); }
.spark { width: 100%; height: 120px; display: block; margin-top: 14px; }
.qfacts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; font-variant-numeric: tabular-nums; font-size: 14px; }
.qfacts span { display: block; font-size: 10px; font-weight: 700; color: var(--mute); text-transform: uppercase; letter-spacing: .14em; }
/* Morning report "paper" */
.memo { background: var(--glass-strong); border-radius: var(--r); padding: 30px 34px; box-shadow: var(--shadow-lift); position: relative; }
.memo-h { border-bottom: 1px solid var(--rule); padding-bottom: 12px; margin-bottom: 16px; display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.memo-h h3 { font-family: var(--serif); font-size: 26px; font-weight: 600; line-height: 1.1; }
.memo h4 { margin: 18px 0 8px; font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.memo p { color: var(--ink2); font-size: 14.5px; }
.memo table { font-size: 13.5px; }
.memo th { background: none; padding: 7px 10px 7px 0; }
.memo td { padding: 7px 10px 7px 0; }
.stamp { font-size: 10.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #a52323; background: rgba(255, 240, 238, .85); border: 1px solid rgba(165, 35, 35, .4); border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
footer { border-top: 1px solid rgba(255, 255, 255, .7); background: rgba(255, 255, 255, .3); padding: 26px 0 40px; color: var(--mute); font-size: 13px; }
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth .card { width: 430px; max-width: 100%; padding: 32px; border-radius: 24px; box-shadow: var(--shadow-lift); }
.photo { aspect-ratio: 4 / 5; border-radius: var(--r); display: grid; place-items: center; color: var(--mute); text-align: center; padding: 20px; overflow: hidden; }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.stars { display: inline-flex; gap: 4px; }
.stars button { background: none; border: 0; font-size: 28px; color: rgba(20, 33, 61, .18); cursor: pointer; padding: 0; line-height: 1; }
.stars button.on { color: #d9a52e; }
.note { border-radius: 12px; border-left: 3px solid var(--series-1); padding: 12px 14px; font-size: 13px; color: var(--ink2); box-shadow: none; }
.alert { background: #fff3f2; border: 1px solid rgba(208, 59, 59, .5); border-left-width: 3px; border-radius: 12px; padding: 12px 14px; font-size: 14px; font-weight: 600; color: #7d1a1a; }
.ok { background: rgba(15, 138, 106, .1); border: 1px solid rgba(15, 138, 106, .45); border-left-width: 3px; border-radius: 12px; padding: 14px 16px; }
.choice { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.choice button { text-align: left; padding: 24px; border-radius: var(--r); color: var(--ink); font: inherit; cursor: pointer; transition: box-shadow .15s, transform .15s, background .15s; }
.choice button:hover { background: var(--glass-strong); box-shadow: var(--shadow-lift); transform: translateY(-2px); }
.choice b { display: block; font-family: var(--serif); font-size: 22px; margin: 6px 0; }
.choice span { color: var(--ink2); font-size: 14px; }
h2.sec { font-family: system-ui, "Segoe UI", sans-serif; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .16em; color: var(--gold); margin: 26px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--rule); }

@media (max-width: 960px) {
  body.portal { grid-template-columns: 1fr; }
  .side { position: static; height: auto; margin: 10px; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px; }
  .side nav { flex-direction: row; flex-wrap: wrap; }
  .side .who { margin: 0 0 0 auto; border: 0; padding: 0; }
  .main { padding: 20px 16px 96px; }
  .g4, .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row.three, .row.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .top { padding: 12px 18px; } .top nav a.hide-sm { display: none; }
  .hero-grid, .sec-h { grid-template-columns: 1fr; }
  .ledger > div { grid-template-columns: 40px minmax(0, 1fr); }
  .ledger p { grid-column: 2; }
}
@media (max-width: 640px) {
  .g2, .g3, .g4, .row, .row.three, .row.four, .doors, .choice { grid-template-columns: 1fr; }
  .track .st { font-size: 8px; letter-spacing: 0; }
  .memo { padding: 20px; }
  .quote .big { font-size: 48px; }
  .qfacts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Chad GPT AI assistant item on the landing page */
.thechad { display: flex; gap: 18px; align-items: center; }
.thechad img { width: 96px; height: 96px; flex: none; filter: drop-shadow(0 6px 14px rgba(20, 33, 61, .18)); }
@media (max-width: 640px) { .thechad { align-items: flex-start; } .thechad img { width: 72px; height: 72px; } }
.thechad p { flex: 1 1 auto; min-width: 0; }
@media (max-width: 960px) { .ledger .thechad { grid-column: 2; } }
.ledger > div:has(.thechad) { align-items: center; }
/* Phones: keep the top bar inside the screen */
@media (max-width: 640px) {
  .top { padding: 10px 12px; gap: 8px; }
  .top .brand { font-size: 17px; gap: 8px; }
  .top .brand small { display: none; }
  .top nav { gap: 6px; }
  .top nav .btn.sm { padding: 7px 9px; font-size: 10px; letter-spacing: .05em; }
}
/* Grid children may shrink below their content width (keeps cards inside narrow screens) */
.grid > * { min-width: 0; }
@media (max-width: 640px) { .memo table { font-size: 12.5px; } .quote .big { font-size: 44px; } }
/* Public header: text links + login buttons. On desktop the links sit just left of the buttons;
   on tablets and phones they drop to their own row so About and Referrals stay reachable. */
.top .toplinks { margin-left: auto; }
.top .topbtns { gap: 10px; }
@media (max-width: 960px) {
  .top { flex-wrap: wrap; row-gap: 8px; }
  .top .toplinks { order: 3; width: 100%; margin-left: 0; justify-content: center; gap: 22px; padding-top: 8px; border-top: 1px solid var(--line); }
  .top .toplinks a:not(.btn) { font-size: 11px; }
}
@media (max-width: 960px) { .top .topbtns { margin-left: auto; } }
@media (max-width: 640px) { .top .topbtns { gap: 6px; } }

/* ---------- Chad GPT floating bot (every page) ---------- */
.fab { display: none !important; }
.bot-wrap { position: fixed; right: 20px; bottom: 16px; z-index: 45; display: flex; align-items: flex-end; gap: 10px; pointer-events: none; }
.bot-wrap > * { pointer-events: auto; }
.bot { position: relative; background: none; border: 0; padding: 0; cursor: pointer; display: flex; flex-direction: column; align-items: center; animation: botBounce 4.2s ease-in-out infinite; transform-origin: 50% 100%; }
.bot::before { content: ""; position: absolute; left: 50%; top: 48%; width: 92px; height: 92px; margin: -46px 0 0 -46px; border-radius: 50%; background: rgba(36, 86, 201, .22); animation: botPulse 2.4s ease-out infinite; z-index: -1; }
.bot-art { width: 104px; height: 108px; display: block; overflow: visible; filter: drop-shadow(0 10px 18px rgba(20, 33, 61, .28)); }
.bot-arm-r { transform-box: view-box; transform-origin: 110px 136px; animation: botWave 1.3s ease-in-out infinite; }
.bot-eyes { transform-box: fill-box; transform-origin: center; animation: botBlink 5s infinite; }
.bot-light { animation: botGlow 1.6s ease-in-out infinite; }
.bot-tag { margin-top: -2px; padding: 6px 12px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; box-shadow: 0 6px 16px rgba(36, 86, 201, .35); }
.bot:hover .bot-tag, .bot:focus-visible .bot-tag { background: var(--accent-hover); }
.bot:focus-visible { outline: 3px solid rgba(36, 86, 201, .45); outline-offset: 4px; border-radius: 16px; }
.bot-bubble { position: relative; max-width: 240px; margin-bottom: 62px; padding: 12px 30px 12px 14px; border-radius: 16px 16px 4px 16px; background: rgba(255, 255, 255, .95); border: 1px solid var(--glass-edge); box-shadow: var(--shadow-lift); font-size: 13.5px; line-height: 1.4; color: var(--ink2); cursor: pointer; opacity: 0; transform: translateY(8px) scale(.96); transition: opacity .3s, transform .3s; pointer-events: none; }
.bot-bubble b { color: var(--ink); display: block; font-size: 14px; }
.bot-bubble.show { opacity: 1; transform: none; pointer-events: auto; }
.bot-bubble-x { position: absolute; top: 4px; right: 6px; border: 0; background: none; color: var(--mute); font-size: 18px; line-height: 1; cursor: pointer; padding: 2px 4px; }
.chat { bottom: 150px; }

@keyframes botBounce {
  0%, 46%, 100% { transform: translateY(0) scale(1, 1); }
  6% { transform: translateY(0) scale(1.06, .92); }
  14% { transform: translateY(-26px) scale(.96, 1.05); }
  22% { transform: translateY(0) scale(1.05, .94); }
  28% { transform: translateY(-11px) scale(1, 1); }
  34% { transform: translateY(0) scale(1.02, .98); }
  40% { transform: translateY(-4px); }
  70% { transform: translateY(-6px); }
}
@keyframes botWave { 0%, 100% { transform: rotate(0deg); } 25% { transform: rotate(-24deg); } 75% { transform: rotate(14deg); } }
@keyframes botBlink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes botGlow { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes botPulse { 0% { transform: scale(.7); opacity: .9; } 100% { transform: scale(1.6); opacity: 0; } }

@media (max-width: 640px) {
  .bot-wrap { right: 10px; bottom: 10px; }
  .bot-art { width: 78px; height: 81px; }
  .bot::before { width: 70px; height: 70px; margin: -35px 0 0 -35px; }
  .bot-tag { font-size: 10px; padding: 5px 9px; }
  .bot-bubble { max-width: 190px; margin-bottom: 50px; font-size: 12.5px; }
  .chat { bottom: 120px; right: 10px; }
}
/* People who turn off motion in their device settings get a still bot. */
@media (prefers-reduced-motion: reduce) {
  .bot, .bot::before, .bot-arm-r, .bot-eyes, .bot-light { animation: none !important; }
}
@media (min-width: 641px) {
  .bot-art { width: 132px; height: 137px; }
  .bot::before { width: 118px; height: 118px; margin: -59px 0 0 -59px; }
  .bot-tag { font-size: 12px; padding: 7px 14px; }
  .bot-bubble { margin-bottom: 84px; }
  .chat { bottom: 182px; }
}
/* Sign-in card: never wider than the screen */
.auth { grid-template-columns: minmax(0, 430px); justify-content: center; }
.auth .card { width: 100%; }
@media (max-width: 640px) { .auth { padding: 16px 16px 120px; } .auth .card { padding: 24px 20px; } }

/* ---------- Chad GPT uses Chad's illustrated portrait ---------- */
.thechad img { border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 3px #fff, 0 0 0 5px #6d4cff, 0 8px 22px rgba(20, 33, 61, .25); filter: none; }
.bot-avatar { position: relative; display: block; width: 124px; height: 124px; border-radius: 50%; padding: 4px; background: conic-gradient(from 0deg, #2a78d6, #7b4fff, #3fd1c4, #2a78d6); animation: botRing 4s linear infinite; box-shadow: 0 12px 28px rgba(20, 33, 61, .35); }
.bot-avatar img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 3px solid #fff; animation: botRingCounter 4s linear infinite; }
.bot-hand { position: absolute; top: -6px; right: -10px; font-size: 38px; line-height: 1; transform-origin: 70% 80%; animation: botWave 1.3s ease-in-out infinite; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .25)); }
.bot::before { top: 42%; }
.bot-tag { margin-top: 8px; }
@keyframes botRing { to { transform: rotate(360deg); } }
@keyframes botRingCounter { to { transform: rotate(-360deg); } }
.chat-who { display: flex; align-items: center; gap: 10px; }
.chat-av { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px #6d4cff; }
@media (max-width: 640px) {
  .bot-avatar { width: 84px; height: 84px; padding: 3px; }
  .bot-hand { font-size: 28px; top: -6px; right: -8px; }
  .bot-tag { margin-top: 6px; }
}
@media (prefers-reduced-motion: reduce) { .bot-avatar, .bot-avatar img, .bot-hand { animation: none !important; } }
.bot-hand { right: auto; left: -16px; top: -4px; transform-origin: 70% 85%; }
@media (max-width: 640px) { .bot-hand { left: -12px; } }
