:root{
  --bg: #0b0f14;
  --panel: #0f1621;
  --panel2:#0c121b;
  --text: #e8eef6;
  --muted:#93a4b8;
  --border:#1d2a3a;
  --accent:#4aa3ff;
  --accent2:#7c4dff;
  --danger:#ff4d6d;
  --ok:#2ee59d;

  --r: 18px;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --shadow2: 0 6px 18px rgba(0,0,0,.28);
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: var(--font);
  background: radial-gradient(1200px 800px at 30% -10%, rgba(74,163,255,.18), transparent 55%),
              radial-gradient(900px 700px at 90% 20%, rgba(124,77,255,.16), transparent 55%),
              var(--bg);
  color:var(--text);
}

a{color:inherit; text-decoration:none}
a:hover{color:var(--accent)}

.container{
  width:min(1180px, 100%);
  margin:0 auto;
  padding: 18px 14px;
}

.app{
  display:grid;
  grid-template-columns: 260px 1fr 330px;
  gap: 16px;
  align-items:start;
}

@media (max-width: 1100px){
  .app{grid-template-columns: 240px 1fr}
  .rightbar{display:none}
}
@media (max-width: 820px){
  .app{grid-template-columns: 1fr}
  .sidebar{position:sticky; top:0; z-index:10}
  .sidebar .nav{display:flex; gap:10px; overflow:auto; padding-bottom:10px}
  .sidebar .card{display:none}
}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding: 10px 12px;
  border:1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  border-radius: var(--r);
  box-shadow: var(--shadow2);
  position: sticky;
  top: 12px;
  z-index: 10;
  backdrop-filter: blur(10px);
}

.brand{
  display:flex; align-items:center; gap:10px;
  font-weight:800;
  letter-spacing:.2px;
}
.logo{
  width:34px; height:34px; border-radius:12px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 8px 20px rgba(74,163,255,.25);
  display:grid; place-items:center;
  font-weight:900;
}
.brand small{display:block; font-weight:600; color:var(--muted); margin-top:-2px}

.pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 8px 10px;
  border:1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,.03);
  color: var(--muted);
  font-size: 13px;
}

.sidebar .nav a{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 10px 12px;
  border-radius: 14px;
  color: var(--text);
  border:1px solid transparent;
}
.sidebar .nav a:hover{
  background: rgba(255,255,255,.03);
  border-color: var(--border);
}

.card{
  border:1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  border-radius: var(--r);
  box-shadow: var(--shadow2);
  overflow:hidden;
}

.card .hd{
  padding: 12px 14px;
  border-bottom:1px solid var(--border);
  display:flex; align-items:center; justify-content:space-between;
}
.card .bd{padding: 14px}
.card .ft{padding: 12px 14px; border-top:1px solid var(--border)}

.h1{
  font-size: 18px; font-weight: 800; margin:0;
}
.h2{
  font-size: 14px; font-weight: 800; margin:0; color:var(--muted);
}

.compose textarea{
  width:100%;
  min-height: 96px;
  resize: vertical;
  padding: 12px 12px;
  border-radius: 14px;
  border:1px solid var(--border);
  background: rgba(0,0,0,.25);
  color: var(--text);
  outline:none;
}
.compose textarea:focus{
  border-color: rgba(74,163,255,.65);
  box-shadow: 0 0 0 4px rgba(74,163,255,.12);
}

.row{display:flex; gap:10px; align-items:center; justify-content:space-between; flex-wrap:wrap}
.actions{display:flex; gap:10px; align-items:center; flex-wrap:wrap}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding: 10px 12px;
  border-radius: 14px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.03);
  color: var(--text);
  font-weight:700;
  cursor:pointer;
  transition: transform .06s ease, background .2s ease, border-color .2s ease;
}
.btn:hover{background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.08)}
.btn:active{transform: translateY(1px)}
.btn.primary{
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-color: transparent;
}
.btn.primary:hover{filter: brightness(1.05)}
.btn.danger{background: rgba(255,77,109,.10); border-color: rgba(255,77,109,.35); color:#ffd5dd}
.btn.ghost{background: transparent}

.input{
  width:100%;
  padding: 10px 12px;
  border-radius: 14px;
  border:1px solid var(--border);
  background: rgba(0,0,0,.25);
  color: var(--text);
  outline:none;
}
.input:focus{
  border-color: rgba(74,163,255,.65);
  box-shadow: 0 0 0 4px rgba(74,163,255,.12);
}

.post{
  padding: 14px 14px;
  border-bottom:1px solid var(--border);
}
.post:last-child{border-bottom:none}

.meta{
  display:flex; align-items:center; gap:8px; flex-wrap:wrap;
  color: var(--muted); font-size: 13px;
}
.meta b{color: var(--text)}
.content{
  margin: 10px 0 12px 0;
  white-space: pre-wrap;
  line-height: 1.35;
}

.kbd{
  font-size: 12px;
  padding: 2px 8px;
  border:1px solid var(--border);
  border-bottom-color: rgba(255,255,255,.14);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255,255,255,.03);
}

.flash{
  border:1px solid rgba(255,255,255,.08);
  background: rgba(46,229,157,.09);
  color: #caffea;
  padding: 10px 12px;
  border-radius: 14px;
}

.flash.error{
  background: rgba(255,77,109,.10);
  color: #ffd5dd;
  border-color: rgba(255,77,109,.28);
}

.small{font-size:13px; color:var(--muted)}
.hr{height:1px; background:var(--border); margin:12px 0}

.cover{
  height: 120px;
  background: linear-gradient(135deg, rgba(74,163,255,.35), rgba(124,77,255,.28));
  border-bottom:1px solid var(--border);
}
.profile-head{
  display:flex; gap:14px; align-items:flex-end;
  margin-top: -34px;
}
.avatar{
  width:72px; height:72px; border-radius: 22px;
  border: 3px solid rgba(11,15,20,.9);
  background: linear-gradient(135deg, rgba(255,255,255,.10), rgba(255,255,255,.02));
  display:grid; place-items:center;
  font-weight:900;
  box-shadow: var(--shadow2);
}
.stats{
  display:flex; gap:10px; flex-wrap:wrap;
}
.stat{
  padding: 6px 10px;
  border-radius: 999px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.03);
  color: var(--muted);
  font-size: 13px;
}
.stat b{color:var(--text)}

.hashtag{
  color: var(--accent);
  font-weight: 700;
}
.hashtag:hover{
  text-decoration: underline;
}

.mention{
  color: var(--accent2);
  font-weight: 700;
}
.mention:hover{
  text-decoration: underline;
}

.autocomplete{
  position: relative;
}
.ac-list{
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  border: 1px solid var(--border);
  background: rgba(15,22,33,.98);
  border-radius: 14px;
  box-shadow: var(--shadow2);
  overflow: hidden;
  z-index: 50;
}
.ac-item{
  padding: 10px 12px;
  cursor: pointer;
  display:flex;
  justify-content:space-between;
  gap: 10px;
}
.ac-item:hover, .ac-item.active{
  background: rgba(255,255,255,.06);
}
.ac-left b{display:block}
.ac-left span{color: var(--muted); font-size: 13px}
.ac-right{color: var(--muted); font-size: 13px}
