:root {
  --bg: #f0f2f5;
  --card: #ffffff;
  --text: #1c1e21;
  --muted: #65676b;
  --line: #dddfe2;
  --soft: #e9ebee;
  --accent: #fe7600;
  --accent-strong: #e06400;
  --on-accent: #ffffff;
  --bar: #10131c;
  --danger: #c62828;
  --radius: 10px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0d13;
    --card: #181b25;
    --text: #e6e8ec;
    --muted: #9aa0ab;
    --line: #2a2e3a;
    --soft: #232734;
    --danger: #ef6b6b;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--accent-strong); }
[hidden] { display: none !important; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 5; background: var(--bar); border-bottom: 3px solid var(--accent); }
.topbar-inner { max-width: 712px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.brand img { height: 26px; width: auto; display: block; }
.brand span { color: var(--accent); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: 13px; padding-top: 2px; }
.topbar-link { color: #c9ccd3; text-decoration: none; font-size: 14px; white-space: nowrap; }
.topbar-link:hover { color: #fff; }

/* Wall */
.wall { max-width: 712px; margin: 0 auto; padding: 16px; }
.back { display: inline-block; margin-bottom: 12px; font-weight: 600; text-decoration: none; }
.status { text-align: center; color: var(--muted); margin: 24px 0; }
.status:empty { display: none; }
.more { display: block; width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--text); font-weight: 600; }
.more:hover { background: var(--soft); }

.post { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px; overflow: hidden; }
.post-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px 0; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--bar); flex: none; }
.avatar.initials { display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 15px; }
.post-who { display: block; font-weight: 700; line-height: 1.2; color: var(--text); text-decoration: none; }
a.post-who:hover { text-decoration: underline; }
.post-time { color: var(--muted); font-size: 13px; text-decoration: none; }
.post-time:hover { text-decoration: underline; }
.post-head .spacer { flex: 1; }
.share { border: 0; background: none; color: var(--muted); font-size: 13px; padding: 6px 8px; border-radius: 6px; }
.share:hover { background: var(--soft); color: var(--text); }
.post-title { margin: 12px 16px 0; font-size: 19px; line-height: 1.3; overflow-wrap: anywhere; }
.post-text { margin: 8px 16px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.post-text.clamped { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 6; overflow: hidden; }
.see-more { margin: 2px 16px 0; padding: 0; border: 0; background: none; color: var(--muted); font-weight: 600; }
.see-more:hover { text-decoration: underline; }

.filter { display: flex; gap: 8px; overflow-x: auto; padding: 0 0 12px; scrollbar-width: none; }
.chip { flex: none; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--text); font-size: 14px; font-weight: 600; text-decoration: none; }
.chip:hover { background: var(--soft); }
.chip.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* Pictures */
.gallery { display: grid; gap: 3px; margin-top: 12px; grid-template-columns: repeat(6, 1fr); }
.gallery button { position: relative; padding: 0; border: 0; background: var(--soft); overflow: hidden; grid-column: span 3; aspect-ratio: 1; }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery.n1 button { grid-column: span 6; aspect-ratio: auto; max-height: 760px; }
.gallery.n1 img { height: auto; max-height: 760px; object-fit: contain; }
.gallery.n3 button:first-child { grid-column: span 6; aspect-ratio: 16 / 9; }
.gallery.n5 button:nth-child(n+3) { grid-column: span 2; }
.gallery .extra { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .55); color: #fff; font-size: 28px; font-weight: 600; }

/* Session links */
.post-links { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px 14px; }
.post-links:empty { padding: 0 0 14px; }
.link-btn { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 9px 16px; border-radius: 8px; background: var(--accent); color: var(--on-accent); font-weight: 700; text-decoration: none; overflow-wrap: anywhere; }
.link-btn:hover { background: var(--accent-strong); }
.link-btn::after { content: "→"; }

/* Lightbox */
.lightbox { border: 0; padding: 0; margin: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; background: rgba(5, 6, 10, .96); }
.lightbox[open] { display: grid; place-items: center; }
.lightbox::backdrop { background: #05060a; }
.lightbox img { max-width: 100vw; max-height: 100dvh; object-fit: contain; display: block; }
.lb-btn { position: fixed; z-index: 1; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; font-size: 24px; line-height: 1; }
.lb-btn:hover { background: rgba(255, 255, 255, .28); }
.lb-close { top: 12px; right: 12px; font-size: 18px; }
.lb-prev { left: 12px; top: calc(50% - 22px); }
.lb-next { right: 12px; top: calc(50% - 22px); }
.lb-count { position: fixed; bottom: 14px; left: 0; right: 0; text-align: center; color: #c9ccd3; font-size: 14px; }

@media (max-width: 560px) {
  .wall { padding: 12px 0; }
  .post { border-radius: 0; border-left: 0; border-right: 0; }
  .back { margin-left: 16px; }
  .filter { padding: 0 16px 12px; }
  .more { width: calc(100% - 32px); margin: 0 16px; }
  .brand img { height: 22px; }
}
