/* Woodstar's visual system.
 *
 * The official mark is a violet hummingbird with a cyan wing.
 * Violet carries identity and action; ember carries warmth and attention
 * (the fave, the unread), and every neutral is warmed a few degrees toward
 * the violet so the greys belong to the bird rather than sitting beside it.
 * Accent is spent sparingly — it earns its meaning by being rare.
 *
 * There is no webfont. The one-paint law (see CLAUDE.md) and the no-build
 * rule both forbid holding the first frame on someone else's server, so the
 * personality lives in scale, weight and spacing instead of in a face.
 *
 * Structure: one surface per view. The page has a tint, the view is a single
 * card on it, and everything inside is separated by hairlines — never by
 * nested boxes. That rule is what makes settings, feeds, notifications and
 * profiles read as one product.
 *
 * Colour comes from the mark itself (design/brand): the body's violet →
 * magenta (#6324eb → #b826f7) is action, and only things you press are
 * filled with it — the gradient stops at #8e25f1 so white on it holds 5.7:1.
 * The wing's cyan is held in reserve. Backgrounds stay quiet; a tint is a
 * hint, never a fill.
 *
 * Depth, after Rastrillo's "natural depth" (638a417): light from straight
 * above; things you press sit a touch proud and press in; surfaces rest on
 * the page and never float; only menus, modals and the floating compose
 * button leave it, and tightly. Three tokens do all of it — a top highlight,
 * a contact shadow and an ambient one — tinted from the ink, not grey. Set
 * them to transparent and the app is flat again.
 */

:root {
  --bg: #f2f1f6;
  --surface: #ffffff;
  --surface-2: #f6f4fa;   /* hover wash, quoted blocks */
  --ink: #16141d;
  --ink-2: #56526a;       /* secondary text */
  --ink-3: #7c7790;       /* meta: times, handles, captions */
  --line: #e3e0eb;        /* container edges */
  --hairline: #eceaf2;    /* separators inside a surface */
  --accent: #6324eb;      /* the mark's body violet */
  --accent-ink: #4a1bb0;  /* pressed / on-wash text */
  --on-accent: #ffffff;   /* text and glyphs sitting on a filled accent */
  --accent-wash: #f4f0fe;
  /* What a primary action is filled with, in either scheme. */
  --action: linear-gradient(100deg, #6324eb, #8e25f1);
  --action-hover: linear-gradient(100deg, #5420d4, #7a20dc);
  --on-action: #ffffff;
  --ember: #c2711a;       /* faves, unread */
  --ok: #0f7a57;
  --danger: #c0362c;

  --r-sm: 9px;
  --r: 12px;
  --r-lg: 16px;
  --pill: 999px;
  --gutter: 16px;
  --rail: 264px;
  --col: 660px;
  --bar-h: 52px;    /* the phone's top bar */
  --tabs-h: 54px;   /* and its three tabs */

  --depth-hl: rgb(255 255 255 / 0.8);
  --depth-hl-on-fill: rgb(255 255 255 / 0.22);
  --depth-contact: rgb(22 20 29 / 0.10);
  --depth-ambient: rgb(22 20 29 / 0.06);
  --depth-face: linear-gradient(rgb(255 255 255 / 0.05), rgb(0 0 0 / 0.04));
  --raised: inset 0 1px 0 var(--depth-hl), 0 1px 1px var(--depth-contact), 0 1.5px 3px var(--depth-ambient);
  --raised-fill: inset 0 1px 0 var(--depth-hl-on-fill), 0 1px 1px var(--depth-contact), 0 1.5px 3px var(--depth-ambient);
  --pressed: inset 0 2px 4px var(--depth-contact), inset 0 1px 1px var(--depth-contact);
  --resting: 0 1px 1px var(--depth-ambient), 0 1.5px 3px var(--depth-ambient);
  --current: inset 0 1px 0 var(--depth-hl), 0 0 0 1px var(--depth-contact), 0 1px 2px var(--depth-contact);
  /* A well: the room the place's pages sit in. */
  --sunken: inset 0 1px 2px var(--depth-ambient), inset 0 0 0 1px rgb(22 20 29 / 0.03);
  /* Something that has left the page: tight, not airborne. */
  --shadow: 0 2px 4px rgb(22 20 29 / 0.06), 0 8px 16px -4px rgb(22 20 29 / 0.12);
}

/* The dark palette. Every dark rule keys on data-theme="dark" on <html>,
   never on a media query for the system's scheme: /themeboot.js resolves
   "system" to light or dark, so a person's pick (ui/theme.js) wins over
   their OS. theme.test.mjs holds the line. */
:root[data-theme="dark"] {
  --bg: #0b0a0f;
  --surface: #131119;
  --surface-2: #1b1926;
  --ink: #eceaf3;
  --ink-2: #a8a3ba;
  --ink-3: #837e96;
  --line: #272433;
  --hairline: #201e2b;
  --accent: #b997ff;
  --accent-ink: #c9b8ff;
  /* The accent lightens in the dark, so what sits on it has to darken.
     A primary action does not: --action stays the mark's own violet. */
  --on-accent: #17121f;
  --accent-wash: #221d33;
  --ember: #e9a94a;
  --ok: #3fcb9b;
  --danger: #f0736a;
  --depth-hl: rgb(255 255 255 / 0.06);
  --depth-hl-on-fill: rgb(255 255 255 / 0.10);
  --depth-contact: rgb(0 0 0 / 0.5);
  --depth-ambient: rgb(0 0 0 / 0.35);
  --depth-face: linear-gradient(rgb(255 255 255 / 0.03), rgb(0 0 0 / 0.04));
  --shadow: 0 2px 4px rgb(0 0 0 / 0.35), 0 8px 16px -4px rgb(0 0 0 / 0.5);
}

* { box-sizing: border-box; }

/* Double-tapping the UI must not zoom the page. A feed is a column of small
   targets and a mis-hit shouldn't leave you at 2x with no obvious way back.
   `manipulation` keeps panning and pinch-zoom — the accessibility ones —
   and drops only the double-tap gesture (and with it iOS's 300ms tap
   delay). NOT user-scalable=no on the viewport tag: that would take pinch
   away from people who need it. */
html, body { touch-action: manipulation; }
/* The gutter is reserved whether or not a scrollbar draws, so short and
   long views stop shifting sideways against each other. */
html { scrollbar-gutter: stable; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 { font-weight: 700; letter-spacing: -0.018em; }
h2 { font-size: 20px; margin: 8px 0 12px; }
h3 { font-size: 15px; margin: 0 0 8px; letter-spacing: -0.01em; }
h2 .fine { font-weight: 400; }
a { color: var(--accent); text-underline-offset: 2px; }

/* Lucide icons (ui/dom.js icon()): sized like the surrounding text and
   seated on its baseline, the way the old font glyphs sat. */
svg.icon { width: 1em; height: 1em; vertical-align: -0.125em; }

/* One focus treatment, everywhere. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------- controls */

input, textarea, select {
  width: 100%;
  padding: 10px 12px;
  margin: 4px 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  /* 16px minimum: anything smaller makes iOS Safari zoom the viewport on focus. */
  font-size: 16px;
  /* A field sits slightly into the page — the opposite of a button. */
  box-shadow: inset 0 1px 1px var(--depth-ambient);
}
input::placeholder, textarea::placeholder { color: var(--ink-3); }
input:focus, textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  border-color: var(--accent);
}
/* Checkboxes are not text fields — the blanket width above used to stretch
   them across the row and orphan their label. */
input[type="checkbox"], input[type="radio"] {
  width: auto;
  margin: 0;
  box-shadow: none;
  accent-color: var(--accent);
}
label {
  font-size: 13px;
  color: var(--ink-2);
  font-weight: 500;
}
label.fine { display: flex; align-items: center; gap: 8px; }

button {
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--pill);
  padding: 7px 15px;
  font-weight: 550;
  /* A button sits a touch proud of the page and presses in: instant down,
     slow to let go. --lift and --press are per button, so a borderless one
     opts out on its own rule (below) without reaching its children. */
  --lift: var(--raised);
  --press: var(--pressed);
  --drop: 1px;
  box-shadow: var(--lift);
  transition: background-color 0.12s ease, color 0.12s ease, border-color 0.12s ease, translate 0.3s ease-out;
}
button:hover { background: var(--surface-2); }
button:active:not(:disabled) { box-shadow: var(--press); translate: 0 var(--drop); transition: none; }
/* Borderless buttons are part of whatever they sit in, not objects on it. */
button.linkish, .bar-place, .rail-item, .rail-you, .menu-item, .author-name,
.card header .time, button.mention, button.hashtag, .lightbox-close, .lightbox-nav,
.attach-remove, .typeahead button, .dm-peer, .viewtab, .person-row,
.user-menu button, .follow-list .follow-row, .bar-you, .bar-more, .bar-back,
.tabbar-item {
  --lift: none;
  --press: none;
  --drop: 0;
}
button.primary {
  background: var(--depth-face), var(--action);
  border-color: transparent;
  color: var(--on-action);
  font-weight: 600;
  --lift: var(--raised-fill);
}
button.primary:hover { background: var(--depth-face), var(--action-hover); border-color: transparent; }
button.primary:disabled { opacity: 0.45; cursor: default; }
button.primary:disabled:hover { background: var(--depth-face), var(--action); }
button.linkish {
  border: none;
  background: none;
  color: var(--ink-3);
  padding: 3px 6px;
  font-weight: inherit;
}
button.linkish:hover { color: var(--accent); background: none; }
button.linkish.faved { color: var(--ember); }
/* Destructive intent shows on approach, not at rest — a permanently red
   "remove" reads as an alarm that never stops. */
button.linkish.danger { color: var(--ink-3); }
button.linkish.danger:hover { color: var(--danger); }
button.danger:not(.linkish) {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 40%, var(--line));
  background: none;
}
button.danger:not(.linkish):hover { background: color-mix(in srgb, var(--danger) 8%, transparent); }
/* Disarmed until it's been asked for properly (Delete account's typed confirmation). */
button.danger:not(.linkish):disabled { opacity: 0.45; cursor: default; background: none; }
button.big { width: 100%; padding: 12px; font-size: 16px; margin: 6px 0; }

.fine { font-size: 12.5px; color: var(--ink-3); }
.muted { color: var(--ink-2); }
.error { color: var(--danger); font-size: 13px; }
/* An error line with nothing to say takes no room — anywhere. Left to its
   default paragraph margins it was quietly holding a gap open under the DM
   composer. */
p.error:empty, p.fine:empty { display: none; }
code.keyhex, .keyhex {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--ink-3);
  word-break: break-all;
  display: block;
  margin: 6px 0;
}
.upload-bar { width: 100%; accent-color: var(--accent); }
/* Something is still happening: a slow pulse, not a spinner — nothing is
   stuck, so nothing should look like it is spinning to catch up. */
.pulse {
  display: inline-block;
  width: 0.6em;
  height: 0.6em;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.4;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 1; } }
/* Paired with opacity:0 and a delay: a thing that admits it is waiting only
   after the wait is worth admitting. */
@keyframes fade-in { to { opacity: 1; } }

/* ------------------------------------------------------------------- shell */

.shell { display: flex; align-items: flex-start; }
/* A phantom column the width of the rail, so the reading column sits in the
   middle of the window rather than the middle of what's left over. */
.shell::after { content: ""; flex: 0 1 var(--rail); }
/* ...except where the view takes the whole window: nothing to balance then,
   and no measure to hold it to. */
.shell.wide::after { display: none; }
.shell.wide .main { max-width: none; }
/* ui/shell.js keeps all three navigations in one box; this is the box. */
.chrome {
  flex: 0 0 var(--rail);
  position: sticky;
  top: 0;
  height: 100vh;
}

.main {
  flex: 1 1 auto;
  min-width: 0;
  max-width: var(--col);
  margin: 0 auto;
  padding: 16px;
}
/* One surface per view: every view root becomes the single card the page
   carries. Nothing inside it is boxed again. */
.main > div {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  /* It rests on the page: shaded where it meets it, never lifted off. */
  box-shadow: var(--resting);
  /* Its own formatting context, so a child's top margin can't escape and
     push the surface down the page. */
  display: flow-root;
  margin-bottom: 80px;
}
/* A view that is an app screen rather than a document takes the window's
   height, and its own body scrolls instead of the page. */
.main > div.fill {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 32px);
  margin-bottom: 0;
  overflow: hidden;
}
/* Status lines that have nothing to say take no room. */
.main > div > p:empty, .main > div > div:empty { display: none; }
/* ...and the ones that do sit in the middle of the space they're explaining,
   with room around them. One level down as well as one: a view's status line
   is usually its own child, but a results list keeps its own. */
.main > div > p.muted,
.main > div > div > p.muted {
  margin: 0;
  padding: 40px var(--gutter);
  color: var(--ink-3);
  text-align: center;
}

/* The rail: labelled on a wide screen, icons on a medium one, gone on a
   phone (ui/shell.js renders all three; only one is ever displayed). */
.rail {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 18px 14px 16px;
}
/* The room (ui/shell.js): the switcher, the place's pages and the post
   button, in a shallow well tinted with the place's colour. The tint is a
   hint — a few percent — and the well's edge and the raised current item do
   the real work of saying "this part changes with the place". Woodstar
   Home's room is the mark's violet → magenta; a community's is its own
   colour, set on the shell by ui/place.js with a contrast-checked ink. */
.shell {
  --room: #6324eb;
  --room-ink: var(--accent-ink);
  --room-wash: linear-gradient(165deg, color-mix(in srgb, #6324eb 3.5%, var(--surface)), color-mix(in srgb, #b826f7 2.5%, var(--surface)));
}
.shell.in-community {
  --room-ink: var(--room-ink-light);
  --room-wash: color-mix(in srgb, var(--room) 4%, var(--surface));
}
:root[data-theme="dark"] .shell { --room-wash: linear-gradient(165deg, color-mix(in srgb, #6324eb 7%, var(--surface)), color-mix(in srgb, #b826f7 5%, var(--surface))); }
:root[data-theme="dark"] .shell.in-community { --room-ink: var(--room-ink-dark); --room-wash: color-mix(in srgb, var(--room) 6%, var(--surface)); }
.room {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: -6px -6px 8px;
  padding: 8px 8px 12px;
  border-radius: 20px;
  background: var(--room-wash);
  border: 1px solid color-mix(in srgb, var(--room) 12%, transparent);
  box-shadow: var(--sunken);
}
.room .rail-item:hover { background: color-mix(in srgb, var(--room) 5%, var(--surface)); }
.room .rail-item.active { color: var(--room-ink); }
.room .compose-rail { margin-top: 12px; }
/* At home there is no room to draw: the well appears only once you've
   stepped into a community, and its arrival is what says you have. The
   geometry stays, so nothing in the rail moves when it does. */
.shell:not(.in-community) .room { background: none; border-color: transparent; box-shadow: none; }
.place-switch.place-switch-home {
  /* The bird-only button sizes to its contents; inline-size containment
     would collapse its hover/pressed surface to just the padding. */
  contain: none;
  width: fit-content;
  gap: 6px;
  padding: 6px 8px 6px 6px;
  --lift: none;
}

/* The place switcher: the place's mark and name, top left. */
.place-switch {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  /* Its own width never sets the rail's: a long name truncates instead. */
  min-width: 0;
  contain: inline-size;
  padding: 8px;
  margin-bottom: 6px;
  border: none;
  background: none;
  border-radius: var(--r);
  text-align: left;
}
.place-switch:hover, .place-switch[aria-expanded="true"] { background: color-mix(in srgb, var(--room) 6%, var(--surface)); }
.place-switch[aria-expanded="true"] { box-shadow: var(--pressed); }
.place-switch > svg.icon, .bar-place > svg.icon { color: var(--ink-3); flex: none; }
.place-names { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.place-names strong {
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.place-names span { font-size: 12.5px; color: var(--ink-3); }
.rail > .place-anchor, .room > .place-anchor { width: 100%; }
.place-mark {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 28%;
  object-fit: cover;
  font-weight: 750;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgb(22 20 29 / 0.08);
}
.place-mark-home { background: color-mix(in srgb, #6324eb 10%, var(--surface)); }
.place-mark-home .logo-mark { width: 66%; height: 66%; }
.place-mark-letter { background: var(--room); color: var(--on-room, #fff); }

/* The places menu drops down from the switcher rather than rising like the
   account menu at the rail's foot. */
.menu-label {
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 8px 10px 4px;
}
.place-row { gap: 10px; }
.place-row-text { flex: 1; display: flex; flex-direction: column; line-height: 1.25; text-align: left; }
.place-row-text strong { font-size: 14.5px; font-weight: 650; }
.place-row-text span { font-size: 12px; color: var(--ink-3); }
.menu-item.place-row > svg.icon { color: var(--room-ink); }
/* Something new in one of your other places: a dot, never a count. It is
   Woodstar's violet wherever you are, because it's about elsewhere. */
.place-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.place-row-text .place-row-new, .place-item-meta.place-item-new { color: var(--accent-ink); font-weight: 600; }
.place-switch .place-dot, .bar-place .place-dot { margin: 0 -2px 0 2px; }

.rail-items { display: flex; flex-direction: column; gap: 2px; }
.rail-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: none;
  background: none;
  font-size: 15px;
  font-weight: 500;
  padding: 10px 12px;
  border-radius: var(--pill);
  text-align: left;
  color: var(--ink-2);
}
.rail-item svg.icon { width: 20px; height: 20px; flex: none; }
.rail-item:hover { background: var(--surface-2); color: var(--ink); }
/* Where you are is a raised tab standing on the rail, not a tint. */
.rail-item.active {
  background: var(--surface);
  box-shadow: var(--current);
  color: var(--accent-ink);
  font-weight: 650;
}
.rail-label { flex: 1; text-align: left; }
.compose-rail {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 14px;
  padding: 12px;
  background: var(--depth-face), var(--action);
  border-color: transparent;
  color: var(--on-action);
  font-weight: 650;
  font-size: 15px;
  --lift: var(--raised-fill);
}
.compose-rail .rail-label { flex: none; }
.compose-rail:hover { background: var(--depth-face), var(--action-hover); }
.compose-rail svg.icon { width: 18px; height: 18px; }

/* The identity sits at the foot of the rail; its popover box is the flex
   child, so that is what the auto margin has to push down. */
.rail > .menu-anchor { margin-top: auto; width: 100%; }
.rail-you {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  background: none;
  border-radius: var(--pill);
  text-align: left;
}
.rail-you:hover { background: var(--surface-2); }
.rail-you-names { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.rail-you-names strong {
  font-size: 14.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rail-you-names .handle { font-size: 12.5px; color: var(--ink-3); font-weight: 400; }
/* The menu opens upward, so the caret points that way at rest and turns
   over when it's open — it always shows where the menu is going. */
.rail-you > svg.icon {
  color: var(--ink-3);
  flex: none;
  transform: rotate(180deg);
  transition: transform 0.16s ease;
}
.rail-you[aria-expanded="true"] > svg.icon { transform: rotate(0deg); }

/* Unread: a count where there's room for one, a dot where there isn't. */
.nav-count {
  margin-left: auto;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 11.5px;
  font-weight: 650;
  border-radius: var(--pill);
  padding: 1px 7px;
}
.dot {
  position: absolute;
  top: 8px;
  right: calc(50% - 14px);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ember);
  border: 2px solid var(--surface);
}

/* Mobile chrome: rendered always, shown only under 700px. */
.bar, .tabbar, .compose-fab { display: none; }

/* ------------------------------------------------------------------- menus */

.menu-anchor { position: relative; display: flex; }
/* A popover is new DOM every time it opens, so this is an animation, not a
   transition — and it moves from wherever it's about to sit. */
@keyframes menu-rise { from { opacity: 0; transform: translateY(7px) scale(0.97); } }
@keyframes menu-drop { from { opacity: 0; transform: translateY(-7px) scale(0.97); } }
.menu {
  position: absolute;
  z-index: 60;
  min-width: 232px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
/* In the rail the trigger sits at the bottom, so its menu opens upward. */
.rail .menu {
  bottom: calc(100% + 8px);
  left: 0;
  transform-origin: bottom left;
  animation: menu-rise 0.15s ease-out;
}
.rail .menu-places {
  top: calc(100% + 6px);
  bottom: auto;
  right: 0;
  min-width: 260px;
  transform-origin: top left;
  animation: menu-drop 0.15s ease-out;
}
.bar .menu { top: calc(100% + 8px); animation: menu-drop 0.15s ease-out; }
/* In the bar the switcher is the title, so its menu hangs from the middle. */
.bar .menu-places { left: 50%; translate: -50% 0; min-width: 260px; transform-origin: top center; }
.bar .menu-account { transform-origin: top left; }
.bar .menu-more { transform-origin: top right; }
.bar .menu-account { left: -4px; }
.bar .menu-more { right: -4px; }
.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  text-align: left;
  border: none;
  background: none;
  border-radius: var(--r-sm);
  padding: 8px 10px;
  font-weight: 500;
  color: var(--ink);
}
.menu-item:hover { background: var(--surface-2); }
a.menu-item { text-decoration: none; }
.menu-item svg.icon { width: 18px; height: 18px; color: var(--ink-3); flex: none; }
.menu-sep { height: 1px; background: var(--hairline); margin: 6px 4px; }
/* System / Light / Dark: one segmented row, the pick sitting raised. */
.menu-theme {
  display: flex;
  gap: 2px;
  margin: 2px 4px;
  padding: 3px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
}
.menu-theme button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 4px 6px;
  border: none;
  border-radius: 7px;
  background: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  --lift: none;
  --press: none;
  --drop: 0;
}
.menu-theme button:hover { color: var(--ink); }
.menu-theme button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--ink);
  --lift: var(--raised);
}
.menu-theme svg.icon { width: 15px; height: 15px; flex: none; }
/* Who this menu belongs to — only where the trigger doesn't already say so. */
.menu-who { display: flex; align-items: center; gap: 10px; padding: 8px 10px 10px; }
.menu-who-id { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.menu-who-id strong { font-size: 14.5px; font-weight: 650; letter-spacing: -0.01em; }
.menu-who-id .handle { font-size: 12.5px; color: var(--ink-3); }
.rail .menu-who { display: none; }
/* Another account on this device: avatar, then name over @username. */
.menu-avatar { display: inline-flex; flex: none; }
.menu-other-account { align-items: center; }

/* ---------------------------------------------------------------- page head */

.pagehead {
  position: sticky;
  top: 0;
  z-index: 12;
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 15px var(--gutter) 13px;
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.6);
  backdrop-filter: blur(14px) saturate(1.6);
  /* No rule beneath: the blur already marks the head while scrolling, and
     the feed's day marks draw the only hairlines a timeline needs. */
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.pagehead h2 { margin: 0; font-size: 20px; }
/* "Team Tito only": a page that changes with the place says which place. */
.scope-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: center;
  padding: 2px 9px 2px 3px;
  border-radius: var(--pill);
  background: color-mix(in srgb, var(--room) 9%, var(--surface));
  color: var(--room-ink);
  font-size: 12.5px;
  font-weight: 650;
}
.pagehead-note { font-size: 13px; color: var(--ink-3); }
.pagehead .backlink { order: -1; align-self: center; margin-left: -6px; }

/* -------------------------------------------------------------------- feed */

/* Chronology is this product's whole argument, so the timeline says it out
   loud: one quiet rule per day, and nothing else marking time. */
.daymark {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px var(--gutter) 8px;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.daymark::after { content: ""; flex: 1; height: 1px; background: var(--hairline); }

/* A card is a block inside the view's surface: hairline below, no box. */
.card {
  padding: 14px var(--gutter);
  border-bottom: 1px solid var(--hairline);
  /* positioned so an attached .user-menu-pop anchors to the card, not the page */
  position: relative;
}
/* The surface closes itself: the last block in any list drops its rule so
   it never doubles up with the container's own edge. */
.card:last-child, .repost:last-child, .composer:last-child { border-bottom: none; }

/* A post hangs off one left edge: avatar in its own gutter, name, text and
   actions in a single column beside it. */
.card.post {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  column-gap: 12px;
  align-items: start;
}
.post-main { min-width: 0; }
.card header {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}
.author { display: flex; align-items: baseline; gap: 5px; min-width: 0; }
.author-name {
  border: none;
  background: none;
  padding: 0;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.012em;
  color: var(--ink);
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.author-name:hover { text-decoration: underline; background: none; }
/* Bare hex never gets a name's weight, wherever it renders. */
.name.key {
  color: var(--ink-3);
  font-family: ui-monospace, Menlo, monospace;
  font-size: 13px;
  font-weight: 500;
}
/* The handle a custom name displaced — beside the name, smaller and quieter. */
.author-handle { color: var(--ink-3); font-size: 13.5px; }
/* Someone's pronouns, beside their name: theirs, so never hidden, but
   quieter than the name. */
.pronouns { color: var(--ink-3); font-size: 13px; font-weight: 500; white-space: nowrap; }
.author .pronouns::before { content: "·"; margin-right: 5px; }
.handle-sub { font-weight: 400; margin-left: 5px; color: var(--ink-3); }
/* Both quiet: the address is the signal, these only annotate it. */
.author .confirmed, .author .unconfirmed { color: var(--ink-3); font-size: 11px; }
.author .confirmed svg.icon, .author .unconfirmed svg.icon { width: 13px; height: 13px; }
.author .unconfirmed { opacity: 0.65; }

.card header .time {
  color: var(--ink-3);
  font-size: 13.5px;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  white-space: nowrap;
  font-weight: 400;
}
.card header .time::before { content: "·"; margin-right: 6px; }
.card header .time:hover { color: var(--accent); background: none; }
.card header .via { color: var(--ink-3); font-size: 12px; margin-left: 4px; white-space: nowrap; }
a.via { text-decoration: none; }
a.via:hover { text-decoration: underline; color: var(--accent); }

/* The kebab is on every post, in the same place — but it waits to be
   approached on pointer devices, so a feed is text and not a column of dots. */
.kebab { margin-left: auto; padding: 2px 4px; }
.card header .kebab { font-size: 15px; color: var(--ink-3); }
@media (hover: hover) and (pointer: fine) {
  .card.post .kebab { opacity: 0; transition: opacity 0.12s ease; }
  .card.post:hover .kebab,
  .card.post:focus-within .kebab { opacity: 1; }
}

.content {
  margin: 3px 0 0;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -0.003em;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.mention { color: var(--accent); font-weight: 550; }
.mention.key { color: var(--ember); font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
/* A tag reads like a mention — same accent, same weight, underlined only
   when you reach for it. It links into search, so it takes the same reset. */
.hashtag { color: var(--accent); font-weight: 550; }
button.mention, button.hashtag { border: none; background: none; padding: 0; cursor: pointer; }
button.mention:hover, button.hashtag:hover { text-decoration: underline; background: none; }
/* An imported tweet's @handle leaves for its profile on X. */
a.mention { text-decoration: none; }
a.mention:hover { text-decoration: underline; }
.stamp { font-size: 12px; }

.repost { border-bottom: 1px solid var(--hairline); }
.repost > .card.post { border-bottom: none; padding-top: 2px; }
.repost-note, .reply-note {
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 500;
  padding: 12px var(--gutter) 0 calc(var(--gutter) + 52px);
}
/* Not a flex box: flex would eat the spaces between "in reply" and the
   author's name, which arrive as separate text nodes. */
.reply-note { padding: 0; margin: 2px 0 0 -6px; }

/* Agent and automated-account disclosure (ui/disclosure.js): on every
   card, quiet like the reply note, never omitted. */
.agent-note { color: var(--ink-3); font-size: 13px; font-weight: 500; margin: 2px 0 0; }

/* /connect (ui/connect.js). */
.connect-abilities { display: grid; gap: 6px; margin: 10px 0 14px; }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.connect-disclosure { color: var(--ink-2); font-size: 14px; }
.row-actions { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
/* An imported reply's note leaves for the tweet on Twitter, so it's an
   anchor: no button padding to pull back from, and no underline at rest. */
a.reply-note { display: inline-block; margin-left: 0; text-decoration: none; }
a.reply-note:hover { color: var(--accent); }

/* Nested replies keep the parent's left edge and step in from it. */
.indent { margin-left: 0; }
.indent > .card.post { padding-left: calc(var(--gutter) + 26px); }

.card footer { display: flex; gap: 2px; margin: 8px 0 -4px -8px; }
.card footer button {
  font-size: 15px;
  padding: 6px 9px;
  border-radius: var(--r-sm);
  color: var(--ink-3);
}
.card footer button svg.icon { width: 17px; height: 17px; }
.card footer button:hover { background: var(--surface-2); color: var(--ink); }
.card footer button.faved:hover { color: var(--ember); }

/* Attachments: one image gets the column, several share a grid. */
.media { max-width: 100%; border-radius: var(--r); margin-top: 8px; }
.media-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.media-thumb {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: var(--r);
  cursor: zoom-in;
  border: 1px solid var(--line);
}
.media-grid > .media-thumb:only-child,
.media-grid > .gif-image:only-child .media-thumb {
  width: 100%;
  height: auto;
  max-height: 440px;
  object-fit: cover;
}

/* Unfurl: as modest as a media thumb — a square beside clamped text, never
   a full-width hero. */
.link-card {
  display: flex;
  align-items: stretch;
  max-width: 460px;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
  background: var(--surface);
}
.link-card:hover { background: var(--surface-2); border-color: var(--ink-3); }
.link-card-shot { position: relative; display: flex; flex: none; }
.link-card-image { width: 108px; height: 108px; flex: none; object-fit: cover; }
/* Video cards are the square's one exception: a 16:9 still cropped square is
   mostly somebody's chin. Wider — still a thumbnail, never a hero. The still
   is letterboxed rather than cropped, so the shot keeps the card's full edge
   the way every other card image does, and the whole frame survives. */
.link-card.is-video .link-card-shot { width: 160px; background: #000; }
.link-card.is-video .link-card-image {
  width: 160px;
  height: 100%;
  min-height: 90px;
  object-fit: contain;
}
.link-card-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.link-card-play .icon {
  width: 36px;
  height: 36px;
  padding: 8px;
  border-radius: var(--pill);
  background: rgb(10 8 14 / 0.6);
  color: #fff;
  fill: currentColor;
  stroke: none;
  transition: background 120ms ease, transform 120ms ease;
}
.link-card.is-video:hover .link-card-play .icon {
  background: rgb(10 8 14 / 0.82);
  transform: scale(1.08);
}
.link-card-text { display: flex; flex-direction: column; justify-content: center; padding: 10px 12px; min-width: 0; }
.link-card-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-weight: 650;
  font-size: 14px;
  letter-spacing: -0.01em;
}
.link-card-desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--ink-2);
  font-size: 13px;
  margin-top: 2px;
}
.link-card-domain { display: block; color: var(--ink-3); font-size: 12px; margin-top: 4px; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgb(10 8 14 / 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-img { max-width: 92vw; max-height: 92vh; border-radius: var(--r); cursor: default; }
/* The player: 16:9, as big as the viewport allows, never past either edge. */
.lightbox-embed-box {
  width: min(92vw, calc(92vh * 16 / 9));
  aspect-ratio: 16 / 9;
  border-radius: var(--r);
  overflow: hidden;
  background: #000;
}
.lightbox-embed { width: 100%; height: 100%; border: 0; display: block; }
.lightbox-close, .lightbox-nav {
  display: grid;
  place-items: center;
  padding: 0;
  line-height: 1;
  position: absolute;
  background: rgb(255 255 255 / 0.14);
  color: #fff;
  border: none;
  border-radius: var(--pill);
  width: 44px;
  height: 44px;
  font-size: 20px;
  cursor: pointer;
}
.lightbox-close .icon, .lightbox-nav .icon { display: block; }
.lightbox-close { top: 20px; right: 20px; }
.lightbox-nav.prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lightbox-nav.next { right: 16px; top: 50%; transform: translateY(-50%); }
.lightbox-close:hover, .lightbox-nav:hover { background: rgb(255 255 255 / 0.26); }

/* ----------------------------------------------------------- notifications */

/* Same shape as a post: a marker where the avatar would be, then the line. */
.card.note {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  column-gap: 12px;
  align-items: start;
  font-size: 15px;
}
.note-mark { display: flex; justify-content: center; padding-top: 1px; color: var(--ink-3); }
.note-mark svg.icon { width: 20px; height: 20px; }
.note-fave .note-mark { color: var(--ember); }
.note-repost .note-mark { color: var(--ok); }
.note-dm .note-mark { color: var(--accent); }
.note-quote .note-mark { color: var(--ink-3); }
.note-main strong { font-weight: 650; letter-spacing: -0.01em; }

.quoted-post {
  display: block;
  width: 100%;
  text-align: left;
  margin-top: 8px;
  padding: 9px 12px;
  border: 1px solid var(--hairline);
  border-radius: var(--r);
  background: var(--surface-2);
  cursor: pointer;
  color: var(--ink-2);
  font-weight: 400;
}
.quoted-post:hover { border-color: var(--line); background: var(--surface-2); }
.quoted-post .content { margin: 0; font-size: 14.5px; }

/* A post carried inside another. Same family as .quoted-post (the
   notification snippet), with room for an author line and one thumbnail. */
.quote-card {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 10px 12px;
  text-align: left;
  font: inherit;
  color: inherit;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
}
.quote-card:not(.quote-card-inert):hover { border-color: var(--ink-3); }
/* Inside the compose sheet the card is a plain div (ui/quotecard.js): there
   is nothing to press, so nothing hovers and nothing points. */
.quote-card-inert { cursor: default; }
.quote-head { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.quote-name { font-weight: 600; font-size: 14px; }
.quote-time { font-size: 13px; color: var(--ink-3); }
.quote-card .content { display: block; margin: 0; font-size: 14.5px; }
.quote-media {
  display: block;
  max-height: 180px;
  max-width: 100%;
  margin-top: 8px;
  border-radius: 8px;
  object-fit: cover;
}
.petname-ask input { width: 160px; margin: 0; padding: 4px 8px; }

/* "N new posts" — the one thing allowed to float over a feed, so it takes the
   accent fill and rides just under the sticky head. Its rail is zero-height:
   the pill showing or hiding must never move the feed (ui/feedanchor.js). */
.new-posts {
  position: sticky;
  top: 60px;
  z-index: 11;
  height: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
/* It floats over the feed, so it carries the pop as well as its own edge. */
.new-posts-pill {
  margin-top: 10px;
  background: var(--depth-face), var(--action);
  border-color: transparent;
  color: var(--on-action);
  font-weight: 650;
  --lift: var(--raised-fill), var(--shadow);
}
.new-posts-pill:hover { background: var(--depth-face), var(--action-hover); }
.new-posts-pill[hidden] { display: none; }

/* ---------------------------------------------------------------- composer */

/* A line where the reply box would be ("Sign in to reply.", a reply gate,
   "Loading…"): the composer's own inset, so it lines up with what it
   stands in for instead of touching the card's edge. */
.thread-note { padding: 14px var(--gutter); margin: 0; }
.composer {
  padding: 14px var(--gutter);
  border-bottom: 1px solid var(--hairline);
  position: relative;
  cursor: text;
}
.composer textarea {
  min-height: 44px;
  resize: none;
  overflow: hidden;
  border: none;
  box-shadow: none;
  padding: 4px 0;
  margin: 0;
  background: none;
  font-size: 16px;
  line-height: 1.5;
}
.composer textarea:focus { outline: none; border: none; }
.composer-row { display: flex; align-items: center; gap: 12px; justify-content: flex-end; }
.composer .composer-row, .composer button { cursor: default; }
/* The reply-gate dropdown sits quietly in the row — a control, not a form
   field, so the shared full-width select styling doesn't apply. */
select.gate-pick {
  width: auto;
  margin: 0;
  padding: 4px 2px;
  border: none;
  box-shadow: none;
  background: none;
  color: var(--ink-2);
  cursor: pointer;
}
.count { font-size: 12px; color: var(--ink-3); }
.count.over { color: var(--danger); }

/* --- attachments: the strip, the drop target, the progress ------------- */

.attach-strip { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 2px; }
.attach {
  position: relative;
  width: 88px;
  height: 88px;
  border-radius: var(--r);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.attach-thumb { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Uploading: the picture is already there, dimmed, with the bytes crossing
   the bottom edge — nothing to read, just something visibly happening. */
.attach:has(.attach-progress) .attach-thumb { opacity: 0.55; }
.attach-progress {
  position: absolute;
  inset: auto 0 0 0;
  height: 3px;
  background: color-mix(in srgb, var(--ink) 14%, transparent);
}
.attach-bar { height: 100%; background: var(--accent); transition: width 0.14s linear; }
.attach.error { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.attach.error .attach-thumb { opacity: 0.35; }
.attach-failed {
  position: absolute;
  inset: auto 0 0 0;
  padding: 3px 6px;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  color: #fff;
  background: var(--danger);
}
.attach-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgb(12 10 16 / 0.62);
  color: #fff;
}
.attach-remove svg.icon { width: 13px; height: 13px; }
.attach-remove:hover { background: rgb(12 10 16 / 0.82); }

/* Dropping: the target says so, and says it once. */
.drop-hint {
  display: none;
  position: absolute;
  inset: 6px;
  z-index: 20;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 2px dashed var(--accent);
  border-radius: var(--r);
  background: color-mix(in srgb, var(--accent-wash) 88%, transparent);
  color: var(--accent-ink);
  font-weight: 650;
  font-size: 14px;
  pointer-events: none;
}
.composer.dropping .drop-hint { display: flex; }
/* The conversation pane has no hint element of its own; it tints instead. */
.dm-thread.dropping { background: var(--accent-wash); }

.typeahead {
  position: absolute;
  left: 12px;
  min-width: 232px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 5px;
  z-index: 30;
}
.typeahead button {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  border-radius: var(--r-sm);
  padding: 8px 10px;
  color: var(--ink);
  font-weight: 600;
}
.typeahead button.active, .typeahead button:hover { background: var(--accent-wash); color: var(--accent-ink); }
.typeahead .fine { font-weight: 400; }
.typeahead-empty { padding: 8px 10px; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgb(16 12 24 / 0.42);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  display: grid;
  place-items: start center;
  padding: 12vh 12px 0;
  z-index: 70;
}
.modal-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  width: min(600px, 94vw);
  padding: 14px 18px 16px;
  box-shadow: var(--shadow);
}
.modal-card .composer { border: none; padding: 0; margin: 0; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.modal-head strong { letter-spacing: -0.01em; }

/* -------------------------------------------------------------------- DMs */

.dm-layout {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  flex: 1;
  min-height: 0;
}
.dm-list {
  border-right: 1px solid var(--hairline);
  padding: 12px;
  overflow-y: auto;
}
.dm-new { position: relative; }
.dm-new input { margin: 0 0 10px; }
.dm-new .typeahead { top: 44px; left: 0; right: 0; }
.dm-peer {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  border-radius: var(--r-sm);
  padding: 8px 10px;
  font-weight: 400;
}
.dm-peer-id { min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.dm-peer strong {
  font-weight: 650;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dm-peer .fine { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-peer.active { background: var(--accent-wash); color: var(--accent-ink); }
.dm-peer:hover { background: var(--surface-2); }
.dm-peer.active:hover { background: var(--accent-wash); }
.dm-thread { display: flex; flex-direction: column; min-height: 0; }
.dm-thread > p.muted { margin: auto; padding: 0; color: var(--ink-3); }
.dm-scroll { flex: 1; overflow-y: auto; padding: 12px 16px; }
.bubble {
  background: var(--surface-2);
  border-radius: 16px;
  padding: 9px 13px;
  margin: 4px 0;
  /* A wide pane must not turn a sentence into one long line. */
  max-width: min(76%, 560px);
  width: fit-content;
  font-size: 15px;
}
.bubble.mine { background: var(--accent); color: var(--on-accent); margin-left: auto; }
/* A picture in a bubble is the bubble: it goes edge to edge, and the padding
   only comes back if there's also something to read. */
/* A picture is a picture, not a billboard: it stops well short of the
   bubble's text measure however wide the pane gets. */
.bubble:has(.bubble-media) { padding: 4px; max-width: min(76%, 400px); }
.bubble-media { display: flex; flex-direction: column; gap: 4px; }
.bubble-img { display: block; max-width: 100%; max-height: 420px; border-radius: 13px; }
.bubble:has(.bubble-media) .fine { padding: 0 8px 4px; display: inline-block; }
.bubble .fine { color: var(--ink-3); }
.bubble.mine .fine { color: color-mix(in srgb, var(--on-accent) 68%, transparent); }
/* Flush to the pane and level with itself: the field, the attach button and
   Send are one row of one height, separated from the thread by a hairline —
   not three shapes floating in a margin. */
.dm-thread > .attach-strip { margin: 0; padding: 10px 12px 0; }
.dm-compose {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--hairline);
  background: var(--surface);
}
.dm-compose input {
  margin: 0;
  height: 40px;
  border-radius: var(--pill);
  padding: 0 16px;
}
.dm-compose button { height: 40px; padding: 0 18px; flex: none; }
.dm-compose button.linkish {
  width: 40px;
  padding: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dm-compose button.linkish svg.icon { width: 19px; height: 19px; }
.dm-compose button.linkish:hover { background: var(--surface-2); }
.dm-back { display: none; }

/* --------------------------------------------------------- search & people */

.search-row { display: flex; gap: 8px; align-items: center; padding: 14px var(--gutter) 0; }
.search-row input { margin: 0; }
/* One tab component, wherever a view divides itself. Settings and Search had
   two near-identical ones under different names. */
.viewtabs {
  display: flex;
  gap: 4px;
  padding: 10px var(--gutter);
  overflow-x: auto;
  scrollbar-width: none;
}
.viewtabs::-webkit-scrollbar { display: none; }
.viewtabs { border-bottom: 1px solid var(--hairline); }
/* display: flex beats the UA hidden rule. An empty bar is already caught by
   `.main > div > div:empty`, but a bar hidden with its buttons still in it
   (a community's Highlights rule cleared while the page is open) would
   otherwise stay on screen. */
.viewtabs[hidden] { display: none; }
.viewtab {
  flex: none;
  padding: 7px 14px;
  border: none;
  background: none;
  border-radius: var(--pill);
  color: var(--ink-2);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.viewtab:hover { background: var(--surface-2); color: var(--ink); }
.viewtab[aria-selected="true"] { background: var(--accent-wash); color: var(--accent-ink); }
/* Your feed (ui/yourfeed.js). Its cards are about-panels, whose display:
   grid beats the UA hidden rule, and they come and go with the feed. */
.yourfeed [hidden], .yourfeed p:empty { display: none; }
.yourfeed > .card { margin: 12px var(--gutter); }
.yourfeed > p { padding: 0 var(--gutter); }
/* A post and its Keep and Hide read as one card: the rule moves below the
   row, which lines up with the post's text, as .repost-note does. */
.yourfeed-post { border-bottom: 1px solid var(--hairline); }
.yourfeed-post > .card.post { border-bottom: none; padding-bottom: 4px; }
.yourfeed-post > .fine { margin: 12px var(--gutter) 0; padding-left: 52px; }
.yourfeed-react { margin: 0; padding: 0 var(--gutter) 12px calc(var(--gutter) + 52px); }
.yourfeed-react [aria-pressed="true"] { color: var(--accent); }
.yourfeed-step { margin: 0; }
.yourfeed-wizard { margin: 12px var(--gutter); }
.yourfeed-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.yourfeed-chips:empty { display: none; }
.yourfeed-chip {
  padding: 5px 12px;
  border: 1px solid var(--hairline);
  border-radius: var(--pill);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 0.9rem;
}
button.yourfeed-chip { cursor: pointer; }
button.yourfeed-chip:hover { border-color: var(--accent); }
.yourfeed-chip-still { color: var(--ink-2); }
.yourfeed-add { display: flex; gap: 8px; align-items: center; }
.yourfeed-add input { flex: 1; margin: 0; }
.yourfeed-option { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.yourfeed-option input { margin-top: 3px; }
.yourfeed-option > span { display: grid; gap: 2px; }
.yourfeed-option-off { opacity: 0.55; cursor: default; }
/* Wizard topics are toggles: off is an outline, on is the accent with a tick. */
button.yourfeed-chip { background: none; color: var(--ink-2); font-weight: 500; }
button.yourfeed-chip-on { background: var(--accent-wash); border-color: transparent; color: var(--accent-ink); font-weight: 600; }
.yourfeed-more { margin-top: 0; }
.yourfeed-finding { margin: 12px 0; text-align: center; }
.yourfeed-how summary { cursor: pointer; color: var(--ink-2); font-size: 0.9rem; }
.yourfeed-rule summary { cursor: pointer; color: var(--ink-2); }
.yourfeed-rule[open] { display: grid; gap: 8px; }
.discover-head {
  margin: 0;
  padding: 20px var(--gutter) 6px;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-3);
}
/* A tag search is a page about the tag: its name leads at title size, the
   total sits beside it. Gutter-aligned with the rows beneath it. */
.tag-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 18px var(--gutter) 8px;
}
.tag-head h3 { margin: 0; font-size: 20px; letter-spacing: -0.01em; }
.tag-head .muted { font-size: 13px; color: var(--ink-3); }
/* A search in flight: nothing at all for half a second, because that is how
   long most searches take, and a wait you never see is the best kind. Past
   that it owns up. Reduced motion keeps the delay and drops the fade. */
.search-wait {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 20px var(--gutter);
  color: var(--ink-3);
  opacity: 0;
  animation: fade-in 0.25s ease 0.5s forwards;
}
.person-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  padding: 10px var(--gutter);
  border-radius: 0;
  cursor: pointer;
  font-weight: 400;
}
.person-row:hover { background: var(--surface-2); }
.person-id { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.person-id .addr { font-weight: 650; letter-spacing: -0.01em; }
.person-id .muted { font-size: 13px; color: var(--ink-3); }

/* ----------------------------------------------------------- profile pages */

.profile-header {
  position: relative;
  padding: 18px var(--gutter);
  border-bottom: 1px solid var(--hairline);
}
.profile-id { display: flex; align-items: flex-start; gap: 14px; }
.profile-id .spacer { flex: 1; }
.name-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.profile-header h2 { margin: 0 0 1px; font-size: 21px; }
.profile-header .addr { color: var(--ink-3); margin: 0 0 6px; font-size: 14.5px; }
.profile-header .tagline { margin: 0 0 6px; font-weight: 600; }
.profile-header > p { margin: 10px 0 0; }
.profile-header .fine { margin: 2px 0 0; }

/* private accounts: requests row, request/member rows, feed's private card */
.requests-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  cursor: pointer;
}
.request-row, .member-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.request-body, .member-body { flex: 1; min-width: 0; }
.request-actions, .member-actions { display: flex; gap: 8px; flex-shrink: 0; }
.private-gap-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.following-badge {
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: var(--ink-2);
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: var(--pill);
  padding: 2px 9px;
}
.sug-dir .fine { color: var(--ink-3); }

/* Public (logged-out) pages get a slim bar instead of the app shell. */
.public-page { max-width: var(--col); margin: 0 auto; padding: 16px; }
.public-page > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.public-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.public-bar .logo {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  cursor: pointer;
  padding: 0;
}
.public-bar .logo:hover { color: var(--accent); background: none; }
.logo { display: flex; align-items: center; gap: 8px; }
.logo-mark { width: 26px; height: 26px; }

/* --------------------------------------------------- avatars & identities */

.avatar {
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  line-height: 1; /* the inherited line box would float the glyph high */
  user-select: none;
  flex-shrink: 0;
  object-fit: cover;
  vertical-align: middle;
}
.av24 { width: 24px; height: 24px; font-size: 12px; }
.av30 { width: 30px; height: 30px; font-size: 14px; }
.av32 { width: 32px; height: 32px; font-size: 15px; }
.av36 { width: 36px; height: 36px; font-size: 16px; }
.av40 { width: 40px; height: 40px; font-size: 17px; }
.av56 { width: 56px; height: 56px; font-size: 24px; }

/* -------------------------------------------------------- panels & lists */

section.card h3 { margin-top: 0; }
/* A link-styled button that starts a line keeps the block's left edge. */
section.card > button.linkish { margin-left: -6px; }
/* "Automatically approve people I follow", under Private account (ui/awayswitch.js). */
.away-switch { margin-top: 12px; border-top: 1px solid var(--hairline); padding-top: 12px; }
.away-switch[hidden] { display: none; }
.away-switch h4 { margin: 0 0 6px; }
.away-switch > button.linkish { margin-left: -6px; }
.away-sheet { border: 1px solid var(--border); border-radius: 8px; padding: 12px; }
.away-sheet p { margin: 0 0 10px; }
.away-sheet-actions { display: flex; align-items: center; gap: 12px; }
.passkey-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  font-size: 14px;
}
/* What can act for you: what it allows on the left, Remove on the right. */
.permission-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  font-size: 14px;
  border-top: 1px solid var(--line);
}
.permission-row:first-child { border-top: 0; }
.permission-row .fine { margin: 2px 0 0; }
.user-menu {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  padding: 6px;
  box-shadow: var(--shadow);
  min-width: 232px;
  z-index: 40;
}
.user-menu-pop { position: absolute; } /* top/left set by positionUnder() */
.user-menu { animation: menu-drop 0.15s ease-out; transform-origin: top left; }
.user-menu :is(button, a) {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 38px;
  text-align: left;
  border: none;
  background: none;
  border-radius: var(--r-sm);
  padding: 8px 10px;
  font-weight: 500;
  color: inherit;
  text-decoration: none;
}
.user-menu :is(button, a):hover { background: var(--surface-2); }
.user-menu :is(button, a) svg.icon { width: 17px; height: 17px; color: var(--ink-3); flex: none; }
.user-menu .danger-item { color: var(--danger); }
.user-menu .danger-item svg.icon { color: var(--danger); }

/* post editing: the inline editor and the audit trail */
.post-editor textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  padding: 9px 11px;
  margin-top: 6px;
  resize: vertical;
}
.post-editor textarea:focus { outline: none; border-color: var(--accent); }
.editor-row { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.edited-note { font-size: 12px; margin-left: -6px; }
.edit-trail-item {
  border-left: 2px solid var(--hairline);
  padding-left: 12px;
  margin: 8px 0;
  color: var(--ink-2);
}
.edit-trail-item .content { margin: 2px 0; font-size: 14.5px; }

/* starter packs */
.pack-card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px;
  margin: 12px var(--gutter) 16px;
  background: var(--surface-2);
}
.pack-card h3 { margin: 0 0 4px; font-size: 16px; }
.pack-members { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 12px 0; }
.pack-member { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.pack-conflict { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.pack-conflict input { flex: 0 1 160px; }

/* the Mastodon & Bluesky settings card: numbered steps on a quiet rail,
   and the live name previews that answer "which handle goes here?" */
ol.steps { list-style: none; counter-reset: fedistep; margin: 14px 0 4px; padding: 0; display: grid; gap: 16px; }
ol.steps > li { counter-increment: fedistep; display: grid; grid-template-columns: 22px 1fr; gap: 12px; }
ol.steps > li::before {
  content: counter(fedistep);
  width: 22px; height: 22px; border-radius: 50%;
  border: 1px solid var(--line); color: var(--ink-3);
  font-size: 12px; font-weight: 650; line-height: 20px; text-align: center;
}
ol.steps > li > div > b { font-weight: 650; font-size: 14px; }
section.card b:not(.fedi-name) {
  display: block;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.005em;
  margin: 4px 0 2px;
}
ol.steps input { margin: 6px 0 2px; }
ol.steps .fine { margin: 4px 0 0; }
ol.steps button { margin-top: 8px; }
.fedi-name { font-weight: 650; overflow-wrap: anywhere; }
.fedi-bsky { margin: 12px 0; }
.fedi-toggle { display: flex; align-items: center; gap: 8px; }
.fedi-bsky .fine { margin: 4px 0 0 24px; }
.fedi-move { border: 1px solid var(--line); border-radius: var(--r); padding: 12px; margin: 12px 0; }
.fedi-move .fine { margin: 4px 0 0; }
.fedi-done { font-weight: 550; }
/* Still settling. */
.fedi-pending { color: var(--ink-2); }
.fedi-pending .pulse { margin-right: 0.5em; }

/* Your own follows, opened under your profile header — a people list, so it
   reads like every other people list. */
.follow-list { display: flex; flex-direction: column; margin-top: 12px; }
.follow-list .follow-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: none;
  border: none;
  padding: 8px 10px;
  margin: 0 -10px;
  cursor: pointer;
  border-radius: var(--r-sm);
  text-align: left;
  font: inherit;
  font-weight: 400;
  color: var(--ink);
}
.follow-list .follow-row .name { font-weight: 650; letter-spacing: -0.01em; }
.follow-list .follow-row:hover { background: var(--surface-2); }

/* -------------------------------------------------- onboarding & the gate */

.onboarding { min-height: 100vh; display: grid; place-items: center; padding: 24px 0; }
.onboarding-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 32px;
  width: min(440px, 92vw);
  box-shadow: var(--shadow);
}
.onboarding-card h1 { margin-top: 0; display: flex; align-items: center; gap: 10px; font-size: 27px; }
.onboarding-card h1 .logo-mark { width: 40px; height: 40px; }
.tagline { color: var(--ink-2); }
.tagline.pitch { font-weight: 600; color: var(--ink); }
.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tabs button.active {
  background: var(--accent-wash);
  border-color: transparent;
  color: var(--accent-ink);
}
.signup-nudge { margin-top: 14px; }
.get-apps { border-top: 1px solid var(--hairline); margin: 22px 0 0; padding-top: 16px; font-size: 14px; }
.get-apps a { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.get-apps a:hover { text-decoration: underline; }
.get-apps svg.icon { width: 16px; height: 16px; }

/* Add account (ui/addaccount.js): a panel in the signed-in shell, sized to
   its content — not the .onboarding full-page takeover. It reuses the same
   pagehead + section.card language every other panel view already uses, so
   it reads as belonging rather than a bolted-on screen. */
.pagehead h1 { margin: 0; font-size: 20px; }
/* Plain labels here always introduce a control below them; block keeps a
   label from running on with whatever sits right before it (a button, in
   the "Or a recovery code" case) instead of sharing its line. */
.addaccount label { display: block; margin: 10px 0 4px; }
.addaccount .cancel { display: block; margin: 10px 0 4px var(--gutter); }

/* --------------------------------------------------- notices & boot gate */

.banner {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--bg);
  border-radius: var(--pill);
  padding: 9px 20px;
  font-size: 14px;
  font-weight: 500;
  z-index: 80;
  box-shadow: var(--shadow);
}
/* a calm, non-alarming top notice (address not confirming) */
.notice {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--accent-wash);
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  padding: 9px 16px;
  font-size: 14px;
  text-align: center;
}
.notice button.linkish { color: var(--accent-ink); font-weight: 650; }

/* Boot reveal (ui/bootgate.js): the app assembles invisibly and appears in
   one paint. The loader fades in only when assembly outlasts 500ms. */
body.booting #root, body.booting .banner, body.booting .notice { visibility: hidden; }
.boot-loader {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  animation: fade-in 0.25s ease 0.5s forwards;
}
.boot-loader .logo-mark { width: 56px; height: 56px; animation: boot-loader-pulse 1.4s ease-in-out infinite; }
@keyframes boot-loader-pulse { 50% { transform: scale(0.88); opacity: 0.65; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .boot-loader .logo-mark { animation: none; }
}

/* ================================================== medium: the icon rail */

@media (max-width: 1180px) {
  :root { --rail: 76px; }
  .rail { align-items: center; padding: 18px 10px 16px; }
  .rail-label { display: none; }
  /* The room keeps its well around the icons; the switcher is just the
     place's mark. */
  .room { margin: -6px -4px 8px; padding: 6px 4px 10px; align-items: center; }
  .place-switch { justify-content: center; padding: 6px; }
  .place-names, .place-switch > svg.icon { display: none; }
  .room .compose-rail { margin-top: 10px; }
  /* The icon rail is narrower than the menu: grow it rightward, over the page. */
  .rail .menu-places { right: auto; }
  .rail-item { justify-content: center; padding: 12px; border-radius: 14px; }
  .compose-rail { width: 48px; height: 48px; padding: 0; border-radius: 50%; align-self: center; }
  .rail-you { justify-content: center; padding: 8px 0; }
  .rail-you-names, .rail-you svg.icon { display: none; }
  .rail .menu { left: 0; min-width: 224px; }
  .nav-count {
    position: absolute;
    top: 6px;
    right: 6px;
    margin: 0;
    font-size: 10px;
    padding: 0 5px;
  }
  .rail-item { position: relative; }
}

/* =========================================== mobile: top bar + three tabs */

@media (max-width: 700px) {
  :root { --gutter: 14px; }
  .shell { display: block; }
  .shell::after { display: none; }
  .chrome { position: static; height: auto; }
  .rail { display: none; }
  .main {
    max-width: 100%;
    margin: 0;
    /* the tabs, plus room to see the last row clear of them */
    padding: 0 0 calc(var(--tabs-h) + 18px + env(safe-area-inset-bottom));
  }
  /* A view that fills the window owns its own bottom edge: no padding under
     it, and the floating compose button steps aside rather than landing on
     whatever that view put there. */
  .shell.wide .main { padding-bottom: 0; }
  .shell.wide .compose-fab { display: none; }
  /* Full-bleed on a phone: the surface is the screen, not a card on it. */
  .main > div { border: none; border-radius: 0; min-height: 100vh; margin-bottom: 0; box-shadow: none; }
  /* Exactly the window, less the bar above and the tabs below. */
  .main > div.fill {
    height: calc(100vh - var(--bar-h) - var(--tabs-h)
                 - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    min-height: 0;
  }
  .pagehead { display: none; }

  .bar {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
    height: calc(var(--bar-h) + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 10px 0;
    background: var(--surface);
    background: color-mix(in srgb, var(--surface) 90%, transparent);
    -webkit-backdrop-filter: blur(16px) saturate(1.7);
    backdrop-filter: blur(16px) saturate(1.7);
    border-bottom: 1px solid var(--hairline);
  }
  .bar-you, .bar-more, .bar-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    padding: 0;
    border-radius: 50%;
    color: var(--ink-2);
  }
  .bar-more svg.icon, .bar-back svg.icon { width: 22px; height: 22px; }
  .bar-you:hover, .bar-more:hover, .bar-back:hover { background: var(--surface-2); }
  .bar-title {
    text-align: center;
    font-size: 16px;
    font-weight: 650;
    letter-spacing: -0.015em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  /* On a place's front page the title is the switcher; on its other pages
     the place rides under the title. */
  .bar > .place-anchor { justify-self: center; min-width: 0; max-width: 100%; }
  .bar-place {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    max-width: 100%;
    padding: 4px 8px;
    border: none;
    background: none;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.015em;
    color: var(--ink);
  }
  .bar-place span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .bar-place:hover { background: none; }
  .bar-sub { display: block; font-size: 11.5px; font-weight: 600; letter-spacing: 0; color: var(--room-ink); line-height: 1.2; }
  /* The bar and the tabs carry only the place's pages, so they are the room. */
  .shell.in-community .bar, .shell.in-community .tabbar { background: var(--room-wash); }
  .shell.in-community .bar { border-bottom-color: color-mix(in srgb, var(--room) 14%, var(--hairline)); }
  .shell.in-community .tabbar { border-top-color: color-mix(in srgb, var(--room) 14%, var(--hairline)); }
  .bar .menu { max-width: calc(100vw - 20px); }

  .tabbar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    position: fixed;
    inset: auto 0 0 0;
    z-index: 50;
    padding: 4px 0 env(safe-area-inset-bottom);
    background: var(--surface);
    background: color-mix(in srgb, var(--surface) 93%, transparent);
    -webkit-backdrop-filter: blur(16px) saturate(1.7);
    backdrop-filter: blur(16px) saturate(1.7);
    border-top: 1px solid var(--hairline);
  }
  .tabbar-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 50px;
    border: none;
    background: none;
    border-radius: 0;
    color: var(--ink-3);
  }
  .tabbar-item svg.icon { width: 23px; height: 23px; }
  .tabbar-item:hover { background: none; }
  .tabbar-item.active { color: var(--room-ink); }

  .compose-fab {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    right: 16px;
    bottom: calc(66px + env(safe-area-inset-bottom));
    z-index: 45;
    width: 52px;
    height: 52px;
    padding: 0;
    border-radius: 50%;
    background: var(--depth-face), var(--action);
    border-color: transparent;
    color: var(--on-action);
    --lift: var(--raised-fill), 0 6px 18px rgb(99 36 235 / 0.30);
  }
  .compose-fab:hover { background: var(--depth-face), var(--action-hover); }
  .compose-fab svg.icon { width: 22px; height: 22px; }

  .card { padding: 13px var(--gutter); }
  .card.post { grid-template-columns: 38px minmax(0, 1fr); column-gap: 10px; }
  .indent > .card.post { padding-left: calc(var(--gutter) + 18px); }
  .repost-note { padding-left: calc(var(--gutter) + 48px); }
  .yourfeed-react { padding-left: calc(var(--gutter) + 48px); }
  .yourfeed-post > .fine { padding-left: 48px; }
  .media { max-height: 60vh; }
  /* Touch has no hover to reveal it, so the kebab stays put. */
  .card.post .kebab { opacity: 1; }

  /* The profile header stacks: actions on the avatar's line, identity on
     its own, so a long name isn't squeezed into a third of the width. */
  .profile-id { flex-wrap: wrap; align-items: center; }
  .profile-id > div:not(.avatar) { order: 5; flex: 1 0 100%; margin-top: 10px; }
  .profile-id .spacer { order: 2; }
  .profile-id > button { order: 3; }

  .search-row, .viewtabs { padding-left: var(--gutter); padding-right: var(--gutter); }
  .search-row { padding-top: 12px; }

  /* Messages: one pane at a time */
  .dm-layout { grid-template-columns: 1fr; }
  .dm-list { border-right: none; }
  .dm-layout.has-peer .dm-list { display: none; }
  .dm-layout:not(.has-peer) .dm-thread { display: none; }
  .dm-back { display: inline-flex; align-self: flex-start; margin: 8px 8px 0; }
  .bubble { max-width: 86%; }

  .modal-overlay { padding-top: 6vh; }
  .pack-card { margin-inline: var(--gutter); }
  .public-page { padding: 12px; }
}

/* The quote composer: a sheet over the app, in the ui/lightbox.js mould. */
.quote-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 8vh 16px 16px;
  background: rgb(0 0 0 / 55%);
}
.quote-sheet {
  position: relative;
  width: 100%;
  max-width: 560px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  /* A long quoted post on a short viewport used to push Post off the bottom
     of the screen with no way to reach it. 100% is the overlay's content box
     — the viewport less its padding — so the sheet stops at the fold and
     scrolls inside instead of overflowing past it. */
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.quote-close {
  position: absolute;
  top: 8px;
  right: 8px;
  border: 0;
  background: none;
  color: var(--ink-3);
  cursor: pointer;
}

/* Communities are a posting destination, independent of the active profile.
   No bottom rule: this sits directly above the view's card, which draws its
   own top edge — the two together read as a line, a gap, and then another
   line, with the first running wider than the second. Space separates them.

   A community's colour is a hint of the place, never a fill: a few percent
   of wash here and in its room, the letter that stands in for a missing
   logo, and the ink of the item you're on. Never on a button, never as a
   link — actions stay Woodstar's violet in every place. The one place it
   carries text, the ink is walked until it reads at 4.5:1 in both schemes
   (lib/roomcolour.js), so an admin can pick any colour and nothing becomes
   unreadable. --community-accent is set on this element by
   ui/community/banner.js, so it cannot leak past it. */
.community-banner {
  padding: 16px 20px 18px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--resting);
  /* A card of its own above the view's, on the surface rather than the page:
     mixed into the page tint it read as a grey smudge. Two and a half
     percent of the place's colour — enough to belong to the place, far too
     little to move any text's contrast against it. */
  background: color-mix(in srgb, var(--community-accent, var(--room, var(--accent))) 2.5%, var(--surface));
}
@media (max-width: 700px) {
  .community-banner { margin-bottom: 0; border: none; border-radius: 0; box-shadow: none; border-bottom: 1px solid var(--hairline); }
}
.community-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
/* The Communities page (ui/communities.js): the idea first, then the places,
   then a quiet way to start one. */
.communities-page { padding-bottom: 8px; }
.explainer { padding: 22px var(--gutter) 8px; }
.orbit-slot { display: flex; justify-content: center; margin-bottom: 6px; }
.orbit { width: 300px; max-width: 100%; height: auto; }
.orbit-path { fill: none; stroke: var(--line); stroke-dasharray: 2 6; }
.orbit-empty { fill: var(--surface-2); stroke: var(--line); }
.orbit-home { fill: color-mix(in srgb, #6324eb 10%, var(--surface)); stroke: var(--accent); stroke-width: 2; }
.explainer h1 { margin: 0 0 6px; font-size: 26px; letter-spacing: -0.025em; text-align: center; }
.explainer-lede { margin: 0 auto 18px; max-width: 46ch; text-align: center; color: var(--ink-2); font-size: 15.5px; line-height: 1.5; }
.explainer-points {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
  padding: 16px;
  border-radius: var(--r);
  background: var(--surface-2);
}
.explainer-point { display: flex; gap: 10px; align-items: flex-start; }
.explainer-point strong { font-size: 14.5px; }
.explainer-point p { margin: 2px 0 0; font-size: 13.5px; color: var(--ink-3); line-height: 1.45; }
.explainer-icon {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: color-mix(in srgb, #6324eb 10%, var(--surface));
  color: var(--accent);
}
.place-section h2 {
  margin: 22px var(--gutter) 6px;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.place-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px var(--gutter);
  border: none;
  border-top: 1px solid var(--hairline);
  border-radius: 0;
  background: none;
  text-align: left;
  --lift: none;
  --press: none;
  --drop: 0;
}
.place-item:hover { background: var(--surface-2); }
.place-item:disabled { opacity: 0.55; cursor: default; }
.place-item > svg.icon { color: var(--ink-3); flex: none; }
.place-item-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.place-item-text strong { display: flex; align-items: center; gap: 8px; font-size: 15.5px; }
.place-item-about { font-size: 13.5px; color: var(--ink-2); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.place-item-meta { font-size: 12.5px; color: var(--ink-3); font-weight: 400; }
.here-tag {
  font-size: 11px;
  font-weight: 650;
  padding: 1px 7px;
  border-radius: var(--pill);
  background: color-mix(in srgb, var(--room) 12%, var(--surface));
  color: var(--room-ink);
}
.community-start {
  margin: 16px var(--gutter) 8px;
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: var(--r);
}
.community-start[hidden] { display: none; }
.community-start-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.community-start-head p { margin: 2px 0 0; }
.community-start-head button { white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.community-create { display: grid; gap: 14px; padding: 16px 0 0; }
@media (max-width: 700px) {
  .explainer-points { grid-template-columns: 1fr; }
  .community-start-head { flex-direction: column; align-items: flex-start; }
}

/* The first visit to a community (ui/community/welcome.js). */
.community-welcome {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--hairline);
}
.community-welcome-body { flex: 1; min-width: 0; }
.community-welcome h2 { margin: 2px 0 8px; font-size: 19px; }
.community-welcome ul { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 8px; }
.community-welcome li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.community-welcome li svg.icon { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--room-ink); }
.community-welcome-done { padding-left: 0; font-weight: 600; color: var(--room-ink); }
.community-create[hidden] { display: none; } /* display: grid would otherwise beat the UA hidden rule */
.community-create label { display: grid; gap: 6px; }
.community-create .community-sharing { display: flex; align-items: center; gap: 10px; }
.community-sharing input { width: auto; }
.community-destination { padding: 0 0 8px; font-weight: 600; }

/* --- community roles, standing and moderation ------------------------- */

/* What a moderator decided, shown to the person it was decided about. Loud
   enough to be read before the control it replaces, quiet enough not to be
   an alarm — it is usually the start of a conversation, not a punishment. */
.standing-notice {
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-sm);
  padding: 0.6rem 0.75rem;
  background: var(--surface-2);
  display: grid;
  gap: 0.25rem;
}
.standing-notice strong { font-weight: 600; }
.composer-standing:not(:empty) { margin-bottom: 0.5rem; }

.community-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.community-controls .standing-notice { flex: 1 1 100%; }

.members-panel { display: grid; gap: 0.75rem; padding-inline: var(--gutter); }
.member-groups { display: grid; gap: 1rem; }
.member-group h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  margin: 0 0 0.25rem;
}
/* Positioned, because attachMenu anchors its popover to this element. */
.member-row { position: relative; }
.member-main { display: flex; align-items: center; gap: 0.6rem; }
.member-who { display: flex; flex-direction: column; min-width: 0; }
.member-who strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-standing { color: var(--ink-2); }
.member-menu { margin-left: auto; padding: 0.25rem; }

/* The in-place expansion. Indented under its row so it reads as belonging to
   that person rather than to the list. */
.mod-panel {
  display: grid;
  gap: 0.5rem;
  margin: 0.5rem 0 0.75rem 2.6rem;
  padding: 0.75rem;
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  background: var(--surface-2);
}
.mod-panel label { display: grid; gap: 0.25rem; font-size: 0.85rem; color: var(--ink-2); }
.mod-panel-actions { display: flex; gap: 0.5rem; align-items: center; }

.duration-field { border: 0; margin: 0; padding: 0; }
.duration-field legend { font-size: 0.85rem; color: var(--ink-2); padding: 0 0 0.25rem; }
.duration-choices { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--hairline);
  border-radius: var(--pill);
  padding: 0.25rem 0.7rem;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 0.85rem;
}
.chip:hover { background: var(--surface-2); color: var(--ink); }
/* The chosen one has to be visible without color alone. */
.chip[aria-checked="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}

.manage-page { display: grid; }
.manage-body { padding: 0.75rem 0; }

/* Who can post: two choices as cards rather than bare radios, because each
   needs a sentence to be understood and a label on its own would not do it. */
.voice-choices { display: grid; gap: 0.5rem; }
.voice-choice {
  display: grid;
  gap: 0.15rem;
  text-align: left;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
}
.voice-choice:hover { background: var(--surface-2); }
/* Not colour alone: the chosen one is also the only one with a filled edge. */
.voice-choice[aria-checked="true"] {
  border-color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
  background: var(--surface-2);
}
.about-panel { display: grid; gap: 0.75rem; }
.about-panel h3 { margin: 0.25rem 0 0; font-size: 0.95rem; }

/* Deletion is folded away and opens onto the one thing that makes it real:
   typing the name. */
.danger-zone { margin-top: 0.5rem; border-top: 1px solid var(--hairline); padding-top: 0.75rem; }
.danger-zone summary { cursor: pointer; color: var(--ink-2); font-size: 0.9rem; }
.danger-zone[open] summary { margin-bottom: 0.5rem; }
.danger-zone label { display: grid; gap: 0.25rem; font-size: 0.85rem; color: var(--ink-2); margin-bottom: 0.5rem; }

/* A community's own picture, in the banner and in its settings. Square with
   a soft corner rather than a circle: a circle is a person, and this is a
   place. */
.community-logo {
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  object-fit: cover;
  flex: none;
}
.community-about { margin: 0.15rem 0 0; }
/* Bigger where it is being chosen — you are looking at the picture, not
   past it. */
.community-logo-slot .community-logo { width: 48px; height: 48px; }
.danger-body { display: grid; gap: 0.5rem; }
.about-panel textarea { width: 100%; resize: vertical; }

/* The wide image above a profile or a community. Fixed aspect so a tall
   upload cannot push the page it belongs to off the screen. */
.profile-cover, .community-cover {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 1;
  object-fit: cover;
}
.profile-cover {
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  /* The header card owns the padding; the image goes edge to edge inside it.
     Width is stated rather than left to `auto` — an <img> is a replaced
     element, so `auto` is its intrinsic width, and a wide upload would
     overflow the card while a narrow one sat short of both edges. */
  width: calc(100% + 2 * var(--gutter));
  margin: -18px calc(-1 * var(--gutter)) 12px;
}
.community-cover { border-radius: var(--r-sm); margin-bottom: 12px; }
.community-cover-slot:empty { display: none; }
.cover-preview { border-radius: var(--r-sm); margin: 0; width: 100%; }
.cover-slot:empty { display: none; }
.cover-input { display: none; }

.community-picture-field { display: grid; gap: 0.35rem; }
.community-picture-row { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.community-cover-slot { flex: 1 1 220px; max-width: 320px; }
.community-cover-empty {
  display: grid;
  place-items: center;
  aspect-ratio: 3 / 1;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px dashed var(--hairline);
  color: var(--ink-2);
}
/* The third and last place a community's colour shows: the square where a
   logo would be. Still not behind body text — the single letter on it is
   sized and weighted to carry on any hue. */
.community-logo-empty {
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--community-accent, var(--accent)) 22%, var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--community-accent, var(--accent)) 40%, transparent);
  color: var(--ink);
  font-weight: 600;
}

/* GIF search lives next to the composer, with feedback at the action. */
.gif-picker { padding: 12px 0; }
.gif-search-row { display: flex; gap: 8px; }
.gif-search-row input { min-width: 0; flex: 1; }
.gif-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; max-height: 300px; overflow: auto; }
.gif-grid .gif-image { overflow: hidden; border-radius: 8px; }
.gif-select { position: absolute; inset: 0; padding: 0; background: transparent; border: 0; }
.gif-select:hover { background: rgb(255 255 255 / 0.08); }
.gif-grid img { width: 100%; height: 100px; object-fit: cover; display: block; }
.gif-image { display: inline-block; position: relative; max-width: 100%; vertical-align: top; }
.gif-image > img { display: block; }
.media-grid > .gif-image:only-child { width: 100%; }
.attach > .gif-image { width: 100%; height: 100%; }
.gif-replay {
  position: absolute; right: 4px; bottom: 4px; z-index: 1;
  display: grid; place-items: center; width: 36px; height: 36px;
  padding: 0; border: 0; border-radius: 50%; line-height: 1;
  color: white; background: rgb(0 0 0 / 0.65); cursor: pointer;
}
.gif-replay[hidden] { display: none; }
.gif-replay:hover { background: rgb(0 0 0 / 0.85); }
.gif-replay .icon { display: block; width: 18px; height: 18px; }
/* Polls stay in the post's text column, with inline outcomes. */
.poll { display: grid; gap: 8px; margin-block: 12px; }
.poll-choice { width: 100%; text-align: left; border: 1px solid var(--accent); color: var(--accent); padding: 10px 12px; border-radius: 8px; white-space: normal; overflow-wrap: anywhere; }
.poll-result { position: relative; isolation: isolate; display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 8px; overflow: hidden; background: var(--bg); overflow-wrap: anywhere; }
.poll-bar { position: absolute; inset: 0 auto 0 0; z-index: -1; background: var(--accent); opacity: .16; }
.poll-result strong { flex-shrink: 0; }
.poll p { margin: 0; }
.poll-compose { border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin-block: 8px; min-width: 0; }
.poll-compose[hidden] { display: none; }
.poll-compose input { display: block; width: 100%; margin-block: 8px; }
.poll-compose-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
/* Scheduled posts: the composer's time picker, and the list of what's waiting. */
.schedule-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin-block: 8px; }
.schedule-pick[hidden] { display: none; }
.schedule-done:empty { display: none; }
.scheduled-item { padding: 12px var(--gutter); }
.scheduled-when { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.scheduled-text { margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Sponsored posts (ui/sponsorlabel.js). The label is calm but unmistakable:
   a filled pill in the accent wash with the accent's own ink, bold — never
   styled to blend into the author line. Both themes define the two
   variables, so it reads in the dark as well. The composer shows the same
   pill when a post will be an ad (ui/postas.js). */
.sponsor-chip, button.linkish.sponsor-chip {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--accent-ink);
  background: var(--accent-wash);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: var(--pill);
  padding: 2px 9px;
  white-space: nowrap;
  box-shadow: none;
}
button.linkish.sponsor-chip:hover { color: var(--accent-ink); background: color-mix(in srgb, var(--accent) 16%, var(--surface)); }
.sponsor-why {
  margin: 6px 0 4px;
  padding: 0.5rem 0.75rem;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  display: grid;
  gap: 6px;
  justify-items: start;
}
.sponsor-why[hidden], .sponsored-gone[hidden] { display: none; }
.sponsor-withdraw { display: grid; gap: 6px; justify-items: start; }
.sponsored-note { padding: 0.75rem 1rem; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.sponsored-note p { margin: 0; }
/* The composer's author chip and what sits beside it (ui/postas.js). */
.postas-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.postas-head[hidden] { display: none; }
button.postas-trigger {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px 3px 4px; font-weight: 600; font-size: 14px;
}
.postas-trigger svg.icon { width: 16px; height: 16px; color: var(--ink-3); }
.postas-anchor .menu { top: calc(100% + 6px); left: 0; transform-origin: top left; animation: menu-drop 0.15s ease-out; }
.postas-item:disabled { opacity: 0.55; cursor: default; }
.postas-item svg.icon { margin-left: auto; color: var(--accent); }
.postas-usage { color: var(--ink-2); }
/* Offering to sponsor: a real button beside Join, quieter than it. */
button.sponsor-offer { font-size: 14px; }
/* The apply page's own sentences line up with its cards. */
.sponsor-apply > p, .sponsor-apply-body > p { padding-inline: var(--gutter); }
.sponsor-rules { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.sponsor-rules input[type="number"] { width: 4.5em; }
.sponsors-panel ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.sponsor-app p, .sponsor-row p { margin: 4px 0; }

/* Settings → What can act for you: a row's actions, and adding a person. */
.permission-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.permission-actions { display: flex; gap: 12px; }
.permission-add { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* --- Share on Woodstar (/share, ui/share.js): a page of its own --- */
.share-page { max-width: 560px; margin: 0 auto; padding: 18px 16px 40px; display: flex; flex-direction: column; gap: 12px; }
.share-head { display: flex; align-items: center; gap: 9px; font-size: 16px; }
.share-head svg { width: 26px; height: 26px; }
.share-account { display: flex; align-items: center; gap: 9px; font-size: 14px; }
.share-who { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; }
.share-destination { display: flex; align-items: center; gap: 8px; }
.share-dest { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px 5px 6px; border-radius: 999px; font-weight: 650;
  background: color-mix(in srgb, var(--room, var(--accent)) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--room, var(--accent)) 28%, var(--line)); }
.share-dest svg { width: 15px; height: 15px; opacity: .7; }
.share-page .composer { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px 14px; }
.share-preview { padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.share-text { margin: 0 0 8px; font-size: 17px; white-space: pre-wrap; overflow-wrap: anywhere; }
.share-to { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; }
.share-notice { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 12px; border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 6%, var(--surface)); font-size: 14px; }
.share-notice > svg { width: 16px; height: 16px; color: var(--accent); }
.share-notice > span { flex: 1 1 200px; }
.share-notice .error { flex-basis: 100%; margin: 0; }
.share-wide { width: 100%; justify-content: center; }
.share-center { text-align: center; }
.share-join { display: flex; flex-direction: column; gap: 10px; padding: 16px; }
.share-join[hidden] { display: none; } /* shown only once "How to join" is pressed */
.share-join h2 { margin: 0; font-size: 19px; }
.share-join p { margin: 0; }
.share-kept { display: flex; align-items: center; gap: 6px; color: #059669; font-weight: 600; font-size: 14px; }
.share-kept svg { width: 16px; height: 16px; }
.share-or { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: 12.5px; }
.share-or::before, .share-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.share-done { text-align: center; padding: 26px 20px; }
.share-done h2 { margin: 10px 0 0; }
.share-done .row-actions { justify-content: center; flex-wrap: wrap; }
.share-done-icon { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 50%;
  background: color-mix(in srgb, #059669 14%, var(--surface)); color: #059669; }
.share-done-icon svg { width: 26px; height: 26px; }
.share-anchor .menu { min-width: 280px; }
.share-page .community-destination { display: none; } /* the "Post to" pill says it */
