/* ─────────── note header ─────────── */
.screen-head { padding: 0 var(--pad); }
/* a heading with no note behind it, so it needs its own gap before the list */
.page-head { padding: 0 var(--pad) 0.875rem; }
.crumb {
  margin-bottom: 0.8125rem;
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
  font-family: var(--mono);
  font-size: 0.71875rem;
  letter-spacing: .03em;
  color: var(--faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0;
}
.crumb b { color: var(--muted); font-weight: 500; }
.crumb a { color: inherit; text-decoration: none; }
.screen-title { margin: 0; font-size: 1.5625rem; font-weight: 600; line-height: 1.22; letter-spacing: -.025em; overflow-wrap: break-word; }
/* ─────────── prose ─────────── */
.prose {
  padding: 1.375rem var(--pad) 0.5rem;
  font-size: 1.03125rem;
  line-height: 1.63;
  color: #dde2ea;
  overflow-wrap: anywhere;
}
.prose p { margin: 0 0 1.0625rem; }
.prose h2 { font-size: 0.9375rem; font-weight: 600; letter-spacing: .02em; margin: 1.875rem 0 0.6875rem; color: var(--text); }
/* a heading jumped to should not sit flush against the top edge */
.prose :is(h1, h2, h3, h4, h5, h6) { scroll-margin-top: 0.875rem; }
.prose h3 { font-size: 0.875rem; font-weight: 600; margin: 1.5rem 0 0.5625rem; color: var(--muted); }
.prose ul, .prose ol { margin: 0 0 1.0625rem; padding-left: 1.25rem; }
.prose li { margin-bottom: 0.4375rem; }
.prose li::marker { color: var(--faint); }
.prose code {
  font-family: var(--mono);
  font-size: .86em;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.3125rem;
  padding: 0.09375rem 0.3125rem;
  color: #c9d3e0;
}
.prose pre {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.625rem;
  padding: 0.8125rem 0.875rem;
  overflow-x: auto;
  margin: 0 0 1.125rem;
}
.prose pre code { background: none; border: 0; padding: 0; font-size: 0.8rem; line-height: 1.6; white-space: pre; }
/* Feed and page bodies are someone else's HTML: they arrive with whatever width
 * their author gave them, so everything embedded is held to the column. */
.prose img, .prose video, .prose iframe, .prose embed, .prose object, .prose svg {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  margin: 0 0 1.0625rem;
}
.prose figure { margin: 0 0 1.0625rem; }
.prose figcaption { margin-top: 0.375rem; font-size: 0.78125rem; color: var(--muted); }
/* a wide table scrolls itself rather than stretching the page */
.prose table { display: block; width: max-content; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin: 0 0 1.0625rem; font-size: 0.84375rem; }
.prose :is(th, td) { border: 1px solid var(--line); padding: 0.375rem 0.625rem; text-align: left; vertical-align: top; }
.prose th { color: var(--text); font-weight: 600; }
.prose blockquote { margin: 0 0 1.0625rem; padding: 0.125rem 0 0.125rem 0.9375rem; border-left: 2px solid var(--line-strong); color: var(--muted); }
/* A section break, in the app's own line colour. Left alone it takes the
 * browser's default rule, which on this background is a near-white bar louder
 * than anything else in a note. A background rather than a border, so it is one
 * hairline and not the inset pair a default hr draws. */
.prose hr { height: 1px; margin: 1.875rem 0; border: 0; background: var(--line); }
.prose a, .prose a:link, .prose a:visited, .prose a:hover, .prose a:active, .inline-link {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid rgba(143, 184, 232, .3);
  cursor: pointer;
}

/* Dashed means "doesn't exist yet". Solid = exists, you'll open it. */
.wikilink { color: var(--link); border-bottom: 1px solid rgba(143, 184, 232, .3); cursor: pointer; text-decoration: none; }
.wikilink-missing { color: var(--unresolved); border-bottom: 1px dashed rgba(201, 138, 122, .5); cursor: pointer; text-decoration: none; }
.url { color: var(--link); word-break: break-all; }
.tag {
  display: inline-block;
  line-height: 1.5;
  font-family: var(--mono);
  font-size: .84em;
  color: var(--muted);
  cursor: pointer;
  text-decoration: none;
}

/* ─────────── table of contents ─────────── */
/* Collapsed by default: on a phone a long note's headings would otherwise push
 * the note itself off the screen. */
.toc { margin: 0.875rem var(--pad) 0; border: 1px solid var(--line); border-radius: 0.625rem; background: var(--surface); }
.toc > summary {
  cursor: pointer;
  padding: 0.625rem 0.8125rem;
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--faint);
}
.toc > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
.toc[open] > summary { border-bottom: 1px solid var(--line); }
.toc ul { margin: 0; padding: 0.375rem 0 0.375rem 1.25rem; list-style: none; }
.toc > div > ul { padding: 0.625rem 0.8125rem 0.75rem 1.25rem; }
.toc li { margin: 0; padding: 0.125rem 0; }
.toc a { color: var(--link); font-size: 0.84375rem; line-height: 1.5; }
.toc a:hover { text-decoration: underline; text-underline-offset: 0.1875rem; }

/* ─────────── note edges ─────────── */
.edges { margin-top: 1.625rem; border-top: 1px solid var(--line); padding: 0 var(--pad) 1.875rem; }
.edge-section { padding-top: 1.375rem; }
.edge-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 0.625rem; }
.edge-head .edge-label { font-family: var(--mono); font-size: 0.625rem; letter-spacing: .13em; text-transform: uppercase; color: var(--faint); }
.edge-head .edge-count { font-family: var(--mono); font-size: 0.65625rem; color: var(--faint); }
.edge-item { width: 100%; padding: 0.5rem 0; border-radius: 0.4375rem; }
.edge-item .edge-name { font-size: 0.90625rem; color: var(--text); line-height: 1.35; overflow-wrap: break-word; }
.edge-item .edge-name.is-missing { color: var(--unresolved); }
.edge-item .quote {
  margin-top: 0.25rem;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--muted);
  padding-left: 0.625rem;
  border-left: 1px solid var(--line-strong);
}
.edge-item .quote em { color: var(--link); font-style: normal; }
.edge-item .edge-sub { margin: 0.1875rem 0 0; font-family: var(--mono); font-size: 0.65625rem; color: var(--faint); }
.tag-list { display: flex; flex-wrap: wrap; gap: 0.4375rem; }
/* a way out of this note into a list scoped to it */
.scope-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.625rem;
  width: 100%;
  margin-top: 0.625rem;
  padding: 0.6875rem 0.8125rem;
  cursor: pointer;
  text-align: left;
  background: none;
  border: 1px dashed var(--line-strong);
  border-radius: 0.5625rem;
  color: var(--muted);
  font-size: 0.84375rem;
}
.scope-button:active { background: var(--surface); }
.scope-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.scope-button .arrow { color: var(--faint); font-family: var(--mono); }
.row-tags { display: flex; flex-wrap: wrap; gap: 0.375rem; margin-top: 0.375rem; }
/* a note autosaved but never saved */
.row-status {
  margin-left: 0.4375rem;
  font-family: var(--mono);
  font-size: 0.625rem;
  font-weight: 400;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--warn);
  vertical-align: 0.0625rem;
}

.badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 1.1875rem;
  line-height: 1;
  font-family: var(--mono);
  font-size: 0.625rem;
  color: var(--accent);
  border: 1px solid rgba(232, 180, 92, .35);
  border-radius: 1.25rem;
  padding: 0 0.5625rem;
  white-space: nowrap;
}
.kind {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 1.0625rem;
  line-height: 1;
  font-family: var(--mono);
  font-size: 0.5625rem;
  letter-spacing: .1em;
  color: var(--faint);
  border: 1px solid var(--line);
  border-radius: 0.1875rem;
  padding: 0 0.25rem;
  white-space: nowrap;
}
