@layer components {
  /* Settings and a shelf's page: rows of settings, each a line or a small block, ruled like a list. */
  .row-note { font-size: 0.88rem; color: var(--ink-soft); max-width: var(--measure); margin-block: 0 0.6rem; }
  .setting-rows { display: grid; margin-block: 0.2rem 0.6rem; }
  .setting-row { padding-block: 0.8rem; border-block-start: 1px solid var(--rule); scroll-margin-top: 2rem; display: grid; gap: 0.3rem; }
  .setting-row.is-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.3rem 0.7rem; padding-block: 0.55rem; }
  .setting-row:last-child { border-block-end: 1px solid var(--rule); }
  .setting-head { display: flex; align-items: baseline; gap: 0.6rem; }
  .setting-name { font-weight: 700; }
  .setting-meta { font-size: 0.78rem; color: var(--ink-soft); }
  .setting-state { font-size: 0.88rem; margin: 0; }
  .setting-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin-block: 0.4rem; }
  .setting-actions form:not(.setting-form) { display: inline; }
  .setting-end { margin-inline-start: auto; }
  .setting-form { display: flex; flex-wrap: wrap; gap: 0.6rem; flex: 1 1 min(18rem, 100%); min-width: 0; }
  .setting-form select { width: 100%; }
  .setting-form input[type=password], .setting-form input[type=text], .setting-form select {
    flex: 1 1 12rem; min-width: 0; padding: 0.35em 0.6em; border: 1px solid var(--rule); border-radius: 6px; background: var(--paper); color: var(--ink); font: inherit; font-size: 0.85rem;
  }
  .setting-form input[type=password] { font-family: var(--mono); }
  .setting-form input:focus, .setting-form select:focus { outline: none; border-color: var(--ink-soft); }
  .setting-help { font-size: 0.75rem; color: var(--ink-soft); margin: 0; }
  .person-role { font-size: 0.78rem; color: var(--ink-soft); }
  .setting-form input.join-field { font-family: var(--mono); font-size: 0.78rem; }
}

@layer components {
  /* A shelf's head on Home: its name (opening its page) with the marks of its people and its team. */
  .shelf-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.7rem; }
  .shelf-name { font-size: 1.1rem; line-height: 1.2; margin: 0; }
  .shelf-name a { color: inherit; text-decoration: none; }
  .shelf-name a:hover { text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 3px; }
  .shelf-people { display: inline-flex; gap: 0.15rem; }
  .shelf-mark.timeline-who { width: 1.35rem; height: 1.35rem; font-size: 0.5rem; }
  .shelf-team { font-size: 0.78rem; color: var(--ink-soft); }
  .shelf-team a { color: inherit; }
  .shelf-head .home-views { margin-inline-start: auto; }
}

@layer components {
  /* Said to assistive tech only. */
  .visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

@layer components {
  /* Settings and a team's page are one width, whatever is on them; a shelf's is a binder's and Home's. */
  .paper.settings-paper, .paper.team-paper { width: min(calc(var(--measure) + 8ch), calc(100vw - 32px)); justify-self: center; }
  /* Two widths in the whole of Margin: a place (Home, a shelf, a binder, the Bin, a writer's page,
     Templates) is one width; a page read (a paper, Settings, a team, Find, a change) is the paper's.
     On a phone every page runs edge to edge, its words 16px in, as a paper does. */
  .paper.shelf-paper, .paper.writer-paper, .paper.roster-paper { width: min(1070px, calc(100vw - 32px)); justify-self: center; }
  @media (max-width: 60ch) { .paper.shelf-paper, .paper.writer-paper, .paper.roster-paper, .paper.settings-paper, .paper.team-paper, .paper.bin-paper { width: 100vw; } }
}

@layer components {
  /* Settings: a row of choices, the chosen one in ink; the hues as small discs of ink. */
  .setting-choice { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
  .setting-choice .inline-form { display: inline; }
  .button.is-chosen { border-color: var(--ink); font-weight: 700; }
  .button.au { color: var(--au, var(--ink)); }
  .setting-form.is-narrow { flex: 0 1 auto; }
  .hue-swatch { width: 1.3rem; height: 1.3rem; border-radius: 50%; background: oklch(var(--swatch)); border: 2px solid transparent; box-shadow: 0 0 0 1px var(--rule); }
  .hue-swatch:hover { box-shadow: 0 0 0 1px var(--ink-soft); }
  .hue-swatch.is-chosen { border-color: var(--paper); box-shadow: 0 0 0 2px var(--ink); }
  /* The reader's own mark, as others see it: their colour, not ink. */
  .your-mark .timeline-who.is-shown { background: var(--au, var(--ink)); }
  .setting-row.is-line .your-mark { display: inline-flex; }
}
