/* Outpost components. Plain class names, tokens only (docs/UI.md). */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--text-md);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
::selection { background: var(--mint); color: var(--ink); }
img, svg { display: block; max-width: 100%; }
a { color: var(--teal-ink); text-underline-offset: 0.2em; }
a:hover { color: var(--ink); }
:focus-visible { outline: var(--focus); outline-offset: 3px; border-radius: 4px; }
code, kbd, samp { font-family: var(--mono); font-size: 0.9em; }
code { background: color-mix(in srgb, var(--ink) 6%, transparent); padding: 0.1em 0.35em; border-radius: 4px; overflow-wrap: anywhere; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -0.02em; line-height: 1.05; }
h1 { font-size: var(--h1); font-weight: 800; letter-spacing: -0.03em; }
h2 { font-size: var(--h2); font-weight: 700; }
h3 { font-size: var(--h3); font-weight: 700; letter-spacing: -0.01em; }
/* An h3 in looks, on another element: an h2 that reads as a card title,
   or a legend, which would otherwise keep the body's line height and sit
   lower than a heading beside it. */
.h3 { font-family: var(--display); font-size: var(--h3); font-weight: 700; letter-spacing: -0.01em; line-height: 1.05; }
p, li { max-width: var(--measure); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: absolute; left: var(--space-4); top: -4rem; background: var(--paper); padding: var(--space-2) var(--space-4); border-radius: var(--radius-pill); z-index: 20; }
.skip-link:focus { top: var(--space-2); }

/* ---------- top bar ---------- */
/* Every label on the bar has one font, size, line height and letter-spacing,
   and every control is 2rem tall, centred in the bar, so all the text sits
   on one baseline. --bar-gap is the one gap between items. */
.topbar { background: var(--ink); color: var(--paper); position: sticky; top: 0; z-index: 10; }
.topbar__inner {
  --bar-gap: var(--space-5);
  max-width: var(--content); min-height: 3.5rem; margin: 0 auto; padding: 0 var(--gutter);
  display: flex; align-items: center; gap: var(--bar-gap);
  font-family: var(--mono); font-size: 0.85rem; line-height: 1.25rem; letter-spacing: 0.02em;
}
.topbar .icon { flex-shrink: 0; }
.brand { display: flex; align-items: center; gap: 0.55rem; color: var(--paper); text-decoration: none; flex-shrink: 0; transition: color 120ms ease; }
.brand img { width: 1.9rem; height: auto; }
.brand__word { font-family: var(--mono); letter-spacing: 0.02em; }
.brand:hover { color: var(--mint); }
.brand__by { font-family: var(--mono); font-size: var(--text-xs); letter-spacing: 0.04em; color: var(--mint); }
/* Signed-out pages that are not the sign-in page: the bar is just the brand. */
.topbar--public .topbar__inner { flex-wrap: wrap; row-gap: var(--space-1); padding-block: 0.7rem; }

/* The profile: a thin rule, its name (a link to the overview) and a chevron
   that opens the list of profiles. */
.profile { position: relative; display: flex; align-items: center; gap: 0.2rem; min-width: 0; }
.profile::before { content: ""; flex-shrink: 0; width: 1px; height: 1.25rem; margin-right: calc(var(--bar-gap) - 0.2rem); background: color-mix(in srgb, var(--paper) 30%, transparent); }
.profile__name { font-weight: 500; min-width: 0; }
.profile__name > span { overflow: hidden; text-overflow: ellipsis; max-width: 24ch; }
.switcher { flex-shrink: 0; }
.profile__none { padding-left: 0.2rem; }

/* Links on the bar: the current one has a cyan underline, a hovered one a
   faint paper one. Nothing moves. */
.nav { display: flex; align-items: center; gap: var(--bar-gap); list-style: none; padding: 0; }
.nav a, .profile__name {
  position: relative; display: inline-flex; align-items: center; gap: 0.4rem; height: 2rem;
  color: var(--paper); text-decoration: none; white-space: nowrap;
}
.nav a::after, .profile__name::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0.1rem; height: 2px; border-radius: 1px;
  background: transparent; transition: background-color 120ms ease;
}
.nav a:hover, .profile__name:hover { color: var(--paper); }
.nav a:hover::after, .profile__name:hover::after { background: color-mix(in srgb, var(--paper) 45%, transparent); }
.nav a[aria-current="page"]::after, .profile__name[aria-current="page"]::after { background: var(--cyan); }
/* A count beside a label: approvals waiting, unread in the inbox. */
.bar-count {
  display: inline-grid; place-items: center; box-sizing: border-box; min-width: 1.25rem; height: 1.125rem; padding: 0 0.3rem;
  border-radius: var(--radius-pill); background: var(--paper); color: var(--ink);
  font-family: var(--mono); font-size: 0.7rem; font-weight: 500; line-height: 1; letter-spacing: 0;
}

/* Every focusable thing on the ink bar gets the cyan ring (teal is only 4.3:1 on ink). */
.topbar :focus-visible { outline-color: var(--cyan); }
.topbar .menu :focus-visible { outline-color: var(--teal); } /* the open menu is paper */
.topbar summary { cursor: pointer; list-style: none; display: flex; align-items: center; height: 2rem; color: var(--paper); }
.topbar summary::-webkit-details-marker { display: none; }
/* The chevron's padding is its hover circle; the negative margin keeps the
   gap after it the same as every other gap on the bar. */
.switcher summary { gap: 0.35rem; padding-inline: 0.35rem; margin-right: -0.35rem; border-radius: var(--radius-pill); transition: background-color 120ms ease; }
.switcher summary:hover, .switcher[open] summary { background: color-mix(in srgb, var(--paper) 14%, transparent); }
.switcher[open] .icon--chevron { transform: rotate(180deg); }

/* The right-hand end: New post, the inbox and the account menu. */
.topbar__nav { flex-shrink: 0; }
.topbar__end { display: flex; align-items: center; gap: var(--space-3); margin-left: auto; flex-shrink: 0; }
.newpost {
  display: inline-flex; align-items: center; height: 2rem; padding: 0 0.95rem; border-radius: var(--radius-pill);
  background: var(--paper); color: var(--ink); text-decoration: none; white-space: nowrap; transition: background-color 120ms ease;
}
.newpost:hover { background: var(--paper-deep); color: var(--ink); }
.bell { position: relative; display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; color: var(--paper); transition: background-color 120ms ease; }
.bell:hover { background: color-mix(in srgb, var(--paper) 14%, transparent); color: var(--paper); }
.bell[aria-current="page"]::after { content: ""; position: absolute; left: 0.45rem; right: 0.45rem; bottom: 0.1rem; height: 2px; border-radius: 1px; background: var(--cyan); }
.bell .bar-count { position: absolute; top: -0.25rem; left: 1.1rem; height: 1.25rem; border: 2px solid var(--ink); }
.usermenu { position: relative; }
.usermenu summary { border-radius: 50%; }
.usermenu .avatar--bar { width: 2rem; height: 2rem; background: var(--ink-soft); color: var(--paper); font-weight: 500; letter-spacing: 0.02em; border: var(--border) solid transparent; transition: border-color 120ms ease; }
.usermenu summary:hover .avatar--bar, .usermenu[open] .avatar--bar { border-color: var(--paper); }

/* Drop-down menus are paper, in the body font, just below the bar. */
.menu {
  position: absolute; top: calc(100% + 1rem); left: 0; min-width: 14rem; max-width: min(22rem, calc(100vw - 2 * var(--gutter)));
  background: var(--paper); color: var(--ink); border: var(--border) solid var(--ink); border-radius: 1rem; padding: var(--space-2);
  list-style: none; z-index: 30; font-family: var(--body); font-size: var(--text-md); line-height: 1.4; letter-spacing: normal;
}
.profile .menu { left: calc(var(--bar-gap) + 1px); }
.menu--right { left: auto; right: 0; }
.menu a, .menu button { display: block; width: 100%; text-align: left; padding: 0.5rem 0.75rem; border-radius: 0.6rem; color: var(--ink); text-decoration: none; font: inherit; background: none; border: 0; cursor: pointer; }
.menu a:hover, .menu button:hover, .menu a[aria-current] { background: var(--paper-dim); color: var(--ink); }
.menu__label { font-family: var(--mono); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-soft); padding: 0.4rem 0.75rem 0.2rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu hr { border: 0; border-top: 1px solid var(--rule); margin: var(--space-2) 0; }
.menu small { display: block; color: var(--ink-soft); font-size: var(--text-xs); }

/* Below 960px: the Menu button and its panel, full width under the bar. */
.more { display: none; }
.more summary {
  gap: 0.45rem; padding: 0 0.85rem 0 0.7rem; border: var(--border) solid color-mix(in srgb, var(--paper) 40%, transparent);
  border-radius: var(--radius-pill); transition: border-color 120ms ease, background-color 120ms ease;
}
.more summary:hover { border-color: var(--paper); }
.more[open] summary { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.more[open] summary .bar-count { background: var(--ink); color: var(--paper); }
.more .icon--close, .more[open] .icon--open { display: none; }
.more[open] .icon--close { display: block; }
.more__panel {
  position: absolute; top: 100%; left: 0; right: 0; max-height: calc(100dvh - 3.5rem); overflow-y: auto;
  background: var(--ink); border-top: 1px solid color-mix(in srgb, var(--paper) 18%, transparent);
  padding: var(--space-2) var(--gutter) var(--space-5);
}
.more__section + .more__section { border-top: 1px solid color-mix(in srgb, var(--paper) 18%, transparent); margin-top: var(--space-2); padding-top: var(--space-3); }
.more__nav, .more__list { list-style: none; padding: 0; }
.more li, .more p { max-width: none; }
.more__nav { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 12rem), 1fr)); column-gap: var(--space-5); }
.more__nav a, .more__list a, .more__list button {
  display: flex; align-items: center; gap: 0.5rem; width: 100%; min-height: 2.75rem; padding: 0;
  color: var(--paper); text-decoration: none; font: inherit; font-size: 1rem; background: none; border: 0; text-align: left; cursor: pointer;
}
.more__nav a:hover .nav__label, .more__list a:hover > span:first-child, .more__list button:hover { text-decoration: underline; text-underline-offset: 0.3em; }
.more__nav a[aria-current="page"] .nav__label, .more__list a[aria-current="page"] > span:first-child { text-decoration: underline 2px var(--cyan); text-decoration-skip-ink: none; text-underline-offset: 0.35em; }
.more__list a, .more__list button { font-family: var(--body); letter-spacing: normal; }
.more__list hr { border: 0; border-top: 1px solid color-mix(in srgb, var(--paper) 18%, transparent); margin: var(--space-2) 0; }
.more__action { margin: var(--space-2) 0; }
.more__action .newpost { height: 2.5rem; padding-inline: 1.25rem; }
.more__who { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.12em; color: var(--mint); padding-top: var(--space-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* The full bar needs about 1200px at the widest gap. Narrower, the gaps
   close up; from 1199px down to 960px the word "outpost" gives way to the
   mark alone and the type steps down to 0.8rem, still one size for all.
   At any width a long profile name is cut short before anything wraps. */
@media (max-width: 1279.98px) {
  .topbar__inner { --bar-gap: var(--space-4); }
}
@media (max-width: 1199.98px) {
  .topbar__inner { --bar-gap: var(--space-3); font-size: 0.8rem; }
  .brand__word { display: none; }
  .topbar__end { gap: var(--space-2); }
}
@media (max-width: 959.98px) {
  .topbar__inner { --bar-gap: var(--space-4); font-size: 0.85rem; }
  .brand__word { display: inline; }
  .topbar__nav, .topbar__end { display: none; }
  .more { display: block; margin-left: auto; flex-shrink: 0; }
  /* The profile menu drops from the bar's full width, so it never runs off a phone's edge. */
  .profile, .switcher { position: static; }
  .profile .menu { left: var(--gutter); right: var(--gutter); top: calc(100% + 0.25rem); max-width: none; }
  /* Phone tap targets: the Menu button and the profile chevron are 36px
     tall. Both stay centred in the bar, so their text keeps its baseline. */
  .more summary, .switcher summary { height: 2.25rem; }
  .switcher summary { min-width: 2.25rem; justify-content: center; }
}
@media (max-width: 419.98px) {
  .brand__word { display: none; }
  .topbar__inner { --bar-gap: var(--space-3); }
}
@media (prefers-reduced-motion: reduce) {
  .brand, .nav a::after, .profile__name::after, .topbar summary, .newpost, .bell, .avatar--bar { transition: none; }
}

/* ---------- page ---------- */
main { flex: 1; width: 100%; max-width: var(--content); margin: 0 auto; padding: var(--space-6) var(--gutter) var(--space-7); }
/* Eyebrow, h1 and lead stack with one space between each; the actions sit
   on the right with their text on the h1's baseline. Below 600px they go
   under the lead. */
.page-head {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "eyebrow eyebrow" "title actions" "lead lead";
  align-items: baseline; margin-bottom: var(--space-6);
}
.page-head > .eyebrow { grid-area: eyebrow; }
.page-head > h1 { grid-area: title; min-width: 0; }
.page-head > .lead { grid-area: lead; }
.page-head__actions { grid-area: actions; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: flex-end; gap: var(--space-3); margin-left: var(--space-5); }
.page-head__actions:empty { display: none; }
@media (max-width: 600px) {
  .page-head { grid-template-columns: minmax(0, 1fr); grid-template-areas: "eyebrow" "title" "lead" "actions"; }
  .page-head__actions { justify-content: flex-start; margin: var(--space-4) 0 0; }
}
.eyebrow { font-family: var(--mono); font-size: var(--text-xs); letter-spacing: 0.14em; text-transform: uppercase; color: var(--teal-ink); margin-bottom: var(--space-3); }
.lead { font-size: var(--text-lg); color: var(--ink-soft); margin-top: var(--space-3); }
.muted { color: var(--ink-soft); }
.small { font-size: var(--text-sm); }
.mono { font-family: var(--mono); font-size: 0.92em; }
.stack > * + * { margin-top: var(--space-4); }
.stack-lg > * + * { margin-top: var(--space-6); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.row--end { justify-content: flex-end; }
.row--tight { gap: var(--space-1) var(--space-2); } /* badges and tags that belong together */
.row[role="list"] { list-style: none; padding: 0; margin: 0; }
/* A form in a row is a flex box too, so its button lines up with the
   buttons beside it instead of sitting on a line box of its own. */
.row > form { display: flex; align-items: center; gap: var(--space-3); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: var(--space-5); }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: var(--space-5); }
/* Four cards are two by two until there is room for four in a row. */
.grid-3:has(> .card:nth-child(4):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 1200px) { .grid-3:has(> .card:nth-child(4):last-child) { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 600px) { .grid-3:has(> .card:nth-child(4):last-child) { grid-template-columns: minmax(0, 1fr); } }
/* The rule runs along the content's edges, as the page above it does. */
footer.site { border-top: 1px solid var(--rule); padding: var(--space-5) 0; font-family: var(--mono); font-size: var(--text-xs); color: var(--ink-soft); display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--space-3); width: calc(min(100%, var(--content)) - 2 * var(--gutter)); margin: 0 auto; }

/* ---------- settings layout ---------- */
.with-side { display: grid; grid-template-columns: 13rem minmax(0, 1fr); gap: var(--space-6); align-items: start; }
.with-side > * { min-width: 0; }
.side { position: sticky; top: 5rem; list-style: none; padding: 0; display: grid; gap: 0.15rem; }
.side a { display: block; padding: 0.45rem 0.8rem; border-radius: var(--radius-pill); text-decoration: none; color: var(--ink); font-size: var(--text-sm); }
.side a:hover { background: var(--paper-dim); }
.side a[aria-current] { background: var(--ink); color: var(--paper); }
.side__label { font-family: var(--mono); font-size: var(--text-xs); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); padding: var(--space-4) 0.8rem var(--space-1); }
/* The first label starts level with the top of the content beside it. */
.side__label:first-child { padding-top: 0; }
@media (max-width: 820px) {
  .with-side { grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
  /* The padding at the end keeps the last item clear of the fade. */
  .side { position: static; display: flex; overflow-x: auto; gap: var(--space-1); padding: 0 var(--space-6) var(--space-2) 0; scrollbar-width: none; mask-image: linear-gradient(to right, #000 calc(100% - 2rem), transparent); }
  .side a { white-space: nowrap; }
  .side__label { display: none; }
}

/* ---------- cards ---------- */
.card { background: var(--paper-dim); border: 1px solid color-mix(in srgb, var(--ink) 7%, transparent); border-radius: var(--radius-card); padding: clamp(1.1rem, 3vw, 1.8rem); min-width: 0; }
.card--plain { background: var(--paper); border-color: var(--rule); }
.card__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: var(--space-3); margin-bottom: var(--space-4); }
.card__head p { color: var(--ink-soft); font-size: var(--text-sm); }
.card > h2, .card > h3 { margin-bottom: var(--space-3); }
.card--accent { position: relative; overflow: hidden; }
.card--accent::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 6px; background: var(--grad-aqua); }
/* Cards side by side are one height, and a card's closing link (a
   paragraph holding only a link) sits on its bottom edge, level across
   the row. */
:is(.grid-2, .grid-3) > .card.stack { display: flex; flex-direction: column; gap: var(--space-4); }
:is(.grid-2, .grid-3) > .card.stack > * { margin-block: 0; }
:is(.grid-2, .grid-3) > .card.stack > p:last-child:has(> a:only-child) { margin-top: auto; }

/* ---------- buttons ---------- */
/* Hover changes a colour and nothing else: nothing moves, no shadows. Each
   kind sets its colours in custom properties, so one hover rule serves
   them all and a disabled button keeps its resting colours. */
.btn {
  --btn-bg: var(--paper); --btn-hover: var(--paper-dim); --btn-ink: var(--ink);
  --btn-line: var(--ink); --btn-line-hover: var(--btn-line);
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem; min-height: 2.625rem;
  font-family: var(--mono); font-size: 0.82rem; letter-spacing: 0.04em; line-height: 1.2;
  padding: 0.6rem 1.25rem; border-radius: var(--radius-pill); border: var(--border) solid var(--btn-line);
  background: var(--btn-bg); color: var(--btn-ink); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}
.btn:hover { background: var(--btn-hover); border-color: var(--btn-line-hover); color: var(--btn-ink); }
.btn--solid { --btn-bg: var(--ink); --btn-hover: var(--ink-deep); --btn-ink: var(--paper); }
.btn--primary { --btn-bg: var(--grad-aqua); --btn-hover: var(--grad-aqua); --btn-line: transparent; --btn-line-hover: var(--ink); font-weight: 500; }
.btn--quiet { --btn-bg: transparent; --btn-hover: transparent; --btn-line: transparent; }
.btn--quiet:hover { text-decoration: underline; }
.btn--danger { --btn-line: var(--bad); --btn-hover: var(--bad-tint); --btn-ink: var(--bad); }
.btn--small { padding: 0.35rem 0.85rem; font-size: 0.75rem; min-height: 2rem; }
/* A quiet button looks like text, so it lines up like text: no padding at
   the sides, its words on the edge of the card or column it sits in. The
   gap of its row keeps it clear of its neighbours. */
.btn--quiet, .btn--quiet.btn--small { padding-inline: 0; }
.btn--block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { --btn-hover: var(--btn-bg); --btn-line-hover: var(--btn-line); opacity: 0.45; cursor: not-allowed; }
.btn--quiet:is([disabled], [aria-disabled="true"]):hover { text-decoration: none; }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } }

/* ---------- forms ---------- */
form.stack > * + * { margin-top: var(--space-5); }
.field { display: grid; gap: 0.4rem; min-width: 0; align-content: start; }
.field > label, .field > .label, legend { font-weight: 600; font-size: var(--text-sm); }
.field .hint { font-size: var(--text-sm); color: var(--ink-soft); max-width: var(--measure); }
.field .error { font-size: var(--text-sm); color: var(--bad); font-weight: 600; }
input[type="text"], input[type="email"], input[type="url"], input[type="password"], input[type="search"],
input[type="number"], input[type="datetime-local"], input[type="date"], input[type="time"], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--paper);
  border: var(--border) solid var(--rule-strong); border-radius: var(--radius-field); padding: 0.65rem 0.8rem;
}
textarea { min-height: 8rem; resize: vertical; line-height: 1.5; }
/* A select keeps the browser's own list but draws its own arrow, in ink.
   Without the native frame its text starts where a text input's does. A
   page that changes a select's padding sets padding-block and
   padding-left only, so the text never runs under the arrow. */
select:not([multiple], [size]) {
  -webkit-appearance: none; appearance: none; cursor: pointer; padding-right: 2.4rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1.5 1.75 6 6.25l4.5-4.5' fill='none' stroke='%230A1F1D' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.85rem center; background-size: 0.75rem 0.5rem;
}
/* A field and a button side by side in a row are one height: the shorter
   stretches to the taller, so their edges line up (a search box and its
   button, a profile to connect to and its button). */
:is(input, select):not([type="checkbox"], [type="radio"], [type="hidden"], [type="file"]) ~ .btn,
:is(input, select):not([type="checkbox"], [type="radio"], [type="hidden"], [type="file"]):has(~ .btn) { align-self: stretch; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: var(--focus); outline-offset: 1px; border-color: var(--teal); }
/* A date field's picker button takes focus on its own in Chrome, which
   then draws its thin blue ring. A page cannot match that focus (the button
   is inside the browser's own field), but the browser only sets the
   outline's style, so a colour and width given here make it the teal ring. */
input::-webkit-calendar-picker-indicator { border-radius: 4px; cursor: pointer; outline-color: var(--teal); outline-width: 3px; outline-offset: 2px; }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--bad); }
input::placeholder, textarea::placeholder { color: var(--ink-faint); }
input[readonly] { background: var(--paper-dim); }
/* A form someone may only read (a disabled fieldset) looks like a read-only
   field: Paper-dim, ink text that is not faded, no select arrow. */
:is(input, select, textarea):disabled:not([type="checkbox"], [type="radio"]) {
  background-color: var(--paper-dim); background-image: none; color: var(--ink); -webkit-text-fill-color: var(--ink); opacity: 1; cursor: default;
}
textarea:disabled { resize: none; }
fieldset:disabled .choice { cursor: default; }
fieldset { border: 0; padding: 0; min-width: 0; }
legend { padding: 0; } /* browsers indent a legend by 2px; labels are not */
.choice { display: flex; gap: 0.6rem; align-items: flex-start; padding: 0.7rem 0.85rem; border: var(--border) solid var(--rule); border-radius: var(--radius-field); background: var(--paper); cursor: pointer; }
.choice + .choice { margin-top: var(--space-2); }
.choice:has(input:checked) { border-color: var(--ink); background: var(--paper-dim); }
.choice input { margin-top: 0.3rem; accent-color: var(--ink); }
.choice strong { display: block; font-weight: 600; }
.choice span { color: var(--ink-soft); font-size: var(--text-sm); }
.check { display: flex; gap: 0.55rem; align-items: flex-start; }
.check input { margin-top: 0.3rem; accent-color: var(--ink); }
.copy { display: flex; gap: var(--space-2); align-items: stretch; }
.copy input { font-family: var(--mono); font-size: var(--text-sm); }

/* ---------- tables ---------- */
/* position: relative keeps visually hidden labels inside the scroll box,
   so a wide table scrolls within itself and never widens the page. */
.table-wrap { position: relative; overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--radius-card); background: var(--paper); }
table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
th { text-align: left; font-family: var(--mono); font-weight: 400; font-size: var(--text-xs); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); padding: 0.75rem 1rem; border-bottom: 1px solid var(--rule); white-space: nowrap; }
td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--rule); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.actions { text-align: right; white-space: nowrap; }
/* A row of actions ends on the table's edge, as a single button does. */
td.actions .row { justify-content: flex-end; }
td .row { flex-wrap: nowrap; }
/* A long note under a row, across the full width of the table. */
tr.has-note > td { border-bottom: 0; padding-bottom: 0.2rem; }
tr.note-row > td { padding-top: 0; color: var(--ink-soft); }
/* Phones: a table becomes a stack of cards, one per row. Each cell carries
   its column's name in data-label, shown in a gutter at the left. A long note
   under a row (note-row) takes the full width. Tables that are really grids (queue
   times, analytics) keep scrolling inside their frame: .table-wrap--scroll. */
@media (max-width: 600px) {
  .table-wrap:not(.table-wrap--scroll) { border: 0; background: none; overflow: visible; border-radius: 0; }
  .table-wrap:not(.table-wrap--scroll) table, .table-wrap:not(.table-wrap--scroll) tbody { display: block; }
  .table-wrap:not(.table-wrap--scroll) thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .table-wrap:not(.table-wrap--scroll) tr { display: block; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius-card); padding: 0.35rem 0; margin-bottom: var(--space-3); }
  .table-wrap:not(.table-wrap--scroll) td { display: block; position: relative; padding: 0.4rem 1rem 0.4rem 7.9rem; border: 0; overflow-wrap: anywhere; }
  .table-wrap:not(.table-wrap--scroll) td[data-label]::before { content: attr(data-label); position: absolute; left: 1rem; top: 0.55rem; width: 6.4rem; font-family: var(--mono); font-size: var(--text-xs); letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-soft); line-height: 1.3; }
  .table-wrap:not(.table-wrap--scroll) td:not([data-label]), .table-wrap:not(.table-wrap--scroll) td.actions { padding-left: 1rem; }
  .table-wrap:not(.table-wrap--scroll) td.actions { white-space: normal; padding-top: 0.6rem; text-align: left; }
  .table-wrap:not(.table-wrap--scroll) td.actions .row { justify-content: flex-start; }
  .table-wrap:not(.table-wrap--scroll) td.actions:empty { display: none; }
  .table-wrap:not(.table-wrap--scroll) td .row { flex-wrap: wrap; }
  .table-wrap:not(.table-wrap--scroll) td[colspan] { display: block; }
  .table-wrap:not(.table-wrap--scroll) tr.has-note { margin-bottom: 0; border-bottom: 0; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
  .table-wrap:not(.table-wrap--scroll) tr.note-row { border-top: 0; border-top-left-radius: 0; border-top-right-radius: 0; padding-top: 0; }
}

/* ---------- small pieces ---------- */
.chip { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.25rem 0.7rem; border-radius: var(--radius-pill); border: 1px solid var(--rule-strong); background: var(--paper); font-size: var(--text-sm); white-space: nowrap; }
.tag { display: inline-block; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--teal-ink); }
.lamp { display: inline-flex; align-items: center; gap: 0.45rem; font-family: var(--mono); font-size: var(--text-xs); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }
.lamp::before { content: ""; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--rule-strong); flex-shrink: 0; }
.lamp--ok { color: var(--ok); }
.lamp--ok::before { background: var(--ok); }
.lamp--warn { color: var(--warn); }
.lamp--warn::before { background: var(--warn-line); border-radius: 1px; transform: rotate(45deg); }
.lamp--bad { color: var(--bad); }
.lamp--bad::before { background: var(--bad-line); border-radius: 1px; }
.badge { display: inline-block; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em; padding: 0.15rem 0.55rem; border-radius: var(--radius-pill); background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink); white-space: nowrap; }
.badge--owner { background: var(--ink); color: var(--paper); }
.avatar { width: 2rem; height: 2rem; border-radius: 50%; background: var(--paper-deep); color: var(--ink); display: inline-grid; place-items: center; font-family: var(--mono); font-size: 0.75rem; flex-shrink: 0; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 0.4rem 1.2rem; font-size: var(--text-sm); }
.kv dt { color: var(--ink-soft); }
.kv dd { margin: 0; overflow-wrap: anywhere; }

/* Platform badge: the platform's icon in a rounded square of its colour,
   20px (28px with --lg). Colours come from /platforms.css; the icon is a
   <use> of a symbol in the page's sprite, so it takes the badge's colour.
   The two-letter mark shows instead where there is no icon (--mark), in
   forced-colours mode and in print. */
.pbadge { display: inline-grid; place-items: center; flex-shrink: 0; box-sizing: border-box; min-width: 1.25rem; height: 1.25rem; padding: 0 0.2rem; border-radius: 0.35rem; background: var(--ink); color: var(--paper); font-family: var(--mono); font-size: 0.6875rem; font-weight: 500; line-height: 1; letter-spacing: 0.02em; vertical-align: middle; }
.pbadge:not(.pbadge--mark) { width: 1.25rem; padding: 0; }
.pbadge__icon { display: block; width: 0.875rem; height: 0.875rem; fill: currentColor; }
.pbadge:not(.pbadge--mark) .pbadge__mark { display: none; }
.pbadge--lg { min-width: 1.75rem; height: 1.75rem; padding: 0 0.3rem; border-radius: 0.5rem; font-size: 0.8125rem; }
.pbadge--lg:not(.pbadge--mark) { width: 1.75rem; }
.pbadge--lg .pbadge__icon { width: 1.125rem; height: 1.125rem; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
/* An account named by badge and handle: no line break between the two,
   but a long handle may wrap within itself. */
.acc-name { white-space: nowrap; }
.acc-name__handle { white-space: normal; overflow-wrap: anywhere; }
@media (forced-colors: active) {
  .pbadge { border: 1px solid CanvasText; }
  .pbadge .pbadge__icon { display: none; }
  .pbadge:not(.pbadge--mark) .pbadge__mark { display: inline; }
}
/* body raises the specificity above /platforms.css, which loads later. */
@media print {
  body .pbadge { border: 1px solid var(--ink); background: none; color: var(--ink); }
  .pbadge .pbadge__icon { display: none; }
  .pbadge:not(.pbadge--mark) .pbadge__mark { display: inline; }
}

/* ---------- callouts ---------- */
.callout { border-radius: var(--radius-field); padding: 0.85rem 1rem; border-left: 4px solid var(--teal); background: var(--paper-dim); font-size: var(--text-sm); }
.callout strong:first-child { display: block; margin-bottom: 0.15rem; }
.callout--warn { background: var(--warn-tint); border-color: var(--warn-line); }
.callout--bad { background: var(--bad-tint); border-color: var(--bad-line); }
.callout--ok { background: var(--ok-tint); border-color: var(--teal); }
.flash { margin-bottom: var(--space-5); }
/* A form's error straight under the page head, outside any stack. */
.page-head + .callout { margin-bottom: var(--space-5); }

/* ---------- empty state ---------- */
.empty { text-align: center; padding: var(--space-7) var(--space-4); border: 1.5px dashed var(--rule-strong); border-radius: var(--radius-card); }
.empty h2 { font-size: var(--h3); margin-bottom: var(--space-2); }
.empty p { margin: 0 auto var(--space-4); color: var(--ink-soft); }

/* ---------- steps (setup wizard, assistants) ---------- */
.steps { list-style: none; padding: 0; counter-reset: step; display: grid; gap: var(--space-4); }
.step { counter-increment: step; display: grid; grid-template-columns: 2.2rem 1fr; gap: var(--space-4); }
.step::before { content: counter(step); width: 2.2rem; height: 2.2rem; border-radius: 50%; border: var(--border) solid var(--ink); display: grid; place-items: center; font-family: var(--mono); font-size: var(--text-sm); background: var(--paper); }
.step--done::before { content: "\2713"; background: var(--ink); color: var(--mint); border-color: var(--ink); }
.step--current::before { background: var(--ink); color: var(--paper); }
.step > div { min-width: 0; }
.step h3 { margin: 0.35rem 0 var(--space-2); }

/* ---------- sign-in ---------- */
main.signin { max-width: none; margin: 0; }
.signin { min-height: 100vh; display: grid; place-items: center; background: var(--ink); color: var(--paper); padding: var(--space-6) var(--gutter); position: relative; overflow: hidden; }
.signin::before, .signin::after { content: ""; position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.32; pointer-events: none; }
.signin::before { width: 50vw; height: 50vw; min-width: 380px; min-height: 380px; background: radial-gradient(circle, var(--cyan), transparent 65%); top: -16vw; right: -12vw; }
.signin::after { width: 42vw; height: 42vw; min-width: 320px; min-height: 320px; background: radial-gradient(circle, var(--mint), transparent 65%); bottom: -16vw; left: -10vw; }
.signin__box { position: relative; z-index: 1; width: min(100%, 26rem); }
.signin__mark { width: 4.5rem; margin-bottom: var(--space-5); }
.signin h1 { font-size: clamp(3rem, 12vw, 4.6rem); line-height: 0.95; }
.signin .grad { background: var(--grad-aqua); -webkit-background-clip: text; background-clip: text; color: transparent; }
.signin .byline { font-family: var(--mono); font-size: var(--text-sm); letter-spacing: 0.06em; color: var(--mint); margin-top: var(--space-2); }
.signin .tagline { margin: var(--space-5) 0 var(--space-6); color: color-mix(in srgb, var(--paper) 74%, transparent); }
.signin .btn { --btn-bg: transparent; --btn-hover: color-mix(in srgb, var(--paper) 12%, transparent); --btn-ink: var(--paper); --btn-line: var(--paper); }
.signin .btn--paper { --btn-bg: var(--paper); --btn-hover: var(--paper-deep); --btn-ink: var(--ink); }
.signin form + form, .signin .or { margin-top: var(--space-4); }
.signin input[type="password"] { background: color-mix(in srgb, var(--paper) 8%, transparent); color: var(--paper); border-color: color-mix(in srgb, var(--paper) 30%, transparent); }
.signin label { color: var(--paper); }
.signin .callout { color: var(--ink); }
.signin a { color: var(--mint); }
.signin details { margin-top: var(--space-6); font-size: var(--text-sm); color: color-mix(in srgb, var(--paper) 74%, transparent); }
.signin summary { cursor: pointer; }

/* ---------- error page ---------- */
/* Signed in, an error sits in the page column. Signed out it is the sign-in
   page's full-bleed ink, so its colours are set for ink here. */
.problem:not(.signin) { max-width: 34rem; margin: var(--space-7) 0; text-align: left; }
.problem__actions { margin-top: var(--space-5); }
.problem.signin::before, .problem.signin::after { display: none; }
.problem.signin .eyebrow { color: var(--mint); }
.problem.signin h1 { color: var(--paper); }
.problem.signin .lead { color: color-mix(in srgb, var(--paper) 84%, transparent); }
.problem.signin .small, .problem.signin summary { color: color-mix(in srgb, var(--paper) 84%, transparent); }
.problem.signin pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.problem.signin .brand { margin-bottom: var(--space-6); }
.problem.signin .brand__by { color: var(--mint); }
.problem__back { margin-top: var(--space-4); }
.section { margin-top: var(--space-7); }
.section-title { font-size: var(--h2); }
.inline-confirm { position: relative; display: inline-block; }
.inline-confirm summary { list-style: none; }
.inline-confirm summary::-webkit-details-marker { display: none; }
.inline-confirm[open] form { position: absolute; right: 0; top: calc(100% + 0.4rem); width: 18rem; background: var(--paper); border: var(--border) solid var(--ink); border-radius: 1rem; padding: var(--space-4); text-align: left; z-index: 5; white-space: normal; }
.connect-grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr)); gap: var(--space-3); }
.connect-tile { display: grid; gap: 0.35rem; padding: var(--space-4); border: var(--border) solid var(--rule); border-radius: var(--radius-card); background: var(--paper); color: var(--ink); text-decoration: none; transition: border-color 120ms ease, background-color 120ms ease; }
.connect-tile .pbadge { justify-self: start; }
.connect-tile:hover { border-color: var(--ink); background: var(--paper-dim); color: var(--ink); }
@media (prefers-reduced-motion: reduce) { .connect-tile { transition: none; } }
.assistant .step h3 { font-size: var(--h3); }
.assistant__shot { border: 1px solid var(--rule); border-radius: var(--radius-field); max-width: 100%; }
.switcher summary, .usermenu summary { white-space: nowrap; }
/* Legal pages: the admin's own text, at a readable width. */
.legal { max-width: 42rem; margin-inline: auto; padding-block: var(--space-4); }
.legal p { max-width: none; }

/* ---------- phones ---------- */
@media (max-width: 600px) {
  /* A post's title is the card's link, so it gets a thumb-sized target. */
  .posts-table__text a { display: inline-block; padding-block: 0.5rem; }
  /* 16px stops iOS zooming in when a field takes focus. */
  body :is(input, select, textarea):not([type="checkbox"], [type="radio"], [type="file"], [type="hidden"]) { font-size: 1rem; }
  .btn--small, .tool__body .chip { min-height: 2.25rem; }
  /* A link on a line of its own (a card's closing link, "Open the post")
     is a tap target, so it is at least 36px tall. Links inside a sentence
     keep the line's height. */
  .solo-link, :is(.grid-2, .grid-3) > .card.stack > p:last-child > a:only-child { display: inline-flex; align-items: center; min-height: 2.25rem; }
  .signin summary { padding-block: 0.45rem; }
}

.jump-link { margin-bottom: var(--space-4); }

/* ---------- segmented control (Segmented) ---------- */
/* One choice from a few, as pill radios under a legend (compose's Format).
   The radio is hidden but stays focusable; its pill shows the focus ring.
   The chosen pill is solid ink with a check mark, so the choice never rests
   on colour. Pills are 36px tall and wrap on a phone. */
.seg { display: grid; gap: var(--space-2); }
.seg__options { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.seg__option {
  position: relative; display: inline-flex; align-items: center; min-height: 2.25rem; padding: 0.35rem 1rem;
  border: var(--border) solid var(--rule-strong); border-radius: var(--radius-pill); background: var(--paper); color: var(--ink);
  font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.04em; line-height: 1.2; cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease;
}
.seg__option:hover { border-color: var(--ink); background: var(--paper-dim); }
.seg__option input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.seg__option:has(input:checked) { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.seg__option:has(input:checked):hover { background: var(--ink-deep); }
.seg__option input:checked + .seg__label::before { content: "\2713"; margin-right: 0.4rem; }
.seg__option:has(input:focus-visible) { outline: var(--focus); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .seg__option { transition: none; } }
@media (forced-colors: active) { .seg__option:has(input:checked) { border-width: 3px; } }
