:root {
  color-scheme: dark;
  --bg: #15202b;
  --panel: #192734;
  --raise: #22303c;
  --raise-hover: #283846;
  --line: #2b3b4b;
  --text: #e4eaef;
  --muted: #8b99a6;
  --accent: #1d9bf0;
  --accent-wash: rgba(29, 155, 240, 0.12);
  --like: #f26d8d;
  --repost: #2fbf74;
  --warn: #f2b84b;
  --error: #f0727c;
  --scrim: rgba(10, 17, 24, 0.55);
  --lb-scrim: rgba(9, 15, 22, 0.94);
  --shadow: rgba(5, 10, 16, 0.45);
  --danger-wash: rgba(240, 114, 124, 0.1);
  --media-btn: rgba(20, 22, 28, 0.72);
  --well: #111a23;
  --card-line: #26364a;
  --thread: 420px;
  --sheet: 820px;
  --rail: 60px;
  --col: 400px;
  --head: 52px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Light tokens: the OS preference unless the Settings choice says otherwise, or the choice itself. Same values twice; CSS can't share a rule between a media query and an attribute selector. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f3f5f7;
    --panel: #fbfcfd;
    --raise: #eef1f4;
    --raise-hover: #e6eaee;
    --line: #d6dde3;
    --text: #1b2630;
    --muted: #566471;
    --accent: #1168ab;
    --accent-wash: rgba(17, 104, 171, 0.1);
    --like: #be2a50;
    --repost: #0f7437;
    --warn: #8f5a00;
    --error: #c0303c;
    --scrim: rgba(60, 74, 88, 0.28);
    --lb-scrim: rgba(236, 240, 244, 0.95);
    --shadow: rgba(30, 45, 60, 0.16);
    --danger-wash: rgba(192, 48, 60, 0.08);
    --media-btn: rgba(20, 22, 28, 0.62);
    --well: #eceff2;
    --card-line: #dfe5ea;
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f5f7;
  --panel: #fbfcfd;
  --raise: #eef1f4;
  --raise-hover: #e6eaee;
  --line: #d6dde3;
  --text: #1b2630;
  --muted: #566471;
  --accent: #1168ab;
  --accent-wash: rgba(17, 104, 171, 0.1);
  --like: #be2a50;
  --repost: #0f7437;
  --warn: #8f5a00;
  --error: #c0303c;
  --scrim: rgba(60, 74, 88, 0.28);
  --lb-scrim: rgba(236, 240, 244, 0.95);
  --shadow: rgba(30, 45, 60, 0.16);
  --danger-wash: rgba(192, 48, 60, 0.08);
  --media-btn: rgba(20, 22, 28, 0.62);
  --well: #eceff2;
  --card-line: #dfe5ea;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  display: flex;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.4 var(--font);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 4px; }
svg { display: block; flex: none; }

/* ---------- rail ---------- */
.rail {
  position: relative;
  flex: 0 0 var(--rail);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 0;
  border-right: 1px solid var(--line);
  z-index: 3;
}
.rail-cols { display: flex; flex-direction: column; gap: 4px; padding-top: 12px; overflow-y: auto; }
/* Hairline between the actions above and the columns below. */
.rail-cols::before { content: ""; flex: none; align-self: center; width: 24px; height: 1px; margin-bottom: 8px; background: var(--line); }
.rail-btn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 0; border-radius: 8px;
  background: transparent;
  color: var(--muted);
}
.rail-btn:hover { background: var(--raise); color: var(--text); }
.rail-add { color: var(--text); background: var(--raise); }
.rail-add[aria-expanded="true"] { color: var(--accent); }

/* ---------- add popover ---------- */
.pop {
  position: absolute;
  top: 10px;
  left: calc(var(--rail) + 8px);
  width: 300px;
  background: var(--raise);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 32px var(--shadow);
  overflow: hidden;
}
.pop-head { display: flex; align-items: center; gap: 4px; height: 44px; padding: 0 6px 0 14px; border-bottom: 1px solid var(--line); }
.pop-head .icon-btn:first-child { margin-left: -8px; }
.pop-title { flex: 1; font-weight: 600; }
.pop-list { padding: 6px 0; }
.pop-item {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 9px 14px;
  border: 0; background: transparent; text-align: left; color: var(--text);
}
.pop-item svg { color: var(--muted); }
.pop-item:hover, .pop-item:focus-visible { background: var(--accent-wash); outline: none; }
.pick-slot { max-height: 320px; overflow-y: auto; border-bottom: 1px solid var(--line); }
.pick-slot > .pop-status { padding: 12px 14px; }
.pick-group { padding: 6px 0; }
.pick-label { padding: 4px 14px; font-size: 12px; color: var(--muted); }
.pick { gap: 10px; padding: 6px 14px; }
.pick:disabled { cursor: default; }
.pick:disabled:hover { background: transparent; }
.pick-av { flex: none; width: 28px; height: 28px; border-radius: 6px; background: var(--bg); object-fit: cover; }
.pick-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pick-title, .pick-by { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-by { font-size: 12px; color: var(--muted); }
.pick:disabled .pick-text, .pick:disabled .pick-av { opacity: 0.5; }
.pick-added { flex: none; font-size: 12px; color: var(--muted); }
.pop-form { padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.pop-label { font-size: 13px; color: var(--muted); }
.pop-input {
  width: 100%; padding: 8px 10px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 6px;
}
.pop-input:focus { outline: none; border-color: var(--accent); }
.pop-input::placeholder { color: var(--muted); opacity: 0.7; }
.pop-status { min-height: 20px; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.pop-status.ok { color: var(--text); }
.pop-status.ok svg { color: var(--accent); width: 16px; height: 16px; }
.pop-status.err { color: var(--error); }
.pop-actions { display: flex; justify-content: flex-end; }
.btn {
  padding: 6px 16px; border: 0; border-radius: 999px;
  background: var(--accent); color: var(--bg); font-weight: 600;
}
.btn:disabled { background: var(--line); color: var(--muted); cursor: default; }

/* ---------- deck + columns ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.notice {
  flex: none;
  display: flex; align-items: center; justify-content: center; gap: 14px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--raise); font-size: 13px;
}
.notice[hidden] { display: none; }
.deck {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
}
.col {
  position: relative;
  flex: 0 0 var(--col);
  width: var(--col);
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--panel);
  border-right: 1px solid var(--line);
}
.col.col-flash { outline: 2px solid var(--accent); outline-offset: -2px; }
/* Drag to reorder: the lifted column follows the pointer above the others, which slide aside. */
.deck.is-dragging { user-select: none; }
.deck.is-dragging .col { transition: transform 180ms cubic-bezier(0.2, 0.9, 0.3, 1); }
.deck.is-dragging .col.lifted { z-index: 4; transition: none; box-shadow: 0 12px 32px var(--shadow), 0 0 0 1px var(--line); }
.deck.is-dragging .col.lifted.settling { transition: transform 160ms cubic-bezier(0.2, 0.9, 0.3, 1); }

.col-head {
  position: relative;
  flex: 0 0 var(--head);
  display: flex; align-items: center; gap: 10px;
  padding: 0 6px 0 2px;
  border-bottom: 1px solid var(--line);
  user-select: none;
}
.col-handle { flex: 1; min-width: 0; align-self: stretch; display: flex; align-items: center; gap: 8px; cursor: grab; touch-action: none; }
.col-handle:active, .deck.is-dragging, .deck.is-dragging * { cursor: grabbing; }
.col-handle.no-drag { cursor: default; }
.col-grip { display: grid; place-items: center; width: 14px; align-self: stretch; color: var(--muted); opacity: 0.35; transition: opacity 120ms ease; }
.col-head:hover .col-grip, .col-handle:focus-within .col-grip { opacity: 1; }
.col-ico { color: var(--accent); }
/* The type icon sits on the title's line; the subtitle tucks under the title, not under the icon. */
.col-titles { flex: 1; min-width: 0; align-self: stretch; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 8px; align-content: center; align-items: center; }
.col-titles > .col-ico { grid-row: 1; display: grid; }
.col-sub { grid-column: 2; }
/* The gear lines up with the title line too (the title's centre sits half a subtitle above the header's). */
.col-head > [data-ui="gear"] { align-self: flex-start; margin-top: calc(var(--head) / 2 - 25.5px); }
.col-head:has(.col-sub:empty) > [data-ui="gear"] { align-self: center; margin-top: 0; }
.col-title { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.col-sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.col-sub.paused { color: var(--warn); }
.col-sub.err { color: var(--error); }
.col-sub[hidden] { display: none; }
.col-sub[title] { cursor: text; }
.col-sub[title]:hover { color: var(--text); }
.col-title.err { color: var(--error); font-size: 13px; font-weight: 600; }
.col-edit { margin: 1px 0 0; }
.col-edit-input {
  width: 100%; padding: 2px 6px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 5px;
  font-size: 13px; cursor: text; user-select: text;
}
.col-edit-input:focus { outline: none; border-color: var(--accent); }
.col-edit-input[aria-invalid] { border-color: var(--error); }
.col-edit-input::placeholder { color: var(--muted); opacity: 0.7; }

.icon-btn {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border: 0; border-radius: 6px;
  background: transparent; color: var(--muted);
}
.icon-btn:hover, .icon-btn[aria-expanded="true"] { background: var(--raise); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }

.menu {
  position: absolute; top: 46px; right: 8px; z-index: 2;
  min-width: 180px; padding: 4px 0;
  background: var(--raise);
  border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 10px 28px var(--shadow);
  cursor: default;
}
.menu-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; padding: 8px 12px;
  border: 0; background: transparent; text-align: left; font-size: 13px;
}
.menu select {
  padding: 3px 6px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 6px;
}
button.menu-row:hover, .menu-check:hover { background: var(--raise-hover); }
.menu-check { cursor: pointer; }
.menu-check input { margin: 0; accent-color: var(--accent); }
.menu-sec { padding: 6px 12px 2px; font-size: 11px; color: var(--muted); }
.menu-sep { margin: 4px 0; border-top: 1px solid var(--line); }
button.menu-row:disabled { color: var(--muted); opacity: 0.5; cursor: default; background: transparent; }
.menu-danger { color: var(--error); }
.menu-danger:hover { background: var(--danger-wash); }
.menu-confirm { margin: 0; padding: 8px 10px 4px; font-size: 13px; }
.menu-confirm-btns { display: flex; gap: 4px; padding: 4px; }
.menu-confirm-btns .menu-row { flex: 1; justify-content: center; text-align: center; }

.col-body { position: relative; flex: 1; min-height: 0; display: flex; }
.scroller { flex: 1; min-width: 0; overflow-y: auto; overscroll-behavior-y: contain; } /* y only: sideways scrolling passes through to the deck */
.newbar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 1;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--raise); color: var(--accent);
  font-size: 13px; font-weight: 600;
}
.newbar svg { width: 14px; height: 14px; }
.newbar:hover { background: var(--raise-hover); }
.newbar[hidden] { display: none; }

.note { margin: 0; padding: 20px 14px; color: var(--muted); font-size: 13px; }
.deck > .empty { padding: 24px; }
.foot { padding: 14px; text-align: center; font-size: 13px; color: var(--muted); }
.foot:empty { padding: 0; }

/* ---------- cells ---------- */
.cell {
  padding: 10px 14px 6px;
  border-bottom: 1px solid var(--line);
}
.cell-muted { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-block: 8px; color: var(--muted); font-size: 13px; }
.cell-muted .btn { padding: 3px 12px; font-size: 13px; }
.cell-main { display: flex; gap: 10px; }
.av-link { flex: none; }
.av, .av-empty {
  display: block; width: 36px; height: 36px; border-radius: 50%;
  background: var(--raise); object-fit: cover;
}
.av-sm { width: 16px; height: 16px; border-radius: 50%; display: inline-block; vertical-align: -3px; margin-right: 4px; }
.cell-content { flex: 1; min-width: 0; }

.cell-head {
  display: flex; align-items: baseline; gap: 4px;
  font-size: 13px; color: var(--muted);
  white-space: nowrap; min-width: 0;
}
.cell-head .name { color: var(--text); font-weight: 700; flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.cell-head .handle { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.cell-head .time { margin-left: auto; padding-left: 6px; flex: none; color: var(--muted); }
.cell-body { margin-top: 2px; white-space: pre-wrap; overflow-wrap: anywhere; }

.ctx {
  margin: 0 0 4px 46px;
  font-size: 13px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ctx a { color: var(--muted); font-weight: 600; }
.ctx .ico { display: inline-block; width: 14px; vertical-align: -3px; }
.ctx .ico svg { width: 14px; height: 14px; }
.ctx-repost .ico { color: var(--repost); }
.ctx-mention .ico, .ctx-reply .ico, .ctx-quote .ico { color: var(--accent); }

.thumbs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-top: 8px; border-radius: 8px; overflow: hidden; }
.thumbs.n1 { grid-template-columns: 1fr; }
.thumbs a { display: block; background: var(--raise); cursor: zoom-in; }
.thumbs img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.thumbs.n1 img { aspect-ratio: auto; max-height: 320px; }
.thumbs.n3 a:first-child { grid-row: span 2; }
.thumbs.n3 a:first-child img { height: 100%; }

.quote {
  margin-top: 8px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 8px;
}
.quote[data-quote-uri] { cursor: pointer; }
.quote[data-quote-uri]:hover { background: var(--raise-hover); }
.quote-head { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quote-head .name { color: var(--text); font-weight: 600; }
.quote-text {
  margin-top: 2px; font-size: 13px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  white-space: pre-wrap;
}
.linkcard {
  display: flex; gap: 0; margin-top: 8px; padding: 7px 10px;
  border: 1px solid var(--line); border-radius: 8px;
  font-size: 13px; color: var(--muted);
  white-space: nowrap; overflow: hidden;
}
.linkcard:hover { text-decoration: none; background: var(--raise); }
.linkcard-host { color: var(--text); flex: none; }
.linkcard-title { overflow: hidden; text-overflow: ellipsis; }
.unavailable { color: var(--muted); font-size: 13px; padding: 4px 0; }
.cell > .unavailable { padding-left: 46px; }

.cell-actions { display: flex; justify-content: space-between; gap: 4px; max-width: 300px; margin: 4px 0 0 -6px; }
.act {
  display: inline-flex; align-items: center; gap: 5px;
  min-width: 0; padding: 3px 4px; justify-self: start;
  border: 0; border-radius: 6px;
  background: transparent; color: var(--muted);
  font-size: 13px; line-height: 1.3;
}
.act svg { width: 16px; height: 16px; flex: none; }
.act:hover { background: var(--raise); }
.act:disabled { cursor: default; opacity: 0.6; }
.act-reply:hover, .act-quote:hover { color: var(--accent); }
.act-repost:hover, .act-repost.on { color: var(--repost); }
.act-like:hover, .act-like.on { color: var(--like); }
.act-like.on svg { fill: currentColor; }
.act-bookmark:hover, .act-bookmark.on { color: var(--accent); }
.act-bookmark.on svg { fill: currentColor; }
/* its own line under the buttons, so a note never moves them */
.act-note { flex: 0 0 100%; padding: 2px 6px 0; font-size: 12px; color: var(--error); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cell-main { cursor: default; }
.cell[data-cid] .cell-main { cursor: pointer; }

/* ---------- inline reply box ---------- */
.reply-box { margin: 6px 0 6px; cursor: default; }
.reply-input {
  display: block; width: 100%;
  min-height: calc(3 * 1.4em + 18px); max-height: calc(6 * 1.4em + 18px);
  padding: 8px 10px; resize: none;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
  font: inherit; line-height: 1.4;
}
.reply-input:focus { outline: none; border-color: var(--accent); }
.reply-input::placeholder { color: var(--muted); opacity: 0.8; }
.reply-foot { display: flex; align-items: center; gap: 10px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.reply-count { font-variant-numeric: tabular-nums; }
.reply-count.warn { color: var(--warn); }
.reply-count.over { color: var(--error); }
.reply-hint { flex: 1; text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reply-hint.err { color: var(--error); }
.reply-box .btn { padding: 4px 14px; font-size: 13px; }

/* ---------- thread slide-over ---------- */
.thread-scrim { position: fixed; inset: 0 0 0 var(--rail); z-index: 4; background: var(--scrim); }
.thread-scrim[hidden] { display: none; }
.thread {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 5;
  width: min(var(--thread), calc(100vw - var(--rail)));
  display: flex; flex-direction: column;
  background: var(--panel);
  border-left: 1px solid var(--line);
  box-shadow: -12px 0 32px var(--shadow);
  transform: translateX(100%); visibility: hidden;
  transition: transform 180ms ease, visibility 0s linear 180ms;
  outline: none;
}
.thread.open { transform: none; visibility: visible; transition: transform 180ms ease; }
/* Wide reader: a sheet centered in the deck area that rises from the bottom. */
.thread.wide {
  top: 24px; bottom: 24px; left: var(--rail); right: 0; margin-inline: auto;
  width: min(var(--sheet), calc(100vw - var(--rail) - 48px));
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  box-shadow: 0 12px 40px var(--shadow);
  transform: translateY(24px); opacity: 0;
  transition: transform 220ms ease-out, opacity 220ms ease-out, visibility 0s linear 220ms;
}
.thread.wide.open { transform: none; opacity: 1; transition: transform 220ms ease-out, opacity 220ms ease-out; }
.panel-wide[hidden] { display: none; }
.panel-wide[aria-pressed="true"] { background: var(--raise); color: var(--text); }
.thread-head {
  flex: 0 0 var(--head);
  display: flex; align-items: center; gap: 10px;
  padding: 0 6px 0 14px;
  border-bottom: 1px solid var(--line);
}
.thread-title { flex: 1; font-size: 15px; font-weight: 700; }
.panel-back[hidden] { display: none; }
.thread-head:has(.panel-back:not([hidden])) { padding-left: 6px; gap: 4px; }
.thread-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.panel-tools { flex: none; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.panel-tools[hidden] { display: none; }
.search-form { display: flex; flex-direction: column; gap: 10px; }
.search-row { display: flex; align-items: center; gap: 10px; }
.search-status { flex: 1; min-width: 0; font-size: 13px; color: var(--muted); }
.search-status.err { color: var(--error); }

.retry-btn {
  padding: 2px 8px; border: 0; border-radius: 999px;
  background: none; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer;
}
.retry-btn:hover { background: var(--accent-wash); }

/* ---------- trending panel ---------- */
.trends { margin: 0; padding: 0; list-style: none; }
.trend-filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.trend-filters .chip { font: inherit; font-size: 13px; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer; text-decoration: line-through; }
.trend-filters .chip[aria-pressed="true"] { background: var(--accent-wash); color: inherit; border-color: var(--accent); text-decoration: none; }
.trend {
  display: flex; flex-direction: column; gap: 3px; width: 100%;
  padding: 12px 14px; border: 0; border-bottom: 1px solid var(--line);
  background: none; color: var(--text); text-align: left; font: inherit; cursor: pointer;
}
.trend:hover { background: var(--accent-wash); }
.trend-name { font-weight: 700; overflow-wrap: anywhere; }
.trend-meta { font-size: 13px; color: var(--muted); }
.trend-desc { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.search-add { padding: 4px 14px; font-size: 13px; }
/* compose */
.compose { position: relative; display: flex; flex-direction: column; gap: 10px; min-height: 100%; padding: 14px; }
.compose .compose-input { min-height: calc(5 * 1.4em + 18px); max-height: calc(12 * 1.4em + 18px); }
.compose-quote { position: relative; }
.compose-quote[hidden] { display: none; }
.compose-quote .quote { margin-top: 0; padding-right: 40px; }
.compose-unquote { position: absolute; top: 4px; right: 4px; }
.compose-card { position: relative; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.compose-card[hidden] { display: none; }
.compose-card-img { display: block; width: 100%; max-height: 160px; object-fit: cover; background: var(--raise); }
.compose-card-text { display: flex; flex-direction: column; gap: 2px; padding: 8px 40px 8px 10px; font-size: 13px; overflow-wrap: anywhere; }
.compose-card-text b { color: var(--text); font-weight: 600; }
.compose-card-text span { color: var(--muted); }
.compose-card-remove { position: absolute; top: 4px; right: 4px; }
.compose-tray { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; padding: 0; list-style: none; }
.compose-tray[hidden] { display: none; }
.compose-img { position: relative; display: flex; flex-direction: column; gap: 4px; }
.compose-img img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; background: var(--raise); }
.compose-vid { grid-column: 1 / -1; }
.compose-vid video { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: contain; border-radius: 8px; background: var(--raise); }
.compose-vid-status { font-size: 13px; color: var(--muted); }
.compose-vid-status.err { color: var(--error); }
.compose-remove {
  position: absolute; top: 4px; right: 4px;
  width: 26px; height: 26px; display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: var(--scrim); color: var(--text);
}
.compose-remove:hover { background: var(--bg); }
.compose-remove:disabled { opacity: 0.5; cursor: default; }
.compose-alt {
  width: 100%; padding: 4px 8px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 6px;
  font: inherit; font-size: 12px;
}
.compose-alt:focus { outline: none; border-color: var(--accent); }
.compose-alt::placeholder { color: var(--muted); }
.compose-note { margin: 0; font-size: 12px; color: var(--warn); }
.compose-note:empty { display: none; }
.compose-note.err { color: var(--error); }
.compose-foot { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.compose-foot .btn { padding: 5px 18px; font-size: 13px; }
.compose-pick { position: relative; margin-left: -6px; cursor: pointer; }
.compose-pick.off { opacity: 0.4; cursor: default; }
.compose-pick:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.compose-file { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip-path: inset(50%); }
.compose-drop {
  position: absolute; inset: 8px; z-index: 1;
  display: none; place-items: center;
  border: 2px dashed var(--accent); border-radius: 10px;
  background: color-mix(in srgb, var(--panel) 88%, var(--accent)); color: var(--accent);
  font-weight: 600; pointer-events: none;
}
.thread.dropping .compose-drop { display: grid; }

/* profile editor */
.pe { display: flex; flex-direction: column; gap: 14px; min-height: 100%; padding: 14px; }
.pe-images { display: flex; flex-direction: column; }
.pe-banner { aspect-ratio: 3 / 1; border-radius: 8px; background: var(--raise); overflow: hidden; }
.pe-av {
  width: 72px; height: 72px; margin: -36px 0 0 12px; border-radius: 50%;
  border: 3px solid var(--panel); background: var(--raise); overflow: hidden;
}
.pe-banner img, .pe-av img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pe-img-actions { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; }
.pe-img-row { display: flex; gap: 6px; }
.pe-img-actions .btn { padding: 4px 12px; font-size: 12px; font-weight: 600; }
.pe-pick { position: relative; cursor: pointer; }
.pe-pick:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.pe-field { display: flex; flex-direction: column; gap: 4px; }
.pe-label { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 600; }
.pe-count { font-weight: 400; font-variant-numeric: tabular-nums; }
.pe-count.over { color: var(--error); }
.pe-input {
  width: 100%; padding: 6px 10px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 6px;
  font: inherit; font-size: 13px;
}
textarea.pe-input { min-height: calc(4 * 1.4em + 14px); max-height: calc(10 * 1.4em + 14px); }
.pe-input:focus { outline: none; border-color: var(--accent); }
.pe-input.over { border-color: var(--error); }
.pe-input::placeholder { color: var(--muted); opacity: 0.8; }
.pe-links-head { display: flex; align-items: center; justify-content: space-between; }
.pe-add { padding: 4px 12px; font-size: 12px; }
.pe-links { display: flex; flex-direction: column; gap: 8px; margin: -6px 0 0; padding: 0; list-style: none; }
.pe-links[hidden] { display: none; }
.pe-link { display: flex; align-items: center; gap: 6px; padding: 6px; border-radius: 8px; background: var(--raise); }
.pe-link.dragging { opacity: 0.5; }
.pe-grip { flex: none; padding: 4px 2px; color: var(--muted); cursor: grab; }
.pe-link-fields { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.pe-link-tools { flex: none; display: flex; }
.pe-link-tools .icon-btn { width: 26px; height: 26px; }
.pe-link-tools .icon-btn svg { width: 14px; height: 14px; }
.pe-link-tools .icon-btn:hover:not(:disabled) { background: var(--raise-hover); }
.pe-link-tools .icon-btn:disabled { opacity: 0.35; cursor: default; background: none; }
.pe .compose-foot { margin-top: auto; }
.pe.sending .pe-images, .pe.sending .pe-links { opacity: 0.6; }
.thread-foot { flex: none; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 13px; }
.thread-foot:has(a[hidden]) { display: none; }
.t-focus .cell { background: var(--raise); }
.t-focus .cell-body { font-size: 16px; line-height: 1.45; }
.t-reply.d1 { padding-left: 16px; }
.t-reply.d2 { padding-left: 32px; }
.t-reply.d3 { padding-left: 48px; }

/* grouped notifications: icon in the avatar slot, two lines max */
.notif .notif-ico {
  flex: none; width: 36px;
  display: flex; justify-content: center; padding-top: 1px;
  color: var(--accent);
}
.notif .notif-ico svg { width: 18px; height: 18px; }
.notif-like .notif-ico svg, .notif-like-via-repost .notif-ico svg { fill: currentColor; }
.notif-like .notif-ico, .notif-like-via-repost .notif-ico { color: var(--like); }
.notif-repost .notif-ico, .notif-repost-via-repost .notif-ico { color: var(--repost); }
.notif .cell-head { color: var(--text); display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; column-gap: 12px; white-space: normal; }
.notif .cell-head .time { white-space: nowrap; }
.notif .n-line { display: flex; align-items: center; gap: 4px; min-width: 0; white-space: nowrap; }
.notif .n-line .av-link { flex: none; }
.notif .n-line .who { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.notif .n-line .verb { flex: none; }
.notif { padding-bottom: 10px; }
.notif[data-open-uri], .notif[data-open-actor] { cursor: pointer; }
.notif-post .thumbs { margin-top: 6px; max-height: 96px; overflow: hidden; }
.notif-post .thumbs img { max-height: 96px; aspect-ratio: auto; }
.notif-snippet { margin-top: 2px; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- image viewer ---------- */
.lb {
  position: fixed; inset: 0; z-index: 10;
  display: flex; align-items: center; justify-content: center; gap: 16px;
  padding: 56px 16px 24px;
  background: var(--lb-scrim);
  overscroll-behavior: contain;
}
.lb[hidden] { display: none; }
.lb-fig { margin: 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.lb-img {
  display: block; max-width: min(1400px, calc(100vw - 160px)); max-height: calc(100vh - 140px);
  object-fit: contain; border-radius: 6px; background: var(--panel);
}
.lb-cap { display: flex; flex-direction: column; align-items: center; gap: 6px; max-width: min(720px, calc(100vw - 160px)); text-align: center; font-size: 13px; }
.lb-alt { color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 4.2em; overflow-y: auto; }
.lb-alt[hidden] { display: none; }
.lb-out { color: var(--muted); }
.lb-out:hover { color: var(--text); }
.lb-btn {
  flex: none; width: 44px; height: 44px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: var(--raise); color: var(--text);
}
.lb-btn:hover { background: var(--raise-hover); }
.lb-btn[hidden] { display: none; }
.lb-close { position: absolute; top: 12px; right: 12px; }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  .thread, .thread.open, .thread.wide, .thread.wide.open { transition: none; }
  .deck.is-dragging .col, .deck.is-dragging .col.lifted.settling { transition: none; }
  .feed-row.feed-leaving { transition: none; }
}

/* ---------- profile panel ---------- */
.notif .cell-head .av-link { display: inline; }
.notif .cell-head .av-sm { width: 20px; height: 20px; vertical-align: -5px; margin-right: 4px; }
.notif .cell-head .who { color: var(--text); font-weight: 700; }
.prof { border-bottom: 1px solid var(--line); }
.prof-banner { display: block; width: 100%; aspect-ratio: 3 / 1; object-fit: cover; background: var(--raise); }
.prof-main { padding: 0 14px 14px; }
.prof-av {
  display: block; width: 72px; height: 72px; margin-top: -36px; border-radius: 50%;
  border: 3px solid var(--panel); background: var(--raise); object-fit: cover;
}
.prof-name { margin-top: 8px; font-size: 18px; font-weight: 700; overflow-wrap: anywhere; }
.prof-handle { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.badge {
  display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 4px;
  background: var(--raise); color: var(--muted); font-size: 11px; font-weight: 600;
}
.prof-bio { margin: 10px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.prof-blocked { margin: 10px 0 0; color: var(--warn); font-size: 13px; }
.prof-media { display: flex; align-items: center; gap: 6px; padding: 8px 14px; font-size: 13px; color: var(--muted); cursor: pointer; }
.prof-counts { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.prof-counts b { color: var(--text); }
.prof-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.prof-actions .btn { padding: 5px 14px; font-size: 13px; }
.btn-quiet { background: var(--raise); color: var(--text); }
.btn-quiet:hover:not(:disabled) { background: var(--raise-hover); }
.prof-out { margin-left: auto; font-size: 13px; color: var(--muted); }
.follow-btn { min-width: 92px; }
.follow-btn .f-on, .follow-btn .f-un, .follow-btn.on .f-off { display: none; }
.follow-btn.on { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.follow-btn.on .f-on { display: inline; }
.follow-btn.on:is(:hover, :focus-visible) .f-on { display: none; }
.follow-btn.on:is(:hover, :focus-visible) .f-un { display: inline; }
.follow-btn.on:is(:hover, :focus-visible) { color: var(--error); box-shadow: inset 0 0 0 1px var(--error); }
.follow-btn[aria-busy="true"] { opacity: 0.7; cursor: progress; }
.prof-note { margin: 8px 0 0; min-height: 0; font-size: 13px; color: var(--error); }
.prof-note:empty { display: none; }

/* ---------- rail tooltip and search popover ---------- */
.rail-tip {
  position: fixed; z-index: 30; pointer-events: none;
  max-width: 280px; padding: 5px 9px;
  background: var(--raise); color: var(--text);
  border: 1px solid var(--line); border-radius: 6px;
  font-size: 12px; line-height: 1.3;
  box-shadow: 0 6px 18px var(--shadow);
  overflow-wrap: anywhere;
}

/* ---------- settings panel, video embeds ---------- */
.rail-settings { margin-top: auto; }
.rail-me:not([hidden]) { margin-top: auto; }
.rail-me:not([hidden]) + .rail-settings { margin-top: 0; }
.rail-me[hidden] { display: none; }
.rail-me-av { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; background: var(--raise); }
.prof-pron { margin-left: 6px; font-size: 12px; }
.prof-links { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 10px 0 0; padding: 0; list-style: none; font-size: 13px; }
.prof-links a { display: inline-flex; align-items: center; gap: 6px; overflow-wrap: anywhere; }
.prof-link-ic { width: 16px; height: 16px; border-radius: 3px; object-fit: cover; }
.settings { padding: 16px; }
.settings-h { margin: 0 0 6px; font-size: 14px; font-weight: 600; }
.appearance { margin: 0 0 22px; padding: 0; border: 0; min-width: 0; }
.appearance legend { padding: 0; margin: 0 0 6px; }
.seg { display: flex; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--bg); }
.seg-opt { position: relative; flex: 1; display: grid; cursor: pointer; }
.seg-opt + .seg-opt { border-left: 1px solid var(--line); }
.seg-opt input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.seg-opt span { padding: 7px 10px; text-align: center; font-size: 13px; color: var(--muted); }
.seg-opt:hover span { background: var(--raise); color: var(--text); }
.seg-opt input:checked + span { background: var(--accent-wash); color: var(--accent); font-weight: 600; }
.muted-display { margin: 4px 0 2px; }
.muted-display-label { display: block; margin-bottom: 4px; font-size: 13px; color: var(--muted); }
.set-tabs { margin: 0; }
.set-tabs .seg-opt { padding: 0; border-width: 0 0 0 1px; background: none; font: inherit; cursor: pointer; }
.set-tabs .seg-opt:first-child { border-left-width: 0; }
.set-tabs .seg-opt span { padding: 5px 10px; }
.set-tabs .seg-opt[aria-selected="true"] span { background: var(--accent-wash); color: var(--accent); font-weight: 600; }
.set-tabs .seg-opt:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 6px; }
.settings-blogs .blogs { margin-top: 0; padding-top: 0; border-top: 0; }
.seg-opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 6px; }
.appearance .settings-note { margin: 0; }
.settings-note { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.lang-list { display: flex; flex-direction: column; }
.lang-row { display: flex; align-items: center; justify-content: space-between; padding: 9px 4px; border-top: 1px solid var(--line); cursor: pointer; }
.lang-row input { margin: 0; accent-color: var(--accent); }
.lang-more > summary { padding: 9px 4px; border-top: 1px solid var(--line); color: var(--accent); font-size: 13px; cursor: pointer; list-style: none; }
.lang-more > summary::-webkit-details-marker { display: none; }
.lang-more[open] > summary { color: var(--muted); }
.mute-h { margin-top: 20px; }
.mute-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 4px; border-top: 1px solid var(--line); }
.mute-text { display: flex; flex-direction: column; min-width: 0; }
.mute-word { overflow-wrap: anywhere; }
.mute-meta { color: var(--muted); font-size: 12px; }
.mute-row .btn { padding: 3px 12px; font-size: 13px; flex: none; }
.mute-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.mute-form .mute-input { flex: 1 1 100%; padding: 6px 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; font-size: 13px; }
.mute-form .mute-input:focus { outline: none; border-color: var(--accent); }
.mute-form select { padding: 5px 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; color: var(--text); font-size: 13px; }
.mute-check { flex: 1 1 100%; display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; cursor: pointer; }
.mute-check input { margin: 0; accent-color: var(--accent); }
.mute-form .btn { padding: 5px 18px; font-size: 13px; margin-left: auto; }
.settings-status { min-height: 18px; margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.video { position: relative; display: block; margin-top: 8px; border-radius: 8px; overflow: hidden; background: var(--raise); min-height: 120px; }
.video img { display: block; width: 100%; max-height: 320px; object-fit: cover; }
.video-play {
  position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px 0 0 -24px; border-radius: 50%;
  background: var(--media-btn);
}
.video-play::after { content: ""; position: absolute; left: 19px; top: 14px; border-style: solid; border-width: 10px 0 10px 16px; border-color: transparent transparent transparent #f2f4f8; }

/* ---------- blog (RSS) columns ---------- */
/* Blog columns sit on a faint light-blue wash, so reading looks apart from social at a glance. */
.col.col-blog { background: color-mix(in srgb, var(--panel) 94%, var(--accent)); }

.rss-tools { flex: none; display: flex; flex-direction: column; gap: 8px; padding: 8px 10px 10px; border-bottom: 1px solid var(--line); }
.rss-filter { position: relative; display: flex; align-items: center; }
.rss-filter > span { position: absolute; left: 9px; color: var(--muted); pointer-events: none; }
.rss-filter input {
  width: 100%; height: 30px; padding: 0 30px 0 29px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 6px; font-size: 13px;
}
.rss-filter input::-webkit-search-cancel-button { display: none; }
.rss-filter input:focus { outline: none; border-color: var(--accent); }
.rss-filter input::placeholder { color: var(--muted); opacity: 0.8; }
.rss-clear { position: absolute; right: 3px; width: 24px; height: 24px; }
.rss-clear[hidden] { display: none; }
.rss-clear svg { width: 14px; height: 14px; }
.rss-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rss-chips[hidden], .rss-chip[hidden] { display: none; }
.rss-chip {
  display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 999px; background: transparent;
  color: var(--muted); font-size: 12px;
}
button.rss-chip:hover:not(:disabled) { color: var(--text); background: var(--raise); }
.rss-chip-on { background: var(--accent-wash); border-color: var(--accent); color: var(--text); padding-right: 3px; }
.rss-chip-label { padding: 0; border: 0; background: none; color: inherit; font-size: 12px; }
.rss-chip-x { display: grid; place-items: center; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted); }
.rss-chip-x:hover { background: var(--raise-hover); color: var(--text); }
.rss-chip-add { width: 24px; padding: 0; justify-content: center; }
.rss-chip-add:disabled { opacity: 0.5; cursor: default; }

.rss-cell { padding: 10px 14px 11px; cursor: pointer; }
.rss-cell:hover { background: var(--raise); }
.rss-cell .cell-head { align-items: center; gap: 6px; }
.rss-fav { flex: none; width: 16px; height: 16px; border-radius: 3px; background: var(--raise); object-fit: cover; }
.rss-cell .cell-head .name { color: var(--muted); font-weight: 600; flex: 0 1 auto; }
.rss-main { display: flex; gap: 12px; margin-top: 4px; }
.rss-text { flex: 1; min-width: 0; }
.rss-title { font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.rss-excerpt {
  margin-top: 3px; font-size: 13px; color: var(--muted); line-height: 1.4; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.rss-thumb { flex: none; width: 64px; height: 64px; margin-top: 2px; border-radius: 6px; background: var(--raise); object-fit: cover; }
mark.hit { background: var(--accent-wash); color: inherit; border-radius: 3px; box-shadow: 0 0 0 1px var(--accent-wash); }
.rss-excerpt mark.hit { color: var(--text); }

/* ---------- reader (in the slide-over) ---------- */
.reader { padding: 14px 16px 28px; }
.reader-lead { display: block; width: 100%; aspect-ratio: 2 / 1; border-radius: 8px; background: var(--raise); object-fit: cover; }
.reader-title { margin: 14px 0 0; font-size: 20px; line-height: 1.3; font-weight: 700; letter-spacing: -0.005em; overflow-wrap: anywhere; }
.reader > .reader-title:first-child { margin-top: 2px; }
.reader-meta { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.reader-meta .rss-fav { margin-right: 2px; }
.reader-meta b { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.reader-linked { margin-top: 6px; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.reader-actions { display: flex; align-items: center; gap: 9px; margin-top: 12px; white-space: nowrap; }
.reader-share-rule { align-self: stretch; width: 1px; margin: 4px 0; background: var(--line); }
.reader-share-out { padding: 0; border: 0; background: none; font: inherit; font-size: 13px; color: var(--muted); cursor: pointer; }
.reader-share-out:hover { color: var(--text); }
.reader-share { display: inline-block; padding: 5px 10px; font-size: 13px; }
.reader-continue:hover { text-decoration: none; }
.reader-permalink { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.reader-permalink:hover { color: var(--text); }
.reader-continue { display: inline-block; padding: 7px 18px; font-size: 14px; }
.reader-body { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 15px; line-height: 1.55; overflow-wrap: anywhere; }
.reader-body p { margin: 0 0 12px; }
.reader-body h2 { margin: 20px 0 8px; font-size: 16px; line-height: 1.35; }
.reader-body ul { margin: 0 0 12px; padding-left: 36px; }
.reader-body li { margin-bottom: 6px; padding-left: 4px; }
.reader-body blockquote { margin: 0 0 12px; padding: 10px 12px; border-radius: 8px; background: var(--raise); color: var(--text); font-size: 14px; }
.reader-body .reader-table { margin: 0 0 14px; overflow-x: auto;
  background:
    linear-gradient(to right, var(--panel) 30%, transparent) left center / 24px 100% no-repeat local,
    linear-gradient(to left, var(--panel) 30%, transparent) right center / 24px 100% no-repeat local,
    linear-gradient(to right, var(--shadow), transparent) left center / 10px 100% no-repeat scroll,
    linear-gradient(to left, var(--shadow), transparent) right center / 10px 100% no-repeat scroll; }
.reader-table table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.4; font-variant-numeric: tabular-nums; }
.reader-table th { padding: 6px 8px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; text-align: left; }
.reader-table td { padding: 6px 8px; border-top: 1px solid var(--line); text-align: left; }
.reader-table th, .reader-table td { overflow-wrap: normal; word-break: normal; }
.reader-table th { white-space: nowrap; }
.reader-table tbody tr:first-child td { border-top: 0; }
.reader-table td:first-child, .reader-table th:first-child { text-align: left; }
.reader-table td:first-child { color: var(--text); }
.reader-table .num, .reader-table td.num:first-child { text-align: right; }
.reader-table.nowrap th, .reader-table.nowrap td { white-space: nowrap; }
.reader-body .reader-table-note { margin: 8px 0 0; padding: 0 10px; font-size: 13px; color: var(--muted); }
.reader-body .reader-media { margin: 0 0 14px; }
.reader-media img, .reader-media video { display: block; max-width: 100%; height: auto; border-radius: 8px; background: var(--raise); }
.reader-media figcaption { margin-top: 6px; font-size: 13px; line-height: 1.4; color: var(--muted); }
.reader-body .reader-embed { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--raise); color: var(--text); }
.reader-body .reader-embed:hover { text-decoration: none; }
.reader-embed-play { flex: none; color: var(--muted); }
.reader-embed-text { display: flex; flex-direction: column; min-width: 0; font-size: 14px; line-height: 1.35; }
.reader-embed-text span { font-size: 13px; color: var(--muted); }
.reader-body .dom { color: var(--muted); font-size: 13px; }

/* ---------- settings: Blogs (RSS) ---------- */
.blogs { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.set-row .settings-h { margin: 0; }
.switch { position: relative; flex: none; width: 34px; height: 20px; }
.switch input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.switch input:disabled { cursor: progress; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--line); transition: background 120ms ease; pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--panel); box-shadow: 0 1px 2px var(--shadow); transition: transform 120ms ease; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(14px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.blogs-top { padding-bottom: 24px; }
.blogs-label { margin: 0; font-size: 15px; font-weight: 600; color: var(--text); }
.blogs-images { margin-top: 12px; }
.blogs-help { margin: 4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.blogs-status { margin: 4px 0 0; color: var(--error); font-size: 13px; line-height: 1.45; }
.blogs-status:empty { display: none; }
.blogs-sec { padding: 24px 0; border-top: 1px solid var(--line); }
.blogs-h { margin: 0; font-size: 16px; font-weight: 700; color: var(--text); }
.blogs-h + * { margin-top: 8px; }
.blogs-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.blogs-head + * { margin-top: 8px; }
.blogs-link { padding: 0; border: 0; background: none; color: var(--accent); font: inherit; font-size: 13px; cursor: pointer; }
.blogs-link:hover { text-decoration: underline; }
.blogs-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.list-n { font-size: 12px; color: var(--muted); }

.cats { display: flex; flex-direction: column; }
.cat { margin: 16px -6px 0; padding: 0 6px; border-radius: 8px; transition: background 100ms ease; }
.cat:first-child { margin-top: 12px; }
.cat-head { display: flex; align-items: center; margin-bottom: 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.cat-n { white-space: pre; }
.cat-head .cat-remove { margin-left: auto; }
.cat-name { padding: 2px 4px; margin: 0 -4px; border: 0; border-radius: 4px; background: none; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: text; }
.cat-name:hover { background: var(--raise); }
.cat-help { margin: 0 0 6px; font-size: 13px; line-height: 1.45; color: var(--muted); }
.cat-remove, .feed-more-btn { width: 24px; height: 24px; flex: none; }
.cat-remove svg { width: 12px; height: 12px; }
.cat-input { width: 180px; padding: 2px 6px; background: var(--bg); border: 1px solid var(--accent); border-radius: 5px; color: var(--text); font: inherit; font-size: 13px; font-weight: 600; outline: none; }
.cat-input::placeholder { color: var(--muted); font-weight: 400; opacity: 0.8; }
.cat-hint-row { padding: 2px 0 4px; }
.cat-hint { font-size: 12px; color: var(--muted); }
.cat.drop-target { background: var(--accent-wash); box-shadow: inset 0 0 0 1px var(--accent); }

.feed-list { position: relative; display: flex; flex-direction: column; }
.feed-row { display: flex; align-items: flex-start; gap: 8px; padding: 8px 4px; border-top: 1px solid var(--line); }
.feed-row:first-child { border-top: 0; }
.feed-row .rss-fav { margin-top: 2px; }
.feed-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.feed-title { font-size: 15px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-meta { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-row select[data-interval] { flex: none; padding: 3px 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; color: var(--text); font-size: 12px; }
.feed-err { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 4px; font-size: 12px; color: var(--muted); }
.err-badge { padding: 1px 7px; border-radius: 4px; background: var(--danger-wash); color: var(--error); font-size: 11px; font-weight: 600; overflow-wrap: anywhere; }
/* "Move to…": a native select laid invisibly over the folder icon, so the keyboard and screen readers get a real select. */
.feed-more { position: relative; flex: none; margin-left: -2px; }
.feed-more-btn { display: grid; place-items: center; }
.feed-more .menu { top: calc(100% + 2px); right: 0; z-index: 5; min-width: 200px; }
.feed-more .menu-row[aria-disabled="true"] { color: var(--muted); cursor: default; }
.feed-more .menu-row[aria-disabled="true"]:hover { background: transparent; }
.feed-more .menu-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.grip { flex: none; display: grid; place-items: center; width: 14px; height: 20px; margin-left: -4px; color: var(--muted); opacity: 0.45; cursor: grab; touch-action: none; }
.grip svg { width: 10px; height: 16px; }
.feed-row:hover .grip { opacity: 1; }
.drop-line { height: 2px; margin: -1px 0 -1px 18px; background: var(--accent); border-radius: 1px; position: relative; z-index: 1; }
.feed-row.lifted {
  position: fixed; z-index: 40; pointer-events: none; margin: 0; padding: 7px 8px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--panel);
  box-shadow: 0 10px 28px var(--shadow); transform: scale(1.02) rotate(-0.4deg); cursor: grabbing;
}
.feed-row.lifted .grip { opacity: 1; }
.feed-row.feed-leaving { opacity: 0; max-height: 0 !important; margin: 0; padding-top: 0; padding-bottom: 0; overflow: hidden; border-top-width: 0;
  transition: opacity 200ms ease, max-height 200ms ease, padding 200ms ease; }
.feed-row.ghost-src { opacity: 0.35; }
.blogs.is-dragging, .blogs.is-dragging * { cursor: grabbing; user-select: none; }

.add-feed, .set-inline { display: flex; gap: 8px; }
.add-feed input, .set-inline input { flex: 1; min-width: 0; padding: 6px 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; color: var(--text); font-size: 13px; }
.add-feed input:focus, .set-inline input:focus { outline: none; border-color: var(--accent); }
.add-feed input::placeholder, .set-inline input::placeholder { color: var(--muted); opacity: 0.8; }
.add-feed .btn, .set-inline .btn { padding: 5px 16px; font-size: 13px; }
.mw-list { display: flex; flex-direction: column; margin-top: 12px; }
.mw-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 3px 4px; border-top: 1px solid var(--line); }
.mw-row:first-child { border-top: 0; }
.mw-chip { display: inline-flex; align-items: center; gap: 2px; min-width: 0; height: 24px; padding: 0 2px 0 10px; border-radius: 999px; background: var(--raise); font-size: 13px; overflow-wrap: anywhere; }
.mw-chip button { flex: none; width: 20px; height: 20px; display: grid; place-items: center; border: 0; border-radius: 50%; background: none; color: var(--muted); }
.mw-chip button:hover { background: var(--raise-hover); color: var(--text); }
.mw-check { flex: none; display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); cursor: pointer; }
.mw-check input { margin: 0; accent-color: var(--accent); }

.fetch-log { margin: 0; }
.fetch-log summary { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; cursor: pointer; list-style: none; }
.fetch-log summary::-webkit-details-marker { display: none; }
.fetch-log summary svg { color: var(--muted); transition: transform 120ms ease; }
.fetch-log[open] summary svg { transform: rotate(90deg); }
.log-body { margin-top: 8px; max-height: 320px; overflow-y: auto; }
.log-list { margin: 0; padding: 0; list-style: none; }
.log-row { display: grid; grid-template-columns: auto 1fr auto; gap: 0 10px; padding: 5px 4px; border-top: 1px solid var(--line); font-size: 12px; }
.log-row:first-child { border-top: 0; }
.log-when, .log-ms { color: var(--muted); white-space: nowrap; }
.log-feed { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-what { grid-column: 2 / 3; color: var(--muted); overflow-wrap: anywhere; }
.log-ms { grid-row: 1; grid-column: 3; }
.log-fail .log-what { color: var(--error); }
.log-empty { margin: 4px 0; }

.opml { display: flex; gap: 8px; margin-top: 12px; }
.opml .btn { padding: 4px 12px; font-size: 12px; }
.opml-status p { margin: 8px 0 4px; color: var(--text); }
.opml-skipped { margin: 0; padding-left: 18px; color: var(--muted); font-size: 12px; }
.failing { margin: 8px 0; }
.failing .opml { margin-top: 8px; }
.opml-title { color: var(--text); font-weight: 600; }
.opml-url { color: var(--text); overflow-wrap: anywhere; }

/* trending: Blogs tab */
.tr-tools { display: flex; align-items: center; gap: 10px; }
.tr-tools .seg { margin: 0; }
.tr-tabs { flex: 1; }
.tr-win { flex: none; width: 108px; }
.tr-tabs .seg-opt span { padding: 5px 10px; }
.tr-win .seg-opt span { padding: 5px 8px; }
.topic-note { margin: 0; padding: 12px 14px 4px; font-size: 13px; color: var(--muted); }
.topics { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 10px 14px 16px; list-style: none; }
.topic { display: inline-flex; align-items: baseline; gap: 6px; padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px; background: none; color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.topic:hover { background: var(--accent-wash); border-color: var(--accent); }
.topic-n { color: var(--muted); font-size: 12px; }

/* ---------- hidden columns ---------- */
/* A hidden column's rail icon: dimmed, never removed. */
.rail-btn.rail-off { color: var(--muted); opacity: 0.5; }
.rail-btn.rail-off:hover { color: var(--muted); opacity: 0.75; }
.rail-note { pointer-events: none; }
.rail-note:empty { opacity: 0; } /* unhidden a frame before its text lands, so screen readers announce it */
.pop-note { padding: 0 14px 12px; }

/* ---------- wide reader: one centered 68ch column; tables and media may use the sheet's inner width ---------- */
.thread.wide .reader {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 68ch) minmax(0, 1fr);
  font-size: 15px; padding: 32px 40px;
}
.thread.wide .reader > * { grid-column: 2; }
.thread.wide .reader > .reader-body {
  grid-column: 1 / -1; border-top: 0;
  background: linear-gradient(var(--line), var(--line)) top center / min(100%, 68ch) 1px no-repeat;
}
.thread.wide .reader-actions { justify-self: start; }
.thread.wide .reader-body > :is(p, h2, ul, ol, blockquote, .reader-embed, .reader-table-note) { max-width: 68ch; margin-inline: auto; }
.thread.wide .reader-body > :is(p, ul, ol, blockquote) { margin-bottom: 12px; }
.thread.wide .reader-body > .reader-table { width: max-content; min-width: min(100%, 68ch); max-width: 100%; margin-inline: auto; }
.thread.wide .reader-body > .reader-media { max-width: 100%; }
.thread.wide .reader-media img, .thread.wide .reader-media video { margin-inline: auto; }
.thread.wide .reader-media figcaption { max-width: 68ch; margin-inline: auto; }
@media (max-width: 660px) { .thread.wide .reader { padding: 20px; } }

/* ---------- keyboard reading ---------- */
.cell.kb-current, .rss-cell.kb-current { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--accent-wash); }

/* ---------- Cards post style ----------
   Deck columns only; thread and profile panels stay flat. Media and link cards keep their own 8px radius. */
:root[data-post-style="cards"] .col .scroller { background: var(--well); padding: 6px 8px 8px; }
:root[data-post-style="cards"] .col-blog .scroller { background: color-mix(in srgb, var(--well) 94%, var(--accent)); } /* keeps the blog-column tint */
:root[data-post-style="cards"] .col .cell {
  margin-bottom: 6px; padding: 10px 12px 6px;
  background: var(--panel); border: 1px solid var(--card-line); border-radius: 10px;
}
:root[data-post-style="cards"] .col .rss-cell { padding-bottom: 11px; }
:root[data-post-style="cards"] .col .rss-cell:hover { background: var(--raise); }
:root[data-post-style="cards"] .col .cell-muted { padding-block: 8px; }
:root[data-post-style="cards"] .col .notif { padding-bottom: 10px; }
:root[data-post-style="cards"] .col .cell.kb-current { background: var(--accent-wash); }
.kb-help {
  position: fixed; right: 16px; bottom: 16px; z-index: 40; min-width: 220px; padding: 12px 14px;
  background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 8px 24px var(--shadow); font-size: 13px;
}
.kb-help[hidden] { display: none; }
.kb-help-title { font-weight: 700; margin-bottom: 8px; }
.kb-help > div:not(.kb-help-title) { display: flex; align-items: baseline; gap: 12px; padding: 2px 0; }
.kb-help kbd {
  min-width: 52px; padding: 1px 6px; text-align: center; font: inherit; font-weight: 600;
  background: var(--raise); border: 1px solid var(--line); border-radius: 4px;
}

/* ---------- in-deck video player ---------- */
.video-on { min-height: 0; background: #0b0f14; cursor: auto; }
.video-player { display: block; width: 100%; max-height: 420px; background: #0b0f14; }
.video-note {
  position: absolute; left: 8px; right: 8px; bottom: 8px; padding: 6px 10px; border-radius: 6px;
  background: var(--media-btn); color: #f2f4f8; font-size: 13px; text-align: center;
}
