:root {
  --bg: #8ccff5;
  --bg-image-url: none;
  --card-bg: #ffffff;
  --muted: #5f6a74;
  --link: #2c92c3;
  --mobile-width: 420px;
  --feed-left-gap: 10px;
  --post-font-size: 16px;
  --meta-font-size: 10.67px;
  --title-font-size: 14px;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: "Segoe UI", "Helvetica Neue", sans-serif;
  background: #fff;
  color: #111;
}
.app-shell {
  width: 100%;
  max-width: var(--mobile-width);
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: calc(64px + env(safe-area-inset-bottom));
  position: relative;
  isolation: isolate;
  background: transparent;
}
.app-shell::before {
  content: "";
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100vw, var(--mobile-width));
  height: 100vh;
  z-index: -1;
  background:
    var(--bg-image-url) top center / auto 100vh no-repeat,
    radial-gradient(circle at 10% 15%, #bde4fb 0, #bde4fb 20%, transparent 20%) 0 0/36px 36px,
    radial-gradient(circle at 80% 70%, #bde4fb 0, #bde4fb 18%, transparent 18%) 0 0/48px 48px,
    var(--bg);
}
.topbar { background: #f8f8f8; border-bottom: 1px solid #ddd; position: sticky; top: 0; z-index: 4; }
.topbar-row { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; padding: 10px 12px; }
.icon-btn {
  border: 0;
  background: transparent;
  font-size: 26px;
  cursor: default;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
}
.channel {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  margin: 0;
  padding-left: 6px;
  min-width: 0;
}
.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #d6d6d6;
  display: grid;
  place-items: center;
  font-weight: 600;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.channel-title { font-size: var(--title-font-size); font-weight: 600; }
.channel-sub { color: #777; font-size: 10px; }
.pinned { background: #fff; padding: 8px 14px 10px; }
.pinned-label { color: #2f8ebb; font-size: 13px; margin-bottom: 2px; }
.pinned-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: var(--post-font-size); }
.feed { padding: 10px 0 0 var(--feed-left-gap); }
.date-separator {
  width: max-content;
  margin: 0 auto 8px;
  background: #3e6988;
  color: #fff;
  border-radius: 16px;
  padding: 2px 14px;
  font-size: 12px;
}
.post-card {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 0 12px 10px;
  margin-bottom: 12px;
  margin-right: calc(25% + var(--feed-left-gap));
  box-shadow: 0 1px 0 rgba(0,0,0,.1);
  overflow: hidden;
}
.post-card-zero { margin-top: 2px; padding-top: 8px; }
.post-images {
  display: grid;
  gap: 2px;
  margin: 0 -12px 8px;
}
.post-image-btn {
  padding: 0;
  border: 0;
  margin: 0;
  background: #e3e3e3;
  width: 100%;
  display: block;
  position: relative;
}
.post-image {
  width: 100%;
  display: block;
  object-fit: cover;
  background: #e3e3e3;
  visibility: hidden;
}
.post-image.is-ready {
  visibility: visible;
}
.post-image-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 22px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: rgba(47, 142, 187, 0.95);
  animation: post-image-spin 0.8s linear infinite;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
}
.post-image-btn.is-loading .post-image-spinner {
  opacity: 1;
}
@keyframes post-image-spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}
.layout-1 { grid-template-columns: 1fr; }
.layout-1 .post-image { aspect-ratio: 10 / 11; }
.layout-2 { grid-template-columns: 1fr 1fr; }
.layout-2 .post-image { aspect-ratio: 2 / 3; }
.layout-3 { grid-template-columns: 1fr 1fr; }
.layout-3 .post-image-btn:nth-child(1) { grid-column: 1 / -1; }
.layout-3 .post-image-btn:nth-child(1) .post-image { aspect-ratio: 20 / 11; }
.layout-3 .post-image-btn:nth-child(n+2) .post-image { aspect-ratio: 1 / 1; }
.layout-4 { grid-template-columns: 1fr 1fr; }
.layout-4 .post-image { aspect-ratio: 2 / 3; }
.layout-5 { grid-template-columns: 1fr 1fr 1fr; }
.layout-5 .post-image-btn:nth-child(1),
.layout-5 .post-image-btn:nth-child(2) { grid-column: span 1; }
.layout-5 .post-image-btn:nth-child(1) .post-image,
.layout-5 .post-image-btn:nth-child(2) .post-image { aspect-ratio: 2 / 3; }
.layout-5 .post-image-btn:nth-child(3),
.layout-5 .post-image-btn:nth-child(4),
.layout-5 .post-image-btn:nth-child(5) { grid-column: span 1; }
.layout-5 .post-image-btn:nth-child(n+3) .post-image { aspect-ratio: 3 / 4; }
.layout-6 { grid-template-columns: repeat(3, 1fr); }
.layout-6 .post-image { aspect-ratio: 3 / 4; }
.layout-7 { grid-template-columns: repeat(6, 1fr); }
.layout-7 .post-image-btn:nth-child(1),
.layout-7 .post-image-btn:nth-child(2),
.layout-7 .post-image-btn:nth-child(3),
.layout-7 .post-image-btn:nth-child(4) { grid-column: span 3; }
.layout-7 .post-image-btn:nth-child(-n+4) .post-image { aspect-ratio: 1 / 1; }
.layout-7 .post-image-btn:nth-child(5),
.layout-7 .post-image-btn:nth-child(6),
.layout-7 .post-image-btn:nth-child(7) { grid-column: span 2; }
.layout-7 .post-image-btn:nth-child(n+5) .post-image { aspect-ratio: 1 / 1; }
.layout-8 { grid-template-columns: repeat(6, 1fr); }
.layout-8 .post-image-btn:nth-child(1),
.layout-8 .post-image-btn:nth-child(2) { grid-column: span 3; }
.layout-8 .post-image-btn:nth-child(-n+2) .post-image { aspect-ratio: 2 / 3; }
.layout-8 .post-image-btn:nth-child(n+3) { grid-column: span 2; }
.layout-8 .post-image-btn:nth-child(n+3) .post-image { aspect-ratio: 1 / 1; }
.post-body { font-size: var(--post-font-size); line-height: 1.22; }
.post-body a { color: var(--link); text-decoration: underline; }
.post-zero { margin: 0 0 10px; font-size: var(--post-font-size); line-height: 1.3; }
.post-meta {
  color: #778;
  font-size: var(--meta-font-size);
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}
.cta-wrap {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: min(100vw, var(--mobile-width));
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  background: #f8f8f8;
  border-top: 1px solid #d9d9d9;
  z-index: 5;
}
.cta-btn {
  width: 100%;
  display: block;
  margin: 0 auto;
  border: 0;
  background: #f8f8f8;
  color: #2f8ebb;
  text-decoration: none;
  text-align: center;
  font-size: var(--post-font-size);
  line-height: 1;
  padding: 8px 0;
  cursor: pointer;
}
.slider-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 100;
}
.slider-back {
  position: absolute;
  top: 14px;
  left: 10px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 36px;
  z-index: 2;
}
.slider-stage {
  height: 100%;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}
.slider-image {
  width: 100%;
  max-width: 100%;
  max-height: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  background: #000;
}
.slider-overlay.is-loading .slider-image {
  opacity: 0.2;
}
.slider-spinner {
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
  animation: slider-spin 0.9s linear infinite;
  z-index: 4;
}
.slider-overlay.is-loading .slider-spinner {
  opacity: 1;
}
@keyframes slider-spin {
  to { transform: rotate(360deg); }
}
.slider-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 24px;
  display: grid;
  place-items: center;
  z-index: 3;
}
.slider-nav-left { left: 10px; }
.slider-nav-right { right: 10px; }
.slider-nav:focus-visible,
.slider-back:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
@media (max-width: 420px) {
  .app-shell { max-width: 100%; }
  .app-shell::before { width: 100vw; }
  .cta-wrap { width: 100vw; }
  .post-card { margin-right: calc(25% + var(--feed-left-gap)); }
}
