:root {
    --navy: #0f1f3d; --navy-2: #172c52; --ink: #1b2433; --muted: #5d6b82; --line: #dde3ec;
    --bg: #f5f7fb; --card: #ffffff; --accent: #1f5fbf; --accent-ink: #ffffff; --ok: #1e7a46; --bad: #b42318;
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif; color: var(--ink); background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; }
h1 { font-size: 1.6rem; margin: 0 0 .75rem; }
h2 { font-size: 1.15rem; margin: 1.25rem 0 .5rem; }
h3 { font-size: 1rem; margin: 1rem 0 .25rem; }
a { color: var(--accent); }
.muted { color: var(--muted); }
pre { white-space: pre-wrap; background: var(--bg); padding: .75rem; border-radius: 6px; font-size: .85rem; }

.shell { display: flex; min-height: 100vh; }
.rail { width: 220px; background: var(--navy); color: #cfd8e8; display: flex; flex-direction: column; padding: 1rem .75rem; gap: .15rem; flex-shrink: 0; }
.rail a { color: #cfd8e8; text-decoration: none; padding: .45rem .6rem; border-radius: 6px; }
.rail a:hover, .rail a.active { background: var(--navy-2); color: #fff; }
.rail .brand { font-weight: 700; font-size: 1.2rem; color: #fff; margin-bottom: .5rem; }
.rail .workspace { font-size: .8rem; padding: 0 .6rem .5rem; color: #8fa3c4; }
.rail-group { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: #8fa3c4; padding: .9rem .6rem .2rem; }
.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: .2rem; font-size: .85rem; }
.rail-foot .who { padding: .4rem .6rem 0; color: #fff; }
.rail-foot .ver { padding: 0 .6rem; color: #8fa3c4; font-size: .75rem; }
.rail-foot .link { color: #cfd8e8; padding: .2rem .6rem; text-align: left; }
.content { flex: 1; min-width: 0; padding: 1.5rem 2rem; max-width: 1100px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 1rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.25rem; margin-bottom: 1rem; }
.card h2 { margin-top: 0; }

.btn { display: inline-block; background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); border-radius: 6px; padding: .45rem .9rem; font: inherit; cursor: pointer; text-decoration: none; }
.btn.ghost { background: transparent; color: var(--accent); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.link { background: none; border: none; color: var(--accent); cursor: pointer; font: inherit; padding: 0 .25rem; }
.link.danger { color: var(--bad); }

.form { display: flex; flex-direction: column; gap: .75rem; max-width: 520px; margin: 1rem 0; }
.form.inline { flex-direction: row; flex-wrap: wrap; align-items: flex-end; max-width: none; }
.form label { display: flex; flex-direction: column; gap: .25rem; font-size: .9rem; }
.form label.radio { flex-direction: row; align-items: center; gap: .5rem; }
.form fieldset { border: 1px solid var(--line); border-radius: 8px; display: flex; flex-direction: column; gap: .4rem; }
input, select { font: inherit; padding: .4rem .5rem; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.validation-errors, .validation-message { color: var(--bad); font-size: .85rem; }

.grid { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 8px; margin: .5rem 0 1rem; }
.grid th, .grid td { text-align: left; padding: .5rem .65rem; border-bottom: 1px solid var(--line); font-size: .9rem; vertical-align: top; }
.grid th { background: var(--bg); font-weight: 600; }
.grid th a { color: inherit; text-decoration: none; white-space: nowrap; }
.grid th a:hover, .grid th a:focus-visible { text-decoration: underline; }
.grid th.r a { display: inline-block; }
.grid th .sort-arrow { font-size: .7em; margin-left: .25em; color: var(--muted); }
.grid tr.dim td { color: var(--muted); }
.row-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

.pill { display: inline-block; font-size: .75rem; padding: .1rem .5rem; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); margin-left: .35rem; }
.pill.ok { color: var(--ok); border-color: var(--ok); }
.pill.bad { color: var(--bad); border-color: var(--bad); }

.flash { padding: .6rem .9rem; border-radius: 8px; margin: .5rem 0 1rem; }
.flash.ok { background: #e8f5ee; color: var(--ok); }
.flash.bad { background: #fdecea; color: var(--bad); }
.pagehead { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.pagehead form { margin: 0; }
.small { font-size: .82rem; }
.r { text-align: right; white-space: nowrap; }
input.num { width: 6.5rem; }
textarea { font: inherit; padding: .4rem .5rem; border: 1px solid var(--line); border-radius: 6px; }
kbd, code { background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: .05rem .35rem; font-size: .88em; }

/* Hilltrace */
:root { --navy: #14213d; --navy-2: #22335a; --accent: #8a1c2b; --gold: #b8892b; }
.rail .brand { letter-spacing: .02em; }
.rail .soon { color: #6f82a6; padding: .35rem .6rem; font-size: .9rem; cursor: default; }
.rail .switch { display: flex; gap: .3rem; padding: 0 .4rem .5rem; }
.rail .switch select { font-size: .8rem; max-width: 150px; }
.hero { padding: 2rem 0 1rem; max-width: 760px; }
.hero h1 { font-size: 2.2rem; }
.lede { font-size: 1.1rem; color: var(--muted); }
.auth { max-width: 460px; margin: 2rem 0; }
.auth.wide { max-width: 620px; }
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin: .5rem 0 1rem; flex-wrap: wrap; }
.tabs a { padding: .45rem .8rem; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs a.active { color: var(--ink); border-bottom-color: var(--accent); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.recovery-code { display: inline-block; margin: .15rem 0; font-size: 1rem; }

/* The Identity pages keep the template's class names; these make them match the rest of the app. */
.row { display: block; }
.form-floating { display: flex; flex-direction: column-reverse; gap: .25rem; margin: 0 0 .75rem; max-width: 460px; }
.form-floating label { font-size: .9rem; }
.form-control { width: 100%; }
.btn-primary { background: var(--accent); color: #fff; }
.w-100 { width: auto; }
.mb-3 { margin-bottom: .75rem; }
.alert { padding: .6rem .9rem; border-radius: 8px; margin: .5rem 0 1rem; background: #eef2f8; }
.alert-danger { background: #fdecea; color: var(--bad); }
.alert-success { background: #e8f5ee; color: var(--ok); }
.alert-warning { background: #fff4d6; color: #8a5a00; }
.text-danger { color: var(--bad); font-size: .85rem; }
.next-step { display: flex; gap: 1rem; align-items: center; background: #eaf1fc; border: 1px solid #c9daf5; border-radius: 8px; padding: .5rem .9rem; margin: 0 0 1rem; font-size: .9rem; }
.next-step .btn { margin-left: auto; padding: .3rem .8rem; }

.tracker { list-style: none; padding: 0; display: flex; flex-direction: column; gap: .5rem; max-width: 760px; }
.tracker li { display: flex; gap: .9rem; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: .75rem 1rem; }
.tracker li > div { flex: 1; }
.tracker .dot { width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; background: var(--bg); border: 1px solid var(--line); font-weight: 700; flex-shrink: 0; }
.tracker li.done .dot { background: var(--ok); color: #fff; border-color: var(--ok); }
.tracker li.current { border-color: var(--accent); box-shadow: 0 0 0 2px #c9daf5; }
.tracker li.current .dot { background: var(--accent); color: #fff; border-color: var(--accent); }
.tracker li.later { opacity: .6; }
.flash a { word-break: break-all; }

/* Members and committees */
.portrait { display: inline-block; object-fit: cover; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); }
.portrait.sm { width: 34px; height: 42px; }
.portrait.lg { width: 150px; height: 184px; }
.portrait.initials { display: inline-grid; place-items: center; color: var(--muted); font-weight: 700; font-size: .8rem; }
.portrait.lg.initials { font-size: 2.2rem; }
.photo-cell { width: 44px; padding-top: .3rem; padding-bottom: .3rem; }
.party { display: inline-grid; place-items: center; min-width: 1.4rem; height: 1.4rem; border-radius: 4px; font-size: .75rem; font-weight: 700; color: #fff; background: #6b7280; margin-right: .2rem; }
.party.D { background: #1d4ed8; }
.party.R { background: #b91c1c; }
.party.I { background: #6d28d9; }
.profile-head { display: flex; gap: 1.25rem; align-items: flex-start; margin: .25rem 0 .5rem; flex-wrap: wrap; }
.profile-head h1 { margin-bottom: .25rem; }
.profile-head .lede { margin: .2rem 0; color: var(--ink); }
.cards.two { grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr)); }
.seats { list-style: none; padding: 0; margin: .25rem 0; display: flex; flex-direction: column; gap: .35rem; }
.seats li.sub { padding-left: 1.1rem; }
ol.seats { list-style: decimal; padding-left: 1.4rem; }
.plain { list-style: none; padding: 0; margin: .25rem 0; display: flex; flex-direction: column; gap: .3rem; }
.chip { display: inline-block; border: 1px solid var(--line); border-radius: 999px; padding: .15rem .65rem; margin: 0 .35rem .35rem 0; text-decoration: none; font-size: .88rem; background: var(--card); }
.sources a { word-break: break-all; }
.search-hero input { min-width: 320px; }
.desk-head { display: flex; align-items: baseline; justify-content: space-between; gap: .25rem 1rem; flex-wrap: wrap; }
.desk-shortcuts { margin: .25rem 0 1rem; }
.desk { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: 1rem; align-items: start; }
.desk-panel { margin-bottom: 0; min-width: 0; }
.desk-panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; margin-bottom: .35rem; }
.desk-panel-head h2 { margin: 0; }
.desk-panel-head > a { font-size: .9rem; white-space: nowrap; }
.desk-list li { padding: .4rem 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.desk-list li:last-child { border-bottom: 0; }
.desk-list .chip { margin: 0 .25rem; padding: 0 .5rem; font-size: .8rem; }
.desk-steps { padding-left: 1.3rem; margin: .5rem 0 1rem; }
.desk-clamp { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.desk-clamp.one { -webkit-line-clamp: 1; line-clamp: 1; }
.desk + .statnotice { margin-top: 1rem; }
.seats li { display: flex; flex-wrap: wrap; gap: .15rem .45rem; align-items: baseline; }
ol.seats li { display: list-item; }
ol.seats li > * { margin-left: .3rem; }
.nowrap { white-space: nowrap; }
.pager { display: flex; gap: 1rem; align-items: center; margin: .5rem 0 1rem; }
.summary p { margin: .4rem 0; line-height: 1.5; }
.party.D, .party.R, .party.I { color: #fff; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .75rem; margin: 0 0 1rem; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: .7rem .9rem; display: flex; flex-direction: column; gap: .15rem; }
.kpi span { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.kpi strong { font-size: 1.5rem; }
.kpi small { color: var(--muted); font-size: .8rem; }

/* Newsroom tools */
.badge { display: inline-block; min-width: 1.2rem; padding: 0 .35rem; border-radius: 999px; background: var(--gold); color: #14213d; font-size: .72rem; font-weight: 700; text-align: center; margin-left: .3rem; }
.watch { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .5rem 0; }
.form.compact { margin: 0; gap: .4rem; }
details.inline { display: inline-block; margin: 0; }
.notes .note { border-left: 3px solid var(--line); padding: .3rem .75rem; margin: .5rem 0; }
.notes .note-body { white-space: pre-wrap; }
.note-head { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.inline-form { display: inline; margin: 0; }
.alerts li { padding: .35rem 0; border-bottom: 1px solid var(--line); }
.alerts li.unread { font-weight: 600; }
.alerts li.unread::before { content: "● "; color: var(--accent); }

/* Staff "view as" switcher and the banner shown while previewing a newsroom view */
.rail .viewas { display: flex; flex-direction: column; gap: .2rem; margin: 0 0 .4rem; padding-bottom: .5rem; border-bottom: 1px solid var(--navy-2); }
.rail .viewas .rail-group { padding-top: .2rem; }
.rail .viewas button { background: none; border: 1px solid transparent; color: #cfd8e8; text-align: left; padding: .35rem .6rem; border-radius: 6px; font: inherit; font-size: .85rem; cursor: pointer; }
.rail .viewas button:hover { background: var(--navy-2); color: #fff; }
.rail .viewas button.on { background: var(--navy-2); border-color: #8fa3c4; color: #fff; font-weight: 600; }
.preview-banner { background: #fff4d6; border: 1px solid #e8c766; color: #5a4300; padding: .55rem .8rem; border-radius: 6px; margin-bottom: 1rem; font-size: .9rem; }

/* Member background facts and ethics records */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0 0 .8rem; }
.facts dt { font-weight: 600; color: var(--muted, #556); }
.facts dd { margin: 0; }
@media (max-width: 640px) { .facts { grid-template-columns: 1fr; } .facts dd { margin-bottom: .4rem; } }
.ethics { border-top: 1px solid #e3e7ee; padding-top: .7rem; margin-top: .7rem; }
.ethics h3 { margin: 0 0 .2rem; font-size: 1rem; }
.ethics p { margin: .25rem 0; }

/* Campaign finance: the campaign-vs-personal money reminder, and the selected cycle */
.notice { background: #eef4ff; border: 1px solid #c9d8f5; color: #1d3561; padding: .55rem .8rem; border-radius: 6px; font-size: .9rem; }
tr.on td { background: #f3f6fb; font-weight: 600; }

/* API keys and docs */
.keyreveal { border-color: #e8c766; background: #fffbea; }
.keyreveal code.key { display: block; word-break: break-all; font-size: .9rem; padding: .5rem; background: #fff; border: 1px solid #e3e7ee; border-radius: 4px; }
pre.code { background: #0f1b2d; color: #e6edf7; padding: .7rem .9rem; border-radius: 6px; overflow-x: auto; font-size: .85rem; }

/* Research assistant */
.assistant { display: grid; grid-template-columns: 220px 1fr; gap: 1.2rem; align-items: start; }
@media (max-width: 800px) { .assistant { grid-template-columns: 1fr; } }
.assistant .history li { padding: .25rem 0; }
.assistant .history li.on a { font-weight: 700; }
.turn { margin-bottom: 1rem; }
.turn.q { color: #334; }
.turn.a .answer { background: #fff; border: 1px solid #e3e7ee; border-radius: 8px; padding: .8rem 1rem; }
.turn.a .answer p { margin: 0 0 .6rem; } .turn.a .answer p:last-child { margin-bottom: 0; }
.turn.a sup a { text-decoration: none; font-weight: 700; padding: 0 .1rem; }
.citations { margin: .4rem 0 0 1.2rem; }
.citations li:target { background: #fff4d6; }
form.ask textarea { width: 100%; font: inherit; padding: .6rem; border: 1px solid #c9d2e0; border-radius: 6px; }
form.ask .actions { display: flex; gap: 1rem; align-items: center; margin-top: .4rem; }

/* Financial disclosures */
.statnotice { background: #f6f3ff; border: 1px solid #d9cff5; color: #3b2f63; padding: .5rem .75rem; border-radius: 6px; }
td.buy { color: #156c3a; font-weight: 600; } td.sell { color: #9b2c2c; font-weight: 600; }
a.ticker { font-weight: 700; margin-right: .3rem; text-decoration: none; }
.pill.warn { background: #fff0e0; color: #8a4b00; border-color: #f1c58f; }

/* Newsroom branding and trials */
.tenant-logo { display: block; margin: .25rem 0 .75rem; }
.tenant-logo img { display: block; max-width: 100%; max-height: 56px; object-fit: contain; }
.tenant-logo-preview { max-width: 240px; max-height: 80px; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; padding: .25rem; background: #fff; }
.trial-banner { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: .4rem .7rem; margin-bottom: .75rem; font-size: .9rem; }
.spark { display: flex; align-items: flex-end; gap: 2px; height: 44px; margin: .5rem 0 1rem; }
.spark span { flex: 1; background: var(--accent, #8a1c2b); opacity: .75; border-radius: 1px; min-width: 3px; }

.profile-contact { display: flex; flex-wrap: wrap; gap: .35rem 1.1rem; margin: .35rem 0 .6rem; font-weight: 600; }
.profile-contact a { text-decoration: none; }
.profile-contact a:hover { text-decoration: underline; }

/* Folding profile sections (Components/Shared/Fold.razor). */
details.fold { padding: 0; margin-bottom: .6rem; }
details.fold > summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .75rem; padding: .85rem 1.25rem .85rem 2.4rem; position: relative; border-radius: 10px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: ""; position: absolute; left: 1.1rem; top: 1.2rem; width: .45rem; height: .45rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s ease; opacity: .6; }
details.fold[open] > summary::before { transform: rotate(45deg); }
details.fold > summary:hover { background: rgba(0, 0, 0, .025); }
details.fold > summary:focus-visible { outline: 2px solid var(--accent, #1d4ed8); outline-offset: -2px; }
details.fold > summary h2 { margin: 0; font-size: 1.1rem; }
details.fold > summary .fold-hint { color: var(--muted, #6b7280); font-size: .9rem; }
details.fold[open] > summary .fold-hint { display: none; }
details.fold > .fold-body { padding: 0 1.25rem 1rem; }
@media print { details.fold > summary::before { display: none; } }

.api-endpoints td:first-child { width: 45%; }
.api-endpoints code { word-break: break-word; }
.api-query { margin-top: .2rem; color: var(--muted); }
.stripe-make { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--line); }

/* Phones and small tablets: the side menu becomes a bar with a Menu button (app.js), the page uses the full width,
   and wide tables scroll sideways inside their box instead of widening the page. Without scripts the menu
   simply sits above the page. */
.topbar { display: none; }
@media (max-width: 860px) {
    .shell { flex-direction: column; }
    .topbar { display: flex; align-items: center; gap: .75rem; position: sticky; top: 0; z-index: 20; background: var(--navy); color: #fff; padding: .5rem 1rem; }
    .topbar .brand { color: #fff; font-weight: 700; font-size: 1.1rem; text-decoration: none; letter-spacing: .02em; }
    .topbar-alerts { margin-left: auto; color: #cfd8e8; text-decoration: none; padding: .45rem .2rem; }
    .menu-btn { display: inline-flex; align-items: center; gap: .45rem; min-height: 40px; padding: .35rem .7rem; background: var(--navy-2); color: #fff; border: 1px solid #2c4470; border-radius: 6px; font: inherit; cursor: pointer; }
    .menu-icon, .menu-icon::before, .menu-icon::after { display: block; width: 16px; height: 2px; background: currentColor; border-radius: 1px; position: relative; }
    .menu-icon::before, .menu-icon::after { content: ""; position: absolute; left: 0; }
    .menu-icon::before { top: -5px; } .menu-icon::after { top: 5px; }
    .rail { width: auto; padding: .5rem 1rem 1rem; }
    .rail > .brand, .rail > .tenant-logo { display: none; }
    .rail a, .rail-foot .link { padding-top: .6rem; padding-bottom: .6rem; }
    .rail-foot { margin-top: .75rem; }
    html.js .rail { display: none; }
    html.js .shell.menu-open .rail { display: flex; position: sticky; top: 56px; max-height: calc(100vh - 56px); overflow-y: auto; z-index: 19; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
    .content { padding: 1rem; max-width: none; }
    h1 { font-size: 1.35rem; }
    .grid { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .search-hero input { min-width: 0; width: 100%; }
    .form.inline > * { flex: 1 1 140px; min-width: 0; }
    .form.inline input:not([type=checkbox]):not([type=radio]), .form.inline select { width: 100%; min-width: 0; }
    input, select, textarea { max-width: 100%; }
    input, select, textarea { font-size: 16px; } /* below 16px iPhones zoom the page on focus */
    .pager { flex-wrap: wrap; }
}
@media print { .topbar { display: none; } }
