/* The tokens, header, account menu and .btn every page shares: the SPA, the analyses pages and sign-in. */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&display=swap');
:root {
  color-scheme: light dark;
  --bg: light-dark(#ffffff, #0f1318); --card: light-dark(#ffffff, #171a20);
  --ink: light-dark(#12161c, #e8ecf1); --mut: light-dark(#4b5563, #a3adb9);
  --line: light-dark(#e3e7ec, #2a313a); --band: light-dark(#f6f8fb, #151a21);
  --acc: light-dark(#1d4ed8, #6b9bff); --acc-ink: light-dark(#ffffff, #0b1020);
  --acc-soft: light-dark(#e8eefc, #1b2740);
  --ok: light-dark(#166534, #4ade80); --ok-soft: light-dark(#dcfce7, #14301f);
  --warn: light-dark(#9a3412, #fb923c); --warn-soft: light-dark(#fef3c7, #3a2a12);
  --bad: light-dark(#b91c1c, #f87171); --bad-soft: light-dark(#fee2e2, #3a1616);
  --heat1: light-dark(#dbe5fb, #1b2740); --heat2: light-dark(#a9c0f5, #27407a);
  --heat3: light-dark(#5f86ea, #3f67c4); --heat4: light-dark(#1d4ed8, #6b9bff);
  --h-track: light-dark(#e5e7eb, #2b3038);
  --h-c1: light-dark(#3b82f6, #60a5fa); --h-c2: light-dark(#10b981, #34d399);
  --h-c3: light-dark(#f59e0b, #fbbf24); --h-c4: light-dark(#8b5cf6, #a78bfa);
  --h-c5: light-dark(#f43f5e, #fb7185); --h-c6: light-dark(#06b6d4, #22d3ee);
  --font: 'IBM Plex Sans', system-ui, sans-serif;
}
:root[data-theme='light'] { color-scheme: light; }
:root[data-theme='dark'] { color-scheme: dark; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--font); }
h1 { margin: 0; font-size: 24px; font-weight: 600; text-wrap: balance; }
.page { width: 100%; max-width: 1280px; margin: 0 auto; padding: 24px; box-sizing: border-box; }
/* A select.btn keeps its width in a row of buttons. */
input, select:not(.btn), textarea { border: 1px solid var(--line); font: 16px/1.55 var(--font); box-sizing: border-box;
  background: var(--bg); border-radius: 8px; color: var(--ink); padding: 0 12px; height: 40px; width: 100%; }
textarea { height: auto; min-height: 40px; padding: 10px 12px; }
input[type=file] { padding-top: 7px; }
@media (max-width: 640px) { .page { padding: 16px; } }
header { position: relative; display: grid; grid-template-columns: auto auto 1fr auto; align-items: center;
  gap: 0 16px; padding: 8px 16px; border-bottom: 1px solid var(--line); }
/* Tailwind preflight gives the SPA border-box; the Django pages have no reset. */
header *, .btn { box-sizing: border-box; }
header .brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 18px; }
/* Both marks get an explicit box and the partner no max-width: the SPA's preflight shrank it 7px. */
header .brand img { height: 28px; width: 28px; display: block; }
header .partner { height: 20px; width: 91px; max-width: none; margin-left: -7px; padding-left: 20px;
  border-left: 1px solid var(--line); }
header .nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0 18px; font-size: 14px; min-width: 0; }
header .nav a[aria-current='page'] { color: var(--acc); font-weight: 600; box-shadow: inset 0 -2px 0 var(--acc); }
/* The 40vw cap keeps a long "Work as" pick from widening the header past a 375px screen. */
header .me { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center;
  gap: 4px 16px; font-size: 14px; }
header .me select { width: auto; max-width: 40vw; }
header a { min-height: 44px; display: inline-flex; align-items: center; color: var(--ink); text-decoration: none; }
@media (max-width: 1100px) {
  header { grid-template-columns: auto 1fr auto; grid-template-areas: 'brand partner me' 'nav nav nav'; }
  header .brand { grid-area: brand; }
  header .partner { grid-area: partner; justify-self: start; }
  header .me { grid-area: me; justify-self: end; }
  header .nav { grid-area: nav; }
  header .nav a { white-space: nowrap; }
}

details > summary { display: flex; align-items: center; min-height: 36px; cursor: pointer; list-style: none; }
/* Without a caret a summary reads as plain text. */
details > summary::before { content: '\25B8'; margin-right: 8px; font-size: 12px; color: var(--mut); }
details[open] > summary::before { content: '\25BE'; }

.account { position: relative; }
.account > summary { padding: 8px 0; }
.account[open] { position: absolute; top: 100%; right: 16px; z-index: 3; padding: 10px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.account form { display: block; padding: 6px 0; }

:is(a, button, input, textarea):focus-visible { outline: 3px solid var(--acc); outline-offset: 2px; }
.btn { min-height: 48px; padding: 0 22px; border-radius: 8px; font: 600 15px/1.2 var(--font); cursor: pointer; border: 1px solid var(--line); background: var(--bg); color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; }
.btn.sm { min-height: 40px; padding: 0 12px; font-size: 14px; }
.btn.pri { background: var(--acc); border-color: var(--acc); color: var(--acc-ink); }
.btn.muted { background: transparent; color: var(--mut); }
/* One link color on SPA and Django pages. Layered, so a Tailwind color on a link still wins. */
@layer base { .page a:not(.btn) { color: var(--acc); text-decoration: none; }
  .page a:not(.btn):hover { text-decoration: underline; } }
