:root {
  --bg: #05070c;
  --panel: #0c0f14;
  --line: rgba(255,255,255,.10);
  --text: #e8eae3;
  --muted: #8d9088;
  --accent: #0b63f3;
  --accent-l: #5c97ff;
  --mono: "DM Mono", ui-monospace, monospace;
  --sans: Inter, "Segoe UI", system-ui, sans-serif;
  --display: "Space Grotesk", Inter, sans-serif;
  --brand: "Syne", "Space Grotesk", sans-serif;
  --col: 600px;
  --rail: 240px;
  --tap: 44px;
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent-l);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 var(--sans); }
body { min-height: 100vh; min-height: 100dvh; }
a { color: var(--accent-l); }
a:focus-visible, button:focus-visible { outline: none; box-shadow: var(--focus); }

.shell {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, var(--col)) var(--rail);
  justify-content: center;
  gap: 0;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 1280px;
  margin: 0 auto;
}
.rail {
  padding: 1rem .85rem 2rem;
  border-right: 1px solid var(--line);
  position: sticky; top: 0; align-self: start;
  height: 100vh; height: 100dvh;
  overflow: auto;
}
.rail.right { border-right: 0; border-left: 1px solid var(--line); }
.brand {
  display: flex; align-items: center; gap: .55rem;
  text-decoration: none; color: var(--text);
  font-family: var(--brand); font-weight: 700; font-size: 1.1rem;
  min-height: var(--tap); margin-bottom: 1rem;
}
.brand img { border-radius: 8px; border: 1px solid rgba(255,255,255,.15); }
.rail-nav { display: flex; flex-direction: column; gap: .25rem; }
.rail-nav a {
  display: flex; align-items: center; gap: .65rem;
  text-decoration: none; color: var(--text);
  font-weight: 600; font-size: 1.05rem;
  padding: .65rem .75rem; border-radius: 999px; min-height: var(--tap);
}
.rail-nav a:hover { background: rgba(255,255,255,.04); }
.rail-nav a.on { color: var(--accent-l); background: rgba(11,99,243,.12); }
.rail-nav .ico { width: 1.25rem; text-align: center; opacity: .85; }
.rail-note { color: var(--muted); font-size: .75rem; margin-top: 1.25rem; line-height: 1.4; }
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: .85rem 1rem; margin-bottom: .85rem;
}
.card h2 { margin: 0 0 .65rem; font-family: var(--display); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: #c5d2ea; }
.card .muted { color: var(--muted); font-size: .82rem; margin: 0; }
#trending { list-style: none; margin: 0; padding: 0; }
#trending li { margin: 0 0 .45rem; }
#trending button, #trending a {
  display: flex; justify-content: space-between; gap: .5rem; width: 100%;
  background: transparent; border: 0; color: var(--text); cursor: pointer;
  font: inherit; text-align: left; padding: .35rem 0; text-decoration: none;
}
#trending .n { color: var(--muted); font-family: var(--mono); font-size: .75rem; }

.timeline {
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  min-width: 0;
  background: #07090e;
}
.sticky-top {
  position: sticky; top: 0; z-index: 5;
  background: rgba(7,9,14,.92);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.top-row {
  display: flex; align-items: center; gap: .65rem;
  padding: .65rem 1rem;
  padding-top: max(.65rem, env(safe-area-inset-top));
}
.top-row h1 { margin: 0; font-family: var(--display); font-size: 1.15rem; flex: 1; }
.back {
  color: var(--accent-l); text-decoration: none; font-weight: 600; font-size: .85rem;
  min-height: var(--tap); display: inline-flex; align-items: center;
}
.live-pill {
  font-family: var(--mono); font-size: .68rem; color: var(--accent-l);
  border: 1px solid var(--accent); background: rgba(11,99,243,.16);
  border-radius: 999px; padding: .28rem .55rem; white-space: nowrap;
}
.tabs {
  display: flex; gap: .15rem; padding: 0 .5rem;
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex-shrink: 0; border: 0; background: transparent; color: var(--muted);
  font: 600 .85rem/1 var(--sans); padding: .85rem .75rem; cursor: pointer;
  border-bottom: 2px solid transparent; min-height: var(--tap);
}
.tab.on { color: var(--text); border-bottom-color: var(--accent); }
.new-posts { text-align: center; padding: .5rem; border-bottom: 1px solid var(--line); }
.new-posts button {
  border: 0; border-radius: 999px; cursor: pointer;
  background: rgba(11,99,243,.2); color: var(--accent-l);
  font: 600 .8rem var(--sans); padding: .45rem .9rem; min-height: 36px;
}

.feed { list-style: none; margin: 0; padding: 0; }
.feed > li {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: .65rem;
  padding: .9rem 1rem;
  border-bottom: 1px solid var(--line);
}
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: #151a24; border: 1px solid var(--line);
  object-fit: contain; padding: 6px;
}
.meta-line {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .45rem;
  font-size: .9rem; margin-bottom: .2rem;
}
.meta-line .name { font-weight: 700; color: var(--text); }
.meta-line .handle, .meta-line .time { color: var(--muted); font-size: .82rem; }
.meta-line a.post-link { text-decoration: none; color: var(--muted); }
.meta-line a.post-link:hover { color: var(--accent-l); text-decoration: underline; }
.headline, a.headline.preview {
  display: block; font-size: 1.02rem; font-weight: 650; margin: .15rem 0 .35rem;
  text-wrap: balance; color: var(--text); text-decoration: none; border: 0; background: transparent;
}
a.headline.preview:hover { color: var(--accent-l); }
.summary { color: #c5cbc0; font-size: .92rem; margin: 0 0 .55rem; text-wrap: pretty; line-height: 1.45; cursor: pointer; }
.preview-card {
  display: block; text-decoration: none; color: inherit;
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  background: rgba(255,255,255,.02); margin-bottom: .55rem;
}
.preview-card img { display: block; width: 100%; max-height: 200px; object-fit: cover; background: #0a0d14; }
.foot-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: .4rem;
  margin-top: .15rem;
}
.chip, .badge, .clicks-badge, .view-post-btn {
  font-family: var(--mono); font-size: .62rem; padding: .22rem .45rem;
  border-radius: 999px; border: 1px solid var(--line); text-transform: uppercase;
  letter-spacing: .04em; color: var(--muted); text-decoration: none;
}
.clicks-badge {
  color: #9dc5ff; border-color: rgba(11,99,243,.35); background: rgba(11,99,243,.08);
  text-transform: none;
}
.view-post-btn {
  margin-left: auto; color: var(--text); border-color: var(--line); background: rgba(255,255,255,.03);
}
.view-post-btn:hover { border-color: var(--accent-l); color: var(--accent-l); background: rgba(11,99,243,.12); }
.badge.On\ map, .badge[data-b="On map"] { color: #9dffb8; border-color: #2f8a4e; background: #0d2a18; }
.badge.Unverified { color: #ffe29a; border-color: #8a6a20; background: #2a210d; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
  background: transparent; border: 0; color: var(--muted);
  cursor: pointer; min-width: 34px; min-height: 34px; border-radius: 999px; font-size: .95rem;
}
.icon-btn:hover { background: rgba(11,99,243,.12); color: var(--accent-l); }
.single-post { padding: 0; }
.single-card {
  padding: 1.25rem 1.15rem 1.35rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.01);
}
.single-head {
  display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: .7rem; align-items: center;
  margin-bottom: .75rem;
}
.single-time { font-family: var(--mono); font-size: .74rem; color: var(--muted); margin-top: .15rem; }
.single-headline { font-size: 1.3rem; font-weight: 700; line-height: 1.32; margin: 0 0 .65rem; text-wrap: balance; }
.single-headline a { color: var(--text); text-decoration: none; }
.single-headline a:hover { color: var(--accent-l); }
.single-summary { color: #d8ddd3; font-size: 1rem; line-height: 1.58; margin: 0 0 .95rem; text-wrap: pretty; }
.single-meta { margin-bottom: .95rem; }
.single-actions { display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; }
.btn-primary, .btn-secondary {
  display: inline-flex; align-items: center; justify-content: center;
  font: 600 .84rem var(--sans); padding: .55rem .95rem; border-radius: 999px;
  text-decoration: none; cursor: pointer; min-height: 38px; border: 1px solid var(--line);
}
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-secondary { background: rgba(255,255,255,.04); color: var(--text); }
.btn-secondary:hover { border-color: var(--accent-l); color: var(--accent-l); }
.related-block { border-top: 1px solid var(--line); }
.related-title {
  margin: 0; padding: .75rem 1rem .5rem; font-family: var(--mono);
  font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
}
.empty { color: var(--muted); text-align: center; padding: 2rem 1rem; }
.bottom-tabs { display: none; }

@media (max-width: 1100px) {
  .shell { grid-template-columns: 72px minmax(0, 1fr); }
  .rail.right { display: none; }
  .rail.left { padding: .75rem .35rem; }
  .brand span, .rail-note, .rail-nav a:not(.on) span:not(.ico), .rail-nav a.on > :not(.ico) {
    /* keep labels for a11y but compact: hide text nodes via narrower rail showing icons */
  }
  .brand span, .rail-note { display: none; }
  .rail-nav a { justify-content: center; padding: .65rem; font-size: 0; }
  .rail-nav a .ico { font-size: 1.1rem; }
}
@media (max-width: 720px) {
  .shell { grid-template-columns: 1fr; }
  .rail.left { display: none; }
  .timeline { border: 0; padding-bottom: calc(56px + env(safe-area-inset-bottom)); }
  .bottom-tabs {
    display: grid; grid-template-columns: 1fr 1fr;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
    background: rgba(7,9,14,.96); border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .bottom-tabs a {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: .15rem; text-decoration: none; color: var(--muted);
    font-size: .68rem; font-weight: 600; min-height: 52px;
  }
  .bottom-tabs a.on { color: var(--accent-l); }
  .bottom-tabs span { font-size: 1rem; }
}

.app-ver { display: none; }
@media (min-width: 1100px) {
  .app-ver {
    display: block;
    position: fixed;
    bottom: 12px;
    left: 18px;
    z-index: 5;
    margin: 0;
    opacity: 0.4;
    font: 11px/1 "DM Mono", ui-monospace, monospace;
    color: #8d9088;
  }
}

.updated-ago {
  margin: 0.15rem 1rem 0.35rem;
  font-size: 0.75rem;
  color: #8d9088;
  font-family: "DM Mono", ui-monospace, monospace;
}
