:root {
  color-scheme: light dark;
  --bg: #fff; --fg: #1c1c1e; --muted: #6b6b70; --card: #fff; --line: #e3e3e6;
  --accent: #ff6600; --accent-hover: #ff8533; --accent-fg: #1c1c1e; --link: #c2410c; --link-hover: #9a3412;
  --icon: #f26100; --highlight: #f26100; --danger: #8b1a10; --danger-bg: #fef0ee;
}
/* Colour roles. --accent fills buttons and badges (orange by day, gold by
   night) under dark text, --accent-hover is its hover shade, --accent-fg the
   text on it. --link is links (a burnt orange by day, since the bright orange is
   too light for text on white), --link-hover its hover. --icon is
   active and hover glyphs (favorite, boost, composer tools; icons need 3:1, so
   a hair deeper than the fill does). --highlight marks
   without text (unread stripe, focused post). --danger is error text on its
   --danger-bg box, kept apart from the reds above by shade and by the box.
   Every pair is held to WCAG AA by TestPalette_Contrast.
   Dark applies when forced, or when the theme is "system" (no data-theme)
   and the OS prefers dark. Keep both blocks in sync (the test checks). */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111113; --fg: #ececee; --muted: #9a9aa0; --card: #1a1a1d; --line: #2c2c31;
  --accent: #ffcc00; --accent-hover: #ff9900; --accent-fg: #111113; --link: #ffcc00; --link-hover: #ff9900;
  --icon: #ffcc00; --highlight: #ff9900; --danger: #ef7a7a; --danger-bg: #241313;
}
:root[data-theme="light"] { color-scheme: light; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #111113; --fg: #ececee; --muted: #9a9aa0; --card: #1a1a1d; --line: #2c2c31;
    --accent: #ffcc00; --accent-hover: #ff9900; --accent-fg: #111113; --link: #ffcc00; --link-hover: #ff9900;
    --icon: #ffcc00; --highlight: #ff9900; --danger: #ef7a7a; --danger-bg: #241313;
  }
}

/* Spacing, type and layout follow Bluesky's web client (its design tokens):
   space 4/8/12/16/20/24, body 15px at 1.5, small 13px, radii 8/12, 42px avatars,
   a 240px navigation (80px icon rail on narrower screens) and a 600px feed column. */
:root {
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px;
  --fs: 15px; --fs-sm: 13px; --fs-nav: 18.8px;
  --r-sm: 8px; --r-md: 12px;
  --avatar: 42px; --nav: 240px; --nav-min: 80px; --col: 600px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: var(--fs)/1.5 system-ui, sans-serif; }
a { color: var(--link); }
a:hover { color: var(--link-hover); }
/* Links in post text can't rely on colour alone (blue vs. black, gold vs.
   white are too close in lightness), so they keep an underline. */
.content a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.content a:hover { text-decoration-thickness: 2px; }
/* Icons come from the sprite (static/icons.svg); the stroke style is set here once
   and inherited into every <use>. */
.icon { width: 20px; height: 20px; flex: none; vertical-align: middle; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.act.on .icon { fill: currentColor; }
/* Every post action is the same box, so links (reply, quote) and buttons line up. */
.status footer a, .status footer button { display: inline-flex; align-items: center; gap: var(--sp-1); height: 32px; padding: 0; line-height: 1; font-size: var(--fs-sm); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Layout: navigation + feed column, centred together. */
.shell { display: grid; grid-template-columns: var(--nav) minmax(0, var(--col)); justify-content: center; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: var(--sp-4); padding: var(--sp-4); overflow-y: auto; scrollbar-width: thin; }
.side a { text-decoration: none; }
.side nav { display: flex; flex-direction: column; gap: var(--sp-1); }
.side nav a { position: relative; display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3); border-radius: 999px; color: var(--fg); font-size: var(--fs-nav); line-height: 1.2; }
.side nav a:hover { background: color-mix(in srgb, var(--fg) 8%, transparent); }
/* The current page: link colour, bold, on a faint tint of the accent. */
.side nav a[aria-current="page"] { color: var(--link); font-weight: 700; background: color-mix(in srgb, var(--accent) 10%, transparent); }
.side nav .ico { width: 28px; display: grid; place-items: center; flex: none; }
.side nav .icon { width: 26px; height: 26px; }
.side nav .badge { margin-left: auto; }
/* Sign out sits at the foot of the navigation, shaped like a nav item. */
.side-foot { margin: auto 0 0; }
.side-foot button { display: flex; align-items: center; gap: var(--sp-3); width: 100%; padding: var(--sp-3); border-radius: 999px; color: var(--muted); font-size: var(--fs); text-decoration: none; }
.side-foot button:hover { background: color-mix(in srgb, var(--fg) 8%, transparent); color: var(--fg); }
.side-foot .ico { width: 28px; display: grid; place-items: center; flex: none; }
/* Your account (top of the phone drawer), the top bar and the drawer's state
   exist on phones only. */
.side .me, .topbar, .nav-open, .nav-backdrop { display: none; }
/* On a phone the checkbox stays in the tab order (visually hidden by .sr), so
   the keyboard can open the menu; its label, the menu button, shows the focus. */
/* The brand is the instance's domain, which can be long: it wraps rather than overflow. */
.brand { font-weight: 800; font-size: 22px; line-height: 1.2; padding: 0 var(--sp-3); overflow-wrap: anywhere; color: var(--fg) !important; text-decoration: none; }

/* The feed column: hairlines left and right, rows run edge to edge inside it. */
main { min-width: 0; min-height: 100vh; border-inline: 1px solid var(--line); padding: 0; }
main > h1 { font-size: 20px; margin: 0; padding: var(--sp-4); border-bottom: 1px solid var(--line); }
main > .hint, main > .empty, main > .more, main > .error { padding: var(--sp-4); margin: 0; }
main > .notif-bar, main > .thread-toggle, main > .notif-new { padding: var(--sp-3) var(--sp-4); margin: 0; border-bottom: 1px solid var(--line); }

main { grid-column: -2; }
/* Signed out (the login page): one column, no sidebar, no borders, only as tall
   as it needs to be and near the top of the screen. */
.shell.solo { grid-template-columns: minmax(0, 26rem); min-height: 0; align-content: start; padding: min(12vh, 6rem) var(--sp-4) var(--sp-4); }
.solo main { border: 0; min-height: 0; }
.login h1 { font-size: 28px; font-weight: 800; margin: 0 0 var(--sp-2); overflow-wrap: anywhere; }
.login p { color: var(--muted); margin: 0 0 var(--sp-5); }
.login button { width: 100%; padding: var(--sp-3) var(--sp-4); font-weight: 700; }

/* Medium screens: the navigation shrinks to an icon rail; labels stay available to
   screen readers and as tooltips. */
@media (max-width: 62.4375em) {
  .shell { grid-template-columns: var(--nav-min) minmax(0, var(--col)); }
  .side { align-items: center; padding: var(--sp-4) var(--sp-2); }
  .side .brand { font-size: 12px; padding: 0; text-align: center; }
  .side nav { align-items: center; }
  .side nav a { padding: var(--sp-3); }
  .side nav .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .side nav .badge { position: absolute; top: 0; right: -4px; margin: 0; }
  .side-foot button { justify-content: center; }
  .side-foot .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

/* Phones: a top bar with a menu button; the navigation becomes a drawer that
   slides in over the page at 85% of the screen, with full labels, your account
   at the top and Sign out at the foot, as Bluesky's does. */
@media (max-width: 37.5em) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  main { border-inline: 0; grid-column: 1; }
  .topbar { display: flex; align-items: center; gap: var(--sp-2); position: sticky; top: 0; z-index: 5; height: 48px; padding: 0 var(--sp-3); border-bottom: 1px solid var(--line); background: var(--bg); }
  /* Same type as the sidebar's brand; trimmed to its letters so it centres on
     the menu button instead of sitting low in its line box. */
  /* A domain is lowercase: centre on its x-height, the way the eye reads it. */
  .topbar .brand { padding: 0; line-height: 1; text-box: trim-both ex alphabetic; }
  .menu-btn { display: grid; place-items: center; width: 36px; height: 36px; margin-left: calc(-1 * var(--sp-1)); border-radius: 50%; cursor: pointer; color: var(--fg); }
  .nav-open { display: block; }
  .menu-btn:hover { background: color-mix(in srgb, var(--fg) 8%, transparent); }
  .nav-open:focus-visible + .topbar .menu-btn { outline: 2px solid var(--icon); outline-offset: 1px; }
  .menu-btn .icon { width: 24px; height: 24px; }

  .side { position: fixed; inset: 0 auto 0 0; z-index: 20; width: 85vw; height: 100dvh; align-items: stretch; padding: var(--sp-4); background: var(--bg); border-right: 1px solid var(--line);
    transform: translateX(-100%); visibility: hidden; transition: transform .2s ease, visibility 0s linear .2s; }
  .side > .brand { display: none; }
  .side .me { display: flex; align-items: center; gap: var(--sp-3); padding: 0 var(--sp-3) var(--sp-3); border-bottom: 1px solid var(--line); color: var(--fg); min-width: 0; }
  .side .me > span { display: flex; flex-direction: column; min-width: 0; }
  .side .me strong, .side .me .acct { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .side nav { align-items: stretch; }
  .side nav a { padding: var(--sp-3); }
  .side nav .lbl, .side-foot .lbl { position: static; width: auto; height: auto; overflow: visible; clip-path: none; }
  .side nav .badge { position: static; margin-left: auto; }
  .side-foot button { justify-content: flex-start; }
  .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 15; background: rgb(0 0 0 / .45); opacity: 0; pointer-events: none; transition: opacity .2s ease; }

  body:has(.nav-open:checked) { overflow: hidden; }
  body:has(.nav-open:checked) .side { transform: none; visibility: visible; transition: transform .2s ease; }
  body:has(.nav-open:checked) .nav-backdrop { opacity: 1; pointer-events: auto; }
}
@media (max-width: 37.5em) and (prefers-reduced-motion: reduce) {
  .side, .nav-backdrop, body:has(.nav-open:checked) .side { transition: none; }
}

/* Rows. Posts are flat, separated by hairlines, with the avatar beside the content. */
.card { background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: var(--sp-4); margin: 0; }
.status { border-bottom: 1px solid var(--line); padding: var(--sp-3) var(--sp-4); margin: 0; }
.status.post { display: grid; grid-template-columns: var(--avatar) minmax(0, 1fr); column-gap: var(--sp-3); align-items: start; }
.status.post > .boosted, .status.post > .replying { grid-column: 1 / -1; margin: 0 0 var(--sp-1) calc(var(--avatar) + var(--sp-3)); }
.status.post > .avatar { grid-column: 1; grid-row: 2; }
.status.post > .body { grid-column: 2; grid-row: 2; min-width: 0; }
.status.post:not(:has(> .boosted, > .replying)) > .avatar, .status.post:not(:has(> .boosted, > .replying)) > .body { grid-row: 1; }
.status header { display: flex; align-items: baseline; gap: var(--sp-2); }
.status header .who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; color: inherit; }
.status header .who strong { margin-right: var(--sp-1); }
.status.notif header, .status:not(.post) header { align-items: center; }
.status.notif header a, .status:not(.post) header a { text-decoration: none; color: inherit; flex: 1; min-width: 0; }
.status header time, .acct, .boosted { color: var(--muted); font-size: var(--fs); }
.boosted, .replying { font-size: var(--fs-sm); font-weight: 600; display: flex; align-items: center; gap: var(--sp-1); }
.replying { color: var(--muted); }
.boosted .icon, .replying .icon { width: 16px; height: 16px; }
.boosted .icon { width: 16px; height: 16px; }
.avatar { border-radius: 50%; object-fit: cover; flex: none; }
.content { overflow-wrap: anywhere; margin-top: var(--sp-1); }
.content p { margin: 0 0 var(--sp-2); }
/* Media: one rounded frame per grid of up to four, split by hairline gaps. The frame's
   shape comes from the post (gallery package); each picture fills its cell, cropped
   at the uploader's focal point. The CSP forbids inline styles, so a lone picture's
   ratio is a class (ar-80..ar-200, steps of 0.05) and the focal point is two classes
   (fx-*, fy-*, 10% steps) that set the variables object-position reads. */
.gallery { display: grid; gap: 2px; margin-top: var(--sp-2); border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line); background: var(--line); }
.gallery[data-n="1"]:not([class*="ar-"]) .cell > * { max-height: 32rem; }
.gallery:not([data-n="1"]) { aspect-ratio: 3 / 2; }
.ar-80 { aspect-ratio: 0.8; } .ar-85 { aspect-ratio: 0.85; } .ar-90 { aspect-ratio: 0.9; } .ar-95 { aspect-ratio: 0.95; } .ar-100 { aspect-ratio: 1; } .ar-105 { aspect-ratio: 1.05; } .ar-110 { aspect-ratio: 1.1; } .ar-115 { aspect-ratio: 1.15; } .ar-120 { aspect-ratio: 1.2; } .ar-125 { aspect-ratio: 1.25; } .ar-130 { aspect-ratio: 1.3; } .ar-135 { aspect-ratio: 1.35; } .ar-140 { aspect-ratio: 1.4; } .ar-145 { aspect-ratio: 1.45; } .ar-150 { aspect-ratio: 1.5; } .ar-155 { aspect-ratio: 1.55; } .ar-160 { aspect-ratio: 1.6; } .ar-165 { aspect-ratio: 1.65; } .ar-170 { aspect-ratio: 1.7; } .ar-175 { aspect-ratio: 1.75; } .ar-180 { aspect-ratio: 1.8; } .ar-185 { aspect-ratio: 1.85; } .ar-190 { aspect-ratio: 1.9; } .ar-195 { aspect-ratio: 1.95; } .ar-200 { aspect-ratio: 2; }
.fx-0 { --fx: 0%; } .fx-1 { --fx: 10%; } .fx-2 { --fx: 20%; } .fx-3 { --fx: 30%; } .fx-4 { --fx: 40%; } .fx-5 { --fx: 50%; } .fx-6 { --fx: 60%; } .fx-7 { --fx: 70%; } .fx-8 { --fx: 80%; } .fx-9 { --fx: 90%; } .fx-10 { --fx: 100%; }
.fy-0 { --fy: 0%; } .fy-1 { --fy: 10%; } .fy-2 { --fy: 20%; } .fy-3 { --fy: 30%; } .fy-4 { --fy: 40%; } .fy-5 { --fy: 50%; } .fy-6 { --fy: 60%; } .fy-7 { --fy: 70%; } .fy-8 { --fy: 80%; } .fy-9 { --fy: 90%; } .fy-10 { --fy: 100%; }
.gallery[data-n="2"] { grid-template-columns: 1fr 1fr; }
.gallery[data-n="3"] { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; grid-template-areas: "a b" "a c"; }
.gallery[data-n="3"] .cell:nth-child(1) { grid-area: a; }
.gallery[data-n="4"] { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.gallery .cell { position: relative; min-width: 0; min-height: 0; background: var(--card); }
.gallery .cell > a { display: block; height: 100%; }
/* BlurHash: a tiny blurred image behind each picture, seen until it loads. */
.gallery .cell > a, .gallery .cell > video { position: relative; }
.gallery .cell > .bh, .gallery[data-n="1"] .cell > .bh { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gallery img, .gallery video { display: block; width: 100%; height: 100%; object-fit: cover; object-position: var(--fx, 50%) var(--fy, 50%); border-radius: 0; }
.gallery[data-n="1"]:not([class*="ar-"]) img, .gallery[data-n="1"]:not([class*="ar-"]) video { height: auto; object-fit: contain; }
.media-badge, .alt summary { position: absolute; font-size: 11px; font-weight: 700; line-height: 1; padding: 3px 5px; border-radius: 4px; background: rgb(0 0 0 / .65); color: #fff; }
.media-badge { top: var(--sp-2); left: var(--sp-2); pointer-events: none; }
.alt summary { left: var(--sp-2); bottom: var(--sp-2); cursor: pointer; list-style: none; }
.alt summary::-webkit-details-marker { display: none; }
.alt[open] p { position: absolute; inset: 0; margin: 0; padding: var(--sp-3) var(--sp-3) 2.25rem; overflow: auto; background: rgb(0 0 0 / .8); color: #fff; font-size: var(--fs-sm); white-space: pre-wrap; }
.alt[open] summary { z-index: 1; }
.more-n { position: absolute; inset: 0; display: grid; place-items: center; background: rgb(0 0 0 / .5); color: #fff; font-size: 28px; font-weight: 700; text-decoration: none; }
.status audio { display: block; width: 100%; margin-top: var(--sp-2); }
/* Actions sit together on the left; share and the "more" menu on the right. */
.status footer { display: flex; gap: var(--sp-4); margin-top: var(--sp-2); align-items: center; font-size: var(--fs-sm); }
.status footer .acts { display: flex; gap: var(--sp-3); align-items: center; margin-right: auto; }
.post-menu { position: relative; }
.post-menu > summary { display: inline-flex; align-items: center; height: 32px; color: var(--muted); cursor: pointer; list-style: none; }
.post-menu > summary::-webkit-details-marker { display: none; }
.post-menu > summary:hover, .status footer a.share:hover { color: var(--icon); }
.post-menu > ul { position: absolute; right: 0; top: 100%; z-index: 5; margin: var(--sp-1) 0 0; padding: var(--sp-2) 0; list-style: none; min-width: max-content;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: 0 6px 20px rgb(0 0 0 / .15); }
.status footer .post-menu > ul a, .status footer .post-menu > ul button { display: block; width: 100%; height: auto; padding: var(--sp-3) var(--sp-4); background: none; border: 0; border-radius: initial; color: var(--fg); font: inherit; font-size: var(--fs); line-height: 1.3; text-align: left; text-decoration: none; cursor: pointer; }
.status footer .post-menu > ul a:hover, .status footer .post-menu > ul a:focus-visible,
.status footer .post-menu > ul button:hover, .status footer .post-menu > ul button:focus-visible { background: var(--line); color: var(--fg); }
.status footer a.share.copied { color: var(--icon); }
.status footer a { text-decoration: none; color: var(--muted); }
.status footer form { margin: 0; }

button, input, select, textarea { font: inherit; color: inherit; }
button { background: var(--accent); color: var(--accent-fg); border: 0; border-radius: 999px; padding: var(--sp-2) var(--sp-4); cursor: pointer; font-weight: 600; }
button.link, button.act { background: none; color: var(--muted); padding: 0; }
button.act.on { color: var(--icon); }
button.act.failed { color: var(--danger); } /* swap.js: GoToSocial refused; put back */
/* A count's space is kept even at zero, so going 0 -> 1 doesn't move the row;
   big counts are shortened to at most four characters (1.2K). */
.status footer .n { min-width: 2ch; text-align: left; font-variant-numeric: tabular-nums; } /* room for two digits, even at zero, so a first favourite moves nothing */
/* Form labels stack; the drawer's menu button and backdrop are labels too, but not form fields. */
label:not(.menu-btn, .nav-backdrop) { display: block; margin-bottom: .75rem; }
input:not([type=hidden], [type=file], [type=radio], [type=checkbox]), textarea, select { display: block; width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm); padding: var(--sp-2) var(--sp-3); margin-top: var(--sp-1); }
.settings-group h2 { font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: var(--sp-4) 0 var(--sp-2); }
fieldset { border: 1px solid var(--line); border-radius: .5rem; margin: 0 0 .75rem; }
.attach { display: grid; gap: .25rem; margin-bottom: .5rem; }
.error { color: var(--danger); background: var(--danger-bg); border-left: 4px solid var(--danger); font-weight: 600; }
.more, .empty { text-align: center; color: var(--muted); }

blockquote.quote, blockquote.context { margin: var(--sp-2) 0; padding: var(--sp-3); border: 1px solid var(--line); border-radius: var(--r-md); background: transparent; }
blockquote.context { max-height: 8rem; overflow: auto; }
blockquote.context strong { display: block; color: var(--muted); font-size: .85rem; }
/* Choices read radio, then label, then any description, in every fieldset. */
input[type=radio], input[type=checkbox] { margin: 0 .4rem 0 0; vertical-align: middle; }
.vis label { display: block; margin-bottom: .4rem; }
.hint { color: var(--muted); font-size: var(--fs-sm); }
/* A pill that is a circle for one digit; flex centring keeps the number in
   the middle whatever the font's own line metrics are. */
.badge { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 999px; background: var(--accent); color: var(--accent-fg); font-size: 12px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.notif header { flex-wrap: wrap; }
.fr { display: flex; gap: .5rem; margin-top: .5rem; }
.fr form { margin: 0; }
button.secondary { background: none; color: var(--muted); border: 1px solid var(--line); }
/* Filled buttons darken (light) or turn orange (dark) on hover. */
button:not(.link, .act, .secondary, .emoji-pick, .icon-btn):hover { background: var(--accent-hover); }
img.emoji { display: inline-block; vertical-align: middle; height: 1.3em; width: auto; margin: 0 .05em; }
.emoji-pick { background: none; padding: .15rem; border-radius: .35rem; }
.emoji-pick:hover { background: var(--line); }
.card-link { display: flex; gap: var(--sp-3); margin-top: var(--sp-2); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; text-decoration: none; color: inherit; }
.card-link img { width: 7rem; object-fit: cover; flex: none; }
.card-link span { display: grid; padding: .5rem .5rem .5rem 0; min-width: 0; overflow-wrap: anywhere; }
.card-link img + span { padding-left: 0; }
.card-link > span:first-child { padding-left: .75rem; }
/* Replies under an opened post, after Phanpy: each reply hangs off a line
   that runs down from its parent's avatar, joined by a rounded elbow; the
   line carries on past a reply only while more of its siblings follow.
   --line-x is the parent's avatar centre, fixed where each .replies is
   declared, so it holds at any depth; replies use smaller avatars and no
   rules between them. Elbows: 4px into the reply box (the line), 12px to the
   reply's avatar. */
.replies { --line-x: calc(var(--sp-4) + var(--avatar) / 2 - 1px); padding-left: calc(var(--line-x) + 12px - var(--sp-4)); }
.thread-replies { border-bottom: 1px solid var(--line); padding-bottom: var(--sp-2); }
.reply { position: relative; --avatar: 28px; }
.reply > .status { border-bottom: 0; position: relative; padding-top: var(--sp-2); padding-bottom: var(--sp-2); }
.reply::before { content: ""; position: absolute; left: calc(var(--sp-4) - 12px); top: 0; width: 12px; height: calc(var(--sp-2) + var(--avatar) / 2);
  border-left: 2px solid var(--line); border-bottom: 2px solid var(--line); border-bottom-left-radius: 10px; }
.reply:not(:last-child)::after { content: ""; position: absolute; left: calc(var(--sp-4) - 12px); top: 0; bottom: 0; width: 2px; background: var(--line); }
/* From a post with replies, its own line down to them. */
.reply:has(> .replies) > .status::after,
.thread-chain:has(+ .thread-replies) > .status:last-child::after { content: ""; position: absolute; left: calc(var(--sp-4) + var(--avatar) / 2 - 1px); top: calc(var(--sp-2) + var(--avatar) + var(--sp-1)); bottom: 0; width: 2px; background: var(--line); }
.thread-chain:has(+ .thread-replies) > .status:last-child::after { top: calc(var(--sp-3) + var(--avatar) + var(--sp-1)); }
.thread-chain:has(+ .thread-replies) { border-bottom: 0; }
.thread-toggle { margin-bottom: .75rem; }
.when { text-decoration: none; color: var(--muted); font-size: .875rem; white-space: nowrap; }
.when:hover { color: var(--link); text-decoration: underline; }
/* Posts open on click (post-link.js); say so with the pointer. */
.status.post[data-href] { cursor: pointer; }
.status header a.when { flex: none; }
/* The audience mark before the time; public posts have none. */
.status header .vis { flex: none; display: inline-flex; align-self: center; color: var(--muted); }
.status header .vis + .when { margin-left: calc(var(--sp-1) - var(--sp-2)); }
.status header .vis .icon { width: 14px; height: 14px; }
.notif-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: .75rem; }
.notif-bar form { margin: 0; }
.notif.unread { border-left: 4px solid var(--highlight); }
.notif-read { margin: .25rem 0 0; }
.notif-new { text-align: center; }
.notif-new[hidden] { display: none; }
/* Grouped notifications and the post under each, as Bluesky shows them: a row
   of avatars above "Anna, Ben and 3 others ...", then the post itself, muted
   when it is yours being favourited or boosted, with small square pictures. */
.status.notif header > a.avatar, .status.notif .notif-avatars a { flex: none; } /* outranks header a { flex: 1 } */
.status.notif header strong { flex: 1; min-width: 0; }
.notif-avatars { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 6px; flex-basis: 100%; }
.notif-avatars img { display: block; width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.notif-post { margin-top: var(--sp-1); }
.notif-favourite .notif-post .content, .notif-reblog .notif-post .content, .notif-poll .notif-post .content, .notif-update .notif-post .content {
  color: var(--muted); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-clamp: 4; overflow: hidden; }
.notif-thumbs { display: flex; gap: var(--sp-1); margin-top: var(--sp-2); }
.notif-thumb { position: relative; width: 64px; height: 64px; border-radius: 8px; overflow: hidden; background: var(--line); flex: none; }
.notif-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
article.notif[data-href] { cursor: pointer; }
/* The composer: text box, then a row of glyph toggles and Publish. Each glyph's
   checkbox opens its panel through :has(), so no JavaScript is involved. */
.composer textarea { resize: vertical; }
.composer.inline { padding: var(--sp-4); margin: 0; border-bottom: 1px solid var(--line); }
.composer.inline textarea { border: 0; padding: var(--sp-3); font-size: 17px; background: transparent; }
.composer .panel { display: none; margin: var(--sp-2) 0; }
.composer:has(.t-cw:checked) .panel-cw, .composer:has(.t-emoji:checked) .panel-emoji,
.composer:has(.t-vis:checked) .panel-vis, .composer:has(.t-media:checked) .panel-media, .composer:has(.t-poll:checked) .panel-poll { display: block; }
.composer .tools { display: flex; align-items: center; gap: var(--sp-1); margin-top: var(--sp-2); }
.composer .tool { display: grid; place-items: center; width: 36px; height: 36px; margin: 0; border-radius: 50%; color: var(--icon); cursor: pointer; }
.composer .tool:hover { background: color-mix(in srgb, var(--icon) 12%, transparent); }
.composer .tool:has(:checked) { background: color-mix(in srgb, var(--icon) 18%, transparent); }
.composer .tool:has(:focus-visible) { outline: 2px solid var(--icon); outline-offset: 1px; }
.composer .publish { margin-left: auto; }
.emoji-grid { display: flex; flex-wrap: wrap; gap: 2px; margin-bottom: var(--sp-2); }
.emoji-pick { font-size: 22px; line-height: 1; color: inherit; }
.link-preview { margin-bottom: .75rem; }
.link-preview .card-link { margin-bottom: .5rem; }
.link-preview .card-link > span { display: grid; padding: .5rem .75rem; }
details.sensitive { margin-top: .5rem; }
details.sensitive > summary { cursor: pointer; padding: var(--sp-3); border: 1px solid var(--line); border-radius: var(--r-md); color: var(--muted); }
details.sensitive[open] > summary { margin-bottom: .5rem; }
.publish-error:empty { display: none; }
.publish-error .error { margin: 0 0 var(--sp-2); padding: var(--sp-2) var(--sp-3); }

/* Avatars in posts link to the profile. */
a.avatar { display: block; width: var(--avatar); height: var(--avatar); }
a.avatar img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

/* Profiles: banner, avatar overlapping it, follow button opposite. */
.profile { border-bottom: 1px solid var(--line); padding: 0 var(--sp-4) var(--sp-3); }
.profile .banner { display: block; width: calc(100% + 2 * var(--sp-4)); margin: 0 calc(-1 * var(--sp-4)); aspect-ratio: 3 / 1; object-fit: cover; background: var(--line); }
.profile-top { display: flex; justify-content: space-between; align-items: flex-end; margin-top: -42px; }
.profile-top .avatar { width: 84px; height: 84px; border: 3px solid var(--bg); background: var(--bg); }
.profile .rel { display: flex; align-items: center; gap: var(--sp-2); }
.profile .rel form { margin: 0; }
.profile h1 { margin: var(--sp-2) 0 0; font-size: 22px; line-height: 1.3; overflow-wrap: anywhere; }
.profile .acct { margin: 0; display: flex; align-items: center; gap: var(--sp-1); overflow-wrap: anywhere; }
.profile .acct .icon { width: 16px; height: 16px; }
.follows-you, .profile .tag { font-size: var(--fs-sm); color: var(--muted); background: var(--line); border-radius: var(--r-sm); padding: 0 var(--sp-2); }
.profile .moved { margin: var(--sp-3) 0 0; padding: var(--sp-3); border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--line); }
.profile .moved > p { margin: 0 0 var(--sp-2); color: var(--muted); font-size: var(--fs-sm); }
.profile .moved-to { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.profile .moved-to .who { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; color: inherit; text-decoration: none; overflow-wrap: anywhere; }
.profile .moved-to .avatar { width: 42px; height: 42px; flex: none; }
.profile .moved-to .acct { display: inline; color: var(--muted); }
.profile .featured-tags { list-style: none; display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: var(--sp-3) 0 0; padding: 0; }
.profile .chip { display: inline-block; padding: var(--sp-1) var(--sp-3); border: 1px solid var(--line); border-radius: 999px; font-size: var(--fs-sm); text-decoration: none; overflow-wrap: anywhere; }
.profile .private-note { margin-top: var(--sp-3); }
.profile .private-note label { font-size: var(--fs-sm); font-weight: 600; }
.profile .private-note .hint { font-weight: 400; }
.profile .private-note textarea { resize: vertical; }
.profile .private-note button { margin-top: var(--sp-2); }
.edit-profile label { display: block; margin-bottom: var(--sp-3); }
.edit-profile .pic-row { margin-bottom: var(--sp-4); }
.edit-profile .pic-header { display: block; width: 100%; aspect-ratio: 3 / 1; object-fit: cover; background: var(--line); border-radius: var(--r-sm); margin-bottom: var(--sp-2); }
.edit-profile .pic-avatar { width: 84px; height: 84px; margin-bottom: var(--sp-2); }
.edit-profile .field-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: var(--sp-2); }
.edit-profile .field-row label { margin-bottom: var(--sp-2); }
.edit-profile .form-actions { display: flex; align-items: center; gap: var(--sp-3); margin: var(--sp-3) 0 0; }
.profile .note { margin-top: var(--sp-3); overflow-wrap: anywhere; }
.profile .fields { margin: var(--sp-3) 0 0; border: 1px solid var(--line); border-radius: var(--r-sm); }
.profile .fields > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: var(--sp-3); padding: var(--sp-2) var(--sp-3); }
.profile .fields > div + div { border-top: 1px solid var(--line); }
.profile .fields dt { color: var(--muted); font-size: var(--fs-sm); font-weight: 600; overflow-wrap: anywhere; }
.profile .fields dd { margin: 0; overflow-wrap: anywhere; }
.profile .fields .verified dd .icon { width: 16px; height: 16px; color: var(--icon); }
.profile .counts { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-4); margin: var(--sp-3) 0 0; color: var(--muted); }
.profile .counts strong { color: var(--fg); }
.tabs { display: flex; border-bottom: 1px solid var(--line); }
.tabs a { flex: 1; text-align: center; padding: var(--sp-3) var(--sp-2); color: var(--muted); text-decoration: none; font-weight: 600; border-bottom: 3px solid transparent; }
.tabs a[aria-current="page"] { color: var(--fg); border-bottom-color: var(--icon); }
.tab-tools { display: flex; align-items: center; gap: var(--sp-3); margin: 0; padding: var(--sp-2) var(--sp-4); border-bottom: 1px solid var(--line); }
.tab-tools .switch-row { margin: 0; }
/* A profile's media tab: three square tiles a row, Mastodon's media view. */
.media-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; border-bottom: 1px solid var(--line); }
.media-tile { position: relative; display: block; aspect-ratio: 1; overflow: hidden; background: var(--line); }
.media-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.media-tile:hover img:not(.bh), .media-tile:focus-visible img:not(.bh) { opacity: .85; }
.media-tile .media-badge { top: auto; left: var(--sp-1); bottom: var(--sp-1); }
.media-tile.covered::after { content: "Sensitive"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: var(--fs-sm); font-weight: 600; color: #fff; background: rgb(0 0 0 / .25); }
.pinned { display: flex; align-items: center; gap: var(--sp-1); margin: var(--sp-3) var(--sp-4) calc(-1 * var(--sp-2)); color: var(--muted); font-size: var(--fs-sm); font-weight: 600; }
.pinned .icon { width: 16px; height: 16px; }

/* Feed tabs across the top of every timeline; they scroll sideways when there
   are more than fit. */
.feed-tabs { overflow-x: auto; scrollbar-width: none; }
.feed-tabs a { flex: 0 0 auto; padding-inline: var(--sp-4); white-space: nowrap; }
.tag { font-size: var(--fs-sm); color: var(--muted); background: var(--line); border-radius: var(--r-sm); padding: 0 var(--sp-2); }

/* The Feeds page. */
.feed-list { list-style: none; margin: var(--sp-3) 0 var(--sp-6); padding: 0; border-top: 1px solid var(--line); }
.feed-list li { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-2) var(--sp-4); border-bottom: 1px solid var(--line); }
.feed-list .feed-name { font-weight: 600; text-decoration: none; color: var(--fg); min-width: 0; overflow-wrap: anywhere; }
.feed-list .feed-ops { display: flex; gap: var(--sp-1); margin-left: auto; }
.feed-list form { margin: 0; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; background: none; border: 0; color: var(--muted); border-radius: var(--r-sm); cursor: pointer; }
.icon-btn:hover { color: var(--icon); background: var(--line); }
.pinned-feed .feed-ops form:last-child .icon-btn { color: var(--icon); }
main > h2 { font-size: 17px; margin: 0; padding: var(--sp-5) var(--sp-4) 0; }
.list-form { display: grid; gap: var(--sp-3); max-width: 28rem; padding: var(--sp-3) var(--sp-4) var(--sp-6); }
.list-form fieldset { padding: var(--sp-2) var(--sp-3) var(--sp-3); margin: 0; }
.list-form fieldset { border: 1px solid var(--line); border-radius: var(--r-sm); display: grid; gap: var(--sp-1); }

/* A list's page: its people, each with a Remove button, then a delete that
   asks twice (the disclosure, then the button). */
.members { list-style: none; margin: 0; padding: 0; }
.members li { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--line); }
.members .who { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; color: var(--fg); text-decoration: none; }
.members .who > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.members .acct { color: var(--muted); }
.members form { margin: 0; }
.list-delete { padding: var(--sp-6) var(--sp-4); }
.list-delete > summary { cursor: pointer; color: var(--danger); }
.list-delete p { color: var(--muted); }
button.danger { background: var(--danger); border-color: var(--danger); color: var(--bg); }
/* A profile's "…" menu: Lists, each a toggle with a tick when the account is in it. */
.profile-menu > summary { width: 36px; justify-content: center; }
.profile-menu > ul { min-width: 14rem; }
.profile-menu li > a, .profile-menu button { display: flex; align-items: center; gap: var(--sp-2); width: 100%; padding: var(--sp-3) var(--sp-4); background: none; border: 0; border-radius: 0; color: var(--fg); font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.profile-menu li > a:hover, .profile-menu button:hover, .profile-menu button:focus-visible { background: var(--line); color: var(--fg); }
.profile-menu .tick { width: 20px; display: grid; place-items: center; color: var(--icon); }
.profile-menu .menu-head { padding: var(--sp-2) var(--sp-4) var(--sp-1); color: var(--muted); font-size: var(--fs-sm); font-weight: 700; }
.profile-menu .menu-note { padding: var(--sp-2) var(--sp-4) var(--sp-3); color: var(--muted); font-size: var(--fs-sm); }
.profile-menu .menu-note a { padding: 0; color: inherit; text-decoration: underline; }

/* Content warning, after Phanpy: the warning reads as a line of its own, then a
   pill on faint stripes (hidden content) that shows or hides the post. */
details.cw > summary { display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-2); list-style: none; cursor: pointer; }
details.cw > summary::-webkit-details-marker { display: none; }
.cw-text { font-weight: 600; overflow-wrap: anywhere; }
.cw-btn { display: inline-flex; align-items: center; gap: var(--sp-1); padding: 3px var(--sp-3); border: 1px dashed var(--line); border-radius: 999px; color: var(--muted); font-size: var(--fs-sm); font-weight: 600;
  background: repeating-linear-gradient(-45deg, transparent 0 4px, color-mix(in srgb, var(--fg) 6%, transparent) 4px 8px); }
.cw-btn .icon { width: 16px; height: 16px; }
details.cw > summary:hover .cw-btn { color: var(--fg); border-color: var(--muted); }
details.cw > summary:focus-visible { outline: none; }
details.cw > summary:focus-visible .cw-btn { outline: 2px solid var(--accent); outline-offset: 2px; }
details.cw .cw-hide, details.cw[open] .cw-show { display: none; }
details.cw[open] .cw-hide { display: inline; }
details.cw[open] > summary { margin-bottom: var(--sp-2); }
details.cw[open] .cw-btn { background: none; border-style: solid; }

/* Search: a rounded box with the glyph inside, then People and Posts tabs. */
.search-form { padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--line); }
.search-box { display: flex; align-items: center; gap: var(--sp-2); padding: 0 var(--sp-3); border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--muted); }
.search-box:focus-within { border-color: var(--accent); }
.search-box input { flex: 1; min-width: 0; border: 0; background: none; padding: var(--sp-2) 0; color: var(--fg); font: inherit; outline: none; }

/* @-mention suggestions, under the composer's text box (mention.js). */
.composer { position: relative; }
.mention-list { position: absolute; left: var(--sp-4); right: var(--sp-4); z-index: 6; max-height: 18rem; overflow-y: auto; margin: calc(-1 * var(--sp-2)) 0 0; padding: var(--sp-1) 0; list-style: none;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: 0 6px 20px rgb(0 0 0 / .15); }
.mention-list li { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-2) var(--sp-3); cursor: pointer; white-space: nowrap; overflow: hidden; }
.mention-list li strong { overflow: hidden; text-overflow: ellipsis; }
.mention-list li .acct { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.mention-list li[aria-selected="true"], .mention-list li:hover { background: var(--line); }
.mention-list .avatar { width: 28px; height: 28px; flex: none; }

/* The tab row's tools: feed options (⚙, toggles the panel below) and Manage
   feeds (+), styled like the composer's tools. */
.feed-tabs .feed-tools { display: flex; align-items: center; gap: var(--sp-1); margin-left: auto; padding-inline: var(--sp-2); flex: none; }
.feed-tabs .tool { display: grid; place-items: center; width: 36px; height: 36px; margin: 0; padding: 0; border-radius: 50%; color: var(--muted); cursor: pointer; }
.feed-tabs .tool:hover { background: color-mix(in srgb, var(--fg) 8%, transparent); color: var(--fg); }
.feed-tabs .tool:has(:checked) { background: color-mix(in srgb, var(--icon) 18%, transparent); color: var(--icon); }
.feed-tabs .tool:has(:focus-visible) { outline: 2px solid var(--icon); outline-offset: 1px; }
.feed-panel { display: none; padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--line); background: var(--card); }
main:has(.t-feed-opts:checked) .feed-panel { display: grid; gap: var(--sp-3); }
.feed-panel form { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-4); }
.feed-panel label { margin: 0; }
.feed-panel .feed-about { margin: 0; color: var(--muted); font-size: var(--fs-sm); }
.filter-note { margin: 0; padding: var(--sp-2) var(--sp-4); border-bottom: 1px solid var(--line); color: var(--muted); font-size: var(--fs-sm); }

/* A reply grouped with the conversation it continues (Bluesky-style): the
   posts above it have no rule between them, and a line runs from each
   avatar down to the next. "N more replies" stands for those left out. */
.tl-group { border-bottom: 1px solid var(--line); }
.tl-group > .status { border-bottom: 0; position: relative; }
.tl-group > .status.ctx { padding-bottom: var(--sp-1); }
.tl-group > .status.ctx::after { content: ""; position: absolute; left: calc(var(--sp-4) + var(--avatar) / 2 - 1px); top: calc(var(--sp-3) + var(--avatar) + var(--sp-1)); bottom: 0; width: 2px; background: var(--line); }
.tl-group > .status:not(:first-child)::before { content: ""; position: absolute; left: calc(var(--sp-4) + var(--avatar) / 2 - 1px); top: 0; height: calc(var(--sp-3) - var(--sp-1)); width: 2px; background: var(--line); }
.tl-gap { display: block; position: relative; padding: var(--sp-1) var(--sp-4) var(--sp-1) calc(var(--sp-4) + var(--avatar) + var(--sp-3)); color: var(--link); font-size: var(--fs-sm); text-decoration: none; }
.tl-gap:hover { text-decoration: underline; }
.tl-gap::before { content: ""; position: absolute; left: calc(var(--sp-4) + var(--avatar) / 2 - 1px); top: 0; bottom: 0; border-left: 2px dotted var(--line); }
.tl-join { padding: 0; height: var(--sp-2); }
.reply-context { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-4); flex-basis: 100%; }
.reply-context legend { padding: 0; margin-bottom: var(--sp-1); font-weight: 600; }

/* Thread slide-out (post-link.js): a panel from the right over a dimmed feed;
   the whole screen on phones. */
.slideout-backdrop { position: fixed; inset: 0; z-index: 25; background: rgb(0 0 0 / .35); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
.slideout-backdrop.open { opacity: 1; pointer-events: auto; }
.slideout { position: fixed; top: 0; right: 0; bottom: 0; z-index: 30; width: min(640px, 100vw); display: flex; flex-direction: column; background: var(--bg); border-left: 1px solid var(--line); box-shadow: -8px 0 30px rgb(0 0 0 / .15);
  transform: translateX(100%); visibility: hidden; transition: transform .22s ease, visibility 0s linear .22s; outline: none; }
.slideout.open { transform: none; visibility: visible; transition: transform .22s ease; }
.slideout-head { display: flex; align-items: center; gap: var(--sp-2); height: 48px; padding: 0 var(--sp-3); border-bottom: 1px solid var(--line); flex: none; }
.slideout-head strong { flex: 1; }
.slideout-head .slideout-page { font-size: var(--fs-sm); color: var(--muted); }
.slideout-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.slideout-body > .hint { padding: var(--sp-3) var(--sp-4); margin: 0; }
body.slideout-on { overflow: hidden; }
@media (prefers-reduced-motion: reduce) {
  .slideout, .slideout.open, .slideout-backdrop { transition: none; }
}

/* "N new posts" (feed-live.js): floats at the top of the feed while you read. */
.new-pill { position: sticky; top: var(--sp-3); z-index: 4; display: flex; align-items: center; gap: var(--sp-1); width: max-content; margin: var(--sp-2) auto calc(-1 * (32px + var(--sp-2))); height: 32px; padding: 0 var(--sp-4); border: 0; border-radius: 999px;
  background: var(--accent); color: var(--accent-fg); font-weight: 700; font-size: var(--fs-sm); box-shadow: 0 4px 14px rgb(0 0 0 / .2); cursor: pointer; }
.new-pill[hidden] { display: none; }
.new-pill .icon { width: 16px; height: 16px; }
@media (max-width: 37.5em) { .new-pill { top: calc(48px + var(--sp-2)); } }

/* Switch: a native checkbox with role="switch", drawn as a track and knob (in
   the manner of Pico's, without Pico). Still a real form control: keyboard,
   screen readers and forms treat it as a checkbox. Put it before its text
   inside a label.switch-row. */
input[type=checkbox][role=switch] { appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 2.25rem; height: 1.25rem; margin: 0; border-radius: 999px;
  background: color-mix(in srgb, var(--fg) 22%, transparent); cursor: pointer; transition: background-color .15s ease; vertical-align: middle; }
input[type=checkbox][role=switch]::before { content: ""; position: absolute; top: 2px; left: 2px; width: calc(1.25rem - 4px); aspect-ratio: 1; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .3); transition: transform .15s ease; }
input[type=checkbox][role=switch]:checked { background: var(--accent); }
input[type=checkbox][role=switch]:checked::before { transform: translateX(1rem); }
input[type=checkbox][role=switch]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input[type=checkbox][role=switch]:disabled { opacity: .5; cursor: not-allowed; }
@media (prefers-reduced-motion: reduce) { input[type=checkbox][role=switch], input[type=checkbox][role=switch]::before { transition: none; } }
.switch-row { display: flex; align-items: center; gap: var(--sp-3); margin: 0; cursor: pointer; }
.switch-row .hint { display: block; }

/* The opened post: its text a size up, and a rule below before the replies. */
.status.focused .content { font-size: 17px; }

/* A hashtag's feed: what it is, and Follow. */
.tag-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--line); color: var(--muted); font-size: var(--fs-sm); }
.tag-head p, .tag-head form { margin: 0; }
.tag-head strong { color: var(--fg); }
.search-help { padding: var(--sp-3) var(--sp-4); color: var(--muted); font-size: var(--fs-sm); }
.search-help p { margin: 0 0 var(--sp-2); }
.search-help strong { color: var(--fg); }

.status footer .post-menu > ul a.danger-link { color: var(--danger); }
.delete-confirm { display: flex; align-items: center; gap: var(--sp-4); padding: var(--sp-4); margin: 0; }

/* Polls: options to tick and Vote, or results as bars (native <progress>,
   since inline styles are off) with the leader in the accent colour. */
.poll { margin-top: var(--sp-2); }
.poll-vote { display: grid; gap: var(--sp-2); margin: 0; }
.poll-vote label { margin: 0; padding: var(--sp-2) var(--sp-3); border: 1px solid var(--line); border-radius: var(--r-sm); cursor: pointer; }
.poll-vote label:has(:checked) { border-color: var(--accent); }
.poll-vote button { justify-self: start; }
.poll-results { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-1); }
.poll-results li { position: relative; display: flex; align-items: center; gap: var(--sp-2); min-height: 32px; padding: 0 var(--sp-3); border-radius: var(--r-sm); overflow: hidden; }
.poll-bar { position: absolute; inset: 0; width: 100%; height: 100%; appearance: none; -webkit-appearance: none; border: 0; background: transparent; z-index: 0; }
.poll-bar::-webkit-progress-bar { background: transparent; }
.poll-bar::-webkit-progress-value { background: color-mix(in srgb, var(--fg) 12%, transparent); }
.poll-bar::-moz-progress-bar { background: color-mix(in srgb, var(--fg) 12%, transparent); }
.leading .poll-bar::-webkit-progress-value { background: color-mix(in srgb, var(--accent) 35%, transparent); }
.leading .poll-bar::-moz-progress-bar { background: color-mix(in srgb, var(--accent) 35%, transparent); }
.poll-label, .poll-pct { position: relative; z-index: 1; }
.poll-label { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.poll-label .icon { width: 16px; height: 16px; vertical-align: -3px; }
.leading .poll-label { font-weight: 700; }
.poll-pct { font-variant-numeric: tabular-nums; color: var(--muted); }
.poll-meta { margin: var(--sp-1) 0 0; color: var(--muted); font-size: var(--fs-sm); }
.panel-poll input[name=poll_option] { margin-bottom: var(--sp-2); }
.poll-settings { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-4); }
.poll-settings label { margin: 0; }
.poll-settings select { display: inline-block; width: auto; margin: 0 0 0 var(--sp-1); }

/* The follow button's confirm: "Following" opens a small card asking to
   unfollow, so it takes two clicks (no JavaScript). */
.follow { position: relative; }
.follow form { margin: 0; }
details.confirm > summary { list-style: none; cursor: pointer; }
details.confirm > summary::-webkit-details-marker { display: none; }
.button { display: inline-flex; align-items: center; padding: var(--sp-2) var(--sp-4); border-radius: var(--r-sm); font-weight: 600; background: var(--accent); color: var(--accent-fg); }
.button.secondary { background: none; color: var(--muted); border: 1px solid var(--line); }
.confirm-pop { position: absolute; right: 0; top: calc(100% + var(--sp-1)); z-index: 6; width: max-content; max-width: 16rem; padding: var(--sp-3); background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: 0 6px 20px rgb(0 0 0 / .15); }
.confirm-pop p { margin: 0 0 var(--sp-2); }
/* Mute and Block in the profile menu open a small form in place. */
.profile-menu .menu-sub > summary { padding: var(--sp-3) var(--sp-4); cursor: pointer; list-style: none; }
.profile-menu .menu-sub > summary::-webkit-details-marker { display: none; }
.profile-menu .menu-sub > summary:hover { background: var(--line); }
.profile-menu .menu-form { display: grid; gap: var(--sp-2); padding: 0 var(--sp-4) var(--sp-3); margin: 0; }
.profile-menu .menu-form label { margin: 0; }
.profile-menu .menu-form button { width: auto; justify-self: start; padding: var(--sp-2) var(--sp-4); }
.profile-menu .menu-form button:not(.danger) { background: var(--accent); color: var(--accent-fg); }
.profile-menu .menu-form select { display: inline-block; width: auto; margin: 0 0 0 var(--sp-1); }
.danger-text { color: var(--danger); }
.profile .counts a { color: inherit; text-decoration: none; }
.profile .counts a:hover { text-decoration: underline; }
.page-head { padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--line); font-weight: 700; }
.page-head a { color: var(--fg); text-decoration: none; }
.page-head .acct { font-weight: 400; }
.settings-link { padding: 0 var(--sp-4) var(--sp-4); }
.settings-version { padding: 0 var(--sp-4) var(--sp-4); }
.settings-version dl { display: grid; grid-template-columns: max-content 1fr; gap: var(--sp-1) var(--sp-4); margin: 0; font-size: var(--fs-sm); }
.settings-version dt { color: var(--muted); }
.settings-version dd { margin: 0; overflow-wrap: anywhere; }

/* Hover cards (hover-card.js): a small profile card over a name or avatar. */
.hovercard { position: absolute; z-index: 40; width: 320px; max-width: calc(100vw - 16px); padding: var(--sp-3);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: 0 6px 20px rgb(0 0 0 / .15); }
.hovercard[hidden] { display: none; }
.hovercard .hc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-2); }
.hovercard .hc-who { display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; color: inherit; text-decoration: none; overflow-wrap: anywhere; }
.hovercard .hc-who .avatar { width: 56px; height: 56px; }
.hovercard .hc-who > span { display: grid; }
.hovercard .acct { color: var(--muted); font-size: var(--fs-sm); }
.hovercard .hc-rel { margin: var(--sp-2) 0 0; }
.hovercard .hc-note { margin-top: var(--sp-2); font-size: var(--fs-sm); overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-clamp: 4; overflow: hidden; }
.hovercard .hc-note p { margin: 0; }
.hovercard .hc-counts { display: flex; gap: var(--sp-3); margin: var(--sp-2) 0 0; font-size: var(--fs-sm); }
.hovercard .hc-counts a { color: var(--muted); text-decoration: none; }
.hovercard .hc-counts strong { color: var(--fg); }

/* Keyword filters (Settings). */
.filters { list-style: none; margin: 0; padding: 0; }
.filters li { display: grid; gap: 2px; padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.filter-form > label { display: block; margin-bottom: var(--sp-3); }
.filter-form fieldset label { display: block; margin-bottom: .4rem; }
.filter-form .form-actions { display: flex; align-items: center; gap: var(--sp-3); margin: var(--sp-3) 0 0; }
