:root {
  --bg: #ffffff;
  --ink: #1c2430;
  --muted: #5c6772;
  --red: #d0122d;
  --red-deep: #9d0e22;
  --silver: #8b939e;
  --line: rgba(28, 36, 48, 0.1);
  --glass: rgba(255, 255, 255, 0.72);
  --shadow: 0 10px 30px rgba(28, 36, 48, 0.06);
  --radius: 22px;
  --font: "Didact Gothic", "Segoe UI", sans-serif;
  --top: 98px;
}
body.has-dock { padding-top: var(--top); }

@font-face {
  font-family: "Didact Gothic";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/didact-gothic.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;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  min-height: 100vh;
  background-color: #c5ccd4;
  background-image: url("/img/bg-1.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}
body.bg-2 {
  background-image: url("/img/bg-2.jpg");
}
img { max-width: 100%; height: auto; }
a { color: var(--red-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--red); }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 12px; top: -40px; background: #fff; padding: 8px 12px; z-index: 20;
}
.skip:focus { top: 8px; }

.glass-filter {
  position: absolute;
  width: 0;
  height: 0;
}
.glass {
  position: relative;
  overflow: hidden;
  border: 0;
  border-radius: 24px;
  background: transparent;
  box-shadow: 0 6px 6px rgba(0, 0, 0, 0.2), 0 0 20px rgba(0, 0, 0, 0.1);
  transition-timing-function: cubic-bezier(0.175, 0.885, 0.32, 2.2);
}
.glass-distort,
.glass-tint,
.glass-shine {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}
.glass-distort {
  z-index: 0;
  overflow: hidden;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  filter: url(#glass-distortion);
  isolation: isolate;
}
.glass-tint {
  z-index: 10;
  background: rgba(198, 204, 212, 0.28);
}
.glass-shine {
  z-index: 20;
  overflow: hidden;
  box-shadow: inset 2px 2px 1px 0 rgba(255, 255, 255, 0.5), inset -1px -1px 1px 1px rgba(255, 255, 255, 0.5);
}
.glass > :not(.glass-distort):not(.glass-tint):not(.glass-shine) {
  position: relative;
  z-index: 30;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass-tint { background: rgba(198, 204, 212, 0.72); }
}

.topbar {
  position: fixed; top: 10px; left: 10px; right: 10px; z-index: 50;
  display: flex; align-items: center; gap: 16px;
  margin: 0; padding: 8px 16px;
  width: auto;
  border-radius: 24px;
}
.topbar > .glass-tint,
.side > .glass-tint,
.tabbar > .glass-tint {
  background: rgba(248, 250, 252, 0.84);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}
.topbar > .glass-distort,
.side > .glass-distort,
.tabbar > .glass-distort {
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  filter: none;
}
.brand { display: flex; align-items: center; text-decoration: none; }
.brand img { height: 58px; width: auto; aspect-ratio: 557 / 217; display: block; background: transparent; }
.search { display: flex; flex: 1; gap: 8px; min-width: 0; }
.search input, .field input, .field textarea, .field select {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
  border-radius: 14px;
  padding: 11px 12px;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.8);
}
.search input { min-width: 0; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.icon-link {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 12px; border-radius: 14px;
  text-decoration: none; color: var(--ink); position: relative;
}
.dot-count {
  position: absolute; top: 4px; right: 2px;
  background: var(--red); color: #fff; border-radius: 99px;
  font-size: 11px; min-width: 16px; text-align: center; padding: 0 4px;
}

.layout.solo { grid-template-columns: minmax(0, 640px); justify-content: center; width: min(680px, calc(100% - 20px)); margin: 18px auto 40px; }
.layout {
  width: 100%;
  margin: 0;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 300px;
  gap: 0;
  align-items: start;
}
.side {
  position: sticky;
  top: var(--top);
  left: 0;
  height: calc(100vh - var(--top) - 16px);
  max-height: calc(100vh - var(--top) - 16px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 14px 14px 24px;
  margin: 10px 0 10px 10px;
  border-radius: 24px;
  align-self: start;
}
.side::-webkit-scrollbar { display: none; width: 0; height: 0; }
.rail {
  position: sticky;
  top: var(--top);
  height: auto;
  overflow: visible;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-self: start;
  padding: 12px 12px 24px;
}
.rail .glass { border-radius: 24px; width: 100%; }
.rail .ad-link { grid-template-columns: 52px minmax(0, 1fr); padding-right: 42px; }
.rail .ad-logo { width: 52px; height: 52px; object-fit: contain; }
.ad-mark { z-index: 40; }
.rail-panel { padding: 14px; }
.side nav, .rail nav { display: flex; flex-direction: column; gap: 4px; }
.side a, .tabbar a, .rail a.quiet {
  display: flex; align-items: center; gap: 8px;
  min-height: 42px; padding: 6px 10px; border-radius: 12px;
  color: var(--ink); text-decoration: none;
}
.side a.is-on, .side a:hover, .tabbar a.is-on { background: rgba(208, 18, 45, 0.08); }
.kicker {
  margin: 14px 10px 6px; color: var(--muted); font-size: 12px;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.space-link { font-weight: 600; }
.space-link span { color: var(--silver); font-weight: 500; }

.feed { min-width: 0; display: flex; flex-direction: column; gap: 14px; padding: 16px 20px 40px; }
.hero { padding: 22px 22px 18px; }
.hero h1 { margin: 0 0 6px; font-size: 1.7rem; letter-spacing: -0.03em; }
.lede { margin: 0; color: var(--muted); max-width: 62ch; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; color: var(--muted); font-size: 0.92rem; }
.crumbs a { color: var(--muted); }

.card { padding: 16px 16px 12px; }
.ad-card { padding: 14px 14px 14px 16px; }
.glass.ad-card > .ad-mark:not(.glass-shine) {
  position: absolute;
  top: 8px;
  right: 8px;
  left: auto;
  z-index: 40;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 6px;
  line-height: 1.5;
}
.ad-link {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding-right: 42px;
  color: var(--ink);
  text-decoration: none;
}
.ad-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.95);
}
.ad-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ad-copy strong { font-size: 1.05rem; letter-spacing: -0.02em; line-height: 1.25; }
.ad-kicker {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.ad-desc { color: var(--ink); font-size: 0.92rem; }
.ad-link:hover strong { color: var(--red-deep); }
.card h2, .card h3 { margin: 8px 0; font-size: 1.15rem; letter-spacing: -0.02em; line-height: 1.3; }
.card h2 a, .card h3 a { color: var(--ink); text-decoration: none; }
.card h2 a:hover, .card h3 a:hover { color: var(--red-deep); }
.card-top, .card-actions, .row, .badges { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.card-top { color: var(--muted); font-size: 0.92rem; }
.excerpt, .prose { overflow-wrap: anywhere; }
.excerpt { margin: 0 0 8px; }
.card-actions { margin-top: 8px; }
.card-actions form { margin: 0; }
.meta-line { color: var(--muted); font-size: 0.92rem; }

.chip, .ai-badge, .prem-badge, .creator-badge {
  display: inline-flex; align-items: center; min-height: 26px;
  padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 700;
  text-decoration: none; letter-spacing: 0.01em;
}
.sort-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.sort-row .chip {
  min-height: 36px; padding: 0 12px; color: var(--ink);
  background: rgba(255, 255, 255, 0.62); border: 1px solid var(--line);
}
.sort-row .chip.is-on { background: rgba(208, 18, 45, 0.12); color: var(--red-deep); border-color: rgba(208, 18, 45, 0.28); }
.clout {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.ai-badge { background: rgba(139, 147, 158, 0.16); color: #243040; border: 1px solid rgba(139, 147, 158, 0.45); }
.prem-badge { background: rgba(208, 18, 45, 0.1); color: var(--red-deep); border: 1px solid rgba(208, 18, 45, 0.28); }
.creator-badge { background: rgba(255,255,255,0.8); border: 1px solid rgba(28,36,48,0.16); color: var(--ink); }

.btn, button.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 14px; border-radius: 14px;
  border: 1px solid transparent; background: var(--red); color: #fff;
  text-decoration: none; cursor: pointer; font-weight: 650;
}
.btn:hover { background: var(--red-deep); color: #fff; }
.btn.ghost, button.ghost {
  background: rgba(255,255,255,0.7); color: var(--ink); border-color: var(--line);
}
.btn.ghost:hover { color: var(--ink); background: #fff; }
.vote {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 12px;
  background: transparent; cursor: pointer; text-decoration: none;
}
.vote .ico, .save-mark .ico { width: 22px; height: 22px; display: block; fill: currentColor; }
.vote.up, .vote.up:hover { color: #d0122d; }
.vote.down, .vote.down:hover { color: #3a424c; }
.vote.up.is-on { background: rgba(208, 18, 45, 0.12); }
.vote.down.is-on { background: rgba(58, 66, 76, 0.12); }
.save-mark {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 12px;
  background: transparent; color: #3a424c; cursor: pointer; text-decoration: none;
}
.save-mark:hover { color: #3a424c; }
.save-mark.is-on, .save-mark.is-on:hover { color: #d0122d; background: rgba(208, 18, 45, 0.12); }
.save-mark::after {
  content: "Save";
  position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%);
  background: #1c2430; color: #fff; font-size: 12px; font-weight: 700;
  padding: 4px 8px; border-radius: 8px; white-space: nowrap;
  opacity: 0; pointer-events: none;
}
.save-mark:hover::after, .save-mark:focus-visible::after { opacity: 1; }
.score { font-variant-numeric: tabular-nums; color: var(--muted); min-width: 1.5rem; text-align: center; }

.field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 12px; }
.field span { font-size: 0.86rem; font-weight: 700; }
.check { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 10px; }
.check input { margin-top: 4px; width: 18px; height: 18px; }
.hp { position: absolute; left: -9999px; }

.flash { padding: 12px 14px; }
.flash.ok { border-color: rgba(22, 120, 70, 0.25); }
.flash.bad { border-color: rgba(208, 18, 45, 0.35); }
.composer, .prose-card, .faq, .plans, .auth-card { padding: 18px; }
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.plan { padding: 16px; }
.plan strong { font-size: 1.4rem; }
.faq details { padding: 8px 0; border-top: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 700; }
.comment { list-style: none; padding: 12px 0 0; }
.comments { list-style: none; margin: 0; padding: 0; }
.depth-1 { margin-left: 14px; }
.depth-2 { margin-left: 28px; }
.depth-3 { margin-left: 42px; }
.depth-4, .depth-5, .depth-6 { margin-left: 56px; }
.comment.is-collapsed .comment-body, .comment.is-collapsed .reply-form { display: none; }
.reply-form textarea { min-height: 80px; }
.post-body { font-size: 1.02rem; }
.post-body a { overflow-wrap: anywhere; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.footer {
  width: auto;
  margin: 10px;
  padding: 22px 24px 28px;
  border-radius: 24px;
}
.brand-grid, .footer-links { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.footer-links { margin-top: 14px; }
.tabbar button {
  flex: 1; min-height: 44px; border: 0; background: transparent; border-radius: 12px; cursor: pointer;
}
.brand-grid a, .footer-links a { color: var(--ink); text-decoration: none; font-size: 0.92rem; }
.brand-grid a:hover, .footer-links a:hover { color: var(--red-deep); }
.fine { color: var(--muted); font-size: 0.88rem; }
.space-scroll { display: none; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.tabbar {
  display: none; position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 40;
  justify-content: space-around; padding: 6px;
}
.tabbar a { flex: 1; justify-content: center; font-size: 0.82rem; }

.empty { padding: 28px 18px; text-align: center; }
.pager { display: flex; gap: 8px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.article h2 { margin: 1.2rem 0 0.4rem; font-size: 1.15rem; }
.article p { margin: 0 0 0.8rem; }
.links { display: flex; flex-wrap: wrap; gap: 10px 14px; padding: 0; margin: 8px 0 0; list-style: none; }
.space-fold-toggle, .brand-fold-toggle {
  display: flex; width: 100%; align-items: center; justify-content: space-between;
  margin: 18px 0 8px; padding: 0; border: 0; background: transparent; cursor: pointer; text-align: left;
}
.brand-fold-toggle {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 1.15rem;
  letter-spacing: 0;
  text-transform: none;
}
.space-fold.is-collapsed .space-fold-list,
.brand-fold.is-collapsed .brand-grid { display: none; }
.fold-toggle .arrow { display: inline-block; transition: transform 0.2s ease; }
.is-collapsed .fold-toggle .arrow { transform: rotate(-90deg); }
.avatar { width: 28px; height: 28px; border-radius: 8px; object-fit: cover; background: #e7ebf0; }
.profile-hero { position: relative; }
.profile-public { display: flex; justify-content: flex-end; margin: 0 0 12px; }
.profile-public a { color: var(--ink); font-weight: 700; text-decoration: none; }
.profile-head { display: flex; gap: 18px; align-items: center; }
.avatar-frame {
  display: block;
  width: 112px;
  height: 112px;
  flex: 0 0 112px;
  aspect-ratio: 1;
  border-radius: 24px;
  overflow: hidden;
  background: #e7ebf0;
}
.avatar-frame img {
  width: 100%;
  height: 100%;
  max-width: none;
  aspect-ratio: 1;
  object-fit: cover;
  object-position: center;
  border-radius: 0;
  display: block;
}
.clout-total { margin: 8px 0 0; font-size: 1.35rem; font-weight: 750; letter-spacing: -0.03em; }
.profile-site { overflow-wrap: anywhere; }
.profile-tabs { display: flex; gap: 8px; margin: 0 0 12px; }
.profile-tabs button {
  min-height: 44px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--line);
  background: rgba(255,255,255,0.72); cursor: pointer; font-weight: 700;
}
.profile-tabs button.is-on { background: var(--red); color: #fff; border-color: transparent; }
.marks { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.mark { opacity: 0.55; }
.mark.is-earned { opacity: 1; }
.mark img { width: 100%; height: 148px; object-fit: cover; border-radius: 18px; display: block; background: #1c2430; }
.mark strong, .mark span, .mark p { display: block; }
.mark span, .mark p { color: var(--muted); font-size: 0.85rem; }
.trust-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 16px; }

.space-app-banner,
.space-app-footer,
.space-app-compact {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px 18px;
  align-items: center;
  margin: 0 0 14px;
  padding: 16px 18px;
}
.space-app-footer, .space-app-compact { display: flex; }
.space-app-icon {
  width: 72px; height: 72px; object-fit: contain; border-radius: 16px;
  background: #fff; flex: 0 0 auto;
}
.space-app-footer .space-app-icon, .space-app-compact .space-app-icon { width: 52px; height: 52px; border-radius: 12px; }
.space-app-copy h2 { margin: 0 0 4px; font-size: 1.15rem; }
.space-app-copy p { margin: 0; color: var(--muted); }
.space-app-note { margin-top: 6px !important; font-size: 0.85rem !important; }
.space-app-badge { display: inline-block; line-height: 0; margin-top: 10px; }
.space-app-badge img { display: block; height: 64px; width: auto; max-width: 100%; }
.space-app-footer .space-app-badge, .space-app-compact .space-app-badge { margin-top: 0; margin-left: auto; }
.space-app-footer .space-app-badge img, .space-app-compact .space-app-badge img { height: 52px; }
.space-app-qr {
  background: #fff; color: #111; padding: 10px; border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; gap: 6px; width: 148px;
}
.space-app-qr img { width: 128px; height: 128px; display: block; }
.space-app-qr span { font-size: 0.78rem; font-weight: 700; color: #111; }
.space-app-nav {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 12px; border-radius: 14px;
  background: var(--red); color: #fff !important; text-decoration: none !important; font-weight: 700;
}
.space-app-nav:hover { color: #fff !important; background: var(--red-deep); }
.space-family {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 12px;
  margin: 16px 10px 0; padding: 0;
}
.space-family a {
  display: flex; align-items: center; gap: 12px;
  width: min(340px, 100%); padding: 12px 14px; border-radius: 18px;
  text-decoration: none; color: var(--ink);
  background: rgba(198,204,212,.28);
  box-shadow: 0 6px 6px rgba(0,0,0,.2), inset 1px 1px 0 rgba(255,255,255,.55);
}
.space-family img { width: 84px; max-width: 32%; height: auto; border-radius: 8px; display: block; }
.space-family strong, .space-family span { display: block; }
.space-family span { margin-top: 3px; font-size: 0.85rem; color: var(--muted); }

@media (max-width: 1024px) {
  .space-app-banner, .space-app-footer, .space-app-compact {
    display: flex; flex-direction: column; text-align: center;
  }
  .space-app-qr { display: none !important; }
  .space-app-footer .space-app-badge, .space-app-compact .space-app-badge { margin-left: 0; }
  .space-family a { width: 100%; }
}
.trust-row a { display: block; padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,0.82); }
.trust-row img { height: 42px; width: auto; display: block; }

@media (max-width: 980px) {
  body { background-attachment: scroll; }
  body.has-dock { padding-top: 148px; }
  .layout { grid-template-columns: 1fr; width: calc(100% - 16px); margin: 8px auto calc(96px + env(safe-area-inset-bottom)); }
  .feed { padding: 0; }
  .side, .rail { display: none; position: static; height: auto; max-height: none; padding: 14px; }
  .side.is-open { max-height: none; scrollbar-width: none; }
  .rail .glass, .side.glass, .footer { border-radius: 24px; }
  .side.is-open {
    display: block;
    position: fixed;
    z-index: 35;
    left: 10px;
    right: 10px;
    top: 78px;
    bottom: calc(78px + env(safe-area-inset-bottom));
    overflow: auto;
  }
  .space-scroll { display: flex; }
  .tabbar {
    display: flex;
    left: 8px;
    right: 8px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    padding: 4px;
  }
  .tabbar a, .tabbar button { min-height: 48px; font-size: 0.78rem; }
  .topbar { position: fixed; flex-wrap: wrap; gap: 8px; width: auto; top: 8px; left: 8px; right: 8px; margin: 0; padding: 8px; border-radius: 24px; }
  .top-actions .space-app-nav { display: none; }
  .search { flex: 1 1 100%; }
  .brand img { height: 42px; }
  .top-actions .hide-sm, .search button span { position: absolute; width: 1px; height: 1px; overflow: hidden; }
  .plans, .grid-2, .marks { grid-template-columns: 1fr; }
  .hero, .card, .auth-card, .prose-card { padding: 14px; }
  .avatar-frame { width: 96px; height: 96px; flex-basis: 96px; }
  .row, .card-actions, .card-top { flex-wrap: wrap; }
  .btn, button.vote, .field input, .field textarea, .search input { min-height: 44px; font-size: 16px; }
  h1 { font-size: 1.45rem; }
  .footer { margin: 8px 8px calc(96px + env(safe-area-inset-bottom)); border-radius: 24px; }
  .trust-row { justify-content: center; }
  .table-wrap { margin: 0 -6px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}
