/* App pieces on top of the Parchment theme: header, page layout, boards,
   Markdown inside boards, the editor, user rows, and dialogs.
   Colors, type, and spacing come from the theme tokens. */

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* Header */
.site-header { border-bottom: 1px solid var(--border); }
.site-header__inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem 2rem; padding-block: .75rem; }
.site-header__end { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem; }
.brand { display: inline-flex; align-items: center; gap: .75rem; color: var(--text); text-decoration: none; font: 1.375rem var(--font-reading); }
.brand:hover { color: var(--text); }
.brand__mark { display: grid; place-items: center; width: 2rem; height: 2rem; border: 1px solid var(--accent); color: var(--accent); border-radius: var(--radius-small); font-style: italic; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1.25rem; }
.nav a { display: inline-flex; align-items: center; min-height: 2.75rem; color: var(--muted); text-decoration: none; font-size: var(--size-small); }
.nav a:hover { color: var(--accent); text-decoration: underline; }
.nav a[aria-current="page"] { color: var(--text); text-decoration: underline; text-decoration-color: var(--accent); }
.nav a:has(.nav__icon) { justify-content: center; min-width: 2.75rem; }
.nav a:has(.nav__icon):hover { text-decoration: none; }
.nav a[aria-current="page"]:has(.nav__icon) { color: var(--accent); }
.nav__icon { width: 1.25rem; height: 1.25rem; }

/* Page layout */
.page { padding-block: var(--space-12) var(--space-16); }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1.25rem; margin-bottom: var(--space-8); }
.page-head > div:first-child { display: grid; justify-items: start; gap: .5rem; max-width: 42rem; }
.page-head h1 { font-size: clamp(2.25rem, 4vw, 3rem); letter-spacing: -.03em; }
.page-head h1 em { color: var(--accent); }
.page-head p:not(.eyebrow) { color: var(--muted); }
.page-head__back { margin-bottom: var(--space-3); font-size: var(--size-small); }
/* The arrow leads here, so its margin goes after it. Inline layout keeps the underline off it. */
a.page-head__back > .link-icon { margin-inline: 0 .375rem; }
.page-section { margin-top: var(--space-12); padding-top: var(--space-10); border-top: 1px solid var(--border); }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 1rem; margin-bottom: var(--space-6); }
.section-head h2 { font-size: clamp(1.625rem, 3vw, 2rem); }
.grid--stretch { align-items: stretch; }

/* Panels whose footer holds actions; the footer stays at the bottom in a stretched grid. */
.panel:has(> .panel__footer) { display: flex; flex-direction: column; }
.panel:has(> .panel__footer) > .panel__body { flex: 1; }
.panel__header h2 { font: 400 1.5rem/1.3 var(--font-reading); }
.panel__footer.cluster { justify-content: space-between; }

.empty { display: grid; justify-items: center; gap: .5rem; }
.empty h2 { font-size: 1.5rem; }

/* Login */
.login-screen { display: grid; min-height: 100dvh; padding: var(--space-6) var(--space-4); }
.login-screen__inner { display: grid; justify-items: center; gap: var(--space-6); width: min(28rem, 100%); margin: auto; }
.login-screen__inner > .panel { width: 100%; }
.login-screen__intro { display: grid; gap: .5rem; }
.login-screen h1 { font-size: 2.25rem; letter-spacing: -.02em; }
.login-screen .button[type="submit"] { width: 100%; }

/* Users */
.people { margin: 0; padding: 0; list-style: none; }
.person { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1rem; padding: var(--row-pad) 1.5rem; }
.person + .person { border-top: 1px solid var(--border); }
.person:hover { background: var(--surface-hover); }
.person__id { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; flex: 1 1 12rem; min-width: 0; overflow-wrap: anywhere; font-weight: 500; }
.person__actions { gap: var(--space-2); }

/* Dialogs share the panel look; the form inside uses the panel regions. */
.popup { width: min(32rem, calc(100% - 2rem)); max-height: calc(100dvh - 3rem); margin: auto; padding: 0; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); box-shadow: 0 1.5rem 3rem rgb(0 0 0 / 18%); }
.popup::backdrop { background: rgb(27 25 22 / 55%); }
.popup .panel__header h2 { font-size: 1.375rem; }
.popup [data-popup-login] { font-weight: 600; }

/* Boards */
.board > .panel__body { padding-block: 1.25rem 1.5rem; }
.board-preview { position: relative; max-height: 12rem; overflow: hidden; }
.board-preview::after { content: ''; position: absolute; inset: auto 0 0; height: 3rem; background: linear-gradient(transparent, var(--surface)); pointer-events: none; }

/* Markdown editor */
.md-editor__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; }
.md-editor__textarea { min-height: 18rem; resize: vertical; font-family: var(--font-code); font-size: var(--size-small); line-height: 1.6; }
.md-editor__preview { min-height: 18rem; padding: 1rem 1.25rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); }
.md-editor__preview[aria-busy="true"] { opacity: .6; }

/* Markdown: serif headings, interface text for links and notes. */
.md { overflow-wrap: anywhere; }
.md > * + * { margin-top: var(--space-3); }
.md :is(h1, h2, h3, h4) + * { margin-top: var(--space-2); }
.md > * + :is(h1, h2, h3, h4) { margin-top: var(--space-6); }
.md :is(h1, h2) { font-family: var(--font-reading); font-weight: 400; line-height: 1.25; }
.md h1 { font-size: 1.5rem; }
.md h2 { font-size: 1.25rem; }
.md :is(h3, h4) { margin-bottom: 0; font-size: 1rem; font-weight: 600; }
.md h4 { color: var(--muted); }
.md :is(ul, ol) { margin-bottom: 0; padding-left: 1.25rem; }
.md li + li, .md li > :is(ul, ol) { margin-top: var(--space-1); }
.md li::marker { color: var(--muted); }
.md strong { font-weight: 600; }
.md blockquote { margin: var(--space-3) 0 0; padding-inline-start: 1rem; border-inline-start: 2px solid var(--accent); color: var(--muted); font-family: var(--font-reading); font-style: italic; }
.md blockquote:first-child { margin-top: 0; }
.md pre { font-size: var(--size-small); }
.md hr { margin-block: var(--space-6); border: 0; border-top: 1px solid var(--border); }
.md img { border-radius: var(--radius); }
.md table { width: 100%; border-collapse: collapse; font-size: var(--size-small); }
.md :is(th, td) { padding: .5rem .75rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.md th { background: var(--surface-subtle); color: var(--muted); font-weight: 500; }
.md tr:last-child td { border-bottom: 0; }

/* {| ... |} snippets: the text plus a small copy button. */
.md-copy__text { padding: .1em .35em; border-radius: var(--radius-small); background: var(--surface-subtle); font: .875em var(--font-code); }
.md-copy__btn { display: inline-flex; align-items: center; justify-content: center; width: 1.75rem; height: 1.75rem; margin-left: .125rem; padding: 0; border: 1px solid transparent; border-radius: var(--radius-small); background: transparent; color: var(--muted); vertical-align: middle; transition: background-color var(--duration), color var(--duration); }
.md-copy__btn:hover { background: var(--accent-soft); color: var(--accent); }
.md-copy__btn svg { width: .875rem; height: .875rem; }
.md-copy__icon--check, .md-copy__btn.is-copied .md-copy__icon--copy { display: none; }
.md-copy__btn.is-copied { background: var(--success-bg); color: var(--success); }
.md-copy__btn.is-copied .md-copy__icon--check { display: block; }

@media (max-width: 44rem) {
  .page { padding-block: var(--space-8) var(--space-12); }
  .person { padding-inline: 1.25rem; }
  .site-header__end { width: 100%; justify-content: space-between; column-gap: 1rem; }
}
@media (pointer: coarse) {
  .md-copy__btn { width: 2.25rem; height: 2.25rem; }
}
