:root{
  --bg:#f6f7fb;
  --card:#ffffff;
  --text:#0f172a;
  --muted:#64748b;
  --border:#e5e7eb;
  --shadow:0 10px 30px rgba(15,23,42,.08);
  --shadowSoft:0 6px 18px rgba(15,23,42,.06);
  --primary:#111827;
  --primaryHover:#0b1220;
  --danger:#b91c1c;

  --navW: 280px;
  --sideW: 360px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background:var(--bg);
  color:var(--text);
}

a{color:inherit}
.muted{color:var(--muted)}
.small{font-size:.9rem}

.appShell{
  width:min(1380px, 100%);
  margin:0 auto;
  display:grid;
  grid-template-columns: var(--navW) 1fr var(--sideW);
  min-height:100vh;
}

@media (max-width: 1100px){
  .appShell{grid-template-columns: 84px 1fr}
  .side{display:none}
  :root{--navW:84px}
}

@media (max-width: 720px){
  .appShell{grid-template-columns: 1fr}
  .nav{display:none}
}

.nav{
  position:sticky;
  top:0;
  height:100vh;
  border-right:1px solid var(--border);
  padding:16px 14px;
  background:rgba(246,247,251,.85);
  backdrop-filter: blur(10px);
  display:flex;
  flex-direction:column;
  gap:14px;
}

.brand{
  display:flex; align-items:center; gap:12px;
  padding:6px 8px;
}
.brandMark{
  width:36px; height:36px; border-radius:12px;
  background: linear-gradient(135deg, #0f172a, #334155);
  box-shadow: var(--shadowSoft);
}
.brandName{font-weight:800; letter-spacing:-.02em; line-height:1}
.brandTag{font-size:.9rem; color:var(--muted); margin-top:2px}

@media (max-width:1100px){
  .brandText{display:none}
}

.navLinks{display:flex; flex-direction:column; gap:6px; margin-top:6px}
.navLink{
  width:100%;
  text-align:left;
  border:1px solid transparent;
  background:transparent;
  color:var(--text);
  padding:10px 10px;
  border-radius:12px;
  cursor:pointer;
  font-weight:600;
}
.navLink:hover{background:#eef2ff}
.navLink.isActive{background:#eef2ff; border-color:#e0e7ff}

@media (max-width:1100px){
  .navLink{padding:12px 10px; text-align:center}
}

.btn{
  border:1px solid var(--border);
  background:#fff;
  color:var(--text);
  border-radius:12px;
  padding:10px 12px;
  cursor:pointer;
  transition: transform .06s ease, background .15s ease, box-shadow .15s ease;
}
.btn:hover{background:#f8fafc}
.btn:active{transform: translateY(1px)}
.btnWide{width:100%}

.btnPrimary{
  background:var(--primary);
  border-color:var(--primary);
  color:#fff;
}
.btnPrimary:hover{background:var(--primaryHover)}
.btnGhost{background:transparent}

.navFooter{margin-top:auto}
.authMini{
  padding:10px;
  border:1px solid var(--border);
  border-radius:14px;
  background:#fff;
  box-shadow: var(--shadowSoft);
}

.main{
  border-right:1px solid var(--border);
  min-height:100vh;
}

.topbar{
  position:sticky;
  top:0;
  z-index:30;
  background:rgba(246,247,251,.85);
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--border);
  padding:12px 14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.topbarTitle{font-weight:800; letter-spacing:-.02em}
.topbarActions{display:flex; align-items:center; gap:10px}

.input{
  border:1px solid var(--border);
  background:#fff;
  color:var(--text);
  border-radius:12px;
  padding:10px 12px;
  outline:none;
}
.input:focus{box-shadow:0 0 0 4px rgba(15,23,42,.06); border-color: rgba(15,23,42,.25)}
.inputSmall{padding:8px 10px; width:260px}
@media (max-width: 520px){ .inputSmall{width: 160px} }

.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:16px;
  padding:14px;
  box-shadow: var(--shadowSoft);
}

.composer{margin:14px}
.composerRow{display:flex; gap:12px}
.composerCol{flex:1}
.textarea{
  width:100%;
  border:0;
  resize:none;
  outline:none;
  font-size:1rem;
  line-height:1.4;
  background:transparent;
  color:var(--text);
}
.composerMeta{
  margin-top:10px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}
.composerActions{display:flex; gap:10px; align-items:center; flex-wrap:wrap}

.imagePreview{
  margin-top:10px;
  border:1px solid var(--border);
  border-radius:14px;
  overflow:hidden;
  max-height: 320px;
}
.imagePreview img{
  width:100%;
  display:block;
  object-fit:cover;
}

.timeline{padding:0 0 30px}
.post{
  border-bottom:1px solid var(--border);
  padding:14px;
  display:flex;
  gap:12px;
}
.post:hover{background: rgba(255,255,255,.55)}
.postMain{flex:1; min-width:0}
.postHead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.postAuthor{
  display:flex;
  gap:8px;
  align-items:baseline;
  min-width:0;
}
.name{font-weight:800; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.handle{color:var(--muted); white-space:nowrap}
.time{color:var(--muted); font-size:.9rem; white-space:nowrap}
.postText{margin:8px 0 10px; white-space:pre-wrap; overflow-wrap:anywhere}
.postMedia{
  border:1px solid var(--border);
  border-radius:16px;
  overflow:hidden;
  background:#f1f5f9;
}
.postMedia img{
  width:100%;
  max-height: 440px;
  object-fit:cover;
  display:block;
  cursor: zoom-in;
}
.postActions{
  display:flex;
  gap:10px;
  margin-top:10px;
  flex-wrap:wrap;
}
.iconBtn{
  background:transparent;
  border:1px solid transparent;
  padding:8px 10px;
  border-radius:999px;
  cursor:pointer;
  color:var(--muted);
  display:inline-flex;
  align-items:center;
  gap:8px;
}
.iconBtn:hover{background:#f1f5f9; border-color:#e2e8f0; color:var(--text)}
.iconBtn.isOn{color:var(--text); border-color:#e2e8f0; background:#f1f5f9}

.replyBox{
  margin-top:10px;
  display:flex;
  gap:10px;
  align-items:flex-start;
}
.replyBox .input{flex:1}
.replies{margin-top:10px; display:flex; flex-direction:column; gap:10px}
.reply{
  border:1px solid var(--border);
  border-radius:14px;
  padding:10px;
  background:#fbfcfe;
}
.replyHead{display:flex; justify-content:space-between; gap:10px}
.divider{height:1px; background:var(--border); margin:12px 0}

.avatar{
  width:42px; height:42px;
  border-radius:999px;
  border:1px solid var(--border);
  background: linear-gradient(135deg, #e2e8f0, #f8fafc);
  display:grid;
  place-items:center;
  font-weight:800;
  color:#0f172a;
  flex: 0 0 auto;
}
.avatarSmall{width:34px; height:34px; font-size:.9rem}

.side{
  position:sticky;
  top:0;
  height:100vh;
  padding:14px;
  display:flex;
  flex-direction:column;
  gap:12px;
  overflow:auto;
}
.cardTitle{font-weight:800; margin-bottom:10px}
.accountCard{display:flex; flex-direction:column; gap:10px}
.trendList{display:flex; flex-direction:column; gap:10px}
.trend{display:flex; justify-content:space-between; gap:10px}
.trend b{font-weight:800}

.badge{
  font-size:.8rem;
  padding:4px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  background:#fff;
  color:var(--muted);
}

.modal{position:fixed; inset:0; display:none; z-index:200}
.modal[aria-hidden="false"]{display:block}
.modalBackdrop{position:absolute; inset:0; background:rgba(15,23,42,.55)}
.modalPanel{
  position:relative;
  width:min(560px, 92vw);
  margin: 8vh auto 0;
  background:#fff;
  border:1px solid var(--border);
  border-radius:16px;
  box-shadow:0 30px 90px rgba(0,0,0,.25);
  overflow:hidden;
}
.modalHeader{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  padding:12px 14px;
  border-bottom:1px solid var(--border);
  background:#fbfcfe;
}
.modalTitle{font-weight:800}
.modalBody{padding:14px}

.formRow{display:flex; gap:10px; flex-wrap:wrap; margin-top:10px}
.formRow .input{flex:1; min-width: 220px}

.notice{
  padding:10px;
  border-radius:14px;
  border:1px solid var(--border);
  background:#fbfcfe;
  color:var(--muted);
}

.lightbox{
  position:fixed;
  inset:0;
  background:rgba(15,23,42,.72);
  display:none;
  align-items:center;
  justify-content:center;
  padding:18px;
  z-index:250;
}
.lightbox[aria-hidden="false"]{display:flex}
.lightbox img{
  max-width:min(1100px, 95vw);
  max-height:85vh;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.18);
  box-shadow:0 24px 80px rgba(0,0,0,.35);
}
.lightboxClose{
  position:fixed;
  top:16px;
  right:16px;
  border:1px solid rgba(255,255,255,.22);
  color:#fff;
}
