:root {
  color-scheme: light;
  font: 400 16px/1.55 "Segoe UI", Arial, sans-serif;
  color: #162743;
  background: #f1f5fa;
  --navy: #101d35;
  --blue: #165a94;
  --muted: #51627a;
  --line: #d7e1ee;
  --orange: #ffad65;
}
* { box-sizing: border-box; }
body { margin: 0; }
.shell { width: min(1180px, calc(100% - 2rem)); margin-inline: auto; }
.top { background: var(--navy); color: #fff; border-bottom: 3px solid #f29c56; }
.bar, .top-links, .brand, .footer { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.bar, .footer { justify-content: space-between; padding-block: .75rem; }
.brand { gap: .65rem; font-weight: 700; }
.brand b { color: var(--orange); }
.brand small { color: #b8c9df; }
.top a { color: inherit; text-decoration: none; }
.top-links { font-size: .875rem; }
a { color: var(--blue); text-underline-offset: .2em; }
a:hover { text-decoration: underline; }
main { padding-block: clamp(1rem, 4vw, 3rem); min-height: 75vh; }
.footer { color: var(--muted); border-top: 1px solid var(--line); font-size: .85rem; }
h2, h3, p { margin: 0 0 .85rem; overflow-wrap: anywhere; }
h2 { font-size: clamp(1.45rem, 3vw, 2rem); line-height: 1.2; }
small { display: block; }
.muted, .hint, .loading { color: var(--muted); }
.hint { font-size: .875rem; }
.eyebrow { color: var(--blue); font-weight: 700; letter-spacing: .12em; font-size: .72rem; margin-bottom: .65rem; }
.auth-screen, .dashboard { display: grid; align-items: start; gap: 1.25rem; }
.auth-screen { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: stretch; gap: 0; border-radius: 20px; overflow: hidden; box-shadow: 0 15px 48px #18334a19; }
.auth-cover { padding: clamp(1.5rem, 5vw, 4rem); display: grid; align-content: end; min-height: 460px; color: #fff; background: linear-gradient(0deg,#101d35 6%,#101d35d9 49%,#101d353b),url('investors-background.jpg') 93% center / auto 100% no-repeat #101d35; }
.auth-cover h2 { font-size: clamp(2rem, 5vw, 3.8rem); font-weight: 700; letter-spacing: -.035em; }
.auth-cover .eyebrow { color: var(--orange); }
.auth-cover .badge { justify-self: start; }
.auth-form { padding: clamp(1.5rem, 5vw, 3.25rem); background: white; align-self: stretch; }
.auth-form > .muted { margin-bottom: 1.5rem; }
.auth-switch { margin: 1rem 0 0; text-align: center; font-size: .875rem; }
.password { display: flex; align-items: stretch; margin-bottom: .6rem; }
.password input { border-radius: 8px 0 0 8px; }
.password button { border: 1px solid var(--line); border-left: 0; border-radius: 0 8px 8px 0; }
.dashboard { grid-template-columns: 220px minmax(0, 1fr); }
.sidebar, .panel { min-width: 0; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.sidebar { padding: .7rem; }
.sidebar nav { display: grid; gap: .35rem; padding-bottom: .7rem; }
.sidebar nav button { text-align: left; color: var(--muted); background: transparent; }
.sidebar nav button:hover, .sidebar nav [aria-current] { background: #e8f3ff; color: #124d7c; }
.account { padding: .6rem; }
.account small { color: var(--muted); overflow-wrap: anywhere; margin-bottom: .75rem; }
.account button { width: 100%; }
.panel { padding: clamp(1rem, 3vw, 1.8rem); margin-bottom: 1rem; }
.overview-panel { border-top: 3px solid #287fb2; }
.metrics, .grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,155px),1fr)); gap: .75rem; }
.metrics { margin-block: 1.25rem; }
.metrics > div { min-width: 0; padding: .85rem; border-radius: 10px; background: #f0f6fe; }
.metrics small { color: var(--muted); }
.metrics strong { display: block; font-size: 1.3rem; overflow-wrap: anywhere; }
.rows { list-style: none; padding: 0; margin: 0; }
.rows li { display: flex; align-items: center; justify-content: space-between; gap: .6rem 1rem; flex-wrap: wrap; padding: .8rem 0; border-top: 1px solid var(--line); }
.rows li div { min-width: 0; overflow-wrap: anywhere; }
.rows small { color: var(--muted); }
.badge { display: inline-block; max-width: 100%; border-radius: 8px; padding: .25rem .65rem; background: #eaf0f7; color: #344963; font-size: .8rem; font-weight: 700; }
.badge.positive { background: #e3f6ed; color: #145c40; }
label { display: grid; gap: .35rem; font-weight: 500; margin-bottom: .8rem; }
label[for="auth-password"] { margin-bottom: .35rem; }
input, select, button { font: inherit; border-radius: 8px; }
input, select { font-weight: 400; min-width: 0; width: 100%; border: 1px solid #bac9db; background: #f9fbfe; padding: .65rem .75rem; color: inherit; }
input[readonly] { background: #edf2f8; color: var(--muted); }
input[type="checkbox"] { width: auto; }
.check { display: flex; align-items: center; gap: .6rem; }
button { padding: .62rem 1rem; border: 1px solid transparent; color: #174d78; background: #eaf3fe; font-weight: 600; cursor: pointer; }
button[type="submit"], .primary { background: #145988; color: white; }
button.secondary { background: white; color: #174d78; border-color: var(--line); }
button.link-button { background: transparent; padding: .25rem; text-decoration: underline; }
button.full { width: 100%; }
button:hover { filter: brightness(.94); }
button:disabled { opacity: .65; cursor: wait; }
:focus-visible { outline: 2px solid #2376b0; outline-offset: 3px; }
fieldset { margin: 0 0 .85rem; border: 1px solid var(--line); border-radius: 8px; min-width: 0; }
legend { padding: 0 .35rem; color: var(--blue); font-weight: 700; }
#message { margin-bottom: .85rem; border-radius: 8px; background: #e3f6ed; color: #145c40; padding: .7rem 1rem; }
#message:empty { display: none; }
#message.error { background: #fff1ed; color: #922e18; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 760px) {
  .auth-screen, .dashboard { grid-template-columns: 1fr; }
  .auth-cover { min-height: 260px; background-position: 92% center; }
  .sidebar nav { display: flex; flex-wrap: wrap; }
  .sidebar nav button { flex: 1 0 auto; text-align: center; }
  .account button { width: auto; }
}
@media (max-width: 390px) {
  .sidebar nav button { padding-inline: .55rem; }
  .top-links { gap: .75rem; }
}

.admin-team{padding:18px 0;border-top:1px solid var(--line)}.member-detail{font-size:.875rem;overflow-wrap:anywhere}.delete-team{margin-top:12px;padding:12px;background:#fff1ed;border-radius:8px}button.danger{background:#922e18}.dashboard-body{min-width:0}

textarea{font:inherit;font-weight:400;color:inherit;resize:vertical;min-height:84px;min-width:0;width:100%;max-width:100%;border:1px solid #bac9db;border-radius:8px;padding:.6rem;background:#f9fbfe}
label{min-width:0;overflow-wrap:anywhere}
details{min-width:0;margin-bottom:1rem;padding:.8rem;border:1px solid var(--line);border-radius:8px}
summary{cursor:pointer;font-weight:600;margin-bottom:.75rem}
.admin-team button{margin-bottom:.4rem}

body.is-admin .shell{width:min(1580px,calc(100% - 32px))}
.is-admin .dashboard{grid-template-columns:214px minmax(0,1fr)}
.list-heading,.dashboard-heading{display:flex;align-items:center;justify-content:space-between;gap:1rem;flex-wrap:wrap;margin-bottom:1rem}
.list-heading h2,.dashboard-heading h2{margin-bottom:0}
.list-toolbar{display:grid;grid-template-columns:minmax(180px,2fr) minmax(140px,1fr) minmax(130px,.75fr) 90px;gap:.7rem}
.list-toolbar label{font-size:.83rem}
.list-count{font-size:.85rem;margin:.3rem 0 .75rem}
.table-scroll{width:100%;overflow:auto;border:1px solid var(--line);border-radius:10px}
.table-scroll table{border-collapse:separate;border-spacing:0;width:100%;min-width:900px;text-align:left;font-size:.82rem}
.table-scroll th{background:#edf3fa;color:#36506e;font-weight:600}
.table-scroll th,.table-scroll td{padding:.7rem .8rem;border-bottom:1px solid #e6edf5;vertical-align:middle;white-space:nowrap}
.table-scroll tbody tr:last-child td{border-bottom:0}
.table-scroll tbody tr:nth-child(even){background:#f8fafd}
.table-scroll tbody tr:hover{background:#eaf4fe}
.table-scroll td{max-width:280px;overflow:hidden;text-overflow:ellipsis}
.table-scroll th:last-child,.table-scroll .row-actions{position:sticky;right:0;background:#f6f9fd;border-left:1px solid var(--line)}
.row-actions button{font-size:.76rem;padding:.35rem .55rem;margin:.1rem}
.danger-outline{color:#a22a25;background:#fff4f2;border-color:#edc4bd}
.pagination{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:.45rem;margin-top:1rem;font-size:.85rem}
.pagination button{padding:.4rem .65rem}
.pagination label{display:flex;align-items:center;gap:.4rem;margin:0}
.pagination input{width:72px;padding:.4rem}
.pagination [data-page]{margin-inline:.4rem}
.portal-dialog{color:#162743;background:#fff;border:1px solid var(--line);border-radius:16px;padding:20px;width:min(920px,calc(100% - 24px));max-height:calc(100dvh - 32px);overflow:auto;box-shadow:0 20px 80px #0004}
.portal-dialog::backdrop{background:#07152bb0}
.portal-dialog .panel{border:0;padding:0;margin:0}
.dialog-close{display:block;margin:0 0 16px auto}
.admin-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin:1.25rem 0}
.metric-card{background:#fff;border:1px solid var(--line);border-top:3px solid #2984b6;border-radius:12px;padding:18px;text-align:left;color:#162743;min-width:0}
.metric-card:nth-child(2){border-top-color:#24a18d}.metric-card:nth-child(3){border-top-color:#e59a3c}.metric-card:nth-child(4){border-top-color:#8873cf}
.metric-card>span,.metric-card small{display:block;font-size:.8rem;color:var(--muted)}
.metric-card strong{display:block;font-size:2rem;line-height:1.4}
.metric-card small{font-weight:400}
.dashboard-charts{display:grid;grid-template-columns:2fr 1fr;gap:14px}
.dashboard-distributions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.dashboard-charts .panel,.dashboard-distributions .panel{padding:20px}
.trend-columns{list-style:none;padding:0;display:grid;grid-template-columns:repeat(14,minmax(0,1fr));gap:6px;margin:20px 0 0}
.trend-columns li{text-align:center;min-width:0;font-size:.72rem}
.trend-columns li>div{height:140px;display:flex;align-items:flex-end;margin-block:5px}
.trend-bar{display:block;width:100%;background:linear-gradient(#42b5cf,#1d629b);border-radius:5px 5px 0 0}
.trend-columns small{font-size:.65rem;color:var(--muted)}
.completion-donut{width:150px;height:150px;border-radius:50%;margin:16px auto;background:conic-gradient(#218b9e var(--complete),#e7edf5 0);display:grid;place-items:center;position:relative}
.completion-donut::before{content:"";position:absolute;inset:18px;border-radius:50%;background:#fff}
.completion-donut strong{position:relative;font-size:1.8rem}
.distribution-bars{list-style:none;margin:0;padding:0}
.distribution-bars li{margin-bottom:14px}
.distribution-bars li>div:first-child{display:flex;justify-content:space-between;align-items:start;gap:10px;font-size:.8rem;margin-bottom:5px}
.distribution-bars span{overflow-wrap:anywhere}
.bar-track{height:7px;border-radius:4px;background:#e8eef7;overflow:hidden}
.bar-track>span{display:block;height:100%;background:#438db9;border-radius:4px}
@media(min-width:761px){.is-admin .sidebar{position:sticky;top:16px}}
@media(max-width:1100px){.admin-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.dashboard-distributions{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:900px){.list-toolbar{grid-template-columns:1fr 1fr}.dashboard-charts,.dashboard-distributions{grid-template-columns:1fr}}
@media(max-width:760px){.is-admin .dashboard{grid-template-columns:1fr}.admin-metrics{gap:8px}.metric-card{padding:12px}.table-scroll th:last-child,.table-scroll .row-actions{position:static}.records-panel{padding:12px}.pagination{justify-content:flex-start}.trend-columns{gap:3px}.trend-columns small{font-size:.55rem}.portal-dialog{padding:14px}}
@media(max-width:390px){.list-toolbar{grid-template-columns:1fr}.metric-card strong{font-size:1.6rem}.trend-columns small{writing-mode:vertical-rl;margin:auto}}

.registration-screen{max-width:1060px;margin-inline:auto}
.registration-screen .grid{grid-template-columns:repeat(3,minmax(0,1fr))}
.registration-screen fieldset{padding:16px}
.registration-notice{padding:12px;border-radius:8px;background:#edf4fc;color:#294f76}
.registration-screen .panel>button{margin-right:10px}
@media(max-width:760px){.registration-screen .grid{grid-template-columns:1fr}.registration-screen fieldset{padding:10px}}

/* Shared form rhythm and type hierarchy for contestant and BTC screens. */
h2, h3 { font-weight: 600; letter-spacing: -.015em; }
strong, b { font-weight: 600; }
.brand { font-weight: 700; }
.brand small { font-weight: 400; }
.eyebrow { font-weight: 600; }
label { align-content: start; font-size: .875rem; line-height: 1.5; }
label input, label select, label textarea { font-size: 1rem; }
input, select { min-height: 46px; }
input[type="checkbox"] { min-height: auto; flex: 0 0 auto; }
.check { font-weight: 400; align-items: start; font-size: .875rem; }
.check input { margin-top: .3em; }
legend { font-weight: 600; font-size: 1rem; }
.sidebar nav button { font-weight: 500; }
.sidebar nav [aria-current] { font-weight: 600; }
.password { display: flex; width: 100%; min-width: 0; margin-bottom: 0; }
.password input { flex: 1 1 0; width: 0; min-width: 0; }
.password button { flex: 0 0 auto; min-width: 64px; white-space: nowrap; padding-inline: .75rem; font-size: .875rem; font-weight: 500; }
h2[tabindex="-1"]:focus { outline: none; }
.registration-form > .muted { font-size: .925rem; margin-block: 1rem; }
.registration-form fieldset { padding: 20px; margin-block: 1.5rem; background: #fff; }
.registration-form .grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: .65rem 1.25rem; align-items: start; }
.registration-form .account-fields { background: #f8fafc; }
.registration-form .account-fields p { color: var(--muted); font-size: .875rem; }
.registration-form .account-fields .grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.account-fields .grid > label:first-child { grid-column: 1 / -1; }
.registration-form .check { margin-block: .4rem 0; }
.registration-notice { font-size: .875rem; }
@media(max-width:1000px) and (min-width:761px) { .registration-form .grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media(max-width:760px) {
  .registration-form .grid, .registration-form .account-fields .grid { grid-template-columns: 1fr; }
  .registration-form fieldset { padding: 14px; margin-block: 1.25rem; }
}

.auth-form > .password { margin-bottom: 1.25rem; }
.registration-heading { display: flex; align-items: center; justify-content: space-between; gap: .75rem 1.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.registration-heading h2 { margin: 0; }
.registration-login { font-size: .875rem; font-weight: 500; padding-block: .4rem; }
