/* The Project Shelf stylesheet, v5 (2026-10-16): the project page is a tabbed page in the
   manner of a code-hosting repository (tab bar with count pills, a plain Overview with an
   About column, one tab per kind of work). Founder's direction: no tiles, no grouping boxes,
   no generic app styling. One file, no external resources (the CSP allows none). System font
   stack, 14px body, 8px rhythm, white ground, 1px rules only where rows or tables need them,
   6px corners, no shadows, blue links, grey chips. Dark theme follows the system setting
   until the visitor picks one with the header switch (data-theme, set by theme.js). 16px
   gutters on phones, no horizontal page scroll
   (the tab bar scrolls sideways instead), reduced motion respected, print styles kept. */

:root {
  --ground: #ffffff;
  --surface: #ffffff;
  --surface-2: #f6f8fa;
  --surface-3: #eaeef2;
  --text: #1f2328;
  --text-soft: #424a53;
  --muted: #59636e;
  --line: #d1d9e0;
  --line-strong: #b7c0c9;
  --accent: #0969da;
  --accent-ink: #ffffff;
  --accent-fill: #1f883d;
  --accent-soft: #ddf4ff;
  --ok: #1a7f37;
  --ok-soft: #dafbe1;
  --warn: #9a6700;
  --warn-soft: #fff8c5;
  --danger: #cf222e;
  --danger-soft: #ffebe9;
  --info: #0969da;
  --info-soft: #ddf4ff;
  --focus: #0969da;
  --radius: 6px;
  --radius-sm: 6px;
  --gutter: 16px;
  --tap: 40px;
  /* the type scale, in px (body is 14px, so rem would be a scale on the root, not the body):
     xs badges, tags, pills and fineprint; sm small text and table headers; base body copy,
     tables, buttons, tabs and inputs; md every h2 and the lede; lg result figures; xl h1 */
  --fs-xs: 12px; --fs-sm: 13px; --fs-base: 14px; --fs-md: 16px; --fs-lg: 20px; --fs-xl: 24px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --font-display: var(--font);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --ground: #0d1117; --surface: #0d1117; --surface-2: #161b22; --surface-3: #21262d;
  --text: #e6edf3; --text-soft: #c9d1d9; --muted: #8d96a0;
  --line: #30363d; --line-strong: #484f58;
  --accent: #4493f8; --accent-ink: #ffffff; --accent-fill: #238636; --accent-soft: #121d2f;
  --ok: #3fb950; --ok-soft: #12261e; --warn: #d29922; --warn-soft: #272115;
  --danger: #f85149; --danger-soft: #2d1b1b; --info: #4493f8; --info-soft: #121d2f; --focus: #79c0ff;
  color-scheme: dark;
}
/* the same tokens when the system prefers dark and the visitor has not chosen (theme.js
   writes data-theme="light" for an explicit light choice) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0d1117; --surface: #0d1117; --surface-2: #161b22; --surface-3: #21262d;
    --text: #e6edf3; --text-soft: #c9d1d9; --muted: #8d96a0;
    --line: #30363d; --line-strong: #484f58;
    --accent: #4493f8; --accent-ink: #ffffff; --accent-fill: #238636; --accent-soft: #121d2f;
    --ok: #3fb950; --ok-soft: #12261e; --warn: #d29922; --warn-soft: #272115;
    --danger: #f85149; --danger-soft: #2d1b1b; --info: #4493f8; --info-soft: #121d2f; --focus: #79c0ff;
    color-scheme: dark;
  }
}

/* ---- base ------------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; color: var(--text); font-family: var(--font); font-size: var(--fs-base); line-height: 1.5;
  overflow-x: hidden; min-height: 100vh; background: var(--ground); }
img, video { max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
h1, h2, h3, h4 { font-family: var(--font); font-weight: 600; line-height: 1.25; margin: 0 0 .5em; color: var(--text); }
h1 { font-size: var(--fs-xl); }
h2 { font-size: var(--fs-md); }
h3 { font-size: var(--fs-base); }
h4 { font-size: var(--fs-base); }
p { margin: 0 0 .9em; }
.lede { font-size: var(--fs-md); color: var(--text-soft); max-width: 70ch; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }
.wrap-narrow { max-width: 48rem; }
.muted { color: var(--muted); }
.soft { color: var(--text-soft); }
.small { font-size: var(--fs-sm); }
.tiny { font-size: var(--fs-xs); }
.mono { font-family: var(--mono); font-size: var(--fs-sm); overflow-wrap: anywhere; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: var(--gutter); top: 8px; background: var(--surface); padding: 8px 12px; z-index: 50;
  border: 1px solid var(--line); border-radius: var(--radius); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }

/* ---- header: a full width dark bar, logo and primary links left, account right ------ */
.site-header { background: #1b4d3e; border-bottom: 1px solid #143a2f; color: #fff;
  --text: #ffffff; --text-soft: #d3e4dc; --muted: #b5cbc1; --surface: #1b4d3e; --surface-2: #275c4b;
  --line: #444c56; --line-strong: #8b949e; --accent: #ffffff; --focus: #ffffff; }
:root[data-theme="dark"] .site-header { background: #0b1f17; border-bottom-color: #1f4435; --surface: #0b1f17; --surface-2: #16332a; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .site-header { background: #0b1f17; border-bottom-color: #1f4435; --surface: #0b1f17; --surface-2: #16332a; }
}
.site-header .wrap { max-width: none; display: flex; align-items: center; gap: 8px; min-height: 56px; flex-wrap: nowrap; padding: 0 16px; }
@media (min-width: 720px) { .site-header .wrap { gap: 16px; padding: 0 32px; } }
.wordmark { font-weight: 600; font-size: var(--fs-md); color: var(--text); text-decoration: none; min-height: var(--tap); white-space: nowrap;
  display: inline-flex; align-items: center; gap: 8px; margin-right: 8px; }
.wordmark:hover { text-decoration: none; }
.wordmark .mark { width: 14px; height: 18px; border: 1.5px solid var(--text); border-radius: 2px; position: relative; flex: none; }
.wordmark .mark::after { content: ""; position: absolute; left: 3px; right: 3px; top: 4px; height: 1.5px; background: var(--text);
  box-shadow: 0 4px 0 var(--text); }
.nav { display: flex; gap: 2px; flex: 1; flex-wrap: nowrap; align-items: center; min-width: 0; }
.nav > .nav-cta, .nav > .account { margin-left: auto; }
.nav > a { white-space: nowrap; }
.account { position: relative; }
.account > summary { list-style: none; min-height: var(--tap); display: inline-flex; align-items: center; gap: 6px; padding: 0 8px; cursor: pointer;
  font-size: var(--fs-base); color: var(--text); font-weight: 400; max-width: 11rem; white-space: nowrap; overflow: hidden; text-overflow: clip; }
.account > summary::-webkit-details-marker { display: none; }
.account > summary::after { content: ""; width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid var(--muted); flex: none; }
.account-menu { position: absolute; right: 0; top: calc(100% - 4px); min-width: 11rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 4px 0; z-index: 40; display: grid; }
.account-menu a, .account-menu button.linklike { display: flex; min-height: 32px; align-items: center; padding: 0 12px; color: var(--text); font-size: var(--fs-base); border: 0; width: 100%; text-align: left; justify-content: flex-start; }
.account-menu a:hover, .account-menu button.linklike:hover { background: var(--surface-2); text-decoration: none; }
.account-menu form { margin: 0; }
.account-menu .theme-switch { border: 0; border-radius: 0; background: none; margin: 0; }
.menu-narrow { display: none !important; }
@media (max-width: 719px) {
  .nav > a:not(:first-child):not(.nav-cta) { display: none; }
  .menu-narrow { display: flex !important; }
  .nav > a, .account > summary { padding: 0 6px; font-size: var(--fs-sm); }
  .account > summary { max-width: 7rem; }
  .site-header .wrap { overflow-x: clip; gap: 4px; }
  /* a signed-out phone header holds the wordmark, Explore, Sign in and the theme switch on one line */
  .wordmark { font-size: var(--fs-md); margin-right: 0; }
  .nav .nav-cta { padding: 0 8px; }
  /* the theme switch is its half moon glyph alone, the pressed state its fill; the label
     stays for screen readers and the title names it on a long press */
  .nav > .theme-switch { padding: 0 7px; white-space: nowrap; margin-left: 0; min-width: 32px; justify-content: center; }
  .nav > .theme-switch .theme-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .nav > .theme-switch .theme-track { display: none; }
}
/* under 380 the wordmark steps down to the body size so the signed-out line keeps its
   16px gutter; under 360 the mark goes and the links tighten */
@media (max-width: 379px) { .wordmark { font-size: var(--fs-base); } }
@media (max-width: 359px) { .wordmark .mark { display: none; } .nav > a:first-child { padding: 0 4px; } .nav .nav-cta { padding: 0 6px; } }
.nav a, .nav button.linklike { min-height: var(--tap); display: inline-flex; align-items: center; padding: 0 8px;
  color: var(--text); text-decoration: none; font-size: var(--fs-base); border-bottom: 2px solid transparent; border-radius: 0; }
.nav a:hover, .nav button.linklike:hover { text-decoration: underline; }
.nav a[aria-current="page"] { border-bottom-color: var(--accent); font-weight: 600; }
.nav a, .nav button.linklike, .nav .theme-switch { color: var(--text); }
.nav form { margin: 0; }
.nav .nav-cta { border: 1px solid var(--line-strong); border-radius: var(--radius); min-height: 32px; padding: 0 12px;
  background: transparent; color: #fff; }
.nav .nav-cta:hover { border-color: #fff; text-decoration: none; }
.nav .nav-cta:hover { background: var(--surface-3); text-decoration: none; }
.preview-flag { font-size: var(--fs-xs); color: var(--muted); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 1px 7px; }

main { padding: 20px 0 56px; }
.site-footer { border-top: 1px solid var(--line); padding: 24px 0 36px; color: var(--muted); font-size: var(--fs-sm); background: var(--surface); }
.site-footer .wrap { display: grid; gap: 8px; }
.site-footer a { color: var(--muted); display: inline-block; min-height: 24px; line-height: 24px; }
.fineprint { font-size: var(--fs-xs); color: var(--muted); margin-top: 4px; }

/* ---- controls -------------------------------------------------------------------- */
.btn, button, input[type=submit] {
  font: inherit; font-size: var(--fs-base); font-weight: 500; min-height: 32px; padding: 0 12px; border-radius: var(--radius); cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; line-height: 1.2; }
.btn:hover, button:hover { background: var(--surface-3); text-decoration: none; }
.btn-primary, button.btn-primary, .actions .btn-primary { background: var(--accent-fill); color: var(--accent-ink); border-color: rgba(31, 35, 40, .15); }
.btn-primary:hover, button.btn-primary:hover { background: var(--accent-fill); filter: brightness(.95); }
.btn-quiet { background: transparent; border-color: transparent; }
.btn-quiet:hover { background: var(--surface-2); }
.btn-danger { color: var(--danger); }
.compact { min-height: 32px; padding: 0 10px; font-size: var(--fs-sm); }
button.linklike { border: 0; background: none; padding: 0 8px; font-weight: 400; }
input[type=text], input[type=email], input[type=url], input[type=date], input[type=search], input[type=number],
input[type=password], select, textarea {
  font: inherit; font-size: var(--fs-base); width: 100%; min-height: 32px; padding: 5px 10px; border-radius: var(--radius);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); }
/* every field shows the same 2px ring as links and buttons: the link blue on white, a light
   blue on the dark ground, both 3:1 or better against the page; the border turns blue too */
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
input[type=file] { font: inherit; font-size: var(--fs-base); width: 100%; min-height: 32px; padding: 4px 0; }
input[type=file]::file-selector-button { font: inherit; font-weight: 500; min-height: 32px; padding: 0 10px;
  border-radius: var(--radius); border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text); margin-right: 10px; }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; accent-color: var(--accent); flex: none; margin-top: 3px; }
label { font-weight: 600; display: block; margin-bottom: 4px; font-size: var(--fs-base); }
.field { margin-bottom: 16px; }
.field .help { color: var(--muted); font-size: var(--fs-sm); margin-top: 4px; }
.errorlist { list-style: none; margin: 4px 0 0; padding: 0; color: var(--danger); font-size: var(--fs-sm); }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 4px 0; }
.check label { font-weight: 400; margin: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; align-items: center; }
fieldset { border: 0; padding: 0; margin: 0; }

/* ---- surfaces: plain sections; a rule only under a heading or between rows -------- */
.card { background: transparent; border: 0; border-radius: 0; padding: 0; }
.card-flat { box-shadow: none; }
.card > h2:first-child, .card > h2[id]:first-child, .section-title { font-size: var(--fs-md); font-weight: 600; margin: 0 0 12px; padding: 0 0 8px;
  border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; }
.stack > * + * { margin-top: 24px; }
.stack + .stack { margin-top: 28px; }
.main-col { min-width: 0; }
/* .grid once laid cards out as tiles; it is now a boxed list of rows (dashboard, courses) */
.grid { display: block; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.grid > * { min-width: 0; }
.grid > .card { border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 12px 16px; display: block; }
.grid > .card:first-child { border-top: 0; }
.grid > .card:hover { background: var(--surface-2); text-decoration: none; }
.grid > .card h3 { margin: 0 0 2px; font-size: var(--fs-md); }
.grid > .card h3, .grid > .project-card h3 { color: var(--accent); }
.messages { list-style: none; padding: 0; margin: 0 0 16px; }
.messages li { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 8px; background: var(--info-soft); color: var(--text);
  border: 1px solid var(--info); font-size: var(--fs-base); }
.messages li.error { background: var(--danger-soft); border-color: var(--danger); }
.messages li.success { background: var(--ok-soft); border-color: var(--ok); }
.empty { padding: 24px 0; color: var(--muted); border-top: 1px solid var(--line); }
.card.empty { border: 1px dashed var(--line); border-radius: var(--radius); padding: 24px 16px; text-align: center; }
.empty p:first-child { font-size: var(--fs-md); color: var(--text-soft); }
.page-head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: flex-end; justify-content: space-between;
  padding-bottom: 16px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.page-head h1 { margin-bottom: 0; overflow-wrap: anywhere; font-weight: 600; }
.page-head .muted { margin: 0; font-size: var(--fs-base); }
.eyebrow { font-size: var(--fs-xs); font-weight: 600; color: var(--muted); margin: 0; }
.layout { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 920px) { .layout { grid-template-columns: minmax(0, 1fr) 296px; gap: 32px; } }
.side h2 { font-size: var(--fs-md); font-weight: 600; margin: 0 0 8px; }
.side .card, .side .about { padding: 0 0 16px; margin: 0 0 16px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.side .card:last-child, .side .about:last-child { border-bottom: 0; }
.side .card > h2:first-child { margin: 0 0 8px; padding: 0; background: none; border: 0; }
.side dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: var(--fs-base); }
.side dt { color: var(--muted); } .side dd { margin: 0; overflow-wrap: anywhere; }
.about-lead { color: var(--text); margin: 0 0 10px; }
.about .tags { margin: 10px 0 0; }
.about-links { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; font-size: var(--fs-base); }
.table-wrap { position: relative; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: var(--fs-base); }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--text-soft); background: var(--surface-2); white-space: nowrap; font-size: var(--fs-sm); }
tr:last-child td { border-bottom: 0; }
.pagination { display: flex; gap: 10px; justify-content: center; align-items: center; margin-top: 24px; font-size: var(--fs-base); }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
details > summary { cursor: pointer; min-height: 32px; display: flex; align-items: center; color: var(--accent); font-weight: 500; font-size: var(--fs-base); }
details[open] > summary { margin-bottom: 6px; }

/* ---- badges and tags: small labels, not pills ------------------------------------ */
.badge { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 2em;
  padding: 0 7px; font-size: var(--fs-xs); font-weight: 500; line-height: 18px; color: var(--muted); background: var(--surface); white-space: nowrap; }
.badge-kind { color: var(--text-soft); background: var(--surface-2); }
.badge-public { color: var(--ok); border-color: var(--ok); }
.badge-unlisted { color: var(--warn); border-color: var(--warn); }
.badge-private { color: var(--muted); }
.badge-featured { color: var(--accent); border-color: var(--accent); }
.badge-ai { color: var(--warn); border-color: var(--warn); }
.badges { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.pill { display: inline-block; min-width: 20px; padding: 0 6px; font-size: var(--fs-xs); font-weight: 500; line-height: 18px; text-align: center;
  color: var(--text); background: var(--surface-3); border-radius: 2em; vertical-align: middle; }
.tag { font-size: var(--fs-xs); font-weight: 500; line-height: 20px; color: var(--accent); background: var(--accent-soft); border-radius: 2em; padding: 0 8px; }
.ai-label { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface-2); font-size: var(--fs-base); }
.ai-notice { margin-top: 16px; }
/* a link inside running text is underlined in both themes, so it does not rest on colour
   alone: every link in a paragraph of the page or the footer (buttons aside), and the
   lists of the legal and about pages */
.ai-notice a, .ai-label a, .readme a, .doc-desc a, .consent a, .field .help a, .disclosure a,
main p a:not(.btn), main dd a, .wrap-narrow li a, .prose a, .site-footer p a { text-decoration: underline; text-underline-offset: 2px; }

/* ---- gallery: a plain list, like a repository index ------------------------------ */
.intro { padding: 0 0 16px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.intro h1 { font-size: var(--fs-xl); margin-bottom: 4px; }
.intro p { margin: 0 0 6px; max-width: 80ch; color: var(--text-soft); }
.intro .how { font-size: var(--fs-base); color: var(--muted); }
.intro .actions { margin-top: 10px; }
.hero { padding: 4px 0 18px; display: grid; gap: 10px; }
.hero h1 { font-size: var(--fs-xl); }
.hero-sub { font-size: var(--fs-md); color: var(--text-soft); max-width: 80ch; margin: 0; }
.hero-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: var(--fs-base); color: var(--muted); }
.hero-steps li strong { color: var(--text); font-weight: 600; margin-right: 4px; }
.hero-actions { margin-top: 4px; }
.filters { display: grid; gap: 8px; grid-template-columns: 1fr; margin-bottom: 12px; }
@media (min-width: 720px) { .filters { grid-template-columns: 2fr 1fr; } }
.repo-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.repo-list.plain { border: 0; border-radius: 0; }
.examples { margin-top: 28px; }
.repo-list.plain .repo-row { padding: 10px 0; }
.repo-row-head { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; margin: 0 0 2px; }
.repo-row-head > .repo-row-title { margin: 0; }
.repo-row { padding: 12px 16px; border-top: 1px solid var(--line); }
.repo-row:first-child { border-top: 0; }
.repo-row h2, .repo-row h3, .repo-row h4 { margin: 0 0 2px; font-size: var(--fs-md); font-weight: 600; overflow-wrap: anywhere; }
.repo-row h2 a, .repo-row h3 a, .repo-row h4 a { color: var(--accent); }
.repo-row .desc { margin: 0 0 6px; color: var(--text-soft); font-size: var(--fs-base); overflow-wrap: anywhere; }
.repo-row .meta { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; font-size: var(--fs-sm); color: var(--muted); }
.repo-row .meta .tag { line-height: 18px; }
.project-card { display: block; text-decoration: none; color: var(--text); }
.project-card h3 { font-size: var(--fs-md); margin: 0; }
.project-card .byline { color: var(--muted); font-size: var(--fs-sm); margin: 0; }
.project-card .meta { margin-top: 6px; }
@media (prefers-reduced-motion: reduce) { .btn, button { transition: none; } }

/* ---- project page: repository-style head and tab bar ------------------------------ */
.crumbs { font-size: var(--fs-sm); color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.crumbs a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.crumbs a:hover { color: var(--text); }
.repo-head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; }
.repo-title { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-width: 0; }
.repo-title h1 { margin: 0; font-size: var(--fs-xl); font-weight: 600; overflow-wrap: anywhere; }
.repo-title > .badge { font-weight: 500; }
.byline-row { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; margin: 8px 0 16px; }
.byline-row .byline { margin: 0; }
.like-form { margin: 0; }
.repo-title h1 a { color: var(--text); }
.repo-actions { display: flex; gap: 6px; align-items: center; }
.repo-actions form { margin: 0; }
.byline { margin: 8px 0 16px; font-size: var(--fs-base); }
.byline a { text-decoration: underline; text-underline-offset: 2px; }
.tabs-bar { position: relative; margin: 0 calc(-1 * var(--gutter)) 24px; }
.tabs { margin: 0; padding: 0 var(--gutter); border-bottom: 1px solid var(--line); display: flex;
  overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity; scroll-padding-inline: var(--gutter); }
/* the hint of more tabs: a chevron on an opaque edge of the frame around the strip, with
   the fade running 32px inward from that edge, so no letter shows between the chevron and
   the edge (scroll-cue.js writes data-cue on the frame; before it has measured, the narrow
   layout shows the right-hand one). The chevron is the muted colour of each theme. */
.tabs[data-scroll] { mask-image: none; -webkit-mask-image: none; }
.tabs-bar::before, .tabs-bar::after { content: ""; position: absolute; top: 0; bottom: 1px; width: 56px; z-index: 1;
  pointer-events: none; display: none; background-repeat: no-repeat; background-size: 10px 16px, 100% 100%; }
.tabs-bar::after { right: 0; background-position: right 9px center, 0 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 16'%3E%3Cpath d='M2 2l6 6-6 6' fill='none' stroke='%2359636e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"), linear-gradient(to right, transparent, var(--ground) 32px); }
.tabs-bar::before { left: 0; background-position: left 9px center, 0 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 16'%3E%3Cpath d='M8 2L2 8l6 6' fill='none' stroke='%2359636e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"), linear-gradient(to left, transparent, var(--ground) 32px); }
.tabs-bar[data-cue="start"]::after, .tabs-bar[data-cue="middle"]::after,
.tabs-bar[data-cue="middle"]::before, .tabs-bar[data-cue="end"]::before { display: block; }
@media (max-width: 919px) { .tabs-bar:not([data-cue])::after { display: block; } }
:root[data-theme="dark"] .tabs-bar::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 16'%3E%3Cpath d='M2 2l6 6-6 6' fill='none' stroke='%238d96a0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"), linear-gradient(to right, transparent, var(--ground) 32px); }
:root[data-theme="dark"] .tabs-bar::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 16'%3E%3Cpath d='M8 2L2 8l6 6' fill='none' stroke='%238d96a0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"), linear-gradient(to left, transparent, var(--ground) 32px); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tabs-bar::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 16'%3E%3Cpath d='M2 2l6 6-6 6' fill='none' stroke='%238d96a0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"), linear-gradient(to right, transparent, var(--ground) 32px); }
  :root:not([data-theme="light"]) .tabs-bar::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 16'%3E%3Cpath d='M8 2L2 8l6 6' fill='none' stroke='%238d96a0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"), linear-gradient(to left, transparent, var(--ground) 32px); }
}
.tabs::-webkit-scrollbar { display: none; }
.tabs ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; min-width: max-content; flex: none; }
.tabs li { scroll-snap-align: start; }
/* a strip that scrolls sideways fades the edge that hides more (scroll-cue.js sets
   data-scroll from the scroll position: start, middle, end, or none when it all fits) */
[data-scroll="start"] { mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent);
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); }
[data-scroll="middle"] { mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent); }
[data-scroll="end"] { mask-image: linear-gradient(to right, transparent, #000 40px);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 40px); }
[data-scroll="none"] { mask-image: none; -webkit-mask-image: none; }
.tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 10px 9px; margin-bottom: -1px; min-height: var(--tap);
  color: var(--text); font-size: var(--fs-base); line-height: 1.4; white-space: nowrap; border-bottom: 2px solid transparent; border-radius: 0; }
.tabs a:hover { text-decoration: none; background: var(--surface-2); border-radius: var(--radius) var(--radius) 0 0; }
.tabs a[aria-current="page"] { font-weight: 600; border-bottom-color: var(--accent); }
@media (min-width: 920px) { .tabs-bar { margin-left: 0; margin-right: 0; } .tabs { padding: 0; } }

/* a document on a tab: title line, then the reader; documents are separated by a rule */
.docs > .doc + .doc { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 20px; }
.doc-head { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-bottom: 8px; }
.doc-title { margin: 0; font-size: var(--fs-md); font-weight: 600; overflow-wrap: anywhere; }
.doc-actions { margin-left: auto; display: inline-flex; gap: 6px; align-items: center; }
.doc-desc { margin: 0 0 10px; color: var(--text-soft); max-width: 80ch; }
.doc-view { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.doc-view > .reader-image { padding: 0; }
.doc-view .reader-image img { border: 0; border-radius: 0; max-height: none; }
.process-figure { margin: 0 0 12px; }
.process-figure img { display: block; max-width: 100%; height: auto; }
.process-figure figcaption { margin-top: 6px; font-size: var(--fs-base); color: var(--text-soft); max-width: 80ch; }
.process-xml > summary { font-size: var(--fs-base); }
.summary .readme { max-width: 80ch; }
.summary .readme p:last-child { margin-bottom: 0; }
.summary-more { margin-top: 8px; }
.summary-more > summary { font-size: var(--fs-base); }
.doc-view > .reader-image { padding: 16px; }
.doc-view .reader-page img { border: 0; border-radius: 0; }
.doc-view .reader-stage { padding: 0; background: var(--surface-2); }
.doc-view .reader-page { max-width: none; }
.jump { list-style: none; margin: 0 0 20px; padding: 0 0 12px; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: var(--fs-sm); }
.jump li { white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.lead .doc-view { margin-bottom: 8px; }

/* file lists: the Overview contents and the Downloads tab */
.files { width: 100%; border: 1px solid var(--line); border-radius: var(--radius); border-collapse: separate; border-spacing: 0; font-size: var(--fs-base); }
.files th { font-size: var(--fs-sm); background: var(--surface-2); border-bottom: 1px solid var(--line); }
.files th:first-child { border-top-left-radius: var(--radius); } .files th:last-child { border-top-right-radius: var(--radius); }
.files td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.files tr:last-child td { border-bottom: 0; }
.files .files-name { overflow-wrap: anywhere; }
.files .files-kind, .files .files-tab { white-space: nowrap; font-size: var(--fs-sm); }
.files .files-tab { text-align: right; }
.files .files-action { text-align: right; white-space: nowrap; }
.files-list { margin-bottom: 24px; }
.files-list td { padding: 6px 12px; }
.files-list .files-size, .files-list .files-date { white-space: nowrap; font-size: var(--fs-sm); }
.files-list tr.is-open td { background: var(--surface-2); }
.files-manage .files-kind { white-space: normal; }
.files-zip td { background: var(--surface-2); }
@media (max-width: 719px) {
  .files-list .files-size, .files-list .files-date, .files-list th:nth-child(3), .files-list th:nth-child(4),
  .files-manage td:nth-child(3), .files-manage th:nth-child(3) { display: none; }
  .files-list td { padding: 8px; }
  /* narrow screens: one block per file, the name on its own line */
  .files-dl thead { display: none; }
  .files-dl, .files-dl tbody { display: block; }
  .files-dl tr { display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: center; padding: 8px; border-bottom: 1px solid var(--line); }
  .files-dl tr:last-child { border-bottom: 0; }
  .files-dl td { display: inline-block; border: 0; padding: 0; white-space: normal; font-size: var(--fs-sm); }
  .files-dl td.files-name { display: block; width: 100%; font-size: var(--fs-base); }
  .files-dl td.files-action { margin-left: auto; }
}
.files .files-old td { color: var(--muted); }
.files-dl td { white-space: nowrap; }
.files-dl td.files-name { white-space: normal; }
.files-history { margin-top: 4px; }
.files-history > summary { min-height: 32px; font-size: var(--fs-sm); font-weight: 400; }
.files-history .versions { font-size: var(--fs-sm); }
.inline-form { display: inline; margin-left: 8px; }
.inline-form button { vertical-align: middle; }

/* figures: a plain list with captions, full size on click */
.figures { list-style: none; margin: 0; padding: 0; display: grid; gap: 24px; }
.figure + .figure { border-top: 1px solid var(--line); padding-top: 24px; }
.figure figure { margin: 0; }
/* width stays the attribute's (not auto), so the box is reserved before the file arrives */
.figure picture, .process-figure picture, .reader-image picture { display: block; max-width: 100%; }
.figure img { display: block; max-width: 100%; height: auto; background: #fff; }
.figure figcaption { margin: 0 0 8px; font-size: var(--fs-base); color: var(--text-soft); max-width: 80ch; }
.figure-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.figure-title { margin: 0; font-size: var(--fs-md); color: var(--text); overflow-wrap: anywhere; }
.figure-desc { margin: 4px 0 0; }
.figure figcaption .doc-actions { display: block; margin: 6px 0 0; }
/* every figure opens at full size: the picture is the link, and so is the line under it */
.figure-zoom { display: block; cursor: zoom-in; }
/* on the dark ground a figure drawn on white sits on a rounded light card with a margin
   of its own white, so it reads as a picture, not a bright slab */
:root[data-theme="dark"] .figure img, :root[data-theme="dark"] .process-figure img,
:root[data-theme="dark"] .reader-image img, :root[data-theme="dark"] .nb-out img {
  background: #ffffff; padding: 12px; border-radius: 8px; border: 1px solid #30363d; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .figure img, :root:not([data-theme="light"]) .process-figure img,
  :root:not([data-theme="light"]) .reader-image img, :root:not([data-theme="light"]) .nb-out img {
    background: #ffffff; padding: 12px; border-radius: 8px; border: 1px solid #30363d; }
}
.figure-open { margin: 6px 0 0; }
.figure-open a { display: inline-block; min-height: 24px; line-height: 24px; }

/* authors */
.author-list { list-style: none; margin: 0; padding: 0; }
.author-list > li { padding: 16px 0; border-top: 1px solid var(--line); }
.author-list > li:first-child { padding-top: 0; border-top: 0; }
.author { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: start; }
.author h2 { margin: 0; font-size: var(--fs-md); }
.author-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0 0 4px; }
.avatar-sm { width: 40px; height: 40px; margin: 0; border: 1px solid var(--line); font-size: var(--fs-md); }

/* manage */
.manage-section + .manage-section { margin-top: 28px; }
.manage-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); }
.manage-item { padding: 10px 14px; border-top: 1px solid var(--line); }
.manage-item:first-child { border-top: 0; }
.manage-item .doc-title { font-size: var(--fs-md); }
.manage-item details { margin-top: 4px; }
.manage-item details > summary { min-height: 28px; font-size: var(--fs-sm); }
.status-line { margin: 0 0 16px; font-size: var(--fs-base); color: var(--muted); }
.status-line .done { color: var(--text-soft); }
.status-line .current { color: var(--text); font-weight: 600; }
.review-note { padding: 8px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--text); font-size: var(--fs-base); }
.edit-project > summary { font-size: var(--fs-base); }
.manage-side { order: -1; }
@media (min-width: 920px) { .manage-side { order: 0; } }
.readme { overflow-wrap: anywhere; line-height: 1.6; }
.readme-title { font-size: var(--fs-sm); font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 12px; }
.readme-box .readme { max-width: 80ch; }
.use-password { margin: -6px 0 14px; }
.use-password > summary { font-size: var(--fs-base); font-weight: 400; }
.versions { list-style: none; margin: 4px 0 0; padding: 0; font-size: var(--fs-sm); }
.versions li { padding: 6px 0; border-top: 1px solid var(--line); }
.versions .superseded-label { font-weight: 600; color: var(--warn); }
.versions a { text-decoration: underline; text-underline-offset: 2px; }
.files-older > summary { font-size: var(--fs-sm); font-weight: 400; min-height: 32px; }
.license-line { font-size: var(--fs-sm); color: var(--muted); border-top: 1px solid var(--line); margin-top: 32px; padding-top: 12px; }
.credit-line { font-size: var(--fs-sm); color: var(--muted); margin-top: 4px; }
.disclosure { font-size: var(--fs-sm); color: var(--text-soft); background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 10px 12px; margin-top: 16px; }
.share-row { display: flex; flex-wrap: wrap; gap: 6px; }
.share-btn { min-height: 32px; padding: 0 10px; font-size: var(--fs-sm); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: var(--fs-base); margin: 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }

/* ---- visibility control ---------------------------------------------------------- */
.vis-form { display: grid; gap: 8px; }
.vis-options { display: flex; flex-wrap: wrap; gap: 6px; }
.vis-options label { font-weight: 400; font-size: var(--fs-base); display: inline-flex; align-items: center; gap: 6px; min-height: 32px;
  padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--radius); margin: 0; cursor: pointer; background: var(--surface); }
.vis-options label:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); }
.consent { font-size: var(--fs-sm); color: var(--text-soft); }
.inline-error { color: var(--danger); font-size: var(--fs-sm); }

/* ---- profile --------------------------------------------------------------------- */
.profile-card { margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.profile-body { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: start; }
.profile-body h1 { margin: 0 0 4px; font-size: var(--fs-xl); }
.profile-body .lede { margin: 0 0 8px; }
.avatar { width: 72px; height: 72px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-2);
  object-fit: cover; display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-xl); font-weight: 600; color: var(--muted); }

/* ---- auth and simple forms ------------------------------------------------------- */
.auth { max-width: 30rem; margin: 16px auto 0; }
.auth h1 { font-size: var(--fs-xl); }
.form-card { max-width: 46rem; }

/* ---- print ----------------------------------------------------------------------- */
@media print {
  body { background: #fff; color: #000; font-size: 11pt; }
  .site-header, .site-footer, .nav, .actions, .share-row, .vis-form, form, details:not([open]), .btn, button, .skip { display: none !important; }
  [data-scroll] { mask-image: none !important; -webkit-mask-image: none !important; }
  .doc-view, .files, .table-wrap { border-color: #999; break-inside: avoid; }
  .tabs, .reader-bar, .reader-text, .crumbs, .like-form, .repo-actions { display: none !important; }
  a { color: #000; text-decoration: none; }
  main { padding: 0; }
  .layout { grid-template-columns: 1fr; }
  /* a paged document prints every page, one per sheet, in order */
  .reader-pages .reader-page, .reader-pages .reader-page[hidden] { display: block !important; width: 100%; max-width: none; margin: 0; }
  .reader-pages .reader-page + .reader-page { break-before: page; }
  .reader-pages .reader-page img { border: 0; border-radius: 0; width: 100%; }
  .reader-stage { padding: 0; display: block; }
  .doc-view, .reader, .reader-stage { border: 0; break-inside: auto; overflow: visible; }
}

/* ---- reader (in-page views of artifacts) ---------------------------------------- */
.reader { background: var(--surface-2); }
.reader-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between;
  padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--surface); }
.reader-nav, .reader-tools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.reader-count { font-size: var(--fs-sm); color: var(--muted); min-width: 6ch; text-align: center; }
.reader-tools input.compact { min-height: 32px; width: 14rem; max-width: 100%; }
.reader-stage { padding: 12px; display: grid; justify-items: center; }
.reader-page { margin: 0; width: 100%; max-width: 920px; }
.reader-page img { display: block; width: 100%; height: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
/* a page rendered before its size was recorded reserves a letter-shaped box until it arrives */
.reader-page img:not([width]) { aspect-ratio: auto 17 / 22; }
.reader-pages.natural .reader-page { width: auto; max-width: none; overflow-x: auto; }
.reader-pages.natural .reader-page img { width: auto; max-width: none; }
.reader-text { margin-top: 8px; }
.reader-text pre { white-space: pre; font-family: var(--mono); font-size: var(--fs-sm); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; max-height: 50vh; overflow: auto; }
.reader-pages:focus-visible { outline-offset: -3px; }
.reader-image { margin: 0; padding: 12px; display: grid; justify-items: center; }
.reader-image img { max-height: 70vh; width: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.reader-video video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; max-height: 72vh; background: #000; }
.reader-video video:focus-visible, video:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.reader-audio { padding: 12px; } .reader-audio audio { width: 100%; }
.reader-transcript { padding: 8px 12px 12px; }
.reader-transcript .readme { max-height: 40vh; overflow: auto; }
.reader-pending { padding: 12px; }
.reader-note { padding: 6px 12px; margin: 0; }
.reader-sheet table { font-size: var(--fs-sm); }
/* a rendered sheet: the workbook as LibreOffice draws it, at 1x inside a scrolling strip
   or fitted to the column; Values swaps in the plain table */
.reader-table .reader-nav[role="tablist"] { gap: 0; flex-wrap: nowrap; overflow-x: auto; max-width: 100%; }
.reader-table .reader-nav [role="tab"] { border: 0; background: none; border-radius: 0; padding: 4px 10px 6px; min-height: 32px;
  color: var(--text-soft); border-bottom: 2px solid transparent; font-weight: 500; }
.reader-table .reader-nav [role="tab"]:hover { color: var(--text); background: var(--surface-2); }
.reader-table .reader-nav [role="tab"][aria-selected="true"] { color: var(--text); font-weight: 600; border-bottom-color: var(--accent); }
.sheet-render { margin: 0; background: var(--surface); }
.sheet-scroll { overflow: auto; max-height: 80vh; }
.sheet-scroll a { display: block; width: max-content; max-width: 100%; }
.sheet-render img { display: block; max-width: none; height: auto; background: #fff; cursor: zoom-in; }
.reader-table.fit .sheet-scroll a { width: auto; }
.reader-table.fit .sheet-render img { max-width: 100%; }
.sheet-render figcaption { padding: 6px 12px; border-top: 1px solid var(--line); }
/* on a phone the fitted sheet is a thumbnail: a plain link opens it at full size */
.sheet-open { display: block; min-height: 32px; line-height: 32px; }
@media (min-width: 720px) { .sheet-open { display: none; } .sheet-render figcaption.sheet-open-only { display: none; } }
.reader-table.has-renders:not(.values) .has-render .sheet-values { display: none; }
.reader-table.has-renders:not(.values) [data-values-only] { display: none; }
.reader-table.values .has-render.has-table .sheet-render { display: none; }
.reader-sheet td { white-space: nowrap; max-width: 28ch; overflow: hidden; text-overflow: ellipsis; }
/* a sentence in a cell (a dashboard's notes) wraps in full instead of ending in an ellipsis */
.reader-sheet td.wrap { white-space: normal; max-width: none; }
.reader-sheet td.wrap > div { min-width: 28ch; max-width: 60ch; }
/* the first column holds the row labels: it wraps rather than ending in an ellipsis, and
   a long label anywhere wraps (td.wrap, over 28 characters) with its full text as a title */
.reader-sheet td:first-child { white-space: normal; overflow-wrap: anywhere; min-width: 12ch; }
@media (max-width: 719px) { .reader-sheet td.wrap > div { min-width: 18ch; } }
/* a pressed reader tool (Fit width, Values, Outputs, Wrap) reads as switched on */
.reader-tools button[aria-pressed="true"] { background: var(--surface-3); border-color: var(--text-soft); font-weight: 600; }
.th-sort { all: unset; cursor: pointer; font: inherit; font-weight: 600; display: flex; align-items: center; width: 100%;
  min-width: 24px; min-height: 32px; padding: 6px 0; box-sizing: border-box; }
/* a dashboard table's own title row, shown as its caption (reader.preview.shape_table) */
.table-wrap caption.table-title { caption-side: top; text-align: left; font-weight: 600; padding: 8px 10px 4px; }
.table-wrap caption .table-note { display: block; font-weight: 400; font-size: var(--fs-sm); color: var(--text-soft); margin-top: 2px; white-space: normal; }
th:has(> .th-sort) { padding-top: 0; padding-bottom: 0; }
.th-sort:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.th-sort::after { content: ""; display: inline-block; width: 0; height: 0; margin-left: 6px; vertical-align: middle;
  border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid var(--line-strong); }
.th-sort[data-dir="asc"]::after { border-top: 0; border-bottom: 5px solid var(--accent); }
.th-sort[data-dir="desc"]::after { border-top: 5px solid var(--accent); }
/* a sheet laid out for reading (blank header cells, a dashboard) keeps plain headers */
.reader-sheet th.th-plain { font-weight: 600; }
.reader-sheet tr.th-blank th { padding: 0; height: 0; border: 0; }
/* a table with no header row (a label and value dashboard): the generic column names are for screen readers only */
.reader-sheet thead.sr-head th { padding: 0; height: 0; border: 0; background: none; line-height: 0; }
.reader-sheet .sheet-slicers { margin: 6px 0 0; }
.code-frame { padding: 0; overflow: auto; max-height: 70vh; font-size: var(--fs-sm); background: var(--surface); }
/* the code arrives after the page (reader.js fetches it), so its frame keeps the height
   it will have: 70vh for a long file, the line count times the 19.5px line plus the
   padding for a short one (no layout shift when it lands) */
.code-frame.code-long { min-height: 70vh; }
.code-frame[data-lines="1"] { min-height: min(70vh, 41.5px); } .code-frame[data-lines="2"] { min-height: min(70vh, 61px); } .code-frame[data-lines="3"] { min-height: min(70vh, 80.5px); } .code-frame[data-lines="4"] { min-height: min(70vh, 100px); } .code-frame[data-lines="5"] { min-height: min(70vh, 119.5px); } .code-frame[data-lines="6"] { min-height: min(70vh, 139px); } .code-frame[data-lines="7"] { min-height: min(70vh, 158.5px); } .code-frame[data-lines="8"] { min-height: min(70vh, 178px); } .code-frame[data-lines="9"] { min-height: min(70vh, 197.5px); } .code-frame[data-lines="10"] { min-height: min(70vh, 217px); } .code-frame[data-lines="11"] { min-height: min(70vh, 236.5px); } .code-frame[data-lines="12"] { min-height: min(70vh, 256px); } .code-frame[data-lines="13"] { min-height: min(70vh, 275.5px); } .code-frame[data-lines="14"] { min-height: min(70vh, 295px); } .code-frame[data-lines="15"] { min-height: min(70vh, 314.5px); } .code-frame[data-lines="16"] { min-height: min(70vh, 334px); } .code-frame[data-lines="17"] { min-height: min(70vh, 353.5px); } .code-frame[data-lines="18"] { min-height: min(70vh, 373px); } .code-frame[data-lines="19"] { min-height: min(70vh, 392.5px); } .code-frame[data-lines="20"] { min-height: min(70vh, 412px); } .code-frame[data-lines="21"] { min-height: min(70vh, 431.5px); } .code-frame[data-lines="22"] { min-height: min(70vh, 451px); } .code-frame[data-lines="23"] { min-height: min(70vh, 470.5px); } .code-frame[data-lines="24"] { min-height: min(70vh, 490px); } .code-frame[data-lines="25"] { min-height: min(70vh, 509.5px); } .code-frame[data-lines="26"] { min-height: min(70vh, 529px); } .code-frame[data-lines="27"] { min-height: min(70vh, 548.5px); } .code-frame[data-lines="28"] { min-height: min(70vh, 568px); } .code-frame[data-lines="29"] { min-height: min(70vh, 587.5px); } .code-frame[data-lines="30"] { min-height: min(70vh, 607px); } .code-frame[data-lines="31"] { min-height: min(70vh, 626.5px); } .code-frame[data-lines="32"] { min-height: min(70vh, 646px); } .code-frame[data-lines="33"] { min-height: min(70vh, 665.5px); } .code-frame[data-lines="34"] { min-height: min(70vh, 685px); } .code-frame[data-lines="35"] { min-height: min(70vh, 704.5px); } .code-frame[data-lines="36"] { min-height: min(70vh, 724px); } .code-frame[data-lines="37"] { min-height: min(70vh, 743.5px); } .code-frame[data-lines="38"] { min-height: min(70vh, 763px); } .code-frame[data-lines="39"] { min-height: min(70vh, 782.5px); } .code-frame[data-lines="40"] { min-height: min(70vh, 802px); } .code-frame[data-lines="41"] { min-height: min(70vh, 821.5px); } .code-frame[data-lines="42"] { min-height: min(70vh, 841px); } .code-frame[data-lines="43"] { min-height: min(70vh, 860.5px); } .code-frame[data-lines="44"] { min-height: min(70vh, 880px); } .code-frame[data-lines="45"] { min-height: min(70vh, 899.5px); } .code-frame[data-lines="46"] { min-height: min(70vh, 919px); } .code-frame[data-lines="47"] { min-height: min(70vh, 938.5px); } .code-frame[data-lines="48"] { min-height: min(70vh, 958px); }
.code-frame .hl { margin: 0; }
.code-frame table.highlighttable { width: 100%; border-collapse: collapse; }
.code-frame .highlighttable td { padding: 0; border: 0; vertical-align: top; }
.code-frame .linenos { color: var(--muted); text-align: right; padding: 10px 8px 10px 12px; user-select: none;
  background: var(--surface-2); border-right: 1px solid var(--line); }
.code-frame pre { margin: 0; padding: 10px; font-family: var(--mono); line-height: 1.5; }
.reader-code.wrap .code-frame pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.code-frame .md-doc { padding: 16px 20px; font-size: var(--fs-base); max-width: 72ch; }
.code-frame .md-doc h3, .code-frame .md-doc h4, .code-frame .md-doc h5, .code-frame .md-doc h6 { margin: 1.2em 0 .4em; }
.code-frame .md-doc h3 { font-size: var(--fs-lg); padding-bottom: .3em; border-bottom: 1px solid var(--line); }
.code-frame .md-doc h4 { font-size: var(--fs-md); }
.table-scroll { overflow-x: auto; max-width: 100%; }
.table-scroll:focus-visible { outline: 2px solid var(--accent, #0969da); outline-offset: 2px; }
.code-frame .md-doc table { border-collapse: collapse; margin: .6em 0 1em; font-size: var(--fs-sm); }
.code-frame .md-doc th, .code-frame .md-doc td { border: 1px solid var(--line); padding: 5px 10px; text-align: left; vertical-align: top; }
.code-frame .md-doc th { background: var(--surface-2, var(--surface)); font-weight: 600; }
.code-frame .md-doc pre { background: var(--surface-2, var(--surface)); border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; }
.code-frame .md-doc hr { border: 0; border-top: 1px solid var(--line); margin: 1.4em 0; }
.nb-cells { padding: 12px; display: grid; gap: 12px; } /* not .nb: pygments uses that class for builtins */
.nb-md { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; }
.nb-md h3, .nb-md h4, .nb-md h5, .nb-md h6 { font-size: var(--fs-md); margin-top: .2em; }
.nb-code { display: grid; gap: 6px; }
.nb-in { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: auto; font-size: var(--fs-sm); }
.nb-in .hl { margin: 0; } .nb-in pre { margin: 0; padding: 10px 12px; font-family: var(--mono); line-height: 1.5; }
.nb-in .linenos { display: none; }
.nb-count { position: absolute; right: 10px; top: 6px; font-family: var(--mono); font-size: var(--fs-xs); color: var(--muted); }
.nb-out { background: var(--surface); border-left: 3px solid var(--line-strong); padding: 8px 12px; }
.nb-out pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--mono); font-size: var(--fs-sm); line-height: 1.5;
  max-height: 40vh; overflow: auto; }
.nb-out-error { border-left-color: var(--danger); }
.nb-out-error pre { color: var(--danger); }
.nb-out img { max-width: 100%; height: auto; display: block; }

/* ---- spreadsheet dashboards ------------------------------------------------------- */
.chart-card { margin: 0; padding: 12px 12px 6px; background: var(--surface); border-bottom: 1px solid var(--line); color: var(--text); }
.chart-card svg { display: block; width: 100%; max-width: 100%; height: auto; }
/* reader.charts draws every chart twice: the wide one for a column, the narrow one
   (horizontal bars, labels above, 12px type) for a phone; the card shows one of them */
/* the wide drawing is never shown above its drawn size, so its 12-unit labels stay 12px */
.chart-card .chart-wide { max-width: 720px; }
.chart-card .chart-narrow { display: none; }
@media (max-width: 719px) { .chart-card .chart-wide { display: none; } .chart-card .chart-narrow { display: block; } }
.embed-form { display: grid; gap: 10px; }
.embed-form ul { list-style: none; margin: 0; padding: 0; }

/* ---- theme switch -------------------------------------------------------------- */
.theme-switch { min-height: 32px; padding: 0 8px; border-radius: var(--radius); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text-soft); font-weight: 400; font-size: var(--fs-sm); margin-left: 2px; }
.theme-switch .theme-icon { flex: none; }
.theme-switch[aria-pressed="true"] { background: var(--surface-3); color: var(--text); }
/* the switch shows its state: a small track whose knob sits left (off) or right and filled (on) */
.theme-track { position: relative; flex: none; width: 24px; height: 14px; border: 1.5px solid currentColor; border-radius: 7px; }
.theme-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.theme-switch[aria-pressed="true"] .theme-track { background: currentColor; }
.theme-switch[aria-pressed="true"] .theme-track::after { left: 12px; background: var(--surface); }
@media (prefers-reduced-motion: no-preference) { .theme-track::after { transition: left .15s ease; } }

/* ---- project page flow: lead, at a glance, try it, grouped work ---------------- */
.badge-live { color: var(--ok); border-color: var(--ok); }
.glance { display: grid; gap: 0; grid-template-columns: 1fr; margin: 0; border-bottom: 1px solid var(--line); }
.glance > div { display: grid; grid-template-columns: 1fr; gap: 2px; padding: 0 0 12px; }
.glance > div + div { padding-top: 12px; border-top: 1px solid var(--line); }
@media (min-width: 640px) { .glance > div { grid-template-columns: 160px 1fr; gap: 12px; } }
.glance dt { font-size: var(--fs-sm); font-weight: 600; color: var(--muted); margin: 0; padding-top: 2px; }
.glance dd { margin: 0; line-height: 1.5; overflow-wrap: anywhere; font-size: var(--fs-md); }
.glance dd { font-weight: 400; }
.try { border-top: 1px solid var(--line); padding: 16px 0 0; }
.try-form .actions button { font-weight: 500; }
.try-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.try-head h2 { margin: 0; font-size: var(--fs-md); }
.try-inputs { display: grid; gap: 12px; grid-template-columns: 1fr; margin: 12px 0 4px; }
@media (min-width: 700px) { .try-inputs { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); } }
.try-input label { display: block; font-weight: 600; margin-bottom: 4px; }
.try-pair { display: grid; grid-template-columns: 1fr 7.5em; gap: 10px; align-items: center; }
/* a percent field says so beside the box, so 5 reads as 5 percent and not 0.05 */
.try-pair.has-unit { grid-template-columns: 1fr 7.5em auto; }
.try-unit { color: var(--muted); font-size: var(--fs-sm); }
/* a slider is at least 24 px tall, so the thumb is easy to catch (WCAG 2.5.8) */
.try-pair input[type=range] { width: 100%; accent-color: var(--accent); min-height: 24px; margin: 0; padding: 0; }
/* result tiles: one column on a phone, two from 480px, then the count the template
   chose so no tile sits alone on the last row (core.templatetags.folio.kpi_grid) */
.try-outputs { display: grid; gap: 8px 16px; grid-template-columns: 1fr; margin: 12px 0 8px; }
@media (min-width: 480px) {
  .try-outputs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .try-outputs.cols-1 { grid-template-columns: minmax(0, 1fr); }
  .try-outputs.odd > div:last-child { grid-column: 1 / -1; }
}
@media (min-width: 900px) {
  .try-outputs.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .try-outputs.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .try-outputs.odd > div:last-child { grid-column: auto; }
  .try-outputs.span-last > div:last-child { grid-column: 1 / -1; }
}
.try-outputs .try-rule { margin: 4px 0 0; font-size: var(--fs-sm); font-weight: 400; color: var(--text-soft); max-width: 40ch; }
.try-check { display: flex; align-items: center; gap: 8px; align-self: end; min-height: 32px; }
.try-check label { margin: 0; }
.try-check input[type=checkbox] { margin-top: 0; width: 22px; height: 22px; }
.try-outputs > div { border-top: 1px solid var(--line); padding: 8px 0 4px; }
.try-outputs dt { font-size: var(--fs-sm); color: var(--muted); }
.try-outputs dd { margin: 2px 0 0; font-size: var(--fs-lg); font-weight: 600; overflow-wrap: anywhere; }
.try-error { color: var(--warn); font-weight: 600; }
.try-results[aria-busy=true] { opacity: .55; }
.try-note { margin-top: 8px; max-width: 75ch; }
.structure { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.structure li { display: grid; grid-template-columns: 18px 1fr; gap: 6px; align-items: start; font-size: var(--fs-base); }
.structure .mark { display: inline-block; width: 16px; height: 16px; border-radius: 50%; color: var(--ok); text-align: center; font-size: var(--fs-xs); font-weight: 700; line-height: 16px; }
.structure .mark.open { color: var(--warn); }
.card-result { color: var(--text); font-weight: 600; }
.reading-order { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: var(--fs-base); }
.reading-order a { text-decoration: none; }

/* ---- visitors: like, share, comments ---- */
.like-btn .count { font-variant-numeric: tabular-nums; color: var(--muted); }
.like-btn.is-liked { color: var(--danger); border-color: var(--danger); background: var(--danger-soft); }
.comments { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 10px; }
.comment { border-top: 1px solid var(--line); padding-top: 8px; }
.comment.is-pending { border-left: 3px solid var(--warn); padding-left: 10px; }
.comment p { margin: 4px 0 0; overflow-wrap: anywhere; }
.comment-reply { margin: 8px 0 0 16px; padding-left: 10px; border-left: 3px solid var(--line-strong); }
.comment .actions { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.comment .actions form { margin: 0; display: inline-flex; gap: 6px; }
.reply-form input { min-width: 240px; }
.comment-form .field-row { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .comment-form .field-row { grid-template-columns: 1fr 1fr; } }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
/* the two fields side by side keep the form's own rhythm: no field margin under the row */
.comment-form.stack > * + * { margin-top: 16px; }
.comment-form .field { margin-bottom: 0; }
.comment-form .field .help { margin: 4px 0 0; }
/* running text at a readable line length (the AI notice, legal pages) */
.measure p, .measure li { max-width: 72ch; }

/* ---- originality: a summary line, then plain tables ------------------------------ */
.orig-explainer { color: var(--text-soft); max-width: 80ch; margin: 0 0 12px; }
.orig-strip { display: flex; flex-wrap: wrap; gap: 8px 32px; margin: 0 0 16px; padding: 12px 0; border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line); font-size: var(--fs-base); }
.orig-strip > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.orig-strip dt { color: var(--muted); font-size: var(--fs-xs); font-weight: 600; }
.orig-strip dd { margin: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.band-copy { color: var(--danger); border-color: var(--danger); }
.band-overlap { color: var(--warn); border-color: var(--warn); }
.band-distinct { color: var(--ok); border-color: var(--ok); }
.orig-matches td, .orig-flagged li { font-size: var(--fs-base); }
.orig-passages td { font-size: var(--fs-sm); white-space: normal; min-width: 18rem; }
.orig-quote { margin: 0; padding: 6px 0 6px 12px; border-left: 3px solid var(--line-strong); }
.orig-quote + .orig-quote { margin-top: 8px; }
.orig-matches td:first-child { min-width: 14rem; }
.orig-passages ul { margin: 0; padding-left: 18px; }
.orig-passages li + li, .orig-flagged li + li { margin-top: 6px; }
.orig-flagged { list-style: none; margin: 0; padding: 0; }
.orig-flagged li { padding: 8px 0; border-top: 1px solid var(--line); }
.orig-flagged li:first-child { border-top: 0; }
.orig-flagged { margin-bottom: 8px; }
.wrap-narrow-left { max-width: 72rem; }
.wrap-narrow-left > .orig-strip:first-child { border-top: 0; padding-top: 0; }
.wrap-narrow-left > .orig-strip:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }

/* Professor-only rubric on Manage */
.rubric { width: 100%; border: 1px solid var(--line); border-radius: var(--radius); border-collapse: separate; border-spacing: 0; font-size: var(--fs-base); margin-bottom: 12px; }
.rubric th { font-size: var(--fs-sm); background: var(--surface-2); border-bottom: 1px solid var(--line); text-align: left; padding: 8px 12px; }
.rubric td { padding: 6px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.rubric tbody tr:last-child td { border-bottom: 0; }
.rubric tfoot th, .rubric tfoot td { border-top: 1px solid var(--line); border-bottom: 0; font-weight: 600; }
.rubric input[type="number"] { width: 5.5rem; }
.rubric input[type="text"] { width: 100%; min-width: 12rem; }
@media (max-width: 720px) { .rubric thead { display: none; } .rubric tr { display: block; padding: 8px 0; } .rubric td { display: block; border: 0; padding: 4px 12px; } .rubric tbody tr { border-bottom: 1px solid var(--line); } }

/* Compare two versions of a file (projects.compare, templates/projects/compare_versions.html). */
pre.diff { overflow-x: auto; padding: 8px 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); font: var(--fs-sm)/1.5 var(--mono); }
pre.diff span { display: block; padding: 0 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.diff-add { background: var(--ok-soft); color: var(--text); }
.diff-del { background: var(--danger-soft); color: var(--text); }
.diff-hunk { color: var(--muted); }
.compare-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.compare-grid img { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); margin-bottom: 8px; }
