:root { --bg:#16161A; --card:#222227; --raised:#2D2D33; --text:#fff; --text2:#BFBFC7; --text3:#94949E; --line:rgba(255,255,255,.08); --yellow:#FFCC00; --orange:#F0731A; --danger:#F56152; color-scheme: dark; }
* { box-sizing: border-box; }
html, body { margin:0; background:var(--bg); color:var(--text); font:16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color:var(--yellow); }
.tabs a span:last-child { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:100%; }
h1 { font-size:22px; margin:16px 0 10px; } h2 { font-size:18px; margin:14px 0 8px; } h3 { margin:0 0 4px; font-size:17px; }
.toolbar { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.toolbar h1 { flex:1; }
.card { background:var(--card); border:1px solid var(--line); border-radius:14px; padding:14px; margin:10px 0; }
.callout { border-color:rgba(255,204,0,.35); }
.muted { color:var(--text2); } .small { font-size:13px; } .error { color:var(--danger); min-height:0; margin:6px 0; } .error:empty { display:none; }
label { display:block; margin:10px 0 4px; color:var(--text2); font-size:14px; }
label.check { display:flex; align-items:center; gap:6px; color:var(--text); }
input, select, textarea { width:100%; background:var(--raised); color:var(--text); border:1px solid var(--line); border-radius:10px; padding:10px 12px; font:inherit; }
input[type=checkbox] { width:auto; accent-color:var(--yellow); }
input:focus, select:focus, textarea:focus { outline:2px solid var(--yellow); outline-offset:0; }
button, .button { display:inline-block; background:var(--raised); color:var(--text); border:1px solid var(--line); border-radius:10px; padding:9px 14px; font:inherit; cursor:pointer; text-decoration:none; text-align:center; }
button.primary, .button.primary { background:var(--yellow); color:#16161A; border-color:var(--yellow); font-weight:600; }
button.danger, .chip.danger { color:var(--danger); }
button:disabled { opacity:.6; cursor:progress; }
button.link { background:none; border:0; color:var(--yellow); padding:6px 0; }
form > button.primary { margin-top:14px; width:100%; }
.seg { display:flex; gap:6px; margin:12px 0; } .seg button { flex:1; } .seg .on { border-color:var(--yellow); color:var(--yellow); }
.row { display:flex; gap:8px; align-items:center; margin-top:10px; } .row input, .row textarea { flex:1; } .row.end { justify-content:flex-end; }
.post header, .profile header { display:flex; gap:10px; align-items:center; }
.avatar { flex:none; width:40px; height:40px; border-radius:50%; background:linear-gradient(135deg,var(--yellow),var(--orange)); color:#16161A; font-weight:700; display:grid; place-items:center; font-size:14px; }
.author { font-weight:600; color:var(--text); text-decoration:none; }
.edited { color:var(--text3); }
.caption, .summary { white-space:pre-wrap; overflow-wrap:anywhere; }
.media img, .media video { display:block; width:100%; max-height:70vh; object-fit:contain; background:#000; border-radius:10px; margin:8px 0; }
.video-link { position:relative; display:block; } .video-link span { position:absolute; left:12px; bottom:18px; background:rgba(0,0,0,.7); padding:6px 10px; border-radius:8px; color:#fff; }
.actions { display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin-top:6px; }
.chip { padding:6px 12px; border-radius:999px; font-size:14px; } .chip.on { border-color:var(--yellow); color:var(--yellow); }
.comments { margin-top:8px; } .comments summary { cursor:pointer; color:var(--text2); font-size:14px; }
.comment { padding:6px 0; border-top:1px solid var(--line); font-size:14px; overflow-wrap:anywhere; } .comment.reply { margin-left:18px; border-top:0; }
.filters { display:grid; grid-template-columns:auto 1fr; gap:6px 10px; align-items:center; } .filters label { margin:0; }
.badge { display:inline-block; background:rgba(255,204,0,.15); color:var(--yellow); padding:2px 8px; border-radius:6px; font-size:13px; }
.list { list-style:none; padding:0; margin:0; } .list li a { display:flex; gap:10px; align-items:center; padding:10px; color:var(--text); text-decoration:none; border-bottom:1px solid var(--line); } .list li > a > div { min-width:0; }
.one-line { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.thread { display:flex; flex-direction:column; gap:6px; margin:10px 0; } .bubble { max-width:80%; padding:8px 12px; border-radius:14px; background:var(--raised); white-space:pre-wrap; overflow-wrap:anywhere; } .bubble.out { align-self:flex-end; background:#4a3d00; } .bubble.in { align-self:flex-start; }
.composer textarea { min-height:44px; }
.picker .trade-list { max-height:220px; overflow:auto; border:1px solid var(--line); border-radius:10px; padding:4px 10px; margin-top:6px; background:var(--raised); }
.picker .trade-list label { margin:6px 0; }
dialog.sheet { background:var(--card); color:var(--text); border:1px solid var(--line); border-radius:16px; width:min(560px, 94vw); padding:16px; } dialog::backdrop { background:rgba(0,0,0,.6); }
.notice { position:fixed; left:50%; transform:translateX(-50%); bottom:84px; background:var(--raised); border:1px solid var(--yellow); padding:10px 16px; border-radius:12px; z-index:20; max-width:90vw; } .notice.err { border-color:var(--danger); }
.links a { color:var(--text2); }

/* ---------- signed-in shell ---------- */
body { background:var(--bg) url("/app/bg.jpg") center top / cover fixed no-repeat; min-height:100vh; }
#app { padding:0 0 96px; }
.top { position:sticky; top:0; z-index:5; padding:0 16px; background:rgba(22,22,26,.94); border-bottom:1px solid var(--line); box-shadow:0 2px 12px rgba(0,0,0,.35); }
.top-inner { display:flex; align-items:center; gap:16px; height:68px; max-width:1088px; margin:0 auto; }
.brand { display:inline-flex; align-items:center; gap:12px; font-weight:800; font-size:24px; letter-spacing:.14em; line-height:1; text-transform:uppercase; color:var(--yellow); text-decoration:none; flex:none; white-space:nowrap; }
.brand img { width:48px; height:48px; border-radius:10px; }
.brand .wordmark { display:block; }
.tabs { display:flex; flex:1; justify-content:center; gap:4px; max-width:560px; margin:0 auto; }
.tabs a { flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; height:68px; font-size:12px; color:var(--text3); text-decoration:none; border-bottom:3px solid transparent; min-width:0; border-radius:8px 8px 0 0; }
.tabs a:hover { background:rgba(255,255,255,.05); color:var(--text); }
.tabs a .ico { font-size:20px; line-height:1; display:grid; place-items:center; }
.tabs a .hat-ico { width:22px; height:22px; display:block; color:var(--yellow); }
.tabs a.on { color:var(--yellow); border-bottom-color:var(--yellow); }
.me-chip { display:flex; align-items:center; gap:8px; flex:none; color:var(--text); text-decoration:none; padding:4px 12px 4px 4px; border-radius:999px; background:var(--raised); }
.me-chip:hover { background:#3a3a42; }
.layout { display:grid; grid-template-columns:minmax(0,680px) 300px; gap:24px; justify-content:center; padding:8px 16px 0; max-width:1120px; margin:0 auto; }
.side { position:sticky; top:84px; align-self:start; }
.side-me { display:block; padding:0; overflow:hidden; text-decoration:none; color:var(--text); }
.side-me-body { display:flex; flex-direction:column; align-items:center; gap:2px; padding:0 14px 14px; margin-top:-28px; position:relative; }
.side-links { display:flex; flex-direction:column; gap:2px; padding:8px; }
.side-links a { color:var(--text); text-decoration:none; padding:10px; border-radius:8px; } .side-links a:hover { background:var(--raised); }
.side-note, .side-legal { padding:0 6px; }
.card { box-shadow:0 1px 3px rgba(0,0,0,.35); }
.avatar.sm { width:32px; height:32px; font-size:12px; }
.avatar.lg { width:64px; height:64px; font-size:22px; border:3px solid var(--card); }
.avatar.xl { width:112px; height:112px; font-size:38px; border:4px solid var(--card); box-shadow:0 2px 10px rgba(0,0,0,.5); }
.cover { height:200px; margin:-14px -14px 0; overflow:hidden; border-radius:14px 14px 0 0; background:linear-gradient(135deg,#5a4200,#16161A); }
.cover img { width:100%; height:100%; object-fit:cover; display:block; }
.cover.small { height:72px; margin:0; border-radius:0; }
.profile-head { display:flex; align-items:flex-end; gap:16px; margin-top:-56px; padding:0 4px; position:relative; }
.profile-id { padding-bottom:6px; min-width:0; } .profile-id h2 { margin:0; font-size:24px; }
.profile .stats { margin:10px 4px 0; } .profile .bio { margin:12px 4px; white-space:pre-wrap; }
.photo-note { border-top:1px solid var(--line); padding-top:10px; margin-bottom:0; }
.composer-prompt { display:flex; align-items:center; gap:12px; text-decoration:none; color:var(--text2); }
.composer-prompt span:last-child { flex:1; background:var(--raised); border-radius:999px; padding:10px 16px; }
.composer-prompt:hover span:last-child { background:#3a3a42; }
@media (max-width:1000px) { .layout { grid-template-columns:minmax(0,680px); } .side { display:none; } }
@media (max-width:640px) {
  #app { padding:0 0 84px; } .layout { padding:4px 10px 0; } .top { padding:0 12px; position:static; }
  .top-inner { height:58px; } .brand { font-size:18px; letter-spacing:.12em; gap:8px; } .brand img { width:40px; height:40px; border-radius:8px; }
  .me-name { display:none; } .me-chip { padding:4px; margin-left:auto; }
  .tabs { position:fixed; left:0; right:0; bottom:0; max-width:none; background:rgba(34,34,39,.98); border-top:1px solid var(--line); padding-bottom:env(safe-area-inset-bottom); z-index:10; gap:0; }
  .tabs a { height:58px; border-bottom:0; border-top:3px solid transparent; border-radius:0; } .tabs a.on { border-top-color:var(--yellow); }
  .cover { height:140px; } .avatar.xl { width:92px; height:92px; font-size:30px; } .profile-head { margin-top:-46px; } .profile-id h2 { font-size:20px; }
}

/* ---------- signed-out landing (brand left, white card right) ---------- */
body.signed-out { background:#0f0f12 url("/app/bg.jpg") center / cover fixed no-repeat; }
body.signed-out #app { max-width:none; padding:0; }
.landing { min-height:100vh; display:grid; grid-template-columns:minmax(0,560px) 400px; grid-template-rows:1fr auto; column-gap:72px; align-items:center; justify-content:center; padding:48px 24px 0; }
.landing-brand { padding-bottom:40px; }
.landing-logo { width:200px; height:200px; border-radius:28px; display:block; margin:0 0 8px -8px; box-shadow:0 10px 40px rgba(255,190,40,.18); }
.landing-name { font-size:56px; line-height:1.05; margin:8px 0 12px; color:var(--yellow); font-weight:800; letter-spacing:.02em; }
.landing-tagline { font-size:26px; line-height:1.3; color:#f2f2f4; margin:0; max-width:520px; font-weight:400; }
.auth-card { background:#fff; color:#1c1e21; border-radius:12px; padding:20px 16px 24px; box-shadow:0 4px 12px rgba(0,0,0,.35), 0 16px 40px rgba(0,0,0,.35); margin-bottom:40px; }
.auth-title { margin:4px 4px 14px; font-size:20px; color:#1c1e21; text-align:center; }
.auth-card .muted { color:#606770; } .auth-card .error { color:#c62828; text-align:center; }
.auth-card input { background:#fff; color:#1c1e21; border:1px solid #dddfe2; border-radius:8px; padding:14px 16px; font-size:17px; margin:0 0 12px; }
.auth-card input::placeholder { color:#8a8d91; }
.auth-card input:focus { outline:none; border-color:#e0a800; box-shadow:0 0 0 2px rgba(255,204,0,.45); }
.auth-card form > button.big, .auth-card button.big { width:100%; margin:2px 0 0; padding:12px 16px; font-size:20px; font-weight:700; border-radius:8px; }
.auth-card button.primary { background:var(--yellow); border-color:var(--yellow); color:#16161A; } .auth-card button.primary:hover { background:#f2c200; }
.auth-card .link { color:#8a6400; font-size:15px; font-weight:500; } .auth-card .link:hover { text-decoration:underline; }
.auth-links { display:flex; flex-direction:column; align-items:center; gap:2px; margin-top:12px; }
.divider { border-bottom:1px solid #dadde1; margin:18px 0; }
.auth-card button.create { display:block; margin:0 auto; background:#2E9E4F; border-color:#2E9E4F; color:#fff; font-size:17px; font-weight:700; padding:12px 18px; border-radius:8px; }
.auth-card button.create.big { width:100%; font-size:20px; } .auth-card button.create:hover { background:#278a44; }
.auth-card button.secondary { display:block; width:100%; background:#e4e6eb; border-color:#e4e6eb; color:#1c1e21; font-weight:600; }
.landing-foot { grid-column:1 / -1; text-align:center; padding:18px 0 28px; border-top:1px solid rgba(255,255,255,.08); }
.lang-row { display:flex; justify-content:center; gap:16px; flex-wrap:wrap; } .lang-row .link { color:var(--text2); font-size:14px; } .lang-row .link.on { color:var(--yellow); font-weight:600; }
@media (max-width:900px) {
  .landing { grid-template-columns:minmax(0,420px); grid-template-rows:auto auto auto; padding:28px 16px 0; align-items:start; }
  .landing-brand { text-align:center; padding-bottom:20px; } .landing-logo { width:112px; height:112px; margin:0 auto 4px; border-radius:20px; }
  .landing-name { font-size:36px; margin:4px 0 6px; } .landing-tagline { font-size:18px; margin:0 auto; }
  .auth-card { margin-bottom:24px; }
}

.social-stack { display:flex; flex-direction:column; gap:10px; margin:0 0 4px; }
.auth-card button.social { width:100%; display:flex; align-items:center; justify-content:center; gap:10px; font-weight:600; font-size:16px; padding:12px 16px; margin:0; border-radius:8px; }
.auth-card button.social img { display:block; }
.auth-card button.social.apple { background:#000; border-color:#000; color:#fff; }
.auth-card button.social.apple:hover { background:#1c1c1c; }
.auth-card button.social.google { background:#fff; color:#1c1e21; border:1px solid #dadce0; }
.auth-card button.social.google:hover { background:#f7f8fa; }
.auth-or { display:flex; align-items:center; gap:12px; color:#8a8d91; font-size:13px; font-weight:600; text-transform:uppercase; margin:4px 0 14px; }
.auth-or::before, .auth-or::after { content:""; flex:1; border-bottom:1px solid #dadde1; }
.connected-row { display:flex; align-items:center; gap:10px; justify-content:space-between; margin:10px 0; }
