/* ADS Tutorials Hub: website shell styles.
   Type: Source Serif 4 (display), IBM Plex Sans (text), IBM Plex Mono (labels, data), all self-hosted (OFL).
   Colour: Johns Hopkins Heritage Blue as the primary, a warm burnt orange for the lesion/accent, white neutrals in the style of large product sites (always light; no dark mode). */

@font-face { font-family: "Source Serif 4"; src: url("/fonts/source-serif-4-latin-opsz-normal.woff2") format("woff2"); font-weight: 200 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("/fonts/source-serif-4-latin-opsz-italic.woff2") format("woff2"); font-weight: 200 900; font-style: italic; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("/fonts/ibm-plex-sans-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("/fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("/fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600 700; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500 700; font-display: swap; }

:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f5f5f7;
  --ink: #1d1d1f;
  --ink-2: #424245;
  --ink-3: #6e6e73;
  --line: #e5e5ea;
  --line-strong: #d2d2d7;
  --brand: #002d72;          /* JHU Heritage Blue */
  --brand-2: #0066cc;
  --spirit: #68ace5;         /* JHU Spirit Blue */
  --accent: #c4501a;
  --accent-soft: #f7e3d4;
  --ok: #2c7a56;
  --ok-soft: #e0f0e6;
  --warn: #8f5a00;
  --warn-soft: #fbefd3;
  --err: #b42318;
  --err-soft: #fbe5e2;
  --path-beginning: #2c7a56;
  --path-advanced: #1d4f91;
  --path-replication: #6a4ab3;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 28px -12px rgba(0, 0, 0, .12);
  --header-h: 64px;
  --serif: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}


* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--ink); font: 400 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: clip;
       font-feature-settings: "kern", "liga"; text-rendering: optimizeLegibility; }
::selection { background: var(--accent-soft); color: var(--ink); }
a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--spirit); outline-offset: 2px; border-radius: 3px; }
code, pre { font-family: var(--mono); font-size: .86em; }
code { background: var(--surface-2); padding: .1em .35em; border-radius: 4px; }
pre { margin: 0; overflow: auto; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; letter-spacing: -.015em; margin: 0 0 .5em; font-optical-sizing: auto; }
h4 { font-family: var(--mono); font-weight: 500; font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-3); margin: 1.6em 0 .6em; }
h4 small { text-transform: none; letter-spacing: 0; font-weight: 400; font-family: var(--sans); }
h1 { font-size: 2.1rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.15rem; }
button, input, select { font: inherit; color: inherit; }
.hint { color: var(--ink-3); font-size: .85rem; margin: .3em 0; }
.lead { font-size: 1.1rem; color: var(--ink-2); max-width: 60ch; }
.eyebrow { display: flex; align-items: center; gap: .7rem; font-family: var(--mono); text-transform: uppercase; letter-spacing: .14em;
           font-size: .72rem; color: var(--accent); font-weight: 500; margin: 0 0 1.1rem; }
.eyebrow-rule { width: 28px; height: 1px; background: currentColor; }
.error { color: var(--err); background: var(--err-soft); padding: .5em .75em; border-radius: 6px; }
.ok { color: var(--ok); background: var(--ok-soft); padding: .5em .75em; border-radius: 6px; }
.empty { color: var(--ink-3); padding: 2em 0; }
.callout { background: var(--warn-soft); color: var(--ink); border-left: 3px solid var(--warn); padding: .8em 1em; border-radius: 4px; margin: 1.2em 0; }
.banner.error { margin: 0; border-radius: 0; }

/* ------------------------------------------------------------------ buttons, chips, forms */
.btn { display: inline-flex; align-items: center; gap: .5em; padding: .55em 1em; border-radius: 5px; border: 1px solid var(--line-strong);
       background: var(--surface); color: var(--ink); cursor: pointer; font-weight: 500; white-space: nowrap; text-decoration: none;
       transition: background .15s, border-color .15s, color .15s, transform .15s; }
.btn:hover { border-color: var(--brand); text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { color: var(--brand); background: transparent; text-decoration: underline; text-underline-offset: 4px; }
.btn.lg { padding: .85em 1.35em; font-size: 1rem; }
.btn .arrow { display: inline-block; transition: transform .2s; }
.btn:hover .arrow { transform: translateX(3px); }
.btn.small { padding: .32em .7em; font-size: .85rem; }
.btn.icon { width: 2rem; justify-content: center; }
.chip { display: inline-block; padding: .15em .6em; border-radius: 4px; background: var(--surface-2); font-size: .78rem; color: var(--ink-2); font-family: var(--mono); }
.chip.engine { background: var(--accent-soft); color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: .35em; }
.chip-btn { border: 1px solid var(--line); background: var(--surface); padding: .3em .75em; border-radius: 999px; cursor: pointer; font-size: .85rem; }
.chip-btn:hover { border-color: var(--accent); }
.check { display: inline-flex; align-items: center; gap: .45em; cursor: pointer; }
input[type=search], select { padding: .55em .75em; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--surface); min-width: 0; }
input[type=search]:focus, select:focus { outline: 2px solid var(--spirit); outline-offset: -1px; }
.segmented { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 5px; overflow: hidden; }
.segmented button { border: 0; background: var(--surface); padding: .35em .85em; cursor: pointer; font-size: .85rem; }
.segmented button.active { background: var(--brand); color: #fff; }

.loading { display: flex; align-items: center; gap: .6em; color: var(--ink-3); padding: 1em 0; }
.spinner { width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ header */
.site-header { position: sticky; top: 0; z-index: 10; height: var(--header-h); display: flex; align-items: center; gap: 2rem;
               padding: 0 clamp(1rem, 3vw, 2rem); background: color-mix(in srgb, var(--surface) 88%, transparent);
               backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: .9rem; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-logo, .brand-logo img { height: 44px; width: auto; display: block; }
.brand-sep { width: 1px; height: 30px; background: var(--line-strong); }
.brand-text b { font-family: var(--serif); font-size: 1.12rem; font-weight: 600; letter-spacing: -.01em; color: var(--ink); white-space: nowrap; }
.brand-mark { color: var(--brand); }
.brand-lesion { fill: var(--accent); }
.site-nav { display: flex; gap: 1.6rem; align-self: stretch; }
.site-nav a { display: flex; align-items: center; color: var(--ink-2); font-weight: 500; font-size: .95rem; position: relative; }
.site-nav a:hover { color: var(--ink); text-decoration: none; }
.site-nav a[aria-current]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--brand); }
.site-nav a[aria-current] { color: var(--ink); }
.header-right { margin-left: auto; display: flex; align-items: center; gap: .6rem; }
.privacy-pill { display: inline-flex; align-items: center; gap: .45em; font-family: var(--mono); font-size: .72rem; text-transform: uppercase;
                letter-spacing: .08em; color: var(--ok); padding: .3em .7em; border: 1px solid color-mix(in srgb, var(--ok) 35%, transparent); border-radius: 999px; }

/* ------------------------------------------------------------------ page frame */
.page { max-width: 1200px; margin: 0 auto; padding: 2.5rem clamp(1rem, 3vw, 2rem) 0; }
.page.narrow { max-width: 780px; }
.site-footer { margin-top: 5rem; background: #002d72; color: #c9d6ea; width: 100vw; margin-left: calc(50% - 50vw); }
.footer-inner { max-width: 1200px; margin: 0 auto; padding: 2.6rem clamp(1rem, 3vw, 2rem) 3rem; display: flex; gap: 2.5rem; align-items: center; }
.footer-logo { height: 50px; width: auto; flex: none; }
.footer-text { border-left: 1px solid rgba(255, 255, 255, .2); padding-left: 2.5rem; font-size: .88rem; }
.footer-text p { margin: .25em 0; }
.footer-text a { color: #9fc8f0; }

/* ------------------------------------------------------------------ home: hero */
.hero { position: relative; border-bottom: 1px solid var(--line);
        background:
          radial-gradient(900px 520px at 88% 30%, color-mix(in srgb, var(--spirit) 14%, transparent), transparent 70%),
          var(--bg); }
.hero::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
                background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
                background-size: 48px 48px; mask-image: linear-gradient(90deg, transparent 35%, #000 75%); -webkit-mask-image: linear-gradient(90deg, transparent 35%, #000 75%); }
.hero-inner { position: relative; max-width: 1200px; margin: 0 auto; padding: clamp(3rem, 7vw, 6rem) clamp(1rem, 3vw, 2rem) 3rem;
              display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.hero h1 { font-size: clamp(2.3rem, 4.3vw, 3.55rem); line-height: 1.07; letter-spacing: -.022em; font-weight: 600; margin-bottom: 1.4rem; text-wrap: balance; }
.hl { color: var(--brand); font-style: italic; font-weight: 500; }
.tagline { font-family: var(--sans); font-size: 1.12rem; font-weight: 600; color: var(--accent); letter-spacing: .005em; margin: 0 0 .9rem; }
.hero .lead { margin: 0; text-wrap: pretty; }
.cta { display: flex; flex-wrap: wrap; gap: .7rem; margin: 2.2rem 0 0; }

.scan { margin: 0; justify-self: end; width: 100%; max-width: 440px; }
.scan-frame { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #060a10;
              box-shadow: 0 30px 60px -30px rgba(0, 20, 60, .55), 0 0 0 1px rgba(255, 255, 255, .06) inset; }
.scan-frame img { display: block; width: 100%; height: 100%; object-fit: cover; }
.scan-frame::after { content: ""; position: absolute; left: 0; right: 0; height: 30%; top: -30%;
                     background: linear-gradient(transparent, rgba(104, 172, 229, .10) 85%, rgba(104, 172, 229, .35) 100%);
                     animation: sweep 7s cubic-bezier(.45, 0, .55, 1) infinite; }
@keyframes sweep { 0% { top: -30%; } 60%, 100% { top: 100%; } }
@media (prefers-reduced-motion: reduce) { .scan-frame::after { display: none; } }
.scan-cross { position: absolute; background: rgba(255, 154, 92, .35); }
.scan-cross.h { left: 0; right: 0; top: 47%; height: 1px; }
.scan-cross.v { top: 0; bottom: 0; left: 35%; width: 1px; }
.scan-tag, .scan-side { position: absolute; font-family: var(--mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: #a9bdd3; }
.scan-tag.tl { top: 14px; left: 16px; }
.scan-tag.tr { top: 14px; right: 16px; }
.scan-side { top: 50%; transform: translateY(-50%); font-size: .8rem; color: #8aa0b8; }
.scan-side.l { left: 14px; }
.scan-side.r { right: 14px; }

.stat-strip { position: relative; max-width: 1200px; margin: 0 auto; padding: 0 clamp(1rem, 3vw, 2rem) 2.6rem;
              display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-strip div { border-top: 1px solid var(--line-strong); padding: 1rem 1.5rem 0 0; }
.stat-strip div + div { padding-left: 1.5rem; border-left: 1px solid var(--line); }
.stat-strip dt { font-family: var(--serif); font-size: 2.5rem; font-weight: 500; line-height: 1; color: var(--brand); font-variant-numeric: lining-nums; }
.stat-strip dt small { font-family: var(--sans); font-size: .9rem; font-weight: 400; color: var(--ink-3); margin-right: .25em; vertical-align: .55em; }
.stat-strip dd { margin: .45rem 0 0; font-family: var(--mono); font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }

/* ------------------------------------------------------------------ home: paths and levels */
.section-head { display: flex; align-items: baseline; gap: 1.2rem; margin: 4.5rem 0 1.6rem; }
.section-head h2 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); margin: 0; white-space: nowrap; }
.section-head::after { content: ""; flex: 1; height: 1px; background: var(--line-strong); transform: translateY(-.35em); }
.section-head .legend { order: 2; font-family: var(--mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3);
                        display: flex; align-items: center; gap: .45rem; white-space: nowrap; }
.section-head .legend .cell { margin-left: .6rem; }

.path-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; position: relative; }
.path { --c: var(--brand); }
.path-beginning { --c: var(--path-beginning); }
.path-advanced { --c: var(--path-advanced); }
.path-replication { --c: var(--path-replication); }
.path-card { height: 100%; display: flex; flex-direction: column; padding: 1.6rem 1.6rem 1.3rem; background: var(--surface); color: var(--ink);
             border: 1px solid var(--line); border-radius: var(--radius); position: relative; overflow: hidden;
             transition: transform .2s, box-shadow .2s, border-color .2s; }
.path-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--c); }
.path-card:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--c) 40%, var(--line)); }
.path-top { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 1.2rem; }
.path-num { font-family: var(--serif); font-size: 2.6rem; line-height: 1; font-weight: 400; color: var(--c); font-variant-numeric: lining-nums; }
.path-levels { font-family: var(--mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.path-card h3 { font-size: 1.45rem; margin: 0 0 .6rem; }
.path-card p { color: var(--ink-2); font-size: .95rem; margin: 0 0 1.4rem; flex: 1; }
.path-foot { border-top: 1px solid var(--line); padding-top: .9rem; display: flex; flex-direction: column; gap: .55rem; }
.path-meta { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-family: var(--mono); font-size: .74rem; color: var(--ink-3); }
.path-meta .ready { color: var(--ok); }
.path-meta .done { color: var(--accent); }
.path-go { font-weight: 600; color: var(--c); font-size: .95rem; }
.path-card:hover .path-go { text-decoration: underline; text-underline-offset: 4px; }

.ladder-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 3rem;
               grid-auto-flow: column; grid-template-rows: repeat(5, auto); border-top: 1px solid var(--line-strong); }
.ladder-list li { border-bottom: 1px solid var(--line); }
.ladder-list a { display: grid; grid-template-columns: 2.6rem minmax(0, 1fr) auto 2.8rem; align-items: center; gap: 1rem; padding: .95rem .2rem; color: var(--ink); }
.ladder-list a:hover { text-decoration: none; background: color-mix(in srgb, var(--surface) 70%, transparent); }
.ladder-list a:hover .lv-name { color: var(--brand); }
.lv { font-family: var(--mono); font-weight: 500; font-size: .85rem; color: var(--accent); }
.lv-name { font-family: var(--serif); font-size: 1.1rem; font-weight: 500; transition: color .15s; }
.lv-cells { display: flex; gap: 3px; flex-wrap: wrap; justify-content: flex-end; max-width: 130px; }
.cell { display: inline-block; width: 10px; height: 10px; border-radius: 2px; border: 1px solid var(--line-strong); background: transparent; }
.cell.on { background: var(--ok); border-color: var(--ok); }
.lv-count { text-align: right; color: var(--ink-3); font-size: .8rem; font-family: var(--mono); font-variant-numeric: tabular-nums; }

.home > .page { padding-top: 0; }
.home .paths .section-head { margin-top: 3.5rem; }
.license h1 { font-size: 1.7rem; }
.license .copyright { font-weight: 600; }
.license-text p { color: var(--ink-2); font-size: .95rem; }

/* ------------------------------------------------------------------ course catalog */
.course-head { margin-bottom: 1rem; }
.filters { position: sticky; top: var(--header-h); z-index: 5; display: flex; flex-wrap: wrap; gap: .6rem; align-items: center;
           padding: .8rem 0; background: var(--bg); border-bottom: 1px solid var(--line); margin-bottom: 1.5rem; }
.filters input[type=search] { flex: 1 1 260px; }
.level { margin: 0 0 2.5rem; scroll-margin-top: calc(var(--header-h) + 70px); }
.level-head { display: flex; align-items: baseline; gap: .8rem; flex-wrap: wrap; margin-bottom: .8rem; }
.level-head h2 { margin: 0; }
.level-head p { margin: 0; color: var(--ink-3); font-size: .9rem; }
.nb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: .9rem; }
.nb-card { display: flex; flex-direction: column; gap: .35rem; padding: 1rem 1.05rem; background: var(--surface); border: 1px solid var(--line);
           border-radius: var(--radius); color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.nb-card:hover { text-decoration: none; border-color: var(--brand-2); box-shadow: var(--shadow); }
.nb-card.planned { background: transparent; border-style: dashed; }
.nb-card.planned h3, .nb-card.planned .q { color: var(--ink-3); }
.nb-card-top { display: flex; align-items: center; gap: .5rem; font-size: .78rem; }
.nb-id { font-family: var(--mono); font-weight: 700; color: var(--accent); margin-right: .35em; }
.kind { padding: .05em .5em; border-radius: 4px; background: var(--surface-2); color: var(--ink-2); }
.kind-repl { background: #ece6fb; color: #5b3fae; }
.mins { color: var(--ink-3); margin-left: auto; }
.done-tick { color: var(--ok); font-weight: 700; }
.nb-card h3 { margin: .1rem 0 0; font-size: 1rem; }
.nb-card .q { margin: 0; color: var(--ink-2); font-size: .88rem; flex: 1; }
.nb-card-foot { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .4rem; }
.status { font-size: .74rem; padding: .1em .5em; border-radius: 4px; }
.status.ready { background: var(--ok-soft); color: var(--ok); }
.status.planned { background: var(--surface-2); color: var(--ink-3); }
.status.cached { background: var(--surface-2); color: var(--ink-2); }
.status.engine { background: var(--accent-soft); color: var(--accent); }

/* ------------------------------------------------------------------ lesson (notebook page) */
.lesson { height: calc(100vh - var(--header-h)); display: flex; flex-direction: column; }
.lesson-bar { display: flex; align-items: center; gap: 1rem; padding: .5rem 1rem; border-bottom: 1px solid var(--line); background: var(--surface); flex-wrap: wrap; }
.lesson-bar .crumb { font-size: .8rem; color: var(--ink-3); white-space: nowrap; }
.lesson-bar h1 { font-size: 1.05rem; margin: 0; flex: 1; min-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-actions { display: flex; gap: .4rem; align-items: center; }
.lesson-body { flex: 1; display: grid; grid-template-columns: 1fr 340px; min-height: 0; }
.lesson.panel-closed .lesson-body { grid-template-columns: 1fr 0; }
.lesson.panel-closed .lesson-panel { display: none; }
.nb-frame { width: 100%; height: 100%; border: 0; background: var(--surface); }
/* Desktop app: the notebook frame while the local Jupyter server starts or Python is being set up */
.nb-gate { overflow: auto; display: flex; align-items: flex-start; justify-content: center; padding: 3rem 1.5rem; }
.gate-card { max-width: 640px; width: 100%; }
.gate-card h2 { margin-top: 0; }
.gate-detail { display: flex; align-items: center; gap: .6em; color: var(--ink-2); }
.gate-actions { display: flex; gap: .5rem; margin: 1rem 0; }
.gate-log pre { max-height: 320px; overflow: auto; font-size: .78rem; background: var(--bg); padding: .8em; border-radius: 4px; white-space: pre-wrap; }
.lesson-panel { display: flex; flex-direction: column; min-height: 0; overflow: hidden; border-left: 1px solid var(--line); background: var(--surface); }
.lesson-info { flex: 1 1 50%; min-height: 0; overflow: auto; padding: 1.1rem 1.2rem 1.5rem; }

/* AI tutor: the bottom half of the lesson panel */
.assistant { flex: 0 0 50%; min-height: 0; display: flex; flex-direction: column; border-top: 1px solid var(--line-strong); background: var(--bg); }
.assistant.collapsed { flex: 0 0 auto; }
.assistant.collapsed > :not(.as-head) { display: none; }
.as-head { display: flex; align-items: center; gap: .5rem; padding: .5rem .8rem; border-bottom: 1px solid var(--line); background: var(--surface); }
.as-title { font-family: var(--serif); font-weight: 600; flex: 1; }
.as-toggle, .as-gear { border: 0; background: none; cursor: pointer; color: var(--ink-2); font-size: .9rem; padding: .1rem .3rem; }
.segmented.small button { padding: .2em .6em; font-size: .78rem; }
.as-key { padding: .6rem .8rem; display: flex; flex-direction: column; gap: .4rem; border-bottom: 1px solid var(--line); background: var(--surface); }
.as-key input[type=password], .as-key input[type=text], .as-key select { width: 100%; padding: .45em .6em; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--bg); font-size: .85rem; }
.check.small { font-size: .8rem; color: var(--ink-2); }
.as-note { margin: 0; font-size: .75rem; color: var(--ink-3); line-height: 1.45; }
.as-log { flex: 1; min-height: 0; overflow: auto; padding: .7rem .8rem; display: flex; flex-direction: column; gap: .5rem; }
.as-empty { color: var(--ink-3); font-size: .85rem; margin: 0; }
.as-msg { white-space: pre-wrap; word-break: break-word; font-size: .88rem; line-height: 1.5; padding: .5rem .7rem; border-radius: 8px; max-width: 95%; }
.as-msg.user { align-self: flex-end; background: var(--brand); color: #fff; }
.as-msg.bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); }
.error.small { font-size: .8rem; padding: .35em .6em; }
.as-input { display: flex; gap: .4rem; align-items: flex-end; padding: .5rem .8rem; border-top: 1px solid var(--line); }
.as-input textarea { flex: 1; resize: none; font: inherit; font-size: .88rem; padding: .45em .6em; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); }
.as-web { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; padding: .1rem .8rem .7rem; font-size: .78rem; color: var(--ink-3); }
.as-web span { flex-basis: 100%; }

/* notebook as a web page */
.nbview { height: calc(100vh - var(--header-h)); display: flex; flex-direction: column; }
.nbview-hint { margin: 0; padding: .4rem 1rem; font-size: .8rem; color: var(--ink-3); border-bottom: 1px solid var(--line); background: var(--surface); }
.nbview-frame { flex: 1; width: 100%; border: 0; background: #fffefb; }
.lesson-panel .question { font-family: var(--serif); font-size: 1.2rem; line-height: 1.3; font-weight: 600; margin: 0 0 .8em; color: var(--ink); }
.goals, .outline { padding-left: 1.2em; margin: 0; color: var(--ink-2); font-size: .9rem; }
.goals li, .outline li { margin: .25em 0; }
.prereqs { display: flex; gap: .4rem; flex-wrap: wrap; }
.prereqs a { font-family: var(--mono); padding: .1em .5em; border: 1px solid var(--line); border-radius: 5px; }
.prereqs a.ready { border-color: var(--ok); }
.data-list { list-style: none; padding: 0; margin: 0; font-size: .88rem; }
.data-list li { margin: .35em 0; }
.data-list small { display: block; color: var(--ink-3); }
.howto { margin: 1.4em 0 .5em; font-size: .88rem; color: var(--ink-2); }
.howto summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.howto ul { padding-left: 1.2em; }
.done-check { margin: 1em 0; font-size: .9rem; }
.note { font-size: .85rem; color: var(--ok); }
.prev-next { display: flex; flex-direction: column; gap: .4rem; margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: .88rem; }
.prev-next .next { text-align: right; }
.planned-page .chips { margin: 1rem 0; }
.planned-page .planned-intro { color: var(--ink-2); }
.planned-page .refs { padding-left: 1.2em; margin: 0; color: var(--ink-2); font-size: .85rem; }
.planned-page .refs li { margin: .3em 0; overflow-wrap: anywhere; }

/* ------------------------------------------------------------------ data hub */
.data-head .privacy-note { background: var(--ok-soft); color: var(--ink); border-radius: 8px; padding: .7em 1em; font-size: .9rem; max-width: 80ch; }
.data-head .privacy-note b { color: var(--ok); }
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin: 1.5rem 0 1.2rem; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: .6em 1em; cursor: pointer; color: var(--ink-2); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.active { color: var(--ink); border-bottom-color: var(--accent); }
.searchbar { display: flex; gap: .5rem; }
.searchbar input { flex: 1; }
.suggest { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin: .8rem 0; font-size: .85rem; color: var(--ink-3); }
.hit-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.hit { width: 100%; text-align: left; display: grid; grid-template-columns: 6.5rem 1fr; gap: .1rem 1rem; padding: .7rem .9rem; background: var(--surface);
       border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.hit:hover { border-color: var(--brand-2); }
.hit-id { font-family: var(--mono); color: var(--accent); font-weight: 600; grid-row: span 2; }
.hit-meta { color: var(--ink-3); font-size: .82rem; }
.ds-group { margin: 1.4rem 0 .6rem; font-size: 1rem; }
.ds-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.ds-card { display: flex; flex-direction: column; gap: .35rem; text-align: left; padding: .8rem .9rem; background: var(--surface);
           border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; font: inherit; color: var(--ink); min-width: 0; }
.ds-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.ds-id { font-family: var(--mono); color: var(--accent); font-weight: 600; font-size: .85rem; }
.ds-title { font-weight: 600; line-height: 1.3; }
.ds-summary { color: var(--ink-2); font-size: .85rem; line-height: 1.45; flex: 1; }
.ds-meta { color: var(--ink-3); font-size: .78rem; border-top: 1px solid var(--line); padding-top: .4rem; overflow-wrap: anywhere; }
@media (max-width: 1200px) { .ds-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 960px) { .ds-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 680px) { .ds-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 440px) { .ds-grid { grid-template-columns: 1fr; } }
.dataset-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.4rem; margin: 1rem 0; }
.dc-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.dc-head h2 { margin-bottom: .2em; }
.authors { color: var(--ink-3); font-size: .85rem; margin: 0; }
.dc-stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: .6rem; margin: 1rem 0; }
.dc-stats div { background: var(--surface-2); border-radius: 8px; padding: .55rem .7rem; display: flex; flex-direction: column; }
.dc-stats b { font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dc-stats span { font-size: .75rem; color: var(--ink-3); }
.dc-stats .ok { background: var(--ok-soft); padding: .55rem .7rem; }
.dc-stats .warn { background: var(--warn-soft); }
.cite { font-size: .85rem; color: var(--ink-2); }
.readme pre { white-space: pre-wrap; font-family: var(--sans); font-size: .88rem; color: var(--ink-2); max-height: 7.5em; overflow: hidden;
              mask-image: linear-gradient(to bottom, #000 60%, transparent); margin-bottom: .5rem; }
.readme.open pre { max-height: none; mask-image: none; }
.explorer { display: grid; grid-template-columns: minmax(260px, 360px) 1fr; gap: 1rem; margin: 1rem 0; align-items: start; }
.tree-pane, .detail-pane { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem; min-width: 0; }
.tree-pane { position: sticky; top: calc(var(--header-h) + 12px); max-height: calc(100vh - var(--header-h) - 24px); display: flex; flex-direction: column; }
.pane-head { display: flex; justify-content: space-between; align-items: center; font-size: .85rem; color: var(--ink-3); }
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; font-family: var(--mono); font-size: .82rem; margin-bottom: .5rem; }
.breadcrumbs button { border: 0; background: none; cursor: pointer; color: var(--brand-2); padding: .1em .2em; }
.breadcrumbs .sep { color: var(--ink-3); }
.tree-pane .filter { width: 100%; margin-bottom: .5rem; }
.file-list { list-style: none; padding: 0; margin: 0; overflow: auto; flex: 1; }
.file-list button { width: 100%; display: grid; grid-template-columns: 1.6rem 1fr auto; gap: .4rem; align-items: center; border: 0; background: none;
                    padding: .3rem .4rem; border-radius: 6px; cursor: pointer; text-align: left; font-size: .86rem; }
.file-list button:hover { background: var(--surface-2); }
.file-list button.active { background: var(--accent-soft); }
.file-list .ico { font-size: .9rem; text-align: center; font-family: var(--mono); color: var(--ink-3); }
.file-list .fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: .82rem; }
.file-list button.dir .fname { font-weight: 600; }
.fsize { color: var(--ink-3); font-size: .78rem; font-family: var(--mono); white-space: nowrap; }
.fd-head h3 { display: flex; align-items: center; gap: .5rem; font-family: var(--mono); font-size: .95rem; word-break: break-all; margin-bottom: .1em; }
.fd-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin: .7rem 0; }
.progress { font-family: var(--mono); font-size: .85rem; color: var(--ink-2); margin: .4rem 0; }
.kv { border-collapse: collapse; width: 100%; font-size: .88rem; }
.kv th { text-align: left; color: var(--ink-3); font-weight: 500; padding: .3em 1em .3em 0; width: 9.5rem; vertical-align: top; }
.kv td { padding: .3em 0; font-family: var(--mono); font-size: .84rem; word-break: break-word; }
.kv tr + tr { border-top: 1px solid var(--line); }
.warnings { margin: .6rem 0; padding: .5rem .8rem .5rem 1.8rem; background: var(--warn-soft); border-radius: 8px; font-size: .85rem; }
.affine summary { cursor: pointer; font-size: .85rem; color: var(--ink-2); margin-top: .5rem; }
.affine pre { background: var(--surface-2); padding: .6rem; border-radius: 6px; margin-top: .4rem; }
.text-preview { background: var(--surface-2); padding: .8rem; border-radius: 8px; max-height: 420px; white-space: pre-wrap; word-break: break-word; margin-top: .8rem; }
.table-wrap { overflow: auto; max-height: 420px; margin-top: .8rem; border: 1px solid var(--line); border-radius: 8px; }
.data-table { border-collapse: collapse; font-size: .8rem; font-family: var(--mono); }
.data-table th, .data-table td { padding: .3em .6em; border-bottom: 1px solid var(--line); white-space: nowrap; text-align: left; }
.data-table th { position: sticky; top: 0; background: var(--surface-2); }
.snippet { margin-top: 1rem; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.snippet-head { display: flex; justify-content: space-between; align-items: center; padding: .35rem .6rem; background: var(--surface-2); font-size: .8rem; color: var(--ink-3); }
.snippet pre { padding: .8rem; font-size: .82rem; background: var(--surface); }
.folder-summary h3 { font-family: var(--mono); }
.viewer { margin-top: 1rem; }
.viewer-tools { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; margin-bottom: .4rem; }
.viewer-tools button { border: 1px solid var(--line); background: var(--surface); border-radius: 6px; padding: .2em .6em; font-size: .8rem; cursor: pointer; }
.viewer-tools button.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.viewer-tools .spacer { flex: 1; }
.viewer-canvas { width: 100%; height: 440px; display: block; border-radius: 8px; background: #0f1012; }
.dropzone { border: 2px dashed var(--line); border-radius: var(--radius); padding: 2.2rem 1rem; text-align: center; background: var(--surface); transition: border-color .15s, background .15s; }
.dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }
.dz-title { font-size: 1.1rem; font-weight: 600; margin: 0 0 .3rem; }
.dz-buttons { display: flex; justify-content: center; gap: .6rem; margin-top: 1rem; }
.ws-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.ws-head p { margin: 0; color: var(--ink-2); }
.ws-actions { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.usage { font-family: var(--mono); font-size: .82rem; color: var(--ink-3); }
.ws-group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin: 1rem 0; overflow: hidden; }
.ws-group-head { display: flex; align-items: center; gap: 1rem; padding: .6rem .9rem; background: var(--surface-2); }
.ws-group-head h3 { margin: 0; font-family: var(--mono); font-size: .9rem; flex: 1; }
.ws-group-head span { color: var(--ink-3); font-size: .82rem; }
.ws-list { list-style: none; margin: 0; padding: 0; }
.ws-list li { display: grid; grid-template-columns: 1fr auto auto auto auto; gap: .8rem; align-items: center; padding: .35rem .9rem; border-top: 1px solid var(--line); font-size: .84rem; }
.ws-list code { background: none; padding: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.when { color: var(--ink-3); font-size: .78rem; font-family: var(--mono); }
.cd-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.cd-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; display: flex; flex-direction: column; gap: .6rem; }
.cd-card p { margin: 0; color: var(--ink-2); font-size: .9rem; flex: 1; }
.cd-card pre { background: var(--surface-2); padding: .6rem; border-radius: 6px; font-size: .78rem; white-space: pre-wrap; }
.cd-card .btn { align-self: flex-start; }

/* ------------------------------------------------------------------ about */
.layers { display: grid; gap: .6rem; margin: 1.5rem 0 2rem; }
.layer-row { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--brand-2); border-radius: 8px; padding: .8rem 1rem; }
.layer-row h3 { margin: 0; }
.layer-row .tech { font-family: var(--mono); font-size: .82rem; color: var(--accent); margin: .2em 0; }
.layer-row p { margin: .2em 0 0; color: var(--ink-2); font-size: .9rem; }
.about ul { color: var(--ink-2); }

/* ------------------------------------------------------------------ small screens */
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; }
  .scan { justify-self: start; max-width: 360px; }
  .path-list { grid-template-columns: 1fr; }
  .ladder-list { grid-template-columns: 1fr; grid-auto-flow: row; grid-template-rows: none; }
  .cd-grid { grid-template-columns: 1fr; }
  .dc-stats { grid-template-columns: repeat(3, 1fr); }
  .explorer { grid-template-columns: 1fr; }
  .tree-pane { position: static; max-height: 50vh; }
  .lesson-body { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .lesson-panel { border-left: 0; border-top: 1px solid var(--line); max-height: none; overflow: visible; }
  .lesson-info { overflow: visible; }
  .assistant { flex-basis: auto; min-height: 320px; }
  .privacy-pill { display: none; }
}
@media (max-width: 600px) {
  .site-header { gap: .8rem; }
  .brand { gap: .6rem; }
  .brand-logo, .brand-logo img { height: 30px; }
  .brand-sep { display: none; }
  .brand-text b { font-size: .95rem; }
  .site-nav { gap: .9rem; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .site-nav a { white-space: nowrap; font-size: .9rem; }
  .brand-text { display: none; }
  .site-nav a { font-size: .9rem; }
  .filters select { flex: 1 1 40%; }
  .page { padding: 1.5rem 1rem 0; }
  .lesson-bar h1 { order: 3; flex-basis: 100%; }
  .stat-strip dt { font-size: 1.9rem; }
  .stat-strip div, .stat-strip div + div { padding: .8rem .6rem 0; }
  .ladder-list a { grid-template-columns: 2.2rem minmax(0, 1fr) 2.6rem; }
  .lv-cells { display: none; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 1.2rem; }
  .footer-text { border-left: 0; padding-left: 0; }
  .section-head .legend { display: none; }
  .section-head h2 { white-space: normal; }
  .section-head::after { display: none; }
  .hero h1 { font-size: 2.05rem; }
}

/* folder panel (OpenNeuro) */
.folder-panel h3 { font-family: var(--mono); font-size: .95rem; margin-bottom: .1rem; }
.folder-panel .eyebrow { margin-bottom: .3rem; }
.small-select { padding: .3em .5em; font-size: .85rem; }
.confirm { border: 1px solid var(--line-strong); background: var(--surface-2); border-radius: 8px; padding: .6rem .8rem; margin: .5rem 0; }
.confirm p { margin: 0 0 .3rem; font-size: .9rem; }
.linkish { border: 0; background: none; padding: 0; color: var(--brand-2); cursor: pointer; font: inherit; text-align: left; }
.linkish:hover { text-decoration: underline; }
.table-wrap.scan-table, .table-wrap.participants { max-height: 360px; }
.folder-panel .filter { width: 100%; margin: .4rem 0; }
/* course data */
.cd-section { margin: 1.6rem 0 .2rem; }
.cd-grid.two { grid-template-columns: repeat(2, 1fr); }
.steps { margin: 0; padding-left: 1.2rem; font-size: .88rem; color: var(--ink-2); }
.steps li { margin: .2rem 0; }
@media (max-width: 960px) { .cd-grid.two { grid-template-columns: 1fr; } }

.local-note { max-width: 62ch; margin: 1rem auto 0; font-size: .85rem; color: var(--ink-2); background: var(--ok-soft); border-radius: 8px; padding: .6rem .9rem; text-align: left; }
.local-note b { color: var(--ok); }
.add-all { display: flex; flex-direction: column; gap: .35rem; padding: .5rem 0 .6rem; border-bottom: 1px solid var(--line); margin-bottom: .5rem; }
.add-all .btn { align-self: flex-start; }
.small-note { font-size: .82rem; display: flex; flex-direction: column; gap: .2rem; }
.small-note code { background: none; padding: 0; word-break: break-all; }
.hidden { display: none !important; }

/* Open a notebook from a link (pages/open.rs) */
.open-bar { display: flex; gap: .5rem; max-width: 760px; }
.open-bar input { flex: 1; min-width: 0; padding: .7em .9em; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--surface); font-size: .95rem; }
.open-bar input:focus { outline: 2px solid var(--spirit); outline-offset: -1px; }
.open-bar.large input { padding: .9em 1em; font-size: 1rem; border-width: 2px; border-color: var(--brand); }
.open-bar.large .btn { padding: .85em 1.35em; font-size: 1rem; white-space: nowrap; }
.open-error { max-width: 760px; margin: .6rem 0 0; }
.hero-open { margin-top: 2rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }
.hero-open-label { margin: 0 0 .6rem; font-weight: 600; color: var(--ink-2); }
.hero-download { margin: 1rem 0 0; font-size: .92rem; color: var(--ink-3); }
.open-page .open-bar { margin-top: 1.5rem; }
.open-alt { display: flex; align-items: center; gap: .8rem; margin: 1rem 0 1.5rem; }
.open-alt .btn { cursor: pointer; }
.error-callout { background: var(--err-soft); border-left-color: var(--err); }
.open-recent ul, .open-notes ul { padding-left: 1.2rem; }
.open-recent li small { margin-left: .6rem; color: var(--ink-3); }
.open-notes { margin-top: 2rem; }
.open-banner { margin: 0; padding: .5rem 1rem; font-size: .88rem; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.open-banner.warn { background: var(--warn-soft); }
.open-lesson .lesson-bar .source { margin-left: -.4rem; }
@media (max-width: 640px) { .open-bar { flex-direction: column; } }

/* Desktop app download (pages/download.rs) */
.dl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin: 2rem 0 .8rem; }
.dl-card { border: 1px solid var(--line); border-radius: 8px; padding: 1.2rem 1.3rem; background: var(--surface); display: flex; flex-direction: column; gap: .6rem; }
.dl-card.mine { border: 2px solid var(--brand); }
.dl-card.soon { background: var(--surface-2); color: var(--ink-3); }
.dl-card header { display: flex; align-items: center; justify-content: space-between; }
.dl-card h2 { margin: 0; font-size: 1.25rem; }
.dl-card .hint { margin: 0; }
.dl-card .btn { align-self: flex-start; }
.dl-meta { margin: 0; font-size: .8rem; color: var(--ink-3); }
.dl-meta .sha { font-size: .7rem; word-break: break-all; }
.soon-note { margin: auto 0 0; }
.dl-steps, .dl-compare { margin-top: 2.2rem; }
.dl-steps li { margin-bottom: .5rem; }
.dl-compare table { border-collapse: collapse; width: 100%; max-width: 760px; font-size: .92rem; }
.dl-compare th, .dl-compare td { text-align: left; padding: .45rem .7rem; border-bottom: 1px solid var(--line); }
.dl-compare tbody th { font-weight: 600; color: var(--ink-2); }
