:root {
  --bg: #08151d;
  --bg-deeper: #07131a;
  --panel: #0e2530;
  --panel-hover: #102c39;
  --cyan: #00e7ef;
  --cyan-muted: #0b3442;
  --white: #fafbfc;
  --text: #d8e0e7;
  --muted: #91a0ac;
  --line: #46545d;
  --red: #fb130c;
  --red-bg: #651200;
  --font: Arial, Helvetica, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: auto; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); line-height: 1.5; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--cyan); }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
button:disabled { opacity:.5; cursor: not-allowed; }
.site { min-height:100vh; }
.topbar { height:75px; border-bottom:1px solid var(--line); display:flex; align-items:center; justify-content:space-between; padding:0 max(22px,calc((100vw - 1350px)/2 + 22px)); background:var(--bg); position:sticky; top:0; z-index:15; }
.wordmark { font-size:34px; font-weight:800; letter-spacing:-2.2px; color:#fff; line-height:1; }
.wordmark span { color:var(--cyan); }
.wordmark:hover { color:#fff; }
.top-actions { display:flex; align-items:center; gap:20px; }
.header-avatar-link { display:inline-flex; }
.header-avatar { width:45px;height:45px;border-radius:50%;object-fit:cover; }
.icon-button { border:0;background:none;color:var(--text);padding:6px;display:inline-grid;place-items:center;border-radius:8px; }
.icon-button:hover { background:var(--panel-hover);color:var(--cyan); }
.icon { width:19px;height:19px;display:block; flex:none; }
.icon.large { width:23px;height:23px; }
.search-bar { max-width:720px; margin:0 auto; padding:14px 22px 0; }
.search-bar label { display:block;font-size:12px;color:var(--muted);margin-bottom:6px; }
.search-bar input { width:100%;border:1px solid var(--line);border-radius:10px;padding:12px 14px;color:var(--white);background:var(--panel);font-size:15px; }
.search-bar[hidden] { display:none; }
.layout { max-width:1380px;display:grid; grid-template-columns: 212px minmax(0, 740px) 250px;gap:22px;margin:0 auto;padding:22px 22px 95px;align-items:start; }
.main { width:100%; min-width:0; }
.desktop-sidebar { padding-top:12px;position:sticky;top:98px; }
.desktop-menu-item { display:flex;align-items:center;gap:13px;padding:12px 15px;border-radius:9px;font-size:15px;font-weight:600;color:var(--muted);margin:4px 0; }
.desktop-menu-item.active { color:var(--cyan);background:var(--cyan-muted); }
.desktop-menu-item:hover { color:var(--white);background:var(--panel); }
.desktop-menu-item .icon { width:21px;height:21px; }
.sidebar-fineprint { color:#6f818d;font-size:11px;letter-spacing:.5px;line-height:1.7;margin:32px 16px; }
.right-sidebar { position:sticky;top:98px; }
.sidebar-panel { background:#0d2630;border:1px solid #244454;padding:19px;border-radius:13px; }
.sidebar-panel .eyebrow { font-size:10px;letter-spacing:1.2px;color:var(--cyan);font-weight:700; }
.sidebar-panel h2 { font-size:20px;margin:8px 0;line-height:1.2;color:var(--white); }
.sidebar-panel p:not(.eyebrow) { font-size:13px;line-height:1.6;color:#b5c4cf; }
.sidebar-panel a { display:block;font-size:13px;margin-top:12px;color:var(--cyan); }
.page-heading { display:flex;align-items:center;justify-content:space-between;gap:12px;margin:2px 0 14px; }
.page-heading h1 { font-size:22px;margin:0;color:var(--white);font-weight:700; }
.heading-sub { margin:0 0 16px;color:var(--muted);font-size:14px; }
.eyebrow { font-size:12px;letter-spacing:.5px;text-transform:uppercase;color:var(--muted); }
.thread-card { display:block;border:1px solid #34434c;border-radius:13px;background:var(--bg-deeper); padding:19px 18px;margin:13px 0;transition:background .15s,border-color .15s; }
.thread-card:hover { background:#0b212b;border-color:#456477; }
.thread-card .card-meta { display:flex;align-items:center;gap:10px;margin-bottom:13px; }
.card-meta small { display:block;color:var(--muted);font-size:12px; }
.card-meta strong { display:block;color:var(--text);font-size:14px;font-weight:500; }
.community-avatar { width:43px;height:43px;object-fit:cover;border-radius:10px;flex:none; }
.flair { display:inline-block; font-size:11px;line-height:1.35;text-transform:uppercase;color:var(--cyan);background:var(--cyan-muted);border-radius:6px;padding:6px 9px;letter-spacing:.15px;margin-bottom:10px; }
.flair.red { color:var(--red);background:var(--red-bg); }
.thread-card h2 { color:var(--white);font-size:20px;line-height:1.31;letter-spacing:-.35px;margin:0 0 12px; }
.thread-card .preview { margin:0 0 15px;font-size:14px;color:#c3ced6;line-height:1.55;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden; }
.meta-row { display:flex;align-items:center;gap:20px;color:var(--muted);font-size:12px; }
.meta-row span {display:inline-flex;align-items:center;gap:6px;}
.meta-row .icon {width:17px;height:17px;}
.feed-controls { display:flex;align-items:center;gap:7px;margin:14px 0;flex-wrap:wrap; }
.feed-controls button { background:transparent;color:var(--muted);border:1px solid var(--line);border-radius:999px;padding:7px 13px;font-size:12px; }
.feed-controls button.active { background:var(--cyan-muted);color:var(--cyan);border-color:#245a67; }
.thread-view { padding:0 7px 40px; }
.thread-backbar { display:flex;justify-content:space-between;align-items:center;gap:12px;margin:3px 0 26px; }
.thread-backbar a { color:var(--text);display:flex;align-items:center;gap:10px;font-size:14px; }
.thread-backbar a .icon {width:22px;height:22px;}
.thread-backbar .archive-copy {font-size:12px;color:var(--muted);white-space:nowrap;}
.author-line {display:flex;align-items:center;gap:12px;margin-bottom:27px;}
.author-line .community-avatar {width:46px;height:46px;}
.author-line .community {color:var(--text);font-size:15px;line-height:1.3;}
.author-line .byline {color:var(--muted);font-size:13px;margin-top:3px;}
.inline-user {color:inherit;}
.thread-view h1 { font-size:27px;line-height:1.3;color:var(--white);letter-spacing:-.4px;margin:0 0 21px;font-weight:750; }
.post-body p { font-size:17px;line-height:1.59;margin:0 0 25px;color:var(--text); }
.post-body p:last-child {margin-bottom:19px;}
.post-actions {border-top:1px solid var(--line);padding:14px 1px 17px;display:flex;align-items:center;gap:20px; }
.vote-box {border:1px solid #688391;border-radius:10px;display:inline-flex;align-items:stretch;overflow:hidden;flex:none;background:#0c2a36;}
.vote-box button {border:0;background:transparent;color:#91a6b1;padding:5px 8px;display:flex;align-items:center;justify-content:center; }
.vote-box button:first-child {border-right:1px solid #627785;}
.vote-box button.up.active,.mini-vote button.up.active {color:var(--cyan);}
.vote-box button.down.active,.mini-vote button.down.active {color:var(--red);}
.vote-box button:hover,.mini-vote button:hover {color:var(--white);}
.vote-box .count {min-width:46px;text-align:center;align-self:center;color:var(--text);font-size:14px;padding:0 1px;}
.vote-box .count.upvoted {color:var(--cyan);}
.vote-box .count.downvoted {color:var(--red);}
.vote-box .icon {width:19px;height:19px;}
.plain-count {display:flex;align-items:center;gap:6px;font-size:15px;color:var(--text);}
.plain-count .icon {color:var(--muted);width:18px;height:18px;}
.action-spacer {margin-left:auto;}
.square-action {background:#0c2a36;border:1px solid #66808e;border-radius:8px;padding:6px;color:#cad7e0;display:grid;place-items:center;}
.square-action.active {color:var(--cyan);}
.square-action .icon {width:18px;height:18px;}
.square-action:hover {color:var(--cyan);}
.replies-heading {display:flex;align-items:center;justify-content:space-between;gap:6px;margin:2px 0 16px;}
.replies-heading h2 {font-size:17px;color:var(--text);margin:0;}
.replies-heading select {color:var(--muted);border:0;background:var(--bg);padding:7px 15px 7px 7px;font-size:13px;cursor:pointer;}
.comment-tree {display:flex;flex-direction:column;gap:18px;}
.comment-node {border-left:3px solid #8597a3;padding-left:12px;margin-left:0;position:relative;}
.comment-node .comment-node {margin-top:14px;margin-left:0;border-left-color:#778e9b;}
.comment-head {font-size:13px;line-height:1.5;color:var(--muted);display:flex;align-items:center;gap:6px;flex-wrap:wrap;}
.comment-head a {color:#c7d2db;}
.comment-head .op {color:var(--cyan);font-weight:700;font-size:11px;}
.comment-content {font-size:15.5px;line-height:1.57;margin:9px 0 6px;color:var(--text);white-space:pre-line;}
.comment-controls {display:flex;justify-content:flex-end;align-items:center;gap:10px;color:var(--muted);font-size:12px;min-height:25px;}
.comment-controls button {color:var(--muted);background:none;border:0;padding:2px;display:flex;align-items:center;gap:4px;font-size:12px;}
.comment-controls button:hover {color:var(--cyan);}
.comment-controls .icon {width:15px;height:15px;}
.mini-vote {display:flex;gap:3px;align-items:center;}
.mini-vote button {padding:0 1px;}
.mini-vote span {min-width:18px;text-align:center;}
.mini-vote button.up.active + span {color:var(--cyan);}
.mini-vote button.down.active + span {color:var(--red);}
.toggle-replies {font-size:12px;color:var(--cyan);background:transparent;border:0;padding:5px 0 0;display:inline-flex;gap:4px;align-items:center;}
.replies-collapsed {border-left:3px solid #456978;padding:5px 0 5px 12px;margin-top:10px;color:var(--muted);font-size:12px;}
.community-cover {border-radius:12px;background:linear-gradient(125deg,#003942,#091721 65%);padding:24px 22px;margin-bottom:16px;border:1px solid #2d5963;display:flex;align-items:center;gap:17px;}
.community-cover img {width:64px;height:64px;border-radius:12px;}
.community-cover h1 {font-size:25px;color:var(--white);margin:0;line-height:1.25;}
.community-cover p {font-size:13px;color:#b8c8d2;margin:4px 0 0;}
.community-list {display:flex;flex-direction:column;gap:12px;}
.community-choice {display:flex;align-items:center;gap:14px;border:1px solid var(--line);border-radius:12px;padding:17px;background:#0c222d;}
.community-choice img {width:58px;height:58px;border-radius:12px;}
.community-choice strong {color:var(--white);}
.community-choice p {font-size:13px;color:var(--muted);margin:4px 0 0;}
.empty-state {border:1px dashed var(--line);text-align:center;border-radius:12px;padding:35px 24px;color:var(--muted);}
.empty-state h2 {color:var(--white);font-size:18px;}
.profile-head {display:flex;gap:15px;align-items:center;background:#0b2934;border:1px solid #2c4d59;padding:20px;border-radius:12px;margin-bottom:16px;}
.profile-head .avatar-placeholder {width:58px;height:58px;border-radius:50%;background:#103845;color:var(--cyan);display:grid;place-items:center;font-size:28px;font-weight:700;}
.profile-head h1 {font-size:22px;margin:0;color:var(--white);}
.profile-head p {font-size:12px;color:var(--muted);margin:3px 0 0;}
.profile-comment {border-left:3px solid #68808d;background:#0a212b;padding:13px;margin:12px 0;border-radius:0 8px 8px 0;}
.profile-comment p {font-size:14px;margin:8px 0;color:var(--text);}
.profile-comment small {color:var(--muted);font-size:12px;}
.bottom-nav {display:none;}
.toast {position:fixed;bottom:22px;left:50%;transform:translate(-50%,16px);background:#17404c;border:1px solid #2c7588;color:var(--white);font-size:13px;padding:12px 18px;border-radius:10px;box-shadow:0 8px 30px #0008;z-index:40;opacity:0;pointer-events:none;transition:opacity .2s,transform .2s;max-width:min(460px,90vw);text-align:center;}
.toast.show {opacity:1;transform:translate(-50%,0);}
@media (max-width:1170px) {
  .layout {grid-template-columns: 180px minmax(0,800px);max-width:1050px;gap:18px;}
  .right-sidebar {display:none;}
}
@media (max-width:720px) {
  .topbar {height:72px;padding:0 20px;}
  .wordmark {font-size:31px;}
  .header-avatar {width:42px;height:42px;}
  .layout {display:block;padding:18px 20px 100px;}
  .desktop-sidebar {display:none;}
  .bottom-nav {position:fixed;bottom:0;left:0;right:0;z-index:20;border-top:1px solid var(--line);background:var(--bg);height:70px;display:grid;grid-template-columns:repeat(3,1fr);padding-bottom:env(safe-area-inset-bottom);}
  .bottom-nav a {display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;color:var(--text);font-size:11px;}
  .bottom-nav a.active {color:var(--cyan);}
  .bottom-nav .icon {width:24px;height:24px;}
  .thread-view {padding:0;}
  .thread-backbar {margin:2px 0 25px;}
  .thread-view h1 {font-size:25px;}
  .post-body p {font-size:17px;}
  .comment-content {font-size:15.5px;}
  .thread-card {margin:10px 0;}
  .toast {bottom:84px;}
}
@media (max-width:400px) {
  .layout {padding-left:16px;padding-right:16px;}
  .post-actions {gap:11px;}
  .thread-view h1 {font-size:23px;}
  .comment-controls {gap:6px;}
  .comment-node {padding-left:9px;}
  .comment-head {font-size:12px;}
  .comment-content {font-size:14.5px;}
}
.sr-only {position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;}

/* CyanGo v0.2: generated community icons */
.generated-avatar {display:grid;place-items:center;background:color-mix(in srgb,var(--community-accent) 17%,#102b34);color:var(--community-accent);font-weight:800;line-height:1;letter-spacing:-.5px;border:1px solid color-mix(in srgb,var(--community-accent) 60%,#153b48);font-size:15px;object-fit:contain;}
.community-cover-img {width:64px;height:64px;border-radius:12px;flex:none;}
.community-choice .generated-avatar {width:58px;height:58px;border-radius:12px;}

/* v0.3: image attachments */
.post-feed-media{margin:12px 0 1px;position:relative;max-height:330px;overflow:hidden;border:1px solid #304e5d;border-radius:10px;background:#06151d;display:flex;align-items:center;justify-content:center;}
.post-feed-media img{width:100%;max-height:330px;object-fit:contain;display:block;}
.media-count{position:absolute;bottom:8px;right:9px;background:#06151de8;border:1px solid #59818a;color:#effaff;border-radius:30px;padding:4px 10px;font-size:11px;}
.post-media-gallery{display:grid;grid-template-columns:1fr;gap:13px;margin:22px 0;}
.post-media-gallery.multi{grid-template-columns:repeat(auto-fit,minmax(min(100%,250px),1fr));}
.post-media-gallery figure{margin:0;min-width:0;}
.post-media-gallery figure .media-zoom{appearance:none;border:1px solid #365e69;background:#06151d;border-radius:10px;display:flex;align-items:center;justify-content:center;padding:0;width:100%;overflow:hidden;cursor:zoom-in;}
.post-media-gallery img{display:block;width:100%;height:auto;max-height:580px;object-fit:contain;}
.post-media-gallery figcaption{font-size:12px;color:#9eb8c3;margin:7px 3px;line-height:1.45;}
.image-lightbox{position:fixed;inset:0;z-index:10000;background:rgba(0,6,13,.96);padding:55px 16px 22px;display:flex;align-items:center;justify-content:center;cursor:zoom-out;}
.image-lightbox img{max-width:100%;max-height:100%;object-fit:contain;box-shadow:0 15px 60px #000;}
.image-lightbox .lightbox-close{position:absolute;right:17px;top:10px;background:#1b3542;color:#fff;border:1px solid #668d9b;border-radius:12px;cursor:pointer;font-size:25px;padding:2px 13px;}
@media(max-width:600px){.post-media-gallery.multi{grid-template-columns:1fr}.post-media-gallery img{max-height:480px}}
