/* The app's look: the same design as the single-file Portfolio Manager (ink sidebar, ledger-green accent, Plex Sans for the UI and figures,
   Plex Serif for page titles, white rounded cards on a light grey page, light / dark / auto theme). */
@font-face { font-family: 'IBM Plex Sans'; font-weight: 400; font-style: normal; font-display: swap; src: url(vendor/fonts/ibm-plex-sans-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 500; font-style: normal; font-display: swap; src: url(vendor/fonts/ibm-plex-sans-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 600; font-style: normal; font-display: swap; src: url(vendor/fonts/ibm-plex-sans-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Serif'; font-weight: 500; font-style: normal; font-display: swap; src: url(vendor/fonts/ibm-plex-serif-latin-500-normal.woff2) format('woff2'); }

:root {
  --font-ui: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-title: 'IBM Plex Serif', Georgia, 'Times New Roman', serif;
  --bg: #ffffff; --bg2: #f3f5f7; --bg3: #e9edf1; --bg4: #dde3e9;
  --text: #15202b; --text2: #4d5a67; --text3: #7f8c99;
  --border: rgba(21,32,43,0.10); --border2: rgba(21,32,43,0.19);
  --radius: 8px; --radius-lg: 12px;
  --pos: #1b7a43; --neg: #c0392b;
  --accent: #1e6b55; --accent-hover: #17574a; --accent-bg: #e2f0ea; --on-accent: #ffffff;
  --ai: #4a43a3; --ai-bg: #eceafb;
  --side-bg: #16212c; --side-fg: #b8c4cf; --side-dim: #7d8b98; --side-hover: rgba(255,255,255,0.06); --side-active: rgba(255,255,255,0.11); --side-text: #ffffff;
  --warn-bg: #fff6e5; --warn-border: #f0cf86; --warn-fg: #7a4d08;
  --err-bg: #fdeeee; --err-border: #f1c2c2;
  --info-bg: #ebf3fd; --info-border: #bcd6f2;
  --blue: #1a5fa8; --blue-bg: #deedfb; --green: #2d6314; --green-bg: #dff0d0; --amber: #7a4d08; --amber-bg: #fef3da;
  --pink: #7a1f43; --pink-bg: #fce8ef; --coral: #7a2d11; --coral-bg: #fce8e1; --gray: #4a4a46; --gray-bg: #eeede7; --violet: #5b3fa8; --violet-bg: #ece6fb;
  /* older names used by the page scripts */
  --bad: var(--neg); --bad-bg: var(--err-bg); --accent-text: var(--on-accent); --bar: var(--side-bg); --bar-text: #ffffff;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #18212b; --bg2: #10161d; --bg3: #212b36; --bg4: #2a3541; --text: #e5eaef; --text2: #a7b2bd; --text3: #76838f;
  --border: rgba(255,255,255,0.09); --border2: rgba(255,255,255,0.17); --pos: #52c48a; --neg: #f0776c;
  --accent: #3fa585; --accent-hover: #4fb594; --accent-bg: #173a30; --on-accent: #06140f; --ai: #9f98f0; --ai-bg: #29274a;
  --side-bg: #0b1117; --side-fg: #a9b5c0; --side-dim: #66737f;
  --warn-bg: #3a2d12; --warn-border: #6e5521; --warn-fg: #f2c66b; --err-bg: #3b1e1e; --err-border: #6e3333; --info-bg: #172a40; --info-border: #2f4f73;
  --blue: #8fc1f2; --blue-bg: #1b3350; --green: #a6d98a; --green-bg: #223a1a; --amber: #f2c66b; --amber-bg: #3a2d12; --pink: #f0a3c0; --pink-bg: #41202d;
  --coral: #f4a98d; --coral-bg: #42241a; --gray: #c4c3bc; --gray-bg: #2c2c29; --violet: #c3b3f5; --violet-bg: #2e2650; color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #18212b; --bg2: #10161d; --bg3: #212b36; --bg4: #2a3541; --text: #e5eaef; --text2: #a7b2bd; --text3: #76838f;
  --border: rgba(255,255,255,0.09); --border2: rgba(255,255,255,0.17); --pos: #52c48a; --neg: #f0776c;
  --accent: #3fa585; --accent-hover: #4fb594; --accent-bg: #173a30; --on-accent: #06140f; --ai: #9f98f0; --ai-bg: #29274a;
  --side-bg: #0b1117; --side-fg: #a9b5c0; --side-dim: #66737f;
  --warn-bg: #3a2d12; --warn-border: #6e5521; --warn-fg: #f2c66b; --err-bg: #3b1e1e; --err-border: #6e3333; --info-bg: #172a40; --info-border: #2f4f73;
  --blue: #8fc1f2; --blue-bg: #1b3350; --green: #a6d98a; --green-bg: #223a1a; --amber: #f2c66b; --amber-bg: #3a2d12; --pink: #f0a3c0; --pink-bg: #41202d;
  --coral: #f4a98d; --coral-bg: #42241a; --gray: #c4c3bc; --gray-bg: #2c2c29; --violet: #c3b3f5; --violet-bg: #2e2650; color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font-family: var(--font-ui); background: var(--bg2); color: var(--text); font-size: 14px; line-height: 1.5; }
textarea, input, select, button { font-family: inherit; }
a { color: var(--accent); }
[hidden] { display: none !important; }
.grow { flex: 1; } .muted, .muted-label { color: var(--text3); } .small { font-size: 12px; } .strong { font-weight: 600; }
.pos { color: var(--pos) !important; } .neg { color: var(--neg) !important; }
td, .metric-value, .bench-ret { font-variant-numeric: tabular-nums; }

/* ── shell: ink sidebar + work area ── */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100%; }
.shell.nosd { grid-template-columns: 1fr; }
.side { background: var(--side-bg); color: var(--side-fg); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 18px 12px 14px; overflow-y: auto; overflow-x: hidden; z-index: 50; }
.brand { display: flex; gap: 10px; align-items: center; padding: 2px 8px 14px; } .brand-link { display: flex; gap: 10px; align-items: center; text-decoration: none; flex: 1; min-width: 0; }
.side-toggle { margin-left: auto; border: 1px solid rgba(255,255,255,.18); background: transparent; color: var(--side-fg); border-radius: 7px; width: 26px; height: 26px; cursor: pointer; font-size: 14px; line-height: 1; padding: 0; justify-content: center; flex-shrink: 0; } .side-toggle:hover { background: var(--side-hover) !important; }
.brand-mark { width: 32px; height: 32px; border-radius: 8px; background: var(--accent); color: #fff; display: grid; place-items: center; font-family: var(--font-title); font-size: 17px; flex-shrink: 0; }
.brand-name { color: var(--side-text); font-weight: 600; font-size: 14px; line-height: 1.2; } .brand-sub { color: var(--side-dim); font-size: 11.5px; }
.nav-group { font-size: 10.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--side-dim); padding: 14px 10px 6px; }
.nav-item { display: flex; align-items: center; gap: 10px; width: 100%; color: var(--side-fg); font-size: 13.5px; text-align: left; padding: 8px 10px; border-radius: 7px; text-decoration: none; transition: background .12s, color .12s; }
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; opacity: .85; fill: none; stroke: currentColor; stroke-width: 1.8; }
.nav-item:hover { background: var(--side-hover); color: var(--side-text); }
.nav-item[aria-current="page"] { background: var(--side-active); color: var(--side-text); font-weight: 500; box-shadow: inset 3px 0 0 var(--accent); }
.nav-item:focus-visible, .side-btn:focus-visible, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.nav-item .nav-n { margin-left: auto; font-size: 11px; color: var(--side-dim); }
.side-foot { margin-top: auto; padding-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.side-btn { display: flex; align-items: center; gap: 8px; width: 100%; font-size: 13px; padding: 8px 12px; border-radius: 8px; cursor: pointer; border: 1px solid rgba(255,255,255,.14); background: transparent; color: var(--side-text); text-align: left; }
.side-btn:hover { background: var(--side-hover); }
a.side-btn { text-decoration: none; }
.side-btn.ai { background: rgba(124,116,230,.28); border-color: rgba(160,152,255,.45); } .side-btn.ai:hover:not(:disabled) { background: rgba(124,116,230,.4); } .side-btn:disabled { opacity: .45; cursor: not-allowed; }
.theme-row { display: flex; gap: 4px; padding: 4px 0 0; }
.theme-row button { flex: 1; font-size: 11px; padding: 4px 0; border-radius: 6px; border: 1px solid rgba(255,255,255,.12); background: transparent; color: var(--side-dim); cursor: pointer; }
.theme-row button[aria-pressed="true"] { color: var(--side-text); background: var(--side-active); }
.side-note { font-size: 11px; color: var(--side-dim); padding: 6px 4px 0; line-height: 1.45; }
.main { min-width: 0; display: flex; flex-direction: column; }
.page { width: 100%; max-width: 1320px; margin: 0 auto; padding: 1.5rem 1.75rem 5rem; }

/* collapsed sidebar: icons only */
@media (min-width: 861px) {
  .shell.side-mini { grid-template-columns: 62px minmax(0, 1fr) !important; }
  .side-mini .side { padding: 14px 8px; } .side-mini .brand { flex-direction: column; padding: 2px 0 12px; gap: 8px; } .side-mini .brand-text, .side-mini .nav-group, .side-mini .side-note, .side-mini .switcher, .side-mini .side-lbl { display: none !important; }
  .side-mini .nav-item { font-size: 0; justify-content: center; padding: 9px 0; } .side-mini .nav-item svg { width: 19px; height: 19px; } .side-mini .side-btn { justify-content: center; padding: 9px 0; } .side-mini .theme-row { display: none; }
}
/* the top bar: where you are, the month, the return method, the downloads */
.topbar { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg2) 88%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 0.5px solid var(--border2); }
.topbar-in { max-width: 1320px; margin: 0 auto; padding: 14px 1.75rem 10px; display: flex; flex-direction: column; gap: 10px; }
.tb-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tb-title { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; } .tb-title h1 { margin: 0; font-size: 22px; }
.client-badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; background: var(--accent-bg); color: var(--accent); font-weight: 500; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ctx { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--text2); } .ctx:empty { display: none; }
.ctx label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text3); display: inline-flex; align-items: center; gap: 8px; }
.ctx select { width: auto; font-size: 12.5px; padding: 5px 8px; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text); }
#exportMsg { color: var(--neg); }
.btn-row #askAi { background: var(--ai-bg); color: var(--ai); border-color: color-mix(in srgb, var(--ai) 35%, transparent); }

/* Home */
.home-head { margin: 4px 0 18px; } .home-head h2 { font-family: var(--font-title); font-weight: 500; font-size: 30px; letter-spacing: -.4px; line-height: 1.15; margin: 2px 0 0; text-transform: none; color: var(--text); }
.home-head p { color: var(--text2); margin: 4px 0 0; }
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.step { background: var(--bg); border: 0.5px solid var(--border); border-radius: var(--radius-lg); padding: 14px 14px 12px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.step.now { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.step-top { display: flex; align-items: center; gap: 8px; }
.step-n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; background: var(--bg3); color: var(--text2); flex-shrink: 0; }
.step.done .step-n { background: var(--accent); color: var(--on-accent); }
.step-t { font-weight: 600; font-size: 13.5px; } .step-opt { font-size: 10.5px; color: var(--text3); font-weight: 500; margin-left: auto; }
.step-d { font-size: 12.5px; color: var(--text2); flex: 1; } .step-d .ok { color: var(--pos); } .step-d .warn { color: var(--warn-fg); }
.step .btn, .step button { align-self: flex-start; padding: 6px 12px; font-size: 12.5px; } .step-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.home-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.home-grid > div > h2:first-child, .home-grid > div > h3:first-child { margin-top: 0; }
.ai-card { background: var(--ai-bg); border: 0.5px solid color-mix(in srgb, var(--ai) 35%, transparent); border-radius: var(--radius-lg); padding: 16px; margin-bottom: 16px; }
.ai-card h3 { font-size: 14.5px; font-weight: 600; color: var(--ai); text-transform: none; letter-spacing: 0; margin: 0; display: flex; align-items: center; gap: 6px; }
.ai-card p { font-size: 12.5px; color: var(--text2); margin: 4px 0 10px; }
.ai-q { display: block; width: 100%; text-align: left; font-size: 12.5px; padding: 8px 10px; margin-bottom: 6px; border-radius: 8px; border: 0.5px solid color-mix(in srgb, var(--ai) 30%, transparent); background: var(--bg); color: var(--text); cursor: pointer; }
.ai-q:hover:not(:disabled) { border-color: var(--ai); } .ai-q:disabled { opacity: .55; cursor: not-allowed; }
.attn { background: var(--bg); border: 0.5px solid var(--border); border-radius: var(--radius-lg); padding: 6px 0; margin-bottom: 16px; }
.attn-row { display: flex; gap: 10px; align-items: flex-start; padding: 9px 14px; font-size: 12.5px; border-bottom: 0.5px solid var(--border); } .attn-row:last-child { border-bottom: none; }
.attn-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; background: var(--warn-fg); } .attn-dot.err { background: var(--neg); } .attn-dot.ok { background: var(--pos); }
.attn-row a { color: var(--accent); margin-left: auto; white-space: nowrap; }
@media (max-width: 1100px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } .home-grid { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }
.help h3 { margin-top: 22px; } .help p, .help li { line-height: 1.65; max-width: 80ch; }

/* the customer switcher (in the sidebar) */
.switcher { position: relative; margin: 0 0 4px; }
.switcher > button { display: flex; align-items: center; gap: 6px; width: 100%; text-align: left; font-size: 13px; padding: 8px 10px; border-radius: 8px; cursor: pointer; border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.05); color: var(--side-text); }
.switcher > button:hover { background: var(--side-hover); }
.switcher .muted-label { color: var(--side-dim); font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; display: block; }
.switcher .switch-text { flex: 1; min-width: 0; }
.switcher #switchLabel { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel { position: fixed; z-index: 80; width: min(320px, 90vw); background: var(--bg); color: var(--text); border: 1px solid var(--border2); border-radius: 10px; box-shadow: 0 12px 30px rgba(0,0,0,.28); padding: 8px; }
.panel input { margin-bottom: 6px; } .panel ul { max-height: 280px; overflow: auto; }
.panel li button { display: flex; width: 100%; justify-content: space-between; gap: 8px; text-align: left; border: 0; background: transparent; color: var(--text); padding: 7px 8px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.panel li button:hover { background: var(--bg3); } .panel li button[aria-selected="true"] { background: var(--accent-bg); }
.panel .all { display: block; padding: 6px 4px 2px; font-size: 13px; }

/* ── headings ── */
h1 { font-family: var(--font-title); font-weight: 500; font-size: 24px; letter-spacing: -.2px; line-height: 1.2; margin: 0 0 2px; }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--accent); }
h2, h3 { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--text2); margin: 26px 0 10px; }
h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text3); margin: 14px 0 4px; }
.page > h1 + .muted, .address { margin: 4px 0 0; white-space: pre-line; color: var(--text2); }

/* ── buttons and fields ── */
button, .btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; font-size: 13px; border-radius: var(--radius); border: 0.5px solid var(--border2); background: var(--bg); color: var(--text); cursor: pointer; text-decoration: none; transition: background .12s; }
button:hover:not(:disabled), .btn:hover { background: var(--bg3); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.primary, .btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 500; }
button.primary:hover:not(:disabled), .btn.primary:hover { background: var(--accent-hover); }
button.danger { background: var(--bg); color: var(--neg); border-color: var(--err-border); } button.danger:hover:not(:disabled) { background: var(--err-bg); }
input[type=text], input[type=search], input[type=password], input[type=number], select, textarea { font: inherit; font-size: 13px; width: 100%; padding: 7px 10px; border: 0.5px solid var(--border2); border-radius: var(--radius); background: var(--bg); color: var(--text); }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 0; border-color: var(--accent); }
label.field { display: block; font-size: 12px; color: var(--text2); } label.field input { margin-top: 2px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; } .row > * { flex: 1 1 160px; min-width: 0; } .row > .fixed { flex: 0 0 auto; }
ul.plain { list-style: none; margin: 0; padding: 0; }
.tag { font-size: 11px; color: var(--text2); background: var(--bg3); border-radius: 99px; padding: 0 7px; margin-left: 6px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; align-items: center; }

/* ── cards, tables ── */
.card { background: var(--bg); border: 0.5px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px; box-shadow: 0 1px 3px rgba(0,0,0,.06); margin: 6px 0 1.25rem; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; background: var(--bg); border: 0.5px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.06); margin: 6px 0 1.25rem; }
th { padding: 9px 8px; text-align: left; font-size: 10.5px; font-weight: 600; color: var(--text2); border-bottom: 0.5px solid var(--border2); background: var(--bg2); text-transform: uppercase; letter-spacing: .04em; line-height: 1.3; vertical-align: bottom; }
td { padding: 9px 8px; text-align: left; border-bottom: 0.5px solid var(--border); color: var(--text); vertical-align: middle; }
td.num, th.num { text-align: right; white-space: nowrap; }
td:first-child, th:first-child { min-width: 140px; padding-left: 12px; } td:last-child, th:last-child { padding-right: 12px; }
td a { color: var(--text); text-decoration: none; font-weight: 500; } td a:hover { color: var(--accent); text-decoration: underline; }
td.left, th.left { text-align: left; }
tr:last-child > td { border-bottom: none; }
tr:hover:not(.total-row):not(.subtotal-row) > td { background: var(--bg2); }
tr.total-row > td { font-weight: 600; background: var(--bg3) !important; border-top: 1px solid var(--border2); }
tr.subtotal-row > td { font-weight: 500; background: var(--bg2) !important; }
tr.link { cursor: pointer; }
table table { box-shadow: none; margin: 0; }
td input[type=text], td input[type=number], th input[type=text] { width: 100%; min-width: 90px; padding: 4px 7px; font-size: 12px; }
td select { padding: 4px 7px; font-size: 12px; }
input.exact { width: 130px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 10.5px; font-weight: 500; background: var(--bg3); color: var(--text2); }
.badge.ok { background: var(--accent-bg); color: var(--accent); } .badge.bad { background: var(--err-bg); color: var(--neg); }
.badge.warn { background: var(--warn-bg); color: var(--warn-fg); } .badge.info { background: var(--info-bg); color: var(--blue); }
.cat-EQ { background: var(--blue-bg); color: var(--blue); } .cat-ST { background: var(--green-bg); color: var(--green); } .cat-LT { background: var(--amber-bg); color: var(--amber); }
.cat-PM { background: var(--pink-bg); color: var(--pink); } .cat-OC { background: var(--coral-bg); color: var(--coral); } .cat-CA { background: var(--gray-bg); color: var(--gray); } .cat-CR { background: var(--violet-bg); color: var(--violet); }
.chip { font-size: 11px; padding: 2px 8px; border-radius: 20px; background: var(--bg3); color: var(--text2); border: 0.5px solid var(--border); display: inline-block; margin: 2px 4px 2px 0; }
.msg { border-radius: var(--radius); padding: 9px 12px; margin: 10px 0; border: 0.5px solid transparent; }
.msg.err { background: var(--err-bg); color: var(--neg); border-color: var(--err-border); } .msg.ok { background: var(--accent-bg); border-color: var(--accent); }
.msg.info { background: var(--warn-bg); border-color: var(--warn-border); color: var(--warn-fg); }
details { margin: 8px 0; } summary { cursor: pointer; color: var(--text2); }
.empty, .no-data { padding: 2.2rem 1rem; text-align: center; color: var(--text3); font-size: 13px; background: var(--bg); border: 0.5px dashed var(--border2); border-radius: var(--radius-lg); }
.narr { line-height: 1.7; margin: 8px 0; }
#signin { max-width: 420px; margin: 60px auto; padding: 0 16px; }

/* ── report controls (month, return method, downloads) ── */
.toolbar { display: contents; }
.toolbar label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text3); display: inline-flex; align-items: center; gap: 8px; }
.toolbar select { width: auto; font-size: 12.5px; padding: 5px 8px; text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--text); }
.seg { display: inline-flex; } .seg button { border-radius: 0; padding: 6px 12px; font-size: 12.5px; } .seg button:first-child { border-radius: var(--radius) 0 0 var(--radius); } .seg button:last-child { border-radius: 0 var(--radius) var(--radius) 0; margin-left: -0.5px; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 500; }
.exportbar { margin-left: auto; display: inline-flex; gap: 8px; }
.exportbar #askAi { background: var(--ai-bg); color: var(--ai); border-color: color-mix(in srgb, var(--ai) 35%, transparent); }

/* ── metric and benchmark cards ── */
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 10px; margin: 8px 0 1.5rem; }
.metric-card { background: var(--bg); border: 0.5px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.metric-label { font-size: 11px; color: var(--text2); margin-bottom: 4px; }
.metric-value { font-size: 19px; font-weight: 600; letter-spacing: -.3px; } .metric-sub { font-size: 11px; color: var(--text3); margin-top: 2px; } .metric-alt { font-size: 11px; color: var(--text3); }
.bench-save { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 4px; } .bench-save p { margin: 0; }
.bench-edit { width: fit-content; max-width: 100%; }
.bench-edit table { width: auto; min-width: 360px; box-shadow: none; margin: 0 0 12px; }
.bench-edit th:first-child { width: 240px; } .bench-edit td input[type=text] { width: 100%; } .bench-edit td.num input { width: 110px; text-align: right; }
.bench-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 8px 0 1.5rem; }
.bench-card { background: var(--bg); border: 0.5px solid var(--border); border-radius: var(--radius-lg); padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.bench-name { font-size: 12px; color: var(--text2); margin-bottom: 5px; } .bench-ret { font-size: 26px; font-weight: 700; letter-spacing: -.5px; }
.thismonth { display: flex; gap: 28px; flex-wrap: wrap; align-items: baseline; }

/* ── charts ── */
.pie { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; margin: 8px 0 1.5rem; padding: 16px; background: var(--bg); border: 0.5px solid var(--border); border-radius: var(--radius-lg); }
.legend { flex: 1; min-width: 240px; max-width: 460px; }
.legend-row { display: flex; gap: 10px; align-items: center; padding: 5px 0; border-bottom: 0.5px solid var(--border); font-size: 13px; }
.swatch { width: 12px; height: 12px; border-radius: 3px; flex: none; } .pct { width: 56px; text-align: right; color: var(--text2); }

/* ── Files page ── */
.drop { border: 1.5px dashed var(--border2); border-radius: var(--radius-lg); padding: 1.4rem; margin: 14px 0 10px; text-align: center; background: var(--bg); }
.drop.over { border-color: var(--accent); background: var(--accent-bg); }
#picked li { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border: 0.5px solid var(--border); border-radius: var(--radius); margin-bottom: 4px; background: var(--bg); }
#picked li.problem { border-color: var(--err-border); background: var(--err-bg); }
#picked .name { flex: 1; min-width: 0; overflow-wrap: anywhere; } #picked .why { color: var(--neg); font-size: 12px; }
#detailPanel { margin-top: 14px; } #detailBox h3 { margin: 0 0 6px; } #detailBox h4 { margin: 16px 0 6px; }
.check-bad { color: var(--neg); } .check-warn { color: var(--text2); } #checksList { margin: 0; padding-left: 20px; }
.reading { margin: 8px 0; } #finalSummary { max-width: 420px; }
.secret { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 15px; word-break: break-all; padding: 8px 10px; background: var(--bg); border: 1px dashed var(--accent); border-radius: var(--radius); user-select: all; }

/* ── flags ── */
.flag { display: flex; gap: 12px; align-items: center; padding: 11px 14px; border: 0.5px solid var(--warn-border); border-radius: var(--radius); margin: 8px 0; background: var(--warn-bg); }
.flag > div { flex: 1; } .flag-icon { font-size: 18px; width: 22px; text-align: center; }
.flag.error { border-color: var(--err-border); background: var(--err-bg); } .flag.info { border-color: var(--info-border); background: var(--info-bg); }
.flag .muted { color: var(--text2); }

/* ── statement check: file list verdicts, numbered review sections ── */
button.link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-align: left; text-decoration: underline; text-underline-offset: 2px; }
button.link:hover { color: var(--accent-hover); }
#files tbody tr.clickable { cursor: pointer; } #files tbody tr.clickable:hover td { background: var(--bg2); }
.verdict { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.verdict.ok { background: var(--accent-bg); color: var(--accent); } .verdict.bad { background: #fbe4e1; color: #b3261e; }
.verdict-warn { font-size: 12px; color: var(--amber, #946200); display: block; margin-top: 2px; }
#detailTitle .verdict { margin-left: 8px; text-transform: uppercase; letter-spacing: .03em; }
#checksList { list-style: none; padding: 0; margin: 6px 0 10px; } #checksList li { margin: 2px 0; } #checksList li.check-ok { color: var(--text); } #checksList li.check-ok .why { color: var(--text3); }
#checksList .go { margin-left: 6px; font-weight: 600; }
.rv-sec { margin: 14px 0 18px; } .rv-sec > h4 { margin: 0 0 6px; font-size: 15px; text-transform: none; letter-spacing: 0; color: var(--text); }
.rv-table { width: 100%; } .rv-table th, .rv-table td { padding: 4px 6px; } .rv-table input { width: 9em; text-align: right; }
.rv-table td.num { white-space: nowrap; } .review-form .rv-table td.num > input { width: calc(100% - 46px); } button.where { background: none; border: 0; color: var(--accent); font-size: 12px; cursor: pointer; padding: 0 4px; text-decoration: underline; }
.sec-check { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; } .sec-check .sec-note { flex: 1; min-width: 14em; }
.sec-ok.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); } .sec-bad.on { background: #b3261e; color: #fff; border-color: #b3261e; }
.sec-shown { margin: 6px 0 0; }
.report-line { margin: 0 0 14px; line-height: 1.7; color: var(--text); } .report-line #reportAccounts { font-size: 14px; }
.rv-pair { display: flex; align-items: center; gap: 6px; } .rv-pair input { flex: 1; min-width: 0; } .rv-pair .fx-cell { flex: 1; min-width: 0; }
.review-grid { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr) !important; }
.rv-holdings { width: 100%; } .rv-holdings td, .rv-holdings th { padding: 8px 6px; } .rv-holdings td.sym { color: var(--accent); font-weight: 500; } .rv-holdings td.cls, .rv-holdings th.cls { text-align: right; }
.rv-holdings tr.removed td { text-decoration: line-through; opacity: .5; } .rv-table td.wh { width: 3.5em; } button.where { text-decoration: none; }
.num-cell { display: flex; align-items: center; gap: 4px; } .num-cell > input, .num-cell > .fx-cell { flex: 1; min-width: 0; } .num-cell > input { width: auto !important; } .num-cell button.where { flex: none; }
details.readers { margin-top: 16px; } details.readers > summary { cursor: pointer; font-weight: 600; }
.rv-holdings tfoot td { font-weight: 600; border-top: 0.5px solid var(--border2); padding-top: 10px; } .num-text { text-align: right; padding-right: 8px; }
.reader-notes { margin: 18px 0 10px; } .reader-notes h4 { font-size: 15px; text-transform: none; letter-spacing: 0; color: var(--text); margin: 0 0 6px; }
.reader-notes ul { margin: 0; padding-left: 20px; line-height: 1.6; } .note-title.bad { color: #b3261e; } .note-title.warn { color: var(--amber, #946200); } .note-title.ok { color: var(--text3); }
.result-box { margin: 10px 0; }
input.disagree { box-shadow: 0 0 0 2px rgba(148,98,0,.45); background: #fff8e6; } tr.disagree td { background: #fff8e6; }
.rerun { margin-top: 14px; }
.shell .page.wide { max-width: 1800px; }
.fx-pin { width: 24px !important; height: 24px !important; font-size: 12px !important; } .fx-cell { gap: 3px !important; }
#checksList .go { white-space: nowrap; }
/* ── review against the PDF ── */
.fx-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; border: 0.5px solid var(--border2); border-radius: var(--radius); padding: 10px 12px; margin: 10px 0; background: var(--bg2); }
.fx-bar.on { display: block; border-color: var(--accent); background: var(--accent-bg); } .fx-bar.on #fixMsg { margin-bottom: 8px; font-weight: 500; }
.fx-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.fx-cell { display: flex; gap: 4px; align-items: center; } .fx-cell input { flex: 1; min-width: 0; }
.fx-pin { flex: none; width: 28px; height: 28px; padding: 0; border-radius: 50%; border: 0.5px solid var(--border2); background: var(--bg); cursor: pointer; font-size: 13px; line-height: 1; }
.fx-pin.sel { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
input.fx-changed { box-shadow: 0 0 0 2px rgba(217,72,15,.4); }
.pdf-tok { position: absolute; display: none; cursor: pointer; border-radius: 2px; }
.picking .pdf-tok { display: block; } .picking .pdf-tok:hover { background: rgba(47,111,176,.2); outline: 1.5px solid #2f6fb0; } .picking .pdf-tok.num:hover { background: rgba(30,107,85,.22); outline-color: #1e6b55; }
.review { display: grid; grid-template-columns: minmax(520px, 1.25fr) minmax(0, 1fr); gap: 16px; margin-top: 12px; align-items: start; transition: grid-template-columns .2s; }
.review.fixing { grid-template-columns: minmax(580px, 1.05fr) minmax(0, 1fr); }      /* while fixing: the form keeps room for the pins, the statement gets the rest */           /* while fixing, the statement gets the room */
.review-form, .review-pdf { background: var(--bg); border: 0.5px solid var(--border); border-radius: var(--radius-lg); box-shadow: 0 1px 3px rgba(0,0,0,.06); padding: 14px 16px; }
.review-pdf { position: sticky; top: 120px; } .review-pdf iframe { width: 100%; height: 78vh; border: 0.5px solid var(--border2); border-radius: var(--radius); background: var(--bg2); }
.review-form input[type=text] { width: 100%; padding: 4px 6px; } .review-form input.num { text-align: right; }
.review-form { min-width: 0; overflow-x: auto; }                       /* nothing in the form can spill under the statement */
#reviewHoldings { width: 100%; table-layout: fixed; } #reviewHoldings th:nth-child(1) { width: 17%; } #reviewHoldings th:nth-child(2) { width: 27%; }
#reviewHoldings th:nth-child(3), #reviewHoldings th:nth-child(4) { width: 14%; } #reviewHoldings th:nth-child(5) { width: 16%; } #reviewHoldings th:nth-child(6) { width: 12%; }
#reviewHoldings input { min-width: 0; } #reviewHoldings td button { padding: 4px 8px; font-size: 12px; }
.review-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 15em); column-gap: 10px; align-items: center; }
.review-grid > * { padding: 6px 0; border-bottom: 0.5px solid var(--border); }
.field-name { color: var(--accent); cursor: pointer; } .field-name:hover { text-decoration: underline; }
.detail-nav { margin: 4px 0 10px; } .detail-page { margin: 0; }
#detailTitle { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0 4px; } #detailTitle .detail-file { text-transform: uppercase; letter-spacing: .05em; font-size: 13px; color: var(--text2); font-weight: 600; }
#detailReason { font-size: 12.5px; color: var(--text2); margin: 0 0 4px; }
#checksWrap #checksList li { font-size: 14px; color: var(--text); } #checksWrap #checksList li.check-warn .mark, #checksWrap #checksList li.check-bad .mark { color: #b3261e; } #checksList .mark { font-weight: 700; } #checksList .check-ok .mark { color: var(--accent); } #checksList .check-bad .mark { color: #b3261e; } #checksList .check-warn .mark { color: var(--amber, #946200); }
#checksList .why { color: var(--text3); font-size: 12.5px; }
.fx-hint { margin: 8px 0 0; }
.review-form tr.removed td { opacity: .45; text-decoration: line-through; } .review-form th, .review-form td { padding: 4px 5px; }
.pdf-pages { max-height: 78vh; overflow: auto; border: 0.5px solid var(--border2); border-radius: var(--radius); background: var(--bg3); padding: 6px; }
.pdf-page { position: relative; margin: 0 auto 8px; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.pdf-page canvas { width: 100%; height: 100%; display: block; }
.pdf-hit { position: absolute; border: 2px solid #2f6fb0; background: rgba(47,111,176,.18); border-radius: 2px; pointer-events: none; }
.pdf-hit.current { border-color: #d9480f; background: rgba(217,72,15,.22); box-shadow: 0 0 0 3px rgba(217,72,15,.25); }
.pdf-where { font-size: 12px; margin: 6px 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ── Ask AI ── */
.ai-panel { background: var(--ai-bg); border: 0.5px solid color-mix(in srgb, var(--ai) 35%, transparent); border-radius: var(--radius-lg); padding: 14px 16px; margin: 12px 0; }
.ai-panel h3 { color: var(--ai); margin-top: 0; }
.ai-turn { margin: 8px 0; padding: 8px 10px; border-radius: var(--radius); } .ai-turn.you { background: var(--bg3); } .ai-turn.ai { background: var(--bg); line-height: 1.55; }
.ai-mono { font-family: ui-monospace, Menlo, monospace; font-size: 11px; white-space: pre-wrap; word-break: break-word; background: var(--bg2); border: 0.5px solid var(--border); border-radius: 6px; padding: 6px 8px; margin: 4px 0; max-height: 260px; overflow: auto; }
.ai-ok { background: var(--accent-bg); border-bottom: 1px solid var(--pos); border-radius: 3px; padding: 0 2px; }
.ai-bad { background: var(--warn-bg); border-bottom: 2px solid var(--warn-fg); border-radius: 3px; padding: 0 2px; }
.ai-bad-note { color: var(--warn-fg); font-weight: 600; }
.ai-suggest .chip { cursor: pointer; border-color: color-mix(in srgb, var(--ai) 30%, transparent); background: var(--bg); }
.acct-item { margin: 18px 0; } .acct-link { text-decoration: none; color: var(--text); } .acct-link:hover { color: var(--accent); }

/* ── admin page (its own plain top bar) ── */
header { background: var(--side-bg); color: #fff; display: flex; align-items: center; gap: 14px; padding: 10px 18px; }
header .brand-link, header a.brand { color: #fff; font-weight: 600; text-decoration: none; font-size: 15px; }
header .who { font-size: 12px; opacity: .75; }
header button { background: transparent; color: #fff; border-color: rgba(255,255,255,.3); } header button:hover:not(:disabled) { background: rgba(255,255,255,.1); }
body > main { max-width: 1000px; margin: 0 auto; padding: 20px 20px 60px; }
.shell .page { max-width: 1320px; }

/* ── print report ── */
#printArea { display: none; }
.pr-head { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 2px solid #1a1a18; padding-bottom: 10px; margin-bottom: 18px; }
.pr-title { font-size: 22px; font-weight: 700; } .pr-sub { font-size: 13px; color: #5f5e5a; margin-top: 3px; } .pr-date { font-size: 12px; color: #5f5e5a; }
.pr-h { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: #5f5e5a; margin: 22px 0 10px; border-bottom: .5px solid #ccc; padding-bottom: 5px; }
.pr-tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-bottom: 14px; border: 0; border-radius: 0; box-shadow: none; background: none; }
.pr-tbl th { text-align: right; padding: 7px 10px; border-bottom: 1px solid #888; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: #5f5e5a; background: none; }
.pr-tbl td { text-align: right; padding: 7px 10px; border-bottom: .5px solid #e0e0e0; background: none; color: #1a1a18; }
.pr-tbl .l { text-align: left; } .pr-tbl .sub2 { font-size: 10px; color: #9a9994; }
.pr-tbl .sub-row td { background: #f2f2ef; font-weight: 500; } .pr-tbl .tot-row td { background: #e6e6e1; font-weight: 700; border-top: 1.5px solid #888; }
.pr-note { font-size: 10.5px; color: #9a9994; margin: 6px 0 10px; } .pr-foot { margin-top: 24px; font-size: 10.5px; color: #9a9994; border-top: .5px solid #ccc; padding-top: 8px; }
@media print {
  body > *:not(#printArea) { display: none !important; }
  #printArea { display: block !important; color: #1a1a18; background: #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .pr-tbl tr, .pr-tbl thead { page-break-inside: avoid; } .pr-page2 { page-break-before: always; } @page { margin: 14mm; }
}

/* ── narrow screens ── */
@media (max-width: 1240px) and (min-width: 861px) { .shell { grid-template-columns: 200px minmax(0, 1fr); } .page { padding-left: 1.1rem; padding-right: 1.1rem; } }
@media (max-width: 900px) { .review, .review.fixing { grid-template-columns: 1fr; } .review-pdf { position: static; } .review-pdf iframe { height: 60vh; } }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; } .side { position: static; height: auto; flex-direction: column; }
  .side nav { display: flex; flex-wrap: wrap; gap: 2px; } .nav-group { width: 100%; padding-top: 8px; } .nav-item { width: auto; }
  .page { padding: 16px 16px 50px; } .toolbar { position: static; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
#accounts td:nth-child(2), #accounts th:nth-child(2) { white-space: nowrap; }

.page-label { font-size: 13px; color: var(--text2); font-weight: 500; padding-left: 10px; border-left: 1px solid var(--border2); }
h2.page-title { font-family: var(--font-title); font-weight: 500; font-size: 22px; letter-spacing: -.2px; text-transform: none; color: var(--text); margin: 6px 0 4px; } h2.page-title.big { font-size: 26px; }
select.inline { width: auto; min-width: 260px; }

/* sidebar buttons keep their dark look on hover (the general button:hover rule above is more specific than the sidebar's own) */
.side .switcher > button:hover:not(:disabled), .side .side-btn:hover:not(:disabled), .side .side-toggle:hover:not(:disabled), .side .theme-row button:hover:not(:disabled) { background: var(--side-hover); color: var(--side-text); }
.side .side-btn.ai:hover:not(:disabled) { background: rgba(124,116,230,.4); }
.side .theme-row button[aria-pressed="true"]:hover:not(:disabled) { background: var(--side-active); }

/* Account summary lines the statement does not print: left out of the table, with a way to add one */
.add-lines { margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.add-lines .linkish { background: none; border: 0; padding: 0; color: var(--accent, #2563eb); cursor: pointer; font: inherit; }
.add-lines .linkish:hover { text-decoration: underline; }

/* ── Tendant product bar (the four modules) across the top of every page; ported from the Render demo, 26 Oct 2026 ── */
:root { --pbar-h: 0px; }
body.with-pbar { --pbar-h: 56px; }
.pbar { position: sticky; top: 0; z-index: 60; background: var(--side-bg); color: var(--side-fg); display: block; padding: 0; }
.pbar-in { max-width: none; margin: 0 auto; padding-inline: 20px; display: flex; align-items: stretch; gap: 28px; height: 56px; }
.pbrand { display: flex; align-items: center; gap: 10px; color: var(--side-text); text-decoration: none; flex: none; }
.pbrand .brand-mark { width: 28px; height: 28px; border-radius: 7px; font-size: 16px; }
.pbrand-name { font: 500 18px/1 var(--font-title); letter-spacing: .01em; }
.pbar .sections { display: flex; align-items: stretch; gap: 4px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.pbar .sections::-webkit-scrollbar { display: none; }
.pbar .sec { display: flex; align-items: center; gap: 7px; padding: 0 12px; color: var(--side-fg); text-decoration: none; font-size: 13.5px; white-space: nowrap;
  border-bottom: 2px solid transparent; border-top: 2px solid transparent; }
.pbar a.sec:hover { color: var(--side-text); background: var(--side-hover); }
.pbar .sec[aria-current="page"] { color: var(--side-text); border-bottom-color: var(--accent); font-weight: 500; }
.pbar .sec.soon { color: var(--side-dim); cursor: default; }
.pbar .soon-tag { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; border: 1px solid rgba(255,255,255,.16); border-radius: 999px; padding: 1px 6px; }
.pbar .who { display: flex; align-items: center; gap: 12px; flex: none; font-size: 12.5px; }
.pbar .who-name { color: var(--side-fg); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pbar .who button { color: var(--side-text); background: transparent; border: 1px solid rgba(255,255,255,.18); padding: 6px 11px; font-size: 12.5px; }
.pbar .who button:hover:not(:disabled) { background: var(--side-hover); }
@media (max-width: 860px) {
  body.with-pbar { --pbar-h: 98px; }
  .pbar .who-name { display: none; }
  .pbar-in { flex-wrap: wrap; gap: 0 14px; padding-top: 8px; height: auto; }
  .pbrand, .pbar .who { min-height: 40px; }
  .pbar .who { margin-left: auto; }
  .pbar .sections { order: 3; flex-basis: 100%; min-height: 42px; margin-inline: -8px; }
}
/* the app's own sidebar and page header sit under the bar */
body.with-pbar .side { top: var(--pbar-h); height: calc(100vh - var(--pbar-h)); }
body.with-pbar .topbar { top: var(--pbar-h); }
body.with-pbar .review-pdf { top: calc(120px + var(--pbar-h)); }
body.with-pbar { height: auto; min-height: 100%; }      /* a body as tall as the window would carry the sticky bar away once the page scrolls past it */
body.with-pbar .shell { min-height: calc(100vh - var(--pbar-h)); }

/* ── Tendant home (#/): the four modules ── */
.landing { max-width: 1080px; margin: 0 auto; padding: 24px 0 40px; }
.landing h1 { font: 500 32px/1.15 var(--font-title); margin: 0; letter-spacing: -.005em; text-wrap: balance; }
.landing .lead { margin: 8px 0 28px; color: var(--text2); max-width: 64ch; }
.mods { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 720px) { .mods { grid-template-columns: 1fr; } .landing h1 { font-size: 26px; } }
.mod { display: flex; flex-direction: column; gap: 10px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 22px 22px 20px; color: inherit; text-decoration: none; min-height: 190px; }
a.mod:hover { border-color: var(--accent); box-shadow: 0 1px 0 var(--accent); }
a.mod:hover .go { color: var(--accent); }
.mod-top { display: flex; align-items: center; gap: 12px; }
.mod-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--accent-bg); color: var(--accent); display: grid; place-items: center; flex: none; }
.mod-icon svg { width: 22px; height: 22px; }
.mod h2 { font: 500 20px/1.2 var(--font-title); margin: 0; text-transform: none; letter-spacing: 0; color: var(--text); }
.mod p { margin: 0; color: var(--text2); font-size: 13.5px; }
.mod .go { margin-top: auto; font-size: 13px; color: var(--text3); font-weight: 500; }
.mod.off { background: transparent; border-style: dashed; }
.mod.off .mod-icon { background: var(--bg3); color: var(--text3); }
.mod.off h2 { color: var(--text2); }
.mod .pill { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; border: 1px solid var(--border2); color: var(--text3); border-radius: 999px; padding: 1px 7px; margin-left: auto; }
.landing .foot { margin-top: 26px; font-size: 12px; color: var(--text3); }

/* ── Compliance (#/compliance): the firm's Form ADV and the draft checklists (26-27 Oct 2026) ── */
.compliance { max-width: 1080px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; padding-bottom: 20px; }
.compliance h1 { font: 500 30px/1.15 var(--font-title); margin: 0; letter-spacing: -.005em; }
.compliance .lead { margin: 6px 0 0; color: var(--text2); max-width: 70ch; }
.compliance .card { margin: 0; padding: 20px 22px; }
.compliance .card h2, .compliance .cl-head h2 { font: 500 19px/1.25 var(--font-title); margin: 0 0 4px; text-transform: none; letter-spacing: 0; color: var(--text); }
.compliance .cl-head h2 { font-size: 22px; margin-top: 8px; }
.compliance .sub { color: var(--text3); font-size: 12.5px; }
.compliance .facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 22px; margin-top: 16px; }
@media (max-width: 760px) { .compliance .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } .compliance h1 { font-size: 25px; } }
.compliance .fact .k { font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--text3); }
.compliance .fact .v { font-size: 15px; margin-top: 2px; overflow-wrap: anywhere; }
.compliance .due { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.compliance .due .big { font: 500 22px/1.2 var(--font-title); }
.compliance .tag { font-size: 11px; border-radius: 999px; padding: 2px 9px; border: 1px solid var(--border2); color: var(--text2); }
.compliance .tag.warn { background: var(--warn-bg); color: var(--warn-fg); border-color: var(--warn-border); }
.compliance .tag.bad { background: var(--err-bg); color: var(--neg); border-color: var(--err-border); }
.compliance #advDocs { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.compliance #advDocs th { text-align: left; font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--text3); font-weight: 500; padding: 8px 10px; border-bottom: 1px solid var(--border2); }
.compliance #advDocs td { padding: 11px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.compliance td.part { font-weight: 600; white-space: nowrap; }
.compliance .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.compliance .acts .btn, .compliance .viewer-head .btn { padding: 6px 12px; font-size: 12.5px; }
.compliance .tablewrap { overflow-x: auto; }
.compliance ul.rules { margin: 8px 0 0; padding-left: 18px; color: var(--text2); font-size: 13.5px; }
.compliance ul.rules li { margin: 4px 0; }
.compliance .note { font-size: 12px; color: var(--text3); line-height: 1.55; margin: 6px 0 0; }
#firmBox { display: flex; flex-direction: column; gap: 16px; }
#firmBox[hidden], #advViewer[hidden], #clPanel[hidden] { display: none; }
.compliance .card.sample { background: #fdf0d5; border-color: #e7c27a; color: #6b4600; font-size: 13.5px; }
:root[data-theme="dark"] .compliance .card.sample { background: #3a2e14; color: #f1d9a6; border-color: #7a6022; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .compliance .card.sample { background: #3a2e14; color: #f1d9a6; border-color: #7a6022; } }
.compliance .viewer-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; } .compliance .viewer-head h2 { margin-right: auto; }
#advFrame { width: 100%; height: 78vh; border: 0.5px solid var(--border2); border-radius: var(--radius); background: var(--bg2); }
.cl-box { display: flex; flex-direction: column; gap: 14px; }
.compliance .cl-head { display: flex; flex-direction: column; }
.compliance .draft { background: #e8eefc; border: 1px solid #b7c6ef; color: #23407a; border-radius: var(--radius-lg); padding: 12px 16px; font-size: 13.5px; }
:root[data-theme="dark"] .compliance .draft { background: #1b2740; border-color: #34507f; color: #c9d7f5; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .compliance .draft { background: #1b2740; border-color: #34507f; color: #c9d7f5; } }
.cl-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 760px) { .cl-cards { grid-template-columns: 1fr; } }
.compliance .cl-card { text-align: left; cursor: pointer; font: inherit; color: inherit; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 20px; display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.compliance .cl-card:hover:not(:disabled), .compliance .cl-card[aria-expanded="true"] { border-color: var(--accent); background: var(--bg); }
.compliance .cl-card h3 { font: 500 17px/1.25 var(--font-title); margin: 0; }
.compliance .cl-card .go { font-size: 13px; color: var(--accent); }
.compliance .bar2 { height: 6px; background: var(--bg3); border-radius: 3px; overflow: hidden; } .compliance .bar2 > i { display: block; height: 100%; background: var(--accent); }
.compliance .qsec h3 { font: 500 16px/1.3 var(--font-title); margin: 18px 0 2px; }
.compliance .qrow { border-top: 1px solid var(--border); padding: 12px 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px); gap: 10px 18px; }
@media (max-width: 760px) { .compliance .qrow { grid-template-columns: 1fr; } }
.compliance .qid { color: var(--text3); font-size: 11.5px; margin-right: 6px; }
.compliance .qtext { font-size: 13.5px; } .compliance .qhelp { font-size: 12px; color: var(--text3); margin-top: 3px; }
.compliance .rule { font-size: 10.5px; border: 1px solid var(--border2); border-radius: 999px; padding: 0 6px; color: var(--text3); margin-left: 6px; white-space: nowrap; }
.compliance .qin input, .compliance .qin select, .compliance .qin textarea, .compliance .cmt textarea, .compliance .addq textarea, .compliance .qtable input {
  width: 100%; font: inherit; font-size: 13px; padding: 6px 8px; border: 1px solid var(--border2); border-radius: 6px; background: var(--bg); color: var(--text); box-sizing: border-box; }
.compliance .seg { display: inline-flex; border: 1px solid var(--border2); border-radius: 6px; overflow: hidden; }
.compliance .seg button { border: 0; border-radius: 0; background: var(--bg); color: var(--text2); padding: 5px 11px; font: inherit; font-size: 12.5px; cursor: pointer; border-left: 1px solid var(--border); }
.compliance .seg button:first-child { border-left: 0; } .compliance .seg button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.compliance .seg button:disabled { cursor: default; opacity: 1; } .compliance .seg button:disabled:not([aria-pressed="true"]) { color: var(--text3); }
.compliance .cmt { grid-column: 1 / -1; } .compliance .cmt[hidden] { display: none; }
.compliance .qfoot { display: flex; gap: 12px; align-items: center; margin-top: 6px; }
.compliance .cmtbtn { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-size: 12.5px; cursor: pointer; }
.compliance .cmtbtn:hover:not(:disabled) { background: none; text-decoration: underline; }
.compliance .cmtbtn.has { font-weight: 600; }
.compliance .qsaved { font-size: 11.5px; color: var(--text3); } .compliance .qsaved.ok { color: var(--pos); } .compliance .qsaved.err { color: var(--neg); }
.compliance .qtable { width: 100%; font-size: 12.5px; border-collapse: collapse; } .compliance .qtable td, .compliance .qtable th { padding: 6px 6px; text-align: left; } .compliance .qtable td:first-child { min-width: 180px; }
.compliance .qwide { grid-column: 1 / -1; overflow-x: auto; }
.compliance .addq { margin-top: 10px; } .compliance .addq summary { cursor: pointer; color: var(--accent); font-size: 12.5px; }
.compliance .sendbar { position: sticky; bottom: 0; background: var(--bg); border: 1px solid var(--border2); border-radius: var(--radius-lg); padding: 12px 16px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; box-shadow: 0 -2px 10px rgba(0,0,0,.06); }

/* ── Research (research.html): markets → USA sectors → companies, TradingView's widgets; ported from the Render demo ── */
.research-page main { max-width: 1280px; margin: 0 auto; padding: 22px 20px 48px; display: flex; flex-direction: column; gap: 14px; }
.research-page .crumbs { font-size: 13px; color: var(--text3); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.research-page .crumbs a { color: var(--accent); text-decoration: none; } .research-page .crumbs a:hover { text-decoration: underline; }
.research-page .crumbs strong { color: var(--text2); font-weight: 500; }
.research-page .head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.research-page h1 { font: 500 30px/1.15 var(--font-title); margin: 0; text-wrap: balance; letter-spacing: -.005em; }
.research-page .lead { margin: 6px 0 0; color: var(--text2); max-width: 68ch; }
.research-page .meta { font-size: 12px; color: var(--text3); margin-top: 8px; display: flex; gap: 14px; flex-wrap: wrap; letter-spacing: .01em; }
.research-page .meta b { color: var(--text2); font-weight: 500; }
.research-page .period { display: inline-flex; background: var(--bg); border: 1px solid var(--border2); border-radius: var(--radius); padding: 3px; gap: 2px; }
.research-page .period[hidden] { display: none; }
.research-page .period button { border: 0; background: transparent; padding: 6px 12px; border-radius: 6px; font-size: 13px; color: var(--text2); }
.research-page .period button:hover:not(:disabled) { color: var(--text); background: var(--bg3); }
.research-page .period button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.research-page .tvpanel { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 6px 8px 0; }
.research-page .label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text3); font-weight: 500; margin: 10px 0 0; }
.research-page .tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.research-page .tabs button { background: var(--bg); color: var(--text); border: 1px solid var(--border2); padding: 7px 12px; font-size: 13px; }
.research-page .tabs button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); background: var(--bg); }
.research-page .tabs button.go-strong { background: var(--accent); border-color: var(--accent); color: #fff; }
.research-page .tabs button.go-strong:hover:not(:disabled) { color: #fff; background: var(--accent); filter: brightness(1.07); }
.research-page h2 { font: 500 18px/1.3 var(--font-title); margin: 12px 0 0; text-transform: none; letter-spacing: 0; color: var(--text); }
.research-page h2 small { font: 400 12.5px var(--font-ui); color: var(--text3); margin-left: 8px; }
.research-page .tv.big { height: 540px; } .research-page .tv.mid { height: 430px; }
.research-page .two { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; }
@media (max-width: 860px) { .research-page .two { grid-template-columns: 1fr; } .research-page .tv.big { height: 440px; } .research-page h1 { font-size: 25px; } }
.research-page .rnote { font-size: 12px; color: var(--text3); line-height: 1.55; max-width: 110ch; border-top: 1px solid var(--border); padding-top: 12px; margin-top: 6px; }
.tradingview-widget-container { height: 100%; width: 100%; color-scheme: normal; }   /* lets TradingView's frame stay transparent in dark mode */
.tradingview-widget-container__widget { height: calc(100% - 26px); width: 100%; }
.tradingview-widget-copyright { font-size: 11px; line-height: 26px; color: var(--text3); text-align: right; padding-right: 4px; }
.tradingview-widget-copyright a { color: var(--text3); }
.research-page #signinNote { max-width: 640px; margin: 60px auto; text-align: center; color: var(--text2); }
.research-page main[hidden], .research-page #signinNote[hidden] { display: none; }
.compliance h3, .compliance .cl-card h3, .compliance .qsec h3 { text-transform: none; letter-spacing: 0; color: var(--text); }

/* ── customer Home, as the old app (v5.2): headline tiles, equities vs the index, accounts at a glance ── */
.home-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.home-tile { background: var(--bg); border: 0.5px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.home-tile .k { font-size: 12.5px; color: var(--text2); }
.home-tile .v { font-size: 26px; font-weight: 600; letter-spacing: -.4px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.home-tile .s { font-size: 12px; color: var(--text3); margin-top: 1px; }
.home-tile .v.pos { color: var(--pos); } .home-tile .v.neg { color: var(--neg); }
.home-eq { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.glance { padding: 0; overflow: hidden; }
.glance table { width: 100%; border-collapse: collapse; }
.glance td, .glance th { padding: 9px 14px; }
.glance .glance-name { font-weight: 500; } .glance .glance-num { font-size: 11.5px; color: var(--text3); }
.glance td.glance-bar { width: 30%; }
.glance .bar { height: 6px; border-radius: 3px; background: var(--accent); opacity: .75; min-width: 2px; }
.glance td.num.pos { color: var(--pos); } .glance td.num.neg { color: var(--neg); }
#homeLinks { margin-top: 4px; }
.ctx-line { font-size: 13px; color: var(--text2); flex-basis: 100%; margin-top: -6px; }      /* one line each, as the old header */
.home-empty { padding: 28px 22px; text-align: center; color: var(--text2); }
.home-empty-t { font-family: var(--font-title); font-size: 18px; color: var(--text); margin-bottom: 6px; }
@media (max-width: 640px) { .home-tiles { grid-template-columns: 1fr; } }

/* Aggregate Summary: a share bar under each % of total (as the old app), and the donuts in their own cards */
.bar-wrap { width: 100%; min-width: 60px; background: var(--bg3); border-radius: 2px; height: 4px; margin-top: 4px; }
.bar-fill { height: 4px; border-radius: 2px; }


/* ── Accounts, as the old app: the upload box, a card per account, and one holdings table with subtotals ── */
.upload-zone { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 26px 16px; margin: 0 0 14px; border: 1.5px dashed var(--border2);
  border-radius: var(--radius-lg); background: var(--bg); color: var(--text); text-decoration: none; text-align: center; }
.upload-zone:hover { border-color: var(--accent); }
.acct-item.card { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 0 0 10px; }
.acct-item h3 { margin: 0 0 2px; font-size: 14px; text-transform: none; letter-spacing: 0; color: var(--text); font-weight: 600; }
.acct-item h3 a { color: inherit; text-decoration: none; } .acct-item h3 a:hover { text-decoration: underline; }
.acct-line { font-size: 13px; color: var(--text2); margin-bottom: 6px; }
#holdingsByAccount { width: 100%; border-collapse: collapse; }
#holdingsByAccount td.acct-col { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text2); font-size: 12px; }
#holdingsByAccount td.sym { font-weight: 500; }

/* Equity / YTD, as the old app: two titled cards side by side, the narrative in a card */
.two-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 6px 0 18px; }
@media (max-width: 900px) { .two-cards { grid-template-columns: 1fr; } }
.kv-card { margin: 0; } .kv-title { font-weight: 600; font-size: 14px; margin: 2px 0 10px; }
table.kv { width: 100%; border-collapse: collapse; } table.kv td { padding: 7px 0; border-bottom: 0.5px solid var(--border); font-size: 13px; }
table.kv tr:last-child td { border-bottom: 0; } table.kv td.num { text-align: right; font-weight: 500; }
table.kv td.pos { color: var(--pos); } table.kv td.neg { color: var(--neg); }
.narr-card { padding: 16px 18px; } .narr-card .narr strong.pos { color: var(--pos); } .narr-card .narr strong.neg { color: var(--neg); }
.foot-note { border-top: 0.5px solid var(--border); padding-top: 12px; margin-top: 16px; }
