/* Xhumed – a calm, fast reader. Dark + light, desktop rail + mobile tab bar. */

/* ---------- fonts (self-hosted; the CSP allows no third-party origins) ---------- */
/* One typeface everywhere, like X: Inter (the closest open match to X's own Chirp), variable weight,
   self-hosted. Turkish and the rest of Latin Extended come from the second file. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/fonts/inter-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/fonts/inter-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* ---------- tokens ---------- */
:root {
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: var(--font);
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 24px;
  --radius-sm: 14px;
  --pill: 999px;
  --tap: 44px;
  --avatar: 44px;
  --pad: 16px;
  --rail: 88px;
  --topbar: 64px;
  --tabbar: 64px;
  --side: 340px;
  --max: 1180px;
  --ease: cubic-bezier(.2, .7, .2, 1);

  color-scheme: dark;
  --bg: #0b0b0d;
  --bg-elev: #121215;
  --surface: #18181b;
  --surface-2: #222226;
  --surface-3: #2a2a30;
  --text: #f3f3ef;
  --text-2: #c4c4bd;
  --muted: #8a8a84;
  --hair: rgba(255, 255, 255, .08);
  --hair-strong: rgba(255, 255, 255, .16);
  --accent: #7fd3a3;
  --accent-ink: #07200f;
  --accent-text: #93dab3;
  --accent-soft: rgba(127, 211, 163, .12);
  --rose: #fb7185;
  --sky: #74c7ff;
  --amber: #fbbf24;
  --gold: #e8b931;
  --gov: #9aa4b2;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --scrim: rgba(5, 6, 8, .94);
  --skeleton: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f4f0;
  --bg-elev: #ffffff;
  --surface: #ffffff;
  --surface-2: #f0f0ec;
  --surface-3: #e5e5df;
  --text: #15151a;
  --text-2: #45454c;
  --muted: #6f6f78;
  --hair: rgba(10, 10, 20, .08);
  --hair-strong: rgba(10, 10, 20, .16);
  --accent: #58c391;
  --accent-ink: #072a17;
  --accent-text: #1f7a4f;
  --accent-soft: rgba(88, 195, 145, .14);
  --rose: #e11d48;
  --sky: #0a84d0;
  --amber: #b45309;
  --gold: #b7860b;
  --gov: #5b6676;
  --shadow: 0 10px 30px rgba(20, 20, 30, .12);
  --scrim: rgba(12, 12, 16, .92);
}
:root[data-accent="sky"] { --accent: #74c7ff; --accent-ink: #04141f; --accent-text: #8fd2ff; --accent-soft: rgba(116, 199, 255, .14); }
:root[data-accent="sky"][data-theme="light"] { --accent: #2b9cf0; --accent-ink: #06243a; --accent-text: #0b6fb8; --accent-soft: rgba(43, 156, 240, .14); }
:root[data-accent="rose"] { --accent: #fb7185; --accent-ink: #2a060c; --accent-text: #fd8a9b; --accent-soft: rgba(251, 113, 133, .14); }
:root[data-accent="rose"][data-theme="light"] { --accent: #ec4f6a; --accent-ink: #2a060c; --accent-text: #c21d3d; --accent-soft: rgba(236, 79, 106, .14); }
:root[data-accent="amber"] { --accent: #fbbf24; --accent-ink: #2a1a02; --accent-text: #fcd062; --accent-soft: rgba(251, 191, 36, .14); }
:root[data-accent="amber"][data-theme="light"] { --accent: #f2a913; --accent-ink: #2a1a02; --accent-text: #9a5b00; --accent-soft: rgba(242, 169, 19, .16); }
:root[data-square-avatars] { --avatar-radius: 10px; }
:root[data-compact] { --avatar: 36px; --pad: 12px; }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar) + 12px); }
html, body { margin: 0; }
body {
  font: 15px/1.3334 var(--font); /* type scale: 12 (badges) · 13 (meta) · 15 (body) · 17 (focal tweet) · 20 (headings) · 26 (hero) */
  font-feature-settings: "cv05", "cv11", "ss03"; /* Inter: single-storey a-like l, open digits, as X renders Chirp */
  font-variant-numeric: tabular-nums;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.lb-open { overflow: hidden; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
img { max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
code { font: 13px/1.4 var(--font-mono); background: var(--surface-2); padding: 1px 6px; border-radius: 6px; word-break: break-all; }
h1, h2, h3, h4 { font-family: var(--font); font-weight: 800; letter-spacing: -.01em; margin: 0; }
svg { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); }
small { font-size: 13px; } /* the browser default (smaller) would leak a 12.5px step into the scale */
.small { font-size: 13px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 200; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: var(--pill); }
.skip:focus { left: 8px; }
::selection { background: var(--accent); color: var(--accent-ink); }
.mobile-only { display: none; }

/* ---------- shell: rail + content ---------- */
.shell { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100dvh; }
.rail {
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 18px 10px calc(18px + env(safe-area-inset-bottom)); border-right: 1px solid var(--hair); background: var(--bg);
}
.rail .logo { margin-bottom: 14px; }
.logo { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font: 800 20px/1 var(--font); letter-spacing: -.02em; white-space: nowrap; }
.logo:hover { text-decoration: none; }
.logo-mark { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: var(--accent); color: var(--accent-ink); font: 800 17px/1 var(--font-display); }
.rail .logo-text { display: none; }
.rail-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px; width: 64px; padding: 10px 0 8px; border: 0; background: transparent;
  color: var(--text-2); font-size: 12px; font-weight: 600; border-radius: 16px; transition: background .15s var(--ease), color .15s var(--ease);
}
.rail-item svg { width: 24px; height: 24px; }
.rail-item:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.rail-item.active { color: var(--text); background: var(--surface-2); }
.rail-item.active svg { color: var(--accent); }
.rail .theme-toggle { margin-top: auto; }
.ico-moon { display: none; }
:root[data-theme="light"] .ico-moon { display: block; }
:root[data-theme="light"] .ico-sun { display: none; }

.content { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 24px; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; height: var(--topbar);
  padding-top: env(safe-area-inset-top); background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.topbar .search {
  display: flex; align-items: center; gap: 8px; flex: 1 1 auto; max-width: 640px; height: 44px; padding: 0 6px 0 14px;
  background: var(--surface); border: 1px solid var(--hair); border-radius: var(--pill); transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.topbar .search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.search-ico { width: 18px; height: 18px; color: var(--muted); flex: 0 0 auto; }
.topbar .search input { flex: 1 1 auto; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 15px; }
.topbar .search input::-webkit-search-decoration, .topbar .search input::-webkit-search-cancel-button { -webkit-appearance: none; }
/* Search type picker: our own menu instead of the browser's native select popup. */
.mode { position: relative; flex: 0 0 auto; }
.topbar .search .mode-btn { display: inline-flex; align-items: center; gap: 4px; height: auto; border: 0; background: var(--surface-2); color: var(--text-2); font-size: 13px; font-weight: 600; border-radius: var(--pill); padding: 6px 8px 6px 11px; }
.mode-btn svg { width: 14px; height: 14px; stroke-width: 2.4; transition: transform .15s var(--ease); }
.topbar .search .mode-btn:hover, .topbar .search .mode-btn[aria-expanded="true"] { color: var(--text); }
.mode-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.mode-menu { position: absolute; top: calc(100% + 10px); right: 0; z-index: 40; min-width: 156px; margin: 0; padding: 6px; list-style: none; background: var(--surface); border: 1px solid var(--hair-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.mode-menu[hidden] { display: none; }
.mode-menu li { position: relative; padding: 9px 14px 9px 32px; border-radius: 9px; font-size: 15px; font-weight: 550; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.mode-menu li:hover, .mode-menu li[data-focus] { background: var(--surface-2); color: var(--text); }
.mode-menu li[aria-selected="true"] { color: var(--text); }
.mode-menu li[aria-selected="true"]::before { content: "✓"; position: absolute; left: 12px; top: 9px; font-weight: 700; color: var(--accent); }
.search-key { font: 12px/1 var(--font); color: var(--muted); border: 1px solid var(--hair-strong); border-radius: 6px; padding: 4px 6px; }
.topbar .search button { border: 0; height: 34px; padding: 0 14px; border-radius: var(--pill); background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--hair); border-radius: 50%; background: var(--surface); color: var(--text-2); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover { color: var(--text); border-color: var(--hair-strong); }
.topbar .theme-toggle { margin-left: auto; }
.topbar .logo-mobile { display: none; }

.page { display: grid; grid-template-columns: minmax(0, 1fr) var(--side); gap: 24px; align-items: start; padding: 14px 0 32px; }
.column-main { min-width: 0; background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius); overflow: clip; }
.column-side { position: sticky; top: calc(var(--topbar) + 14px); max-height: calc(100dvh - var(--topbar) - 14px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; min-width: 0; display: flex; flex-direction: column; gap: 14px; padding-bottom: 14px; }
.column-side::-webkit-scrollbar { display: none; }
.foot { color: var(--muted); font-size: 13px; padding: 0 4px calc(24px + env(safe-area-inset-bottom)); }
.tabbar { display: none; }

/* ---------- side boxes ---------- */
.box { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius); padding: 16px 18px; }
.box h3 { font-size: 17px; display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.box h3.sub { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--hair); }
.box p { margin: 4px 0; color: var(--text-2); }
.box-action { margin-left: auto; font: 600 13px var(--font); color: var(--muted); }
.trends, .tips, .who, .plain-list { list-style: none; margin: 0; padding: 0; }
.trends li { padding: 6px 0; display: flex; align-items: baseline; gap: 10px; min-height: 30px; font-weight: 700; }
.trends li a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.trends.plain li { font-weight: 500; }
.trends.plain li a { color: var(--accent-text); }
.trend-meta { margin-left: auto; font-weight: 500; font-size: 12px; color: var(--muted); white-space: nowrap; }
ol.trends { counter-reset: trend; }
ol.trends li::before { counter-increment: trend; content: counter(trend, decimal-leading-zero); color: var(--muted); font: 600 12px var(--font); width: 20px; flex: 0 0 20px; }
.tips li { padding: 4px 0; color: var(--text-2); font-size: 13px; }
.who li { padding: 2px 0; }
.who-row { display: flex; align-items: center; gap: 10px; color: var(--text); min-height: 40px; border-radius: 12px; padding: 2px 4px; margin: 0 -4px; }
.who-row:hover { text-decoration: none; background: var(--surface-2); }
.who-row img, .avatar-fallback.small { width: 34px; height: 34px; border-radius: var(--avatar-radius, 50%); object-fit: cover; background: var(--surface-3); flex: 0 0 34px; font-size: 15px; line-height: 34px; }
.who-name { display: block; line-height: 1.2; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-name small { display: block; color: var(--muted); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lang-switch { margin-left: auto; font-weight: 500; font-size: 12px; display: flex; gap: 2px; }
.lang-switch a { padding: 3px 8px; border-radius: var(--pill); color: var(--muted); }
.lang-switch a.active { background: var(--accent-soft); color: var(--accent-text); }
.photo-rail { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.photo-rail a { display: block; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.photo-rail img { width: 100%; height: 100%; object-fit: cover; display: block; }
.side-links { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- buttons, chips, tabs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border: 1px solid var(--hair-strong); border-radius: var(--pill); background: var(--surface-2); color: var(--text); font-weight: 700; font-size: 13px; min-height: 38px; transition: background .15s var(--ease), border-color .15s var(--ease); }
.btn:hover { text-decoration: none; background: var(--surface-3); }
.btn.primary { background: var(--accent); border-color: transparent; color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .6; cursor: wait; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; border: 1px solid var(--hair); border-radius: var(--pill); background: var(--surface); color: var(--text); font-weight: 600; font-size: 13px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip:hover { background: var(--surface-2); text-decoration: none; }
.chip.active { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.tabs { display: flex; gap: 4px; padding: 10px 12px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; padding: 8px 14px; color: var(--text-2); font-weight: 650; border-radius: var(--pill); white-space: nowrap; min-height: 36px; font-size: 15px; border: 0; background: transparent; }
.tab.active { color: var(--text); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--hair-strong); }
.tab:hover { text-decoration: none; color: var(--text); }
.view-switch { display: inline-flex; gap: 2px; margin-left: auto; padding: 3px; background: var(--surface-2); border-radius: var(--pill); flex: 0 0 auto; }
.view-switch a { display: inline-grid; place-items: center; width: 34px; height: 30px; border-radius: var(--pill); color: var(--muted); }
.view-switch a svg { width: 18px; height: 18px; }
.view-switch a.active { background: var(--surface); color: var(--text); }
.view-switch a:hover { text-decoration: none; color: var(--text); }

/* ---------- panel heads ---------- */
.panel-head { padding: 18px var(--pad) 0; border-bottom: 1px solid var(--hair); }
.panel-head h2 { font-size: 20px; line-height: 24px; overflow-wrap: anywhere; }
.panel-head .q { color: var(--accent-text); }
.panel-head .tabs { padding-left: 0; padding-right: 0; }
.panel-sub { color: var(--muted); font-size: 15px; margin: 2px 0 0; }
.toolbar { display: flex; align-items: center; gap: 8px; padding: 8px var(--pad); border-bottom: 1px solid var(--hair); font-size: 13px; color: var(--text-2); flex-wrap: wrap; }
.live { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 13px; }
.newbar { background: var(--accent-soft); color: var(--accent-text); padding: 10px; text-align: center; font-weight: 700; cursor: pointer; border-bottom: 1px solid var(--hair); }
.source { color: var(--muted); font-size: 13px; padding: 8px var(--pad); border-bottom: 1px solid var(--hair); }
.loading { padding: 40px 20px; text-align: center; color: var(--muted); }
.loading::after { content: ""; display: block; width: 120px; height: 3px; margin: 14px auto 0; border-radius: 2px; background: linear-gradient(90deg, var(--surface-2), var(--accent), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.empty { padding: 44px 20px; text-align: center; color: var(--muted); }
.section { padding: 10px var(--pad); font: 700 13px var(--font); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); background: var(--bg-elev); border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); display: flex; align-items: center; gap: 10px; }
.section .tabs { padding: 0; margin-left: auto; }
.section .tab { padding: 4px 10px; min-height: 28px; font-size: 13px; text-transform: none; letter-spacing: 0; }

/* skeleton rows while the first page loads */
.skeleton { display: grid; grid-template-columns: var(--avatar) 1fr; gap: 12px; padding: 14px var(--pad); border-bottom: 1px solid var(--hair); }
.skeleton .sk { background: var(--skeleton); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border-radius: 8px; }
.skeleton .sk-avatar { width: var(--avatar); height: var(--avatar); border-radius: var(--avatar-radius, 50%); }
.skeleton .sk-line { height: 12px; margin-bottom: 8px; }
.skeleton .sk-line.w40 { width: 40%; } .skeleton .sk-line.w70 { width: 70%; } .skeleton .sk-line.w90 { width: 90%; }
.skeleton .sk-block { height: 160px; border-radius: 14px; margin-top: 4px; }

/* ---------- tweets ---------- */
.tweet { display: grid; grid-template-columns: var(--avatar) minmax(0, 1fr); gap: 12px; padding: 14px var(--pad) 12px; border-bottom: 1px solid var(--hair); position: relative; transition: background .12s var(--ease); }
.tweet:hover { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.tweet.dim { opacity: .9; }
.tweet .avatar { width: var(--avatar); height: var(--avatar); grid-row: span 2; }
.tweet .avatar img, .avatar-fallback { width: var(--avatar); height: var(--avatar); border-radius: var(--avatar-radius, 50%); object-fit: cover; background: var(--surface-3); display: block; text-align: center; line-height: var(--avatar); color: var(--text-2); font-weight: 700; font-size: 17px; }
.tweet .body { min-width: 0; }
.tweet .head { display: flex; align-items: baseline; gap: 5px; flex-wrap: wrap; line-height: 1.3; }
.tweet .name { color: var(--text); font-weight: 700; overflow-wrap: anywhere; }
.tweet .handle { color: var(--muted); font-size: 15px; }
.tweet .time { margin-left: auto; color: var(--muted); font-size: 15px; white-space: nowrap; }
.tweet .text { font-size: 15px; line-height: 20px; white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 2px; }
.tweet.main .text { font-size: 15px; line-height: 20px; margin-top: 4px; } /* same as the timeline, like X's current layout */
.tweet.main .main-time { margin-top: 10px; color: var(--muted); font-size: 13px; }
.tweet.main .main-time .time { margin: 0; font-size: 13px; }
.tweet.main { padding-bottom: 16px; }
.tweet.pinned { background: linear-gradient(90deg, var(--accent-soft), transparent 60%); }
.tweet.tombstone { display: block; color: var(--muted); font-style: italic; padding: 12px var(--pad) 12px calc(var(--pad) + var(--avatar) + 12px); }
.context { color: var(--muted); font-size: 13px; margin-bottom: 3px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.context.replying { margin-top: 2px; }
.context .pin { color: var(--accent-text); font-weight: 700; }
.stats { display: flex; gap: 18px; margin-top: 8px; color: var(--muted); font-size: 13px; flex-wrap: wrap; }
.stats .stat { display: inline-flex; align-items: center; gap: 4px; }
a.stat { color: inherit; } a.stat:hover { color: var(--accent-text); text-decoration: none; }
.stats .ico { opacity: .8; }
.tweet.main .stats { font-size: 13px; padding: 10px 0; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); margin-top: 12px; gap: 22px; }
:root[data-hide-stats] .stats { display: none; }
.actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.chip-act { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; min-height: 28px; border: 1px solid var(--hair); border-radius: var(--pill); background: var(--surface-2); color: var(--text-2); font-size: 13px; font-weight: 600; line-height: 1; transition: background .12s var(--ease), color .12s var(--ease); }
.chip-act svg { width: 13px; height: 13px; flex: 0 0 auto; }
.chip-act:hover { text-decoration: none; background: var(--surface-3); color: var(--text); }
.chip-act.download:hover { color: var(--accent-text); }
.note { margin-top: 10px; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--hair); border-radius: var(--radius-sm); font-size: 13px; }
.note strong { display: block; margin-bottom: 2px; }
.disclosure { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; margin-right: 6px; padding: 2px 8px; border-radius: var(--pill); background: var(--surface-2); color: var(--text-2); font-size: 12px; font-weight: 600; }
.user-row .text { font-size: 13px; color: var(--text-2); }
.user-row .bio-meta { display: flex; gap: 12px; color: var(--muted); font-size: 13px; margin-top: 4px; }

/* verified marks: blue (default), gold (business), gray (government) */
.verified { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--sky); color: #fff; font-size: 12px; font-weight: 800; line-height: 1; vertical-align: -2px; margin-left: 2px; flex: 0 0 16px; }
.verified.business { background: var(--gold); color: #1b1200; }
.verified.government { background: var(--gov); color: #0b0f14; }
.lock { color: var(--muted); font-size: 13px; }

/* thread connector lines (author threads, reply chains, parents) */
/* Thread connector: a clearly visible line from one avatar down to the next, like Nitter / X. */
.tweet.line::before { content: ""; position: absolute; left: calc(var(--pad) + var(--avatar) / 2 - 1.5px); top: calc(14px + var(--avatar) + 4px); bottom: -2px; width: 3px; border-radius: 2px; background: var(--thread-line, color-mix(in srgb, var(--accent) 45%, var(--hair-strong))); }
.tweet.line { border-bottom-color: transparent; }
.tweet.line-top::after { content: ""; position: absolute; left: calc(var(--pad) + var(--avatar) / 2 - 1.5px); top: 0; height: 12px; width: 3px; background: var(--thread-line, color-mix(in srgb, var(--accent) 45%, var(--hair-strong))); }
.tombstone.line::before { top: 0; }
.chain { border-bottom: 1px solid var(--hair); }
.chain-more { display: flex; align-items: center; gap: 12px; padding: 6px var(--pad) 14px; font-size: 13px; }
.chain-more .stub { width: var(--avatar); flex: 0 0 var(--avatar); display: grid; place-items: center; color: var(--hair-strong); letter-spacing: 2px; font-weight: 800; }
.chain-more a { font-weight: 650; }
.related-head { padding: 10px var(--pad); }
.newest { display: block; padding: 10px var(--pad); text-align: center; font-weight: 650; border-bottom: 1px solid var(--hair); background: var(--accent-soft); }
.earlier { display: flex; align-items: center; gap: 12px; padding: 10px var(--pad) 4px; font-size: 13px; }
.earlier .stub { width: var(--avatar); flex: 0 0 var(--avatar); text-align: center; color: var(--hair-strong); font-weight: 800; }

/* ---------- media ---------- */
.media { display: grid; gap: 3px; margin-top: 10px; border-radius: 16px; overflow: hidden; max-width: 520px; border: 1px solid var(--hair); }
.media.count-1 { grid-template-columns: 1fr; }
.media.count-2, .media.count-4 { grid-template-columns: 1fr 1fr; }
.media.count-3 { grid-template-columns: 2fr 1fr; }
.media.count-3 .media-item:first-child { grid-row: span 2; }
.media-item { position: relative; display: block; background: var(--surface); min-height: 80px; cursor: zoom-in; }
.media-item img, .media-item video { width: 100%; height: 100%; max-height: 380px; object-fit: cover; display: block; }
.media.count-1 .media-item img { width: auto; max-width: 100%; max-height: 420px; margin: 0 auto; object-fit: contain; }
/* Focal tweet: a bit roomier than the timeline, never a wall of media (X caps it the same way). */
.media.large .media-item img, .media.large .media-item video { max-height: 360px; object-fit: contain; background: var(--surface); }
.tweet.main .media { max-width: 480px; }
.tweet.main .media.count-1 .media-item img { max-height: 360px; }
.media-item video { cursor: default; }
.media-item.gif { cursor: pointer; }
.media-item .gif-dl { position: absolute; right: 8px; top: 8px; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: rgba(0, 0, 0, .72); color: #fff; opacity: 0; transition: opacity .15s var(--ease); }
.media-item .gif-dl svg { width: 16px; height: 16px; }
.media-item.gif:hover .gif-dl, .media-item.gif:focus-within .gif-dl { opacity: 1; }
@media (hover: none) { .media-item .gif-dl { opacity: 1; } }
.media .badge, .media .play, .media .duration { position: absolute; background: rgba(0, 0, 0, .72); color: #fff; padding: 3px 8px; border-radius: 8px; font-size: 13px; font-weight: 700; font-family: var(--font); }
.media .badge { left: 8px; bottom: 8px; }
.media .duration { right: 8px; bottom: 8px; }
.video-link { min-height: 140px; cursor: pointer; }
/* Play badge: the same accent disc as the player's big button, so a clip looks like ours before it starts. */
.video-link .play, .qthumb .play { left: 50%; top: 50%; transform: translate(-50%, -50%); width: 58px; height: 58px; padding: 0; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; box-shadow: 0 6px 24px rgba(0, 0, 0, .45); transition: transform .15s var(--ease), filter .15s var(--ease); }
.video-link .play svg, .qthumb .play svg { width: 26px; height: 26px; margin-left: 3px; fill: currentColor; stroke: none; }
.video-link:hover .play, .qthumb:hover .play { transform: translate(-50%, -50%) scale(1.06); filter: brightness(1.05); }
.media.count-2 .play, .media.count-3 .play, .media.count-4 .play { width: 46px; height: 46px; }
.media.count-2 .play svg, .media.count-3 .play svg, .media.count-4 .play svg { width: 20px; height: 20px; }
.video-link .play.label { width: auto; height: auto; padding: 8px 16px 8px 12px; border-radius: var(--pill); font: 700 15px var(--font); display: inline-flex; align-items: center; gap: 6px; }
.video-link .play.label svg { width: 18px; height: 18px; margin: 0; }
.media-item.audio { display: grid; place-items: center; min-height: 100px; }
/* Timeline media is smaller than in the focal tweet, like X: a narrower frame and a lower height cap,
   while the picture keeps its shape (portrait clips shrink to the cap instead of filling the column). */
.tweet:not(.main) .media { max-width: 440px; }
.tweet:not(.main) .media-item img, .tweet:not(.main) .media-item video { max-height: 280px; }
.tweet:not(.main) .media.count-1 .media-item img { max-height: 300px; }
.tweet:not(.main) .video-link { min-height: 120px; }
.download { font-size: 13px; }

.media-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; padding: 3px; }
.media-grid .cell { position: relative; aspect-ratio: 1; overflow: hidden; background: var(--surface-2); cursor: zoom-in; display: block; }
.media-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-grid .tag { position: absolute; right: 6px; top: 6px; background: rgba(0, 0, 0, .7); color: #fff; border-radius: 6px; padding: 2px 6px; font: 700 12px var(--font); }
.media-grid .goto { position: absolute; left: 6px; bottom: 6px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: rgba(0, 0, 0, .6); color: #fff; opacity: 0; transition: opacity .15s; }
.media-grid .cell:hover .goto { opacity: 1; }
.media-grid .goto svg { width: 14px; height: 14px; }
.media-gallery { columns: 3; column-gap: 8px; padding: 8px; }
.media-gallery.small { columns: 4; }
.media-gallery.large { columns: 2; }
.gallery-item { break-inside: avoid; margin-bottom: 8px; border-radius: 14px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--hair); }
.gallery-item .cell { display: block; position: relative; cursor: zoom-in; }
.gallery-item img { width: 100%; display: block; }
.gallery-item .cap { display: block; padding: 8px 10px; font-size: 13px; color: var(--text-2); }
.gallery-item .cap b { color: var(--text); }
.gallery-item .tag { position: absolute; right: 6px; top: 6px; background: rgba(0, 0, 0, .7); color: #fff; border-radius: 6px; padding: 2px 6px; font: 700 12px var(--font); }
:root[data-compact-gallery] .gallery-item .cap { display: none; }

/* Quote card, laid out like X: small avatar + name · handle · date, text, media edge to edge. */
.quote { display: block; margin-top: 12px; padding: 0; border: 1px solid var(--hair-strong); border-radius: 16px; color: var(--text); background: var(--bg-elev); cursor: pointer; overflow: hidden; transition: background .12s var(--ease); }
.quote:hover { background: var(--surface-2); }
.quote .qhead { display: flex; align-items: center; gap: 6px; padding: 12px 14px 0; min-width: 0; font-size: 15px; }
.quote .qavatar { width: 22px; height: 22px; border-radius: var(--avatar-radius, 50%); object-fit: cover; flex: 0 0 auto; background: var(--surface-3); }
.quote .qavatar-fallback { display: grid; place-items: center; font: 700 12px var(--font); color: var(--text-2); }
.quote .name { font-weight: 750; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; min-width: 0; }
.quote .qhead .verified { font-size: 12px; width: 16px; height: 16px; line-height: 16px; flex: 0 0 auto; }
.quote .handle, .quote .time { color: var(--muted); font-size: 15px; margin: 0; white-space: nowrap; }
/* On a narrow card the handle gives way first; the name keeps as much room as it can. */
.quote .handle { overflow: hidden; text-overflow: ellipsis; min-width: 36px; flex: 0 4 auto; }
.quote .time { flex: 0 0 auto; }
.quote .qtext { font-size: 15px; line-height: 1.45; white-space: pre-wrap; padding: 4px 14px 12px; overflow-wrap: anywhere; }
.quote .qhead:last-child { padding-bottom: 12px; }
/* Quote media is smaller than the tweet's own: a 96px square beside the text, or, with no text, a
   card-wide picture capped well below a normal tweet's. */
.quote .qbody { display: flex; align-items: flex-start; gap: 12px; padding: 6px 14px 12px; }
.quote .qbody .qtext { padding: 0; flex: 1 1 auto; min-width: 0; }
.quote .qthumb { position: relative; display: block; flex: 0 0 auto; width: 96px; height: 96px; border-radius: 12px; overflow: hidden; background: var(--surface-2); cursor: zoom-in; }
.quote .qthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.quote .qthumb .play { position: absolute; width: 36px; height: 36px; box-shadow: 0 3px 12px rgba(0, 0, 0, .45); }
.quote .qthumb .play svg { width: 16px; height: 16px; margin-left: 2px; }
.quote .qcount { position: absolute; right: 5px; bottom: 5px; background: rgba(0, 0, 0, .72); color: #fff; padding: 2px 6px; border-radius: 6px; font: 700 12px var(--font); }
.quote .media { margin: 0; border: 0; border-radius: 0; max-width: none; border-top: 1px solid var(--hair); background: var(--bg-elev); }
.quote .media-item img, .quote .media-item video, .quote .media.count-1 .media-item img { max-height: 280px; }
.quote .media .vp video { max-height: 280px; }
.quote .video-link { min-height: 100px; }
.quote .video-link .play { width: 46px; height: 46px; }
.quote .video-link .play svg { width: 20px; height: 20px; }
.quote .media-item { background: var(--bg-elev); }
.quote.unavailable { color: var(--muted); font-style: italic; padding: 12px 14px; }

.card { display: flex; margin-top: 10px; border: 1px solid var(--hair); border-radius: var(--radius-sm); overflow: hidden; color: var(--text); background: var(--bg-elev); max-width: 520px; }
.card:hover { text-decoration: none; background: var(--surface-2); }
.card img { width: 112px; height: 112px; object-fit: cover; flex: 0 0 112px; background: var(--surface-2); }
.card-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; justify-content: center; }
.card-title { font-weight: 700; overflow-wrap: anywhere; }
.card-desc { color: var(--text-2); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-host { color: var(--muted); font-size: 12px; }
.article-card { display: block; margin-top: 10px; border: 1px solid var(--hair); border-radius: var(--radius-sm); overflow: hidden; color: var(--text); background: var(--bg-elev); max-width: 520px; }
.article-card:hover { text-decoration: none; background: var(--surface-2); }
.article-card .cover { position: relative; aspect-ratio: 2 / 1; background: var(--surface-2); }
.article-card .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.article-card .cover .tag, .article-card .tag.solo { position: absolute; left: 10px; top: 10px; background: var(--accent); color: var(--accent-ink); border-radius: var(--pill); padding: 3px 10px; font-size: 12px; font-weight: 800; }
.article-card .tag.solo { position: static; display: inline-block; margin: 10px 12px 0; }
.article-card .card-body { padding: 10px 12px 12px; }
.article-card .card-title { font-weight: 700; font-size: 17px; }

.poll { margin-top: 10px; max-width: 440px; }
.poll-row { position: relative; margin: 5px 0; height: 30px; line-height: 30px; background: var(--surface-2); border-radius: 10px; overflow: hidden; font-size: 13px; }
.poll-bar { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: transparent; appearance: none; -webkit-appearance: none; }
.poll-bar::-webkit-meter-bar { background: transparent; border: 0; border-radius: 0; }
.poll-bar::-webkit-meter-optimum-value, .poll-bar::-webkit-meter-suboptimum-value, .poll-bar::-webkit-meter-even-less-good-value { background: var(--accent-soft); }
.poll-bar::-moz-meter-bar { background: var(--accent-soft); }
.poll-label { position: relative; padding-left: 10px; font-weight: 650; }
.poll-pct { position: absolute; right: 10px; top: 0; font-family: var(--font); font-size: 13px; }
.poll-info { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* ---------- profile ---------- */
.profile { border-bottom: 1px solid var(--hair); }
.banner { aspect-ratio: 3 / 1; background: linear-gradient(135deg, var(--surface-2), var(--surface-3)); overflow: hidden; }
.banner.hidden { display: none; }
.banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.banner-link { display: block; width: 100%; height: 100%; cursor: zoom-in; }
.profile-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 0 var(--pad); }
.big-avatar-link { display: block; margin-top: -44px; border-radius: 50%; cursor: zoom-in; flex: 0 0 auto; }
.big-avatar { width: 92px; height: 92px; border-radius: var(--avatar-radius, 50%); border: 4px solid var(--surface); background: var(--surface-3); object-fit: cover; display: block; box-shadow: var(--shadow); }
.banner.hidden + .profile-head .big-avatar-link { margin-top: 16px; }
.profile .who { padding: 8px var(--pad) 0; min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.profile .who .name { font-size: 20px; font-weight: 800; overflow-wrap: anywhere; letter-spacing: -.01em; }
.profile .who .handle { color: var(--muted); width: 100%; }
.profile-head .big-avatar-link, .profile-head > .big-avatar { margin-right: auto; }
.x-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 22px; padding: 7px 14px; font-size: 13px; font-weight: 700; color: var(--text); background: var(--surface-2); border: 1px solid var(--hair); border-radius: var(--pill); flex: 0 0 auto; }
.about-link { margin-top: 22px; }
.x-link:hover { text-decoration: none; background: var(--surface-3); }
.x-link svg { width: 13px; height: 13px; fill: currentColor; stroke: none; }
.bio { padding: 8px var(--pad) 0; font-size: 15px; white-space: pre-wrap; overflow-wrap: anywhere; }
.meta { padding: 8px var(--pad) 0; color: var(--muted); font-size: 13px; display: flex; gap: 14px; flex-wrap: wrap; }
.meta a { color: var(--accent-text); }
.statbar { display: flex; gap: 8px; padding: 12px var(--pad) 4px; font-size: 13px; color: var(--muted); overflow-x: auto; scrollbar-width: none; }
.statbar::-webkit-scrollbar { display: none; }
.statbar a, .statbar span { display: inline-flex; align-items: baseline; gap: 5px; padding: 6px 12px; border-radius: var(--pill); background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.statbar a:hover { text-decoration: none; background: var(--surface-3); color: var(--text); }
.statbar b { color: var(--text); font-size: 15px; font-weight: 700; }
.profile .tabs { padding: 8px var(--pad); border-top: 1px solid var(--hair); margin-top: 8px; }
:root[data-sticky-profile] .profile .tabs { position: sticky; top: var(--topbar); z-index: 5; background: var(--surface); }
/* A list under a sticky head never shrinks below a screen, so switching tabs, sort or view
   (even to the empty profile Search tab) keeps the page's scroll position instead of snapping up. */
#timeline, #reply-list { min-height: 100dvh; }
.tweet[data-open] { cursor: pointer; }
.profile-search { display: flex; gap: 8px; padding: 12px var(--pad); border-bottom: 1px solid var(--hair); }
.profile-search input { flex: 1; min-width: 0; height: 40px; padding: 0 14px; border: 1px solid var(--hair-strong); border-radius: var(--pill); background: var(--bg-elev); }
.about { list-style: none; margin: 0; padding: 8px var(--pad); }
.about li { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--hair); font-size: 15px; }
.about li span:first-child { color: var(--muted); }

/* ---------- lists / communities / spaces ---------- */
.list-row { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 12px; padding: 14px var(--pad); border-bottom: 1px solid var(--hair); color: var(--text); }
.list-row:hover { text-decoration: none; background: var(--surface-2); }
.list-row img, .list-row .list-thumb { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; background: var(--surface-3); }
.list-row .name { font-weight: 750; }
.list-row .desc { color: var(--text-2); font-size: 13px; }
.list-row .meta { padding: 2px 0 0; font-size: 13px; }
.hero-card { padding: 20px var(--pad); border-bottom: 1px solid var(--hair); }
.hero-card h2 { font-size: 20px; }
.hero-card p { margin: 6px 0 0; color: var(--text-2); }
.hero-card .meta { padding: 8px 0 0; }
.rules li { margin: 6px 0; }
.participants { list-style: none; margin: 0; padding: 0 var(--pad) 12px; display: grid; gap: 6px; }
.participants li { display: flex; align-items: center; gap: 10px; }
.role { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: var(--pill); background: var(--surface-2); color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; }
.article-page { padding: 8px var(--pad) 24px; }
.article-page h1 { font-size: 26px; line-height: 1.2; margin: 12px 0 8px; }
.article-page .byline { color: var(--muted); margin-bottom: 16px; }
.article-page .cover { border-radius: var(--radius-sm); overflow: hidden; margin: 0 0 16px; }
.article-page .cover img { width: 100%; display: block; }
.article-page .prose { font-size: 17px; line-height: 1.65; }
.article-page .prose p { margin: 0 0 1em; }
.article-page .prose h2, .article-page .prose h3 { margin: 1.4em 0 .5em; }
.article-page .prose pre { font: 13px/1.5 var(--font-mono); background: var(--surface-2); padding: 12px 14px; border-radius: 12px; overflow: auto; }
.article-page .prose blockquote { margin: 0 0 1em; padding-left: 14px; border-left: 3px solid var(--accent); color: var(--text-2); }
.player { padding: var(--pad); }
.player audio, .player video { width: 100%; border-radius: 12px; }

/* ---------- home ---------- */
.hero { padding: 36px var(--pad) 24px; border-bottom: 1px solid var(--hair); background: radial-gradient(900px 300px at 10% -40%, var(--accent-soft), transparent 60%); }
.hero h1 { font-size: 26px; line-height: 1.15; letter-spacing: -.02em; margin-bottom: 8px; }
.hero h1 em { font-style: normal; color: var(--accent-text); }
.hero p { margin: 0 0 6px; color: var(--text-2); font-size: 15px; max-width: 520px; }
.big-search { display: flex; gap: 8px; }
.big-search input { flex: 1; min-width: 0; font-size: 15px; height: 48px; padding: 0 18px; border: 1px solid var(--hair-strong); border-radius: var(--pill); background: var(--bg-elev); }
.big-search input:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.try { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; font-size: 13px; min-height: 30px; }

/* ---------- search filters ---------- */
.filters { border-bottom: 1px solid var(--hair); }
.filters summary { list-style: none; cursor: pointer; padding: 10px var(--pad); font-size: 13px; font-weight: 650; color: var(--text-2); display: flex; align-items: center; gap: 8px; }
.filters summary::-webkit-details-marker { display: none; }
.filters summary .count { background: var(--accent); color: var(--accent-ink); border-radius: var(--pill); padding: 0 8px; font-size: 12px; }
.filters form { padding: 0 var(--pad) 14px; display: grid; gap: 12px; }
.filter-group { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.filter-group .label { width: 100%; font-size: 13px; color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: .04em; }
.filter-group label.chip { cursor: pointer; }
.filter-group label.chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.filter-group label.chip:has(input:checked) { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.filter-group input[type="date"], .filter-group input[type="number"] { height: 34px; padding: 0 10px; border: 1px solid var(--hair-strong); border-radius: 10px; background: var(--bg-elev); color: var(--text); font-size: 13px; }
.filter-actions { display: flex; gap: 8px; }

/* ---------- settings ---------- */
.settings { padding: 8px 0 24px; }
.settings h2 { padding: 14px var(--pad) 6px; font-size: 20px; }
.settings .panel-sub { padding: 0 var(--pad); }
.settings h3 { padding: 18px var(--pad) 4px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-family: var(--font); font-weight: 700; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px var(--pad); border-bottom: 1px solid var(--hair); }
.setting .label { font-weight: 650; }
.setting .hint { display: block; color: var(--muted); font-size: 13px; font-weight: 500; margin-top: 2px; }
.setting select { height: 36px; padding: 0 12px; border: 1px solid var(--hair-strong); border-radius: 10px; background: var(--bg-elev); color: var(--text); }
.switch { position: relative; display: inline-block; width: 46px; height: 28px; flex: 0 0 46px; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch .knob { position: absolute; inset: 0; border-radius: var(--pill); background: var(--surface-3); transition: background .15s var(--ease); }
.switch .knob::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .35); transition: transform .15s var(--ease); }
.switch input:checked + .knob { background: var(--accent); }
.switch input:checked + .knob::after { transform: translateX(18px); }
.switch input:focus-visible + .knob { outline: 2px solid var(--accent); outline-offset: 2px; }
.settings .foot-actions { padding: 16px var(--pad) 0; display: flex; gap: 8px; }

/* ---------- misc ---------- */
.more { display: block; width: 100%; padding: 14px; border: 0; border-top: 1px solid var(--hair); background: var(--bg-elev); font: 700 13px var(--font); color: var(--text-2); min-height: var(--tap); }
.more:hover { color: var(--accent-text); }
.more:disabled { color: var(--muted); cursor: wait; }
.error { margin: 12px; padding: 16px 18px; background: color-mix(in srgb, var(--rose) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--rose) 35%, transparent); border-radius: var(--radius-sm); }
.error strong { display: block; font-size: 15px; margin-bottom: 4px; }
.error .hint { color: var(--text-2); }
.error .retry { margin-top: 12px; }
.technical { margin-top: 10px; font-size: 13px; color: var(--text-2); }
.technical summary { cursor: pointer; color: var(--muted); }
.attempts { margin: 6px 0 0; padding-left: 18px; font-size: 13px; }
#main > .muted { padding: 10px var(--pad); }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 90; background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: var(--pill); font-weight: 650; font-size: 13px; box-shadow: var(--shadow); }

/* ---------- modal sheet (followers, following, about) ---------- */
body.md-open { overflow: hidden; }
#modal { position: fixed; inset: 0; z-index: 95; display: flex; align-items: center; justify-content: center; padding: 24px; }
#modal[hidden] { display: none; }
.md-backdrop { position: absolute; inset: 0; background: var(--scrim); opacity: .8; }
.md-panel { position: relative; width: min(600px, 100%); max-height: min(80dvh, 760px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--hair-strong); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.md-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 12px 20px; border-bottom: 1px solid var(--hair); }
.md-title { font-size: 17px; }
.md-close { width: 36px; height: 36px; font-size: 15px; }
.md-body { overflow-y: auto; overscroll-behavior: contain; min-height: 120px; }
.md-body .tweet { padding-left: 20px; padding-right: 20px; }
.md-filter { padding: 10px 20px; border-bottom: 1px solid var(--hair); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.md-filter input { width: 100%; height: 38px; padding: 0 14px; border: 1px solid var(--hair-strong); border-radius: var(--pill); background: var(--bg-elev); color: inherit; font: inherit; }
.md-list .user-row[hidden], .md-nomatch[hidden] { display: none; }
.md-body .about { padding: 8px 20px 16px; }
@media (max-width: 760px) {
  #modal { padding: 0; align-items: flex-end; }
  .md-panel { width: 100%; max-height: 88dvh; border-radius: 22px 22px 0 0; border-bottom: 0; }
  .md-body { padding-bottom: env(safe-area-inset-bottom); }
}

/* ---------- lightbox ---------- */
#lightbox { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; }
#lightbox[hidden] { display: none; }
.lb-backdrop { position: absolute; inset: 0; background: var(--scrim); }
.lb-stage { position: relative; margin: 0; max-width: 100vw; max-height: 100vh; max-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 48px 8px 56px; }
.lb-image { max-width: calc(100vw - 16px); max-height: calc(100vh - 104px); max-height: calc(100dvh - 104px); object-fit: contain; border-radius: 12px; box-shadow: 0 4px 30px rgba(0, 0, 0, .6); background: #000; }
.lb-btn { position: absolute; z-index: 2; border: 0; background: rgba(255, 255, 255, .12); color: #fff; width: var(--tap); height: var(--tap); border-radius: 50%; font-size: 26px; line-height: 1; display: flex; align-items: center; justify-content: center; }
.lb-btn:hover { background: rgba(255, 255, 255, .25); }
.lb-close { top: calc(10px + env(safe-area-inset-top)); right: 10px; font-size: 20px; }
.lb-prev { left: 10px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 10px; top: 50%; transform: translateY(-50%); }
#lightbox.single .lb-prev, #lightbox.single .lb-next { display: none; }
.lb-bar { position: absolute; left: 0; right: 0; bottom: calc(12px + env(safe-area-inset-bottom)); color: #cfd6d2; font-size: 13px; text-align: center; padding: 0 60px; display: flex; flex-direction: column; gap: 2px; pointer-events: none; }
.lb-alt { color: #9aa49f; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-dl { top: calc(10px + env(safe-area-inset-top)); right: calc(var(--tap) + 20px); }
.lb-dl svg { width: 22px; height: 22px; stroke-width: 2; }
.lb-dl[hidden] { display: none; }
.lb-stage .vp { width: min(1100px, calc(100vw - 16px)); border-radius: 12px; box-shadow: 0 4px 30px rgba(0, 0, 0, .6); }
.lb-stage .vp video { max-height: calc(100dvh - 104px); }

/* ---- video player (timeline + viewer) ---- */
.vp { position: relative; width: 100%; background: var(--surface); color: #fff; overflow: hidden; outline: 0; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.vp video { display: block; width: 100%; height: 100%; max-height: 640px; object-fit: contain; background: inherit; }
/* The letterbox around a clip matches the card it sits in; only the viewer and fullscreen stay black. */
.quote .vp { background: var(--bg-elev); }
.lb-stage .vp, .vp.fullscreen, .vp:fullscreen { background: #000; }
.vp.inline video { max-height: 360px; }
.media-item.vp-holder { cursor: default; min-height: 0; }
.media-item .vp video { max-height: 360px; }
.media.count-2 .vp video, .media.count-3 .vp video, .media.count-4 .vp video { max-height: 380px; }
/* A sized holder (set when a clip starts in place) owns the box; the player fills it, letterboxing
   the picture inside instead of resizing the tweet. */
.media-item.vp-holder[style] .vp { position: absolute; inset: 0; height: 100%; }
.media-item.vp-holder[style] .vp video, .quote .media-item.vp-holder[style] .vp video { height: 100%; max-height: none; }
.vp.fullscreen, .vp:fullscreen { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; border-radius: 0; }
.vp.fullscreen video, .vp:fullscreen video { max-height: none; height: 100%; }
.vp-big { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 64px; height: 64px; border: 0; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; cursor: pointer; box-shadow: 0 6px 24px rgba(0, 0, 0, .45); transition: opacity .15s var(--ease), transform .15s var(--ease); }
.vp-big svg { width: 30px; height: 30px; }
.vp[data-state="playing"] .vp-big { opacity: 0; pointer-events: none; transform: translate(-50%, -50%) scale(.8); }
.vp-gradient { position: absolute; left: 0; right: 0; bottom: 0; height: 110px; background: linear-gradient(transparent, rgba(0, 0, 0, .78)); pointer-events: none; transition: opacity .2s var(--ease); }
.vp-bar { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 8px 4px; transition: opacity .2s var(--ease); }
.vp.idle[data-state="playing"] .vp-bar, .vp.idle[data-state="playing"] .vp-gradient { opacity: 0; pointer-events: none; }
.vp.idle[data-state="playing"] { cursor: none; }
.vp-seek { position: relative; height: 20px; display: flex; align-items: center; cursor: pointer; touch-action: none; padding: 0 4px; }
.vp-track { position: relative; width: 100%; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .28); overflow: hidden; transition: height .1s var(--ease); }
.vp-seek:hover .vp-track, .vp-seek.drag .vp-track { height: 6px; }
.vp-buffered, .vp-played { position: absolute; left: 0; top: 0; bottom: 0; width: 0; }
.vp-buffered { background: rgba(255, 255, 255, .35); }
.vp-played { background: var(--accent); }
.vp-knob { position: absolute; left: 0; top: 50%; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); transform: translate(-50%, -50%) scale(0); transition: transform .1s var(--ease); pointer-events: none; margin-left: 4px; }
.vp-seek:hover .vp-knob, .vp-seek.drag .vp-knob { transform: translate(-50%, -50%) scale(1); }
.vp-tip { position: absolute; bottom: 24px; transform: translateX(-50%); background: rgba(0, 0, 0, .85); color: #fff; font: 600 13px var(--font); padding: 3px 7px; border-radius: 6px; pointer-events: none; white-space: nowrap; }
.vp-tip[hidden] { display: none; }
.vp-row { display: flex; align-items: center; gap: 0; }
.vp-row button, .vp-dl { display: grid; place-items: center; width: 36px; height: 36px; border: 0; background: transparent; color: #fff; border-radius: 8px; cursor: pointer; flex: 0 0 auto; }
.vp-row button:hover, .vp-dl:hover { background: rgba(255, 255, 255, .16); }
.vp-row svg { width: 20px; height: 20px; stroke-width: 2; }
.vp-time { font: 600 13px var(--font); color: #fff; padding: 0 6px; white-space: nowrap; }
.vp-sep { padding: 0 4px; color: rgba(255, 255, 255, .6); }
.vp-spacer { flex: 1; }
.vp-vol { display: flex; align-items: center; }
.vp-volume { width: 0; opacity: 0; margin: 0; transition: width .15s var(--ease), opacity .15s var(--ease); accent-color: var(--accent); cursor: pointer; }
.vp-vol:hover .vp-volume, .vp-vol:focus-within .vp-volume { width: 72px; opacity: 1; margin-right: 8px; }
.vp-menu-wrap { position: relative; }
.vp-menu { position: absolute; right: 0; bottom: 42px; min-width: 210px; background: rgba(18, 18, 22, .96); border: 1px solid rgba(255, 255, 255, .14); border-radius: 12px; padding: 8px; box-shadow: var(--shadow); color: #fff; z-index: 2; }
.vp-menu[hidden] { display: none; }
.vp-menu h5 { margin: 2px 6px 6px; font: 700 12px var(--font); letter-spacing: .06em; text-transform: uppercase; color: rgba(255, 255, 255, .6); }
.vp-menu .opts { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.vp-menu .opts:last-child { margin-bottom: 0; }
.vp-menu .opts button { width: auto; height: 30px; padding: 0 10px; font: 600 13px var(--font); border-radius: var(--pill); background: rgba(255, 255, 255, .08); }
.vp-menu .opts button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.vp-spinner { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); pointer-events: none; }
.vp-spinner[hidden] { display: none; }
.vp-spinner span { display: block; width: 44px; height: 44px; border: 3px solid rgba(255, 255, 255, .3); border-top-color: #fff; border-radius: 50%; animation: vp-spin .8s linear infinite; }
@keyframes vp-spin { to { transform: rotate(360deg); } }
.vp-tap { position: absolute; top: 12px; left: 12px; display: inline-flex; align-items: center; gap: 6px; background: rgba(0, 0, 0, .75); color: #fff; border: 1px solid rgba(255, 255, 255, .35); padding: 8px 12px; border-radius: var(--pill); font: 600 13px var(--font); cursor: pointer; }
.vp-tap[hidden] { display: none; }
.vp-tap svg { width: 16px; height: 16px; }
.vp-error { position: absolute; left: 12px; right: 12px; bottom: 64px; background: rgba(0, 0, 0, .82); color: #fff; padding: 8px 12px; border-radius: 10px; font-size: 13px; }
.vp-error a { color: var(--accent); }
.lb-link { position: absolute; top: calc(14px + env(safe-area-inset-top)); left: 14px; z-index: 2; color: #fff; background: rgba(255, 255, 255, .12); padding: 8px 14px; border-radius: var(--pill); font-size: 13px; font-weight: 650; }
.lb-link:hover { background: rgba(255, 255, 255, .25); text-decoration: none; }

/* ---------- verification mirror (compact, in-site) ---------- */
.unlock { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; color: var(--text-2); }
.locked { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.btn.mirror { background: var(--amber); color: #2a1a02; border-color: transparent; }
#mirror { position: fixed; inset: auto 16px 16px auto; width: min(420px, calc(100vw - 24px)); z-index: 110; display: block; }
#mirror[hidden] { display: none; }
.mr-backdrop { display: none; }
.mr-panel { position: relative; width: 100%; max-height: min(680px, calc(100dvh - 24px)); background: var(--surface); border: 1px solid var(--hair-strong); border-radius: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; }
.mr-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--hair); background: var(--bg-elev); }
.mr-head > div { display: flex; gap: 6px; align-items: center; }
.mr-brand { font: 800 17px/1 var(--font); letter-spacing: -.02em; }
.mr-close, .mr-expand { position: static; width: 32px; height: 32px; min-height: 32px; padding: 0; font-size: 15px; color: var(--text); background: var(--surface-2); border: 1px solid var(--hair); border-radius: 50%; }
.mr-hint { margin: 0; padding: 8px 14px; font-size: 13px; color: var(--text-2); background: var(--surface-2); border-bottom: 1px solid var(--hair); }
.mr-stage { position: relative; background: #fff; min-height: 100px; max-height: 55dvh; overflow: auto; }
.mr-stage img { display: block; width: 100%; max-width: 100%; height: auto; cursor: pointer; user-select: none; -webkit-user-drag: none; }
.mr-stage img:not([src]) { height: 0; }
.mr-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #4c6575; font-style: italic; }
.mr-loading[hidden] { display: none; }
#mirror .mr-retry[hidden], #mirror .mr-stage[hidden] { display: none; }
.mr-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 14px; border-top: 1px solid var(--hair); font-size: 13px; flex-wrap: wrap; }
.mr-status.good { color: var(--accent-text); font-weight: 700; }
.mr-status.bad { color: var(--rose); }
.mr-keys { display: flex; gap: 6px; }
.mr-keys .btn { padding: 4px 10px; min-height: 30px; font-size: 13px; }
#mirror.mr-expanded { width: min(820px, calc(100vw - 24px)); }
#mirror.mr-expanded .mr-stage { max-height: 72dvh; }

/* ---------- responsive ---------- */
@media (max-width: 1240px) { :root { --side: 300px; } .content { padding: 0 16px; } }
@media (max-width: 1040px) {
  .page { grid-template-columns: minmax(0, 1fr); }
  /* Stacked under the main column the sidebar is plain flow content: no own scroll box, or a
     touch swipe inside it would scroll that box and (with scroll chaining off) never the page. */
  .column-side { position: static; max-height: none; overflow: visible; overscroll-behavior: auto; }
}
@media (max-width: 760px) {
  :root { --topbar: 56px; --pad: 14px; }
  .mobile-only { display: initial; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .content { padding: 0 12px; }
  .topbar { gap: 10px; }
  .topbar .logo-mobile { display: inline-flex; }
  .topbar .logo-mobile .logo-text { display: none; }
  .topbar .search { height: 40px; padding-left: 12px; }
  .topbar .search .mode, .search-key, .topbar .search button { display: none; }
  .vp-row button, .vp-dl { width: 40px; height: 40px; }
  .vp-volume, .vp-row [data-act="pip"] { display: none; }
  .vp-time { font-size: 13px; padding: 0 4px; }
  .topbar .search input { font-size: 15px; }
  .page { padding: 10px 0 calc(var(--tabbar) + 24px + env(safe-area-inset-bottom)); gap: 14px; }
  .column-main { border-radius: 18px; }
  .foot { padding-bottom: calc(var(--tabbar) + 16px + env(safe-area-inset-bottom)); text-align: center; }
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
    height: calc(var(--tabbar) + env(safe-area-inset-bottom)); padding: 0 8px env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--hair);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: var(--tabbar); color: var(--muted); font-size: 12px; font-weight: 650; }
  .tabbar a svg { width: 24px; height: 24px; }
  .tabbar a:hover { text-decoration: none; }
  .tabbar a.active { color: var(--text); }
  .tabbar a.active svg { color: var(--accent); }
  .tabbar .tab-center { height: var(--tabbar); justify-content: center; }
  .tabbar .tab-center svg { width: 26px; height: 26px; padding: 13px; box-sizing: content-box; background: var(--accent); color: var(--accent-ink); border-radius: 50%; box-shadow: 0 8px 20px var(--accent-soft); transform: translateY(-10px); }
  .tabbar .tab-center.active svg { color: var(--accent-ink); }
  .hero { padding: 26px var(--pad) 18px; }
  .hero h1 { font-size: 26px; }
  .big-search { flex-direction: column; }
  .big-search .btn { width: 100%; }
  .tweet { gap: 10px; }
  .tweet .text { font-size: 15px; }
  .media, .card, .article-card { max-width: none; }
  .media-item img, .media-item video { max-height: 320px; }
  .big-avatar-link { margin-top: -36px; }
  .big-avatar { width: 76px; height: 76px; }
  .media-gallery, .media-gallery.small { columns: 2; }
  :root[data-gallery-size="large"] .media-gallery { columns: 1; }
  .panel-head h2 { font-size: 20px; }
  .setting { padding: 12px var(--pad); }
  #mirror { right: 12px; bottom: calc(var(--tabbar) + 12px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(var(--tabbar) + 16px + env(safe-area-inset-bottom)); }
}
@media (max-width: 400px) {
  .hero h1 { font-size: 26px; }
  .stats { gap: 12px; }
  .media-grid { gap: 2px; padding: 2px; }
}
@media (hover: none) {
  .tweet:hover { background: inherit; }
  .media-grid .goto { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .loading::after, .skeleton .sk { animation: none; }
  * { transition: none !important; }
}
