/* page.css — THE PAGES' OWN LOOK, over the UI kit's stylesheet (which resets every element) and
   the mind's theme.css, whose colours these are. */
body { margin: 0; font-size: 0.875rem; }
a { text-decoration: underline; text-underline-offset: 2px; }
code, pre { font-family: var(--font-mono, ui-monospace, monospace); font-size: 0.75rem; }
h1 { font-size: 1.125rem; font-weight: 600; margin-bottom: 0.75rem; }
.where { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.5rem;
  padding: 0.625rem 1rem; border-bottom: 1px solid var(--border); }
.where nav { display: flex; gap: 1rem; }
.where nav a { text-decoration: none; color: var(--muted-foreground); }
.where nav a[aria-current] { color: var(--foreground); font-weight: 600; }
.where .clone { margin-left: auto; }
.clone { color: var(--muted-foreground); user-select: all; }
.tag { border: 1px solid var(--border); border-radius: 999px; padding: 0 0.5rem;
  font-size: 0.75rem; color: var(--muted-foreground); }
.note, .by, .at { color: var(--muted-foreground); }
main > h1, main > ul, main > p, .commit { margin-left: 1rem; margin-right: 1rem; }
main > h1 { margin-top: 1rem; }
.repos li, .commits li { padding: 0.25rem 0; }
.repos .clone { margin-left: 0.75rem; }

.code { display: grid; grid-template-columns: 17rem minmax(0, 1fr); }
#tree { position: sticky; top: 0; height: 100vh; overflow: auto;
  border-right: 1px solid var(--border); }
#content { min-width: 0; padding: 0.875rem 1.25rem 3rem; }
@media (max-width: 48rem) { .code { display: block; } #tree { display: none; } }
.crumbs { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.35rem;
  margin-bottom: 0.75rem; }
.crumbs .at { margin-left: auto; font-size: 0.75rem; }
/* a file's actions: icons at the right of the row of its name */
.crumbs .acts { display: inline-flex; align-self: center; gap: 0.125rem; margin-left: 0.25rem; }
.acts a { display: inline-flex; padding: 0.25rem; border-radius: 0.375rem;
  color: var(--muted-foreground); }
.acts a:hover, .acts a:focus-visible { background: var(--accent); color: var(--foreground); }
.entries { border: 1px solid var(--border); border-radius: 0.5rem; overflow: hidden; }
.entries li + li { border-top: 1px solid var(--border); }
.entries a { display: block; padding: 0.3rem 0.75rem; text-decoration: none;
  font-family: var(--font-mono, ui-monospace, monospace); font-size: 0.8125rem; }
.entries a:hover { background: var(--accent); }
.readme { margin-top: 1.25rem; border: 1px solid var(--border); border-radius: 0.5rem; }
.readme > h2 { padding: 0.4rem 0.75rem; border-bottom: 1px solid var(--border);
  font-size: 0.75rem; color: var(--muted-foreground); }
.readme > :not(h2), .markdown { padding: 1rem 1.25rem; }
#content > .markdown { padding: 0; }
pre { overflow: auto; line-height: 1.5; }
#content > pre, #content > .file { border: 1px solid var(--border); border-radius: 0.5rem; }
#content > pre { padding: 0.75rem; }
#content > .file { overflow: hidden; }
#content > .note { margin-bottom: 0.5rem; font-size: 0.75rem; }

.commit { margin-top: 1rem; margin-bottom: 3rem; }
.commit .message { margin-bottom: 0.75rem; white-space: pre-wrap; }
.commit > p { margin-bottom: 0.5rem; }
.changes { margin-bottom: 1.5rem; }
.changes li, .changed > summary { font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.8125rem; }
.changed { margin-top: 1.25rem; border: 1px solid var(--border); border-radius: 0.5rem; }
/* the file's name stays at the top of the window while its diff is read */
.changed > summary { position: sticky; top: 0; z-index: 1; padding: 0.4rem 0.75rem;
  cursor: pointer; background: var(--background); border-radius: 0.5rem; }
.changed[open] > summary { border-bottom: 1px solid var(--border);
  border-radius: 0.5rem 0.5rem 0 0; }
.changed > .note { padding: 0.5rem 0.75rem; }
.diff { min-height: 4rem; overflow: hidden; border-radius: 0 0 0.5rem 0.5rem; }
/* a diff as plain text: what is there before the script draws it, and when no script loads */
.diff > .plain { padding: 0.5rem 0.75rem; }
.plain .came { color: light-dark(oklch(0.45 0.15 150), oklch(0.78 0.15 150)); }
.plain .went { color: var(--destructive); }
.plain .part { color: var(--muted-foreground); }
/* the script did not load (pages.ts sets the class): say so, and what helps */
.unloaded main::before { content: "This page's script did not load, so the page shows plain text. Reload it to try again.";
  display: block; margin: 0.75rem 1rem 0; padding: 0.4rem 0.75rem; border: 1px solid var(--border);
  border-radius: 0.5rem; color: var(--muted-foreground); font-size: 0.8125rem; }
.status { font-weight: 600; }
.status.added { color: light-dark(oklch(0.5 0.15 150), oklch(0.75 0.15 150)); }
.status.deleted { color: var(--destructive); }
.status.modified { color: light-dark(oklch(0.5 0.13 250), oklch(0.75 0.13 250)); }

/* ── pulls ── */
h2 { margin: 1.5rem 0 0.5rem; font-size: 0.9375rem; font-weight: 600; }
main > h2, main > details { margin-left: 1rem; margin-right: 1rem; }
.pulls li, .branches li { padding: 0.25rem 0; }
.releases { list-style: none; padding: 0; }
.releases li { padding: 0.5rem 0; }
.releases .notes { margin: 0.25rem 0 0; white-space: pre-wrap; font-size: 0.8125rem; color: var(--muted-foreground); }
.done { margin-top: 1.25rem; }
.done summary { cursor: pointer; color: var(--muted-foreground); }
.pull { margin: 1rem 1rem 3rem; }
.pull > p { margin-bottom: 0.5rem; }
.pull .changes { margin-bottom: 1.5rem; }
.tag.open { color: light-dark(oklch(0.5 0.15 150), oklch(0.75 0.15 150)); }
.tag.merged { color: light-dark(oklch(0.5 0.15 300), oklch(0.75 0.15 300)); }
/* A BORDER IS A THREAD'S OR A TEXT FIELD'S, and nothing else's: a box that writes has none. */
.body { margin: 0.75rem 0 1rem; max-width: 46rem; }
.body .markdown { padding: 0; }
.thread { margin: 0.5rem 0; max-width: 46rem; border: 1px solid var(--border);
  border-radius: 0.5rem; background: var(--background);
  font-family: var(--font-sans, system-ui, sans-serif); font-size: 0.8125rem; white-space: normal; }
.thread.resolved { opacity: 0.6; }
/* a thread folded under one line, in the conversation */
.thread > .place { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.35rem;
  padding: 0.4rem 0.75rem; cursor: pointer; color: var(--muted-foreground); font-size: 0.75rem; }
.thread > .place .count { margin-left: auto; }
.thread[open] > .place { border-bottom: 1px solid var(--border); }
.thread .quote { display: block; max-height: 7.5rem; padding: 0.4rem 0.75rem; overflow: auto;
  border-bottom: 1px solid var(--border); white-space: pre; }
.comment { padding: 0.5rem 0.75rem; }
.comment .by { margin-bottom: 0.25rem; font-size: 0.75rem; }
.comment pre { white-space: pre-wrap; font-family: inherit; font-size: inherit; }
.thread .actions { position: relative; padding: 0.25rem 0.75rem 0.5rem; }
.reply summary { display: inline-block; cursor: pointer; color: var(--muted-foreground);
  font-size: 0.75rem; }
.reply[open] summary { margin-bottom: 0.5rem; }
/* beside "Reply", whether the reply box is open or shut */
.thread .resolve { position: absolute; top: 0.1rem; right: 0.75rem; padding: 0.1rem 0.6rem;
  font-size: 0.75rem; }
/* a thread or a draft on lines of a diff: pierre lays it out under the last of them */
.diff .thread, .diff .box { margin: 0.5rem; }

.box { display: grid; gap: 0.5rem; max-width: 46rem; margin: 0.75rem 0;
  font-family: var(--font-sans, system-ui, sans-serif); font-size: 0.8125rem; white-space: normal; }
.thread .box { margin: 0; }
.box input, .box textarea { width: 100%; padding: 0.4rem 0.6rem; border: 1px solid var(--input);
  border-radius: 0.375rem; background: var(--background); font: inherit; }
.box textarea { min-height: 4.5rem; resize: vertical; }
.box .row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.box .problem { color: var(--destructive); }
button { padding: 0.3rem 0.75rem; border: 1px solid var(--border); border-radius: 0.375rem;
  background: var(--secondary); color: var(--secondary-foreground); font-size: 0.8125rem;
  cursor: pointer; }
button.main { border-color: var(--primary); background: var(--primary);
  color: var(--primary-foreground); }
button:disabled { opacity: 0.5; cursor: default; }
.merge { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.75rem 0; }
.merge .box { margin: 0; }
h1 code { font-size: 0.9em; }

/* ── the page that edits a file ── */
.edit { margin: 1rem 1rem 3rem; }
.edit > .crumbs { margin-bottom: 0.75rem; }
#edit-text { display: block; width: 100%; min-height: 60vh; padding: 0.75rem;
  border: 1px solid var(--input); border-radius: 0.5rem; background: var(--background);
  font-family: var(--font-mono, ui-monospace, monospace); font-size: 0.8125rem; line-height: 1.5;
  tab-size: 2; white-space: pre; overflow: auto; resize: vertical; }
#commit h2 { margin: 0; }
.box .choice { display: flex; align-items: baseline; gap: 0.5rem; }
.box .choice input { width: auto; }
/* the branch's name is asked for when the commit goes to a new branch */
.box input[name="branch"] { display: none; max-width: 24rem;
  font-family: var(--font-mono, ui-monospace, monospace); font-size: 0.75rem; }
.box:has(input[value="branch"]:checked) input[name="branch"] { display: block; }
