internal · v1.0

Med Topo Style Guide

Every shared component rendered in one place. If a module page looks off, diff it against this page. Changes to public/styles/medtopo.css?v=17 or public/scripts/medtopo.js?v=17 should be visually verified here first.

01 · tokens

Color tokens

CSS custom properties defined in :root. Reach for these — never hard-code hex.

Surface & text

--bg#f4efe3
--bg-dim#ece5d4
--surface#f9f4e7
--surface-elev#fff
--surface2#f4ecd8
--surface3#ebe2cc
--border#d9ceb5
--text#2d2821
--text-muted#6e5838

Accents

--sienna#8a4b2a
--gold#b08a3e
--gold-soft#c9a75a
--moss#5a6b3e
--slate#4a5662
--plum#6a3d52
--teal#5d7578
--teal-soft#7a9598
--rose#a25a3a
--emerald#7a8560
--emerald-soft#9aa582
--violet#8a6f7e
--aqua#4a7a85
--aqua-soft#6a9ba6

Shadows

--shadow-sm
--shadow-md
--shadow-lg
02 · typography
section head eyebrow

Typography & headings

h3 with accent dot

Body copy (body, 15.5px, line-height 1.58). Use .mono for numbers: pNa 118 mEq/L. Inline keyboard keys like ⌘K use .kbd.

h4 section heading

h4 is the smallest auto-styled header; use it for sub-blocks inside a card or grid cell.

<h3><span class="dot"></span> Title</h3> <h4>Sub-block title</h4> <span class="mono">118 mEq/L</span> <span class="kbd">⌘K</span>
03 · buttons

Stage tabs

The stage-tab bar is the universal top nav inside a module page.

<nav class="journey-nav"> <button class="journey-btn active" data-stage="foundations">Foundations</button> <button class="journey-btn" data-stage="framework">Framework</button> </nav>
04 · cards

Cards & grids

.card (default)

Standard card

Used everywhere. Use .card-elevated to bump shadow depth.

.grid-2

Left

Equal-width 2-col.

Right

.card-elevated shadow.

.grid-3

ICV
ISF
IVF

.grid-4

A
B
C
D
<div class="grid-2"> <div class="card">…</div> <div class="card card-elevated">…</div> </div>
05 · callouts

Callouts

Left-rule emphasis blocks. Default uses --accent; colored modifiers override.

Default. Uses --accent (aqua on most pages).
.rose. For warnings / harms / "don't do this".
.gold. For pearls / mnemonics / "remember this".
.emerald. For reassurance / normal-range anchors.
.teal. Neutral highlight.
.plum. For physiology / mechanism explanations.
<div class="callout rose"><strong>Warning.</strong> …</div>
06 · tables

Data tables

FluidTonicityNa (mEq/L)ICV ΔECV Δ
0.9% NaClIsotonic1540+1000
D5WHypotonic0+667+333
3% NaClHypertonic513−800+1800
LRBalanced130+50+950
<table class="data-table"> … <td class="num">154</td> … </table>
07 · pills

Fluid-family pills

Used on fluid cards and in tables to label tonicity / family.

Isotonic Hypotonic Hypertonic Colloid Balanced
<span class="pill pill-iso">Isotonic</span>
08 · live demo

Stage switcher — wired by medtopo.js

The buttons below are hooked up via the exact convention every module uses: .journey-btn[data-stage="X"] toggles section.stage[id="stage-X"]. Click through to confirm medtopo.js is active. Press 13 to test keyboard shortcuts.

stage 1

Alpha

Stage α content. If you see this, medtopo.js rendered the default active stage correctly.

stage 2

Beta

Stage β content — only visible when Beta is active.

stage 3

Gamma

Stage γ content — the url hash should update on switch.

09 · utilities

Utilities

.mt-10 / .mt-14 / .mt-20 — margin-top spacers.

.text-aqua · .text-teal · .text-rose · .text-gold · .text-emerald · .text-muted

.expand-hint — tiny italic caption under SVG diagrams

10 · contract

medtopo.js auto-wiring contract

Everything here is zero-config. Drop the markup in — medtopo.js finds and wires it.

MarkupBehavior
#globalSidebarCollapse toggle is injected top-right; state persists in localStorage per page.
.journey-btn[data-stage=X]Activates section.stage#stage-X; deactivates siblings.
.gs-sub-link[data-sub=X]Same as above but from the sidebar; marks itself .active.
body[data-keys="1-6,/"]Numeric keys switch stages in order; / focuses search (if #search exists).
[data-spy-container] / [data-spy-link] / [data-spy-target]Scroll-spy: links auto-highlight based on target visibility.