:root {
  --bg: #0e1726;
  --bg-soft: #16233a;
  --card: #ffffff;
  --ink: #1a2231;
  --muted: #5b6b82;
  --line: #e3e8f0;
  --brand: #0b7285;
  --brand-2: #1098ad;
  --accent: #1a56db;
  --ok: #148f5b;
  --warn: #b45309;
  --err: #b91c1c;
  --radius: 12px;
  --shadow: 0 6px 24px rgba(15, 30, 60, .08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: #f5f7fb;
  line-height: 1.55;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- top bar ---- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px;
  background: linear-gradient(90deg, var(--bg) 0%, var(--bg-soft) 100%);
  color: #fff;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand:hover { text-decoration: none; }
.brand-logo {
  /* UCLA Health logo is multicolor (blue box + black text); show it on a small
     white chip so it reads cleanly on the dark top bar. */
  height: 30px; width: auto; display: block;
  background: #fff; padding: 5px 9px; border-radius: 6px;
}
.brand-text {
  display: flex; flex-direction: column; line-height: 1.1;
  padding-left: 14px; border-left: 1px solid rgba(255,255,255,.22);
}
.brand-mark { font-size: 1.25rem; font-weight: 800; letter-spacing: .5px; color: #fff; }
.brand-sub { font-size: .72rem; color: #a9bad4; }

@media (max-width: 560px) {
  .brand-logo { height: 24px; }
  .brand-text { display: none; }
}
.nav { display: flex; align-items: center; gap: 18px; }
.nav a { color: #dce6f5; font-size: .95rem; }
.nav a:hover { color: #fff; text-decoration: none; }
.nav-user { color: #90a4c4; font-size: .85rem; }

.btn {
  display: inline-block; padding: 9px 18px; border-radius: 8px;
  font-size: .95rem; font-weight: 600; cursor: pointer; border: 0;
}
.btn-primary { background: var(--brand-2); color: #fff; }
.btn-primary:hover { background: var(--brand); text-decoration: none; }
.btn-ghost { background: rgba(255,255,255,.1); color: #fff; }
.btn-lg { padding: 13px 26px; font-size: 1.05rem; }
.btn[disabled] { opacity: .6; cursor: not-allowed; }

/* ---- layout ---- */
.container { max-width: 1000px; margin: 0 auto; padding: 32px 20px 60px; }
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 26px; margin-bottom: 24px;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 760px) { .grid-2 { grid-template-columns: 1fr; } }

h1 { font-size: 1.9rem; margin: 0 0 10px; }
h2 { font-size: 1.3rem; margin: 0 0 12px; }
h3 { font-size: 1.05rem; margin: 18px 0 8px; }
.lead { font-size: 1.08rem; color: #33445e; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* ---- hero ---- */
.hero {
  background: linear-gradient(120deg, #0b7285 0%, #1098ad 60%, #22b8cf 100%);
  color: #fff; border-radius: var(--radius); padding: 40px 34px; margin-bottom: 26px;
}
.hero h1 { color: #fff; font-size: 2.2rem; }
.hero p { color: #e6fbff; max-width: 640px; }
.hero .btn-primary { background: #fff; color: var(--brand); margin-top: 14px; }

.demo-frame { text-align: center; }
.demo-frame video, .demo-frame img { max-width: 100%; border-radius: 10px; border: 1px solid var(--line); }

.pill { display:inline-block; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.pill-ok { background: #e6f6ee; color: var(--ok); }
.pill-warn { background: #fdf0dd; color: var(--warn); }
.pill-err { background: #fbe5e5; color: var(--err); }
.pill-proc { background: #e7edfb; color: var(--accent); }

/* ---- forms ---- */
label { display:block; font-weight:600; margin: 14px 0 5px; }
input, select {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line);
  border-radius: 8px; font-size: 1rem; background: #fff;
}
.form-narrow { max-width: 420px; margin: 0 auto; }
.row { display: flex; gap: 16px; }
.row > div { flex: 1; }
.error-box { background: #fbe5e5; color: var(--err); padding: 10px 12px; border-radius: 8px; margin: 12px 0; }
.ok-box { background: #e6f6ee; color: var(--ok); padding: 10px 12px; border-radius: 8px; margin: 12px 0; }

/* ---- tables ---- */
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; }
th { color: var(--muted); font-weight: 600; }

.analysis-list { list-style: none; padding: 0; margin: 0; }
.analysis-item {
  display:flex; align-items:center; justify-content: space-between;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 12px;
}
.dropzone {
  border: 2px dashed #b9c6dd; border-radius: 12px; padding: 34px; text-align: center;
  color: var(--muted); cursor: pointer; background: #fbfcfe;
}
.dropzone.drag { border-color: var(--brand-2); background: #eefbfd; }
.spinner {
  width: 34px; height: 34px; border: 4px solid #d9e2f1; border-top-color: var(--brand-2);
  border-radius: 50%; animation: spin 1s linear infinite; margin: 20px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- biomarker results ---- */
.biomarker-table { margin: 6px 0 20px; }
.biomarker-table td, .biomarker-table th { vertical-align: top; }
.biomarker-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.biomarker-table td .small { margin-top: 2px; }

.pheno {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: .72rem; font-weight: 700; letter-spacing: .2px; white-space: nowrap;
}
.pheno-slowness     { background: #e7edfb; color: #1a56db; }
.pheno-weakness     { background: #fde7e7; color: #b91c1c; }
.pheno-rigidity     { background: #eae7fb; color: #6d28d9; }
.pheno-exhaustion   { background: #fdf0dd; color: #b45309; }
.pheno-unsteadiness { background: #e6f6ee; color: #148f5b; }
.pheno-reference    { background: #eef1f5; color: #5b6b82; }

.dictionary {
  margin-top: 18px; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 16px; background: #fbfcfe;
}
.dictionary summary {
  cursor: pointer; font-weight: 600; color: var(--accent); padding: 4px 0;
}
.dictionary h4 { margin: 16px 0 6px; font-size: .95rem; }

.footer {
  display:flex; flex-direction: column; gap: 2px; align-items:center;
  padding: 24px; color: var(--muted); font-size: .82rem; border-top: 1px solid var(--line);
}
