/* Desktop-only X-like shell. The existing mobile shell remains the source of truth below 960px. */
.desktop-sidebar { display:none; }
.stream-title-actions { display:flex; align-items:center; gap:4px; }
.photos-inline { display:none; }
.desktop-compose-entry { display:none; }

@media (min-width:960px) {
  body { background:var(--soft); }
  .stream-shell { grid-template-columns:minmax(184px,220px) minmax(0,650px) minmax(250px,300px); gap:24px; max-width:1260px; padding:0 24px; }
  .rail { min-height:100dvh; padding:24px 4px; align-content:start; grid-auto-rows:max-content; }
  .rail .wordmark { font-size:31px; }
  .rail .glyph { width:30px; height:30px; stroke-width:2.2; }
  .rail .nav-item { min-height:52px; font-size:17px; }
  .desktop-sidebar { position:sticky; top:0; display:grid; align-content:start; gap:18px; min-width:0; padding:20px 0; min-height:100dvh; }
  .desktop-search { display:grid; gap:2px; padding:8px 12px; border:1px solid var(--edge); border-radius:999px; background:var(--paper); }
  .desktop-search label { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
  .desktop-search input { min-height:42px; padding:8px 10px; border:0; outline:0; background:transparent; }
  #desktop-search-status { min-height:17px; padding:0 10px 4px; color:var(--muted); font-size:11px; }
  .desktop-topics { padding:14px 16px; border:1px solid var(--edge); border-radius:16px; background:var(--paper); }
  .desktop-topics h2 { margin:0 0 10px; font-size:20px; }
  #desktop-topic-list { display:grid; gap:2px; }
  .desktop-topic { display:flex; justify-content:space-between; align-items:center; width:100%; min-height:44px; padding:8px 4px; border:0; border-radius:8px; background:transparent; color:var(--ink); text-align:left; }
  .desktop-topic:hover:not(:disabled), .desktop-topic:focus-visible { background:var(--soft); }
  .desktop-topic small { color:var(--muted); }
  .desktop-viral-title { margin:16px 0 4px; color:var(--muted); font-size:12px; }
  .desktop-viral { display:grid; grid-template-columns:1fr; gap:2px; padding:9px 4px; border-top:1px solid var(--edge); color:var(--ink); text-decoration:none; }
  .desktop-viral .viral-action { color:var(--link); }
  .desktop-compose-entry { display:flex; align-items:center; gap:10px; padding:10px 16px 12px; border-top:1px solid var(--edge); color:var(--muted); font-size:12px; }
  .desktop-compose-button { min-height:40px; padding-inline:18px; border:0; border-radius:999px; background:var(--action-bg); color:var(--action-fg); font-weight:800; }
  .desktop-compose-button:hover { filter:brightness(.95); }
  .timeline { border-inline:1px solid var(--edge); }
  .desktop-sidebar { border-left:1px solid var(--edge); padding-left:20px; }
  .stream-head { border-inline:1px solid var(--edge); }
  .timeline { min-height:100dvh; display:flex; flex-direction:column; }
  .timeline > #refresh-row { order:4; }
  .timeline > #feed { order:5; }
  .timeline > #more-row { order:6; }
  .timeline > .stream-head { order:1; }
  .timeline > #browse-filters { order:2; }
  .timeline > #timeline-note { order:3; }
  .timeline > #pull-indicator { order:7; }
  .desktop-nav-dot { display:inline-grid; place-items:center; width:23px; font-size:25px; line-height:1; }
  html[data-scheme="dark"] body,
  html[data-scheme="dark"] .stream-shell,
  html[data-scheme="dark"] .timeline,
  html[data-scheme="dark"] .stream-head,
  html[data-scheme="dark"] .rail,
  html[data-scheme="dark"] .card { background:var(--paper); }
  html[data-scheme="dark"] .timeline,
  html[data-scheme="dark"] .stream-head,
  html[data-scheme="dark"] .desktop-sidebar { border-color:#2b2b2b; }
  html[data-scheme="dark"] .desktop-search, html[data-scheme="dark"] .desktop-topics { box-shadow:0 1px 0 #ffffff08; }
}

@media (max-width:959px) {
  .desktop-sidebar, .desktop-nav-dot { display:none; }
}

.mobile-account-button,.rail-identity { display:none; }
@media (min-width:960px) {
  html[data-scheme="dark"] { --paper:#000; --soft:#141619; --edge:#2f3336; --ink:#ecedef; --muted:#989fa5; --link:#66b9f0; --blue:#1d9bf0; }
  html[data-scheme="dark"] .stream-shell { background:#000; }
  .rail { align-self:start; height:100dvh; display:flex; flex-direction:column; align-items:flex-start; gap:3px; overflow:auto; }
  .rail .nav-item, .rail .wordmark { flex:none; }
  .rail .nav-item { padding-inline:14px; border-radius:999px; }
  .rail .rail-post { border:0; border-radius:999px; width:92%; padding-block:13px; margin-top:12px; background:var(--ink); color:var(--paper); }
  .rail .rail-identity { margin-top:auto; display:flex; align-items:center; gap:10px; text-decoration:none; color:inherit; font-weight:700; padding:8px; }
  .rail .admin-link { margin:8px 12px; }
  .desktop-compose-entry { order:2; border-bottom:1px solid var(--edge); border-top:0; min-height:98px; gap:12px; }
  .desktop-compose-entry .avatar,.rail-identity .avatar { width:40px; height:40px; }
  .desktop-compose-entry .compose-prompt { text-align:left; font-size:19px; font-weight:450; padding:6px; flex:1; min-width:0; background:none; color:var(--muted); border:0; }
  .desktop-compose-entry .desktop-compose-button { background:var(--ink); color:var(--paper); }
  .desktop-sidebar { border:0; }
  .desktop-search { padding:2px 8px; }
  #desktop-search-status:empty { display:none; }
  .desktop-viral small { color:var(--link); }
  html[data-surface="account"] .desktop-topics,html[data-surface="account"] .desktop-search { display:none; }
  #refresh-row button { border:0; background:none; color:var(--link); }
}
@media (max-width:700px) {
  .stream-title { display:flex; gap:5px; align-items:center; min-height:56px; padding-inline:10px; }
  .mobile-account-button { display:flex; align-items:center; justify-content:center; min-width:38px; min-height:44px; text-decoration:none; }
  .mobile-account-button .avatar { width:30px; height:30px; }
  .stream-title h1 { font-size:17px; }
  .stream-title-actions { margin-left:auto; gap:0; }
  .stream-title .glyph { width:18px; height:18px; }
  #filter-toggle { padding:4px; min-width:36px; min-height:44px; }
  .tabs { touch-action:pan-y pinch-zoom; }
  .card { padding-left:56px; }
}
@media (max-width:360px) {
  .stream-title h1 { font-size:14px; }
  .mobile-account-button { min-width:32px; }
  .stream-title { gap:2px; padding-inline:5px; }
}

/* Keep the page gutters and the embedded X cards on the same canvas. */
@media (min-width:960px) {
  html[data-surface="timeline"] .stream-shell { grid-template-columns:minmax(166px,212px) minmax(0,570px) minmax(224px,292px); justify-content:center; gap:16px; }
  html[data-scheme="dark"][data-surface="timeline"],
  html[data-scheme="dark"][data-surface="timeline"] :is(body,.stream-shell,.rail,.desktop-sidebar) { background:var(--paper); }
}
