/* Dark, airy feed look (inspired by the founder's reference video). Che's own name and icons. */
:root {
  --bg: #101010; --bg2: #181818; --bg3: #1e1e1e; --text: #f3f5f7; --grey: #777; --grey2: #999;
  --line: #2a2a2a; --pill: rgba(24,24,24,.88); --blue: #0095f6; --bad: #ff5f57;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 15px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, textarea { font: inherit; color: var(--text); background: none; border: 0; outline: none; }
a { color: inherit; }
.grey { color: var(--grey); }
.small { font-size: 12px; }
.msg { color: var(--grey); text-align: center; font-size: 14px; padding: 18px; min-height: 1em; margin: 0; }
.msg.bad { color: var(--bad); }
svg { display: block; }

/* layout: one centred column, mobile first */
#app, #login { max-width: 600px; margin: 0 auto; }
.view { padding: env(safe-area-inset-top) 0 calc(110px + env(safe-area-inset-bottom)); min-height: 100vh; }

/* top bar with centred wordmark */
.topbar { position: sticky; top: 0; z-index: 5; display: grid; grid-template-columns: 44px 1fr 44px; align-items: center;
  height: 52px; padding: 0 10px; background: rgba(16,16,16,.92); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.iconbtn { width: 44px; height: 44px; display: grid; place-items: center; color: var(--text); }
.iconbtn svg { width: 24px; height: 24px; }
.wordmark { text-align: center; font-weight: 800; font-size: 26px; letter-spacing: -1px; font-style: italic; }
.wordmark::after { content: "."; color: var(--blue); }
.wordmark.big { font-size: 56px; margin-top: 18vh; }
.toptitle { text-align: center; font-weight: 700; font-size: 16px; }
.bigtitle { padding: 14px 16px 6px; }
.bigtitle h1 { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: -.5px; }

/* avatars */
.av { width: 36px; height: 36px; border-radius: 50%; background: var(--bg3); display: grid; place-items: center; font-size: 18px; flex: none;
  border: .5px solid #333; }
.av.me { background: linear-gradient(135deg, #2f6f66, #1b3f5c); font-weight: 700; font-size: 15px; }
.av.sm { width: 28px; height: 28px; font-size: 12px; }
.av.xl { width: 64px; height: 64px; font-size: 26px; }

/* composer row ("What's new?" style) */
.composer { display: flex; gap: 12px; align-items: center; padding: 10px 16px 14px; border-bottom: .5px solid var(--line); cursor: pointer; }
.name { font-weight: 600; }
.feedname { padding: 10px 16px; color: var(--grey); font-size: 13px; border-bottom: .5px solid var(--line); }
.feedname button { color: var(--text); font-weight: 600; }

/* posts */
.post { display: flex; gap: 12px; padding: 12px 16px 6px; border-bottom: .5px solid var(--line); cursor: pointer; }
.post.nob { border-bottom: 0; }
.post .rail { display: flex; flex-direction: column; align-items: center; }
.post .thread { flex: 1; width: 2px; background: var(--line); margin: 6px 0 -6px; border-radius: 1px; }
.post .body { flex: 1; min-width: 0; padding-bottom: 6px; }
.post .head { display: flex; gap: 6px; align-items: baseline; }
.post .head .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post .head .when { color: var(--grey); white-space: nowrap; }
.post .head .tag { color: var(--grey); font-size: 13px; margin-left: auto; white-space: nowrap; }
.post .text { margin-top: 2px; white-space: pre-wrap; word-wrap: break-word; }
.post .meta { color: var(--grey2); margin-top: 2px; }
.post .thumb { margin-top: 8px; max-width: 70%; max-height: 260px; border-radius: 10px; border: .5px solid var(--line); display: block; object-fit: cover; }
.post .pdf { margin-top: 8px; display: inline-flex; gap: 8px; align-items: center; padding: 10px 14px; border-radius: 10px; border: .5px solid var(--line); color: var(--grey2); }
.actions { display: flex; gap: 18px; margin: 8px 0 4px; align-items: center; }
.actions > * { display: inline-flex; gap: 5px; align-items: center; color: var(--text); text-decoration: none; font-size: 13px; }
.actions svg { width: 20px; height: 20px; }
.actions .off { color: var(--grey); }
.btnrow { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.btnrow a, .btnrow button, .btnrow span { border: .5px solid #3a3a3a; border-radius: 10px; padding: 7px 12px; font-size: 14px; text-decoration: none; color: var(--text); font-weight: 600; }
.btnrow span { color: var(--grey); font-weight: 400; }
.note { color: var(--grey); font-size: 13px; margin-top: 6px; }
.reply a { color: var(--blue); text-decoration: none; }
.reply blockquote { margin: 6px 0; padding-left: 10px; border-left: 2px solid var(--line); }
.reply code, .reply pre { font: 13px ui-monospace, Menlo, monospace; }
.spin { display: inline-block; width: 13px; height: 13px; border: 2px solid #333; border-top-color: var(--text); border-radius: 50%;
  animation: s 1s linear infinite; vertical-align: -2px; }
@keyframes s { to { transform: rotate(360deg); } }
.group { padding: 16px 16px 4px; font-weight: 700; font-size: 15px; }

/* detail (single thread) */
#detail .post { cursor: default; border-bottom: 0; flex-direction: column; gap: 8px; }
#detail .big { font-size: 17px; font-weight: 600; }
.facts { margin: 4px 0; }
.fact { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: .5px solid var(--line); }
.fact span:first-child { color: var(--grey); }
.fact span:last-child { text-align: right; overflow-wrap: anywhere; }
.askbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(84px + env(safe-area-inset-bottom)); width: min(568px, calc(100% - 32px));
  display: flex; gap: 10px; align-items: center; background: var(--bg2); border: .5px solid var(--line); border-radius: 22px; padding: 8px 14px 8px 8px; }
.askbar input { flex: 1; }
#v-detail .tabless { display: none; }

/* search */
.searchbox { margin: 8px 16px 6px; display: flex; gap: 8px; align-items: center; background: var(--bg3); border-radius: 12px; padding: 9px 12px; }
.searchbox .si svg { width: 16px; height: 16px; color: var(--grey); }
.searchbox input { flex: 1; }

/* chips (Activity style) */
.chips { display: flex; gap: 8px; padding: 8px 16px 10px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button { border: .5px solid #3a3a3a; border-radius: 10px; padding: 7px 16px; font-weight: 600; font-size: 14px; white-space: nowrap; }
.chips button.on { background: var(--text); color: #000; border-color: var(--text); }
.brieftext { padding: 6px 16px 12px; white-space: pre-wrap; font-size: 16px; line-height: 1.5; }

/* me */
.profile { display: flex; justify-content: space-between; align-items: center; padding: 26px 16px 18px; }
.profile h2 { margin: 0 0 2px; font-size: 24px; letter-spacing: -.3px; }
.settings { border-top: .5px solid var(--line); margin-bottom: 22px; }
.setrow { display: flex; justify-content: space-between; gap: 16px; padding: 14px 16px; border-bottom: .5px solid var(--line); }
.setrow .grey { text-align: right; font-size: 14px; }

/* buttons */
.pill { display: block; border-radius: 12px; padding: 12px 16px; font-weight: 600; text-align: center; }
.pill.white { background: var(--text); color: #000; width: 100%; }
.pill.white:disabled { opacity: .5; }
.pill.outline { border: .5px solid #3a3a3a; }
.pill.wide { margin: 0 16px; width: calc(100% - 32px); }
.link { color: var(--grey2); padding: 12px 0; width: 100%; }

/* login */
#login { padding: 0 24px; text-align: center; }
.loginsub { color: var(--grey); margin: 6px 0 32px; }
.loginform { display: flex; flex-direction: column; gap: 10px; text-align: left; }
.loginform input { background: var(--bg2); border: .5px solid var(--line); border-radius: 12px; padding: 15px 14px; }
#code { font-size: 22px; letter-spacing: 6px; text-align: center; }

/* floating pill tab bar */
.tabbar { position: fixed; z-index: 10; left: 50%; transform: translateX(-50%); bottom: calc(14px + env(safe-area-inset-bottom));
  width: min(380px, calc(100% - 40px)); height: 58px; display: flex; justify-content: space-around; align-items: center;
  background: var(--pill); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); border: .5px solid #2c2c2c; border-radius: 29px;
  box-shadow: 0 8px 30px rgba(0,0,0,.5); }
.tabbar button { width: 52px; height: 44px; display: grid; place-items: center; color: #6b6b6b; border-radius: 22px; }
.tabbar button svg { width: 26px; height: 26px; }
.tabbar button.on { color: var(--text); background: #262626; }

/* feeds panel (slides in from the left) */
.panel { position: fixed; inset: 0 auto 0 0; z-index: 30; width: min(82vw, 360px); background: var(--bg); padding: calc(14px + env(safe-area-inset-top)) 16px;
  border-right: .5px solid var(--line); box-shadow: 20px 0 40px rgba(0,0,0,.6); animation: slin .22s ease-out; }
@keyframes slin { from { transform: translateX(-100%); } }
.panel h1 { font-size: 24px; margin: 6px 0 14px; }
.feedlist { background: var(--bg2); border-radius: 14px; overflow: hidden; border: .5px solid var(--line); }
.feedlist button { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 15px 16px; text-align: left; font-weight: 500; }
.feedlist button + button { border-top: .5px solid var(--line); }
.feedlist button.on::after { content: "✓"; color: var(--grey2); }

/* sheets */
#scrim { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.55); }
.sheet { position: fixed; z-index: 25; left: 50%; transform: translateX(-50%); bottom: 0; width: min(600px, 100%); background: var(--bg2);
  border-radius: 18px 18px 0 0; padding: 6px 0 calc(16px + env(safe-area-inset-bottom)); animation: up .22s ease-out; max-height: 92vh; overflow: auto; }
@keyframes up { from { transform: translate(-50%, 100%); } }
.sheethead { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 10px 16px; border-bottom: .5px solid var(--line); }
.sheethead b { font-size: 16px; }
.sheethead .r { justify-self: end; font-weight: 600; }
.sheethead .r:disabled { opacity: .4; }
.newrow { display: flex; gap: 12px; padding: 14px 16px 6px; }
.newrow textarea { width: 100%; resize: none; min-height: 60px; }
.tools { display: flex; gap: 20px; color: var(--grey); padding: 4px 0 8px; }
.tools svg { width: 22px; height: 22px; }
.picked { display: flex; gap: 8px; flex-wrap: wrap; padding: 4px 0 8px; }
.picked img { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; border: .5px solid var(--line); }
.picked .pdf { padding: 10px; border: .5px solid var(--line); border-radius: 10px; color: var(--grey2); font-size: 13px; }
.choice { display: block; width: 100%; padding: 15px 18px; text-align: left; font-size: 16px; border-bottom: .5px solid var(--line); }

@media (min-width: 700px) {
  #app { border-left: .5px solid var(--line); border-right: .5px solid var(--line); min-height: 100vh; }
}
