:root{
  --bg:#0b0f17;
  --bg2:#070a10;
  --panel:rgba(17,24,39,.72);
  --panel2:rgba(17,24,39,.92);
  --text:#e5e7eb;
  --muted:#9ca3af;
  --blue:#3b82f6;
  --green:#22c55e;
  --red:#ef4444;
  --line:rgba(255,255,255,.10);
  --shadow: 0 12px 40px rgba(0,0,0,.45);
  --radius:22px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}
*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background: radial-gradient(1100px 600px at 20% -10%, rgba(59,130,246,.18), transparent 60%),
              radial-gradient(900px 500px at 90% 10%, rgba(239,68,68,.10), transparent 55%),
              linear-gradient(180deg, var(--bg), var(--bg2));
  color:var(--text);
}
a{ color:inherit; }
.wrap{ max-width: 980px; margin:0 auto; padding: 16px 14px calc(92px + var(--safe-bottom)); }
.header{
  position: sticky; top:0;
  padding-top: calc(10px + var(--safe-top));
  padding-bottom: 10px;
  backdrop-filter: blur(18px);
  background: linear-gradient(180deg, rgba(11,15,23,.88), rgba(11,15,23,.55));
  border-bottom: 1px solid rgba(255,255,255,.06);
  z-index: 30;
}
.header .inner{
  max-width: 980px; margin:0 auto; padding: 0 14px;
  display:flex; align-items:center; justify-content:space-between; gap:14px;
}
.brand{ display:flex; align-items:center; gap:12px; min-width: 0; }
.brand .mark{
  width:44px; height:44px; border-radius: 14px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.10);
  display:grid; place-items:center;
  overflow:hidden;
}
.brand .mark img{ width:100%; height:100%; object-fit:cover; }
.brand h1{ font-size: 18px; margin:0; letter-spacing:.2px; }
.brand p{ margin:2px 0 0; font-size: 12px; color: var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.pill{
  display:flex; align-items:center; gap:8px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(17,24,39,.68);
  color: var(--text);
  font-size: 12px;
  user-select:none;
}
.dot{ width:8px; height:8px; border-radius: 50%; background: var(--green); }
.dot.wait{ background: rgba(156,163,175,.9); animation: pulse 1.1s infinite; }
@keyframes pulse { 0%{ opacity:.35 } 50%{ opacity:1 } 100%{ opacity:.35 } }

.grid{
  display:grid;
  grid-template-columns: 1.25fr .9fr;
  gap: 14px;
}
@media (max-width: 860px){
  .grid{ grid-template-columns: 1fr; }
}
.card{
  border: 1px solid rgba(255,255,255,.08);
  background: var(--panel);
  backdrop-filter: blur(18px);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card .pad{ padding: 14px; }
.titleRow{ display:flex; align-items:center; justify-content:space-between; gap:10px; }
.h2{ margin:0; font-size: 14px; letter-spacing:.2px; color: rgba(229,231,235,.95); }
.muted{ color: var(--muted); font-size: 12px; }
.row{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.btn{
  appearance:none; border:0; cursor:pointer;
  padding: 11px 12px; border-radius: 16px;
  background: rgba(59,130,246,.92);
  color: white; font-weight: 700;
  box-shadow: 0 10px 22px rgba(59,130,246,.22);
}
.btn:active{ transform: translateY(1px); }
.btn.ghost{
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  box-shadow:none;
}
.btn.danger{
  background: rgba(239,68,68,.88);
  box-shadow: 0 10px 22px rgba(239,68,68,.18);
}
.input, textarea{
  width:100%;
  background: rgba(0,0,0,.22);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 16px;
  padding: 11px 12px;
  color: var(--text);
  outline:none;
}
textarea{ min-height: 92px; resize: vertical; }
.badge{
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
}
.badge.blue{ background: rgba(59,130,246,.16); border-color: rgba(59,130,246,.28); }
.badge.ok{ background: rgba(34,197,94,.14); border-color: rgba(34,197,94,.25); }
.divider{ height:1px; background: rgba(255,255,255,.08); margin: 12px 0; }

.post{
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
}
.post .meta{ display:flex; align-items:flex-start; justify-content:space-between; gap:10px; }
.post .meta small{ color: var(--muted); font-size: 12px; }
.post p{ margin:10px 0 0; white-space: pre-wrap; }
.actions{ display:flex; gap:10px; margin-top: 10px; flex-wrap:wrap; }
.iconbtn{
  cursor:pointer;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(17,24,39,.50);
  user-select:none;
}
.iconbtn:hover{ background: rgba(17,24,39,.70); }

.nav{
  position: fixed; left:0; right:0; bottom:0;
  padding: 10px 12px calc(10px + var(--safe-bottom));
  background: rgba(11,15,23,.76);
  backdrop-filter: blur(18px);
  border-top: 1px solid rgba(255,255,255,.08);
  z-index: 40;
}
.nav .tabs{
  max-width: 980px; margin:0 auto;
  display:grid; grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.tab{
  cursor:pointer; border:0;
  border-radius: 18px;
  padding: 10px 10px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.10);
  color: var(--text);
  font-weight: 700;
}
.tab.active{
  background: rgba(59,130,246,.18);
  border-color: rgba(59,130,246,.35);
}

.toast{
  position: fixed;
  left:50%; transform: translateX(-50%);
  bottom: calc(96px + var(--safe-bottom));
  padding: 10px 12px;
  border-radius: 999px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(17,24,39,.92);
  font-size: 12px;
  display:none;
  z-index: 60;
}
.toast.show{ display:block; }

.modal{
  position: fixed; inset:0;
  display:none; align-items:center; justify-content:center;
  background: rgba(0,0,0,.55);
  padding: 18px;
  z-index: 80;
}
.modal.open{ display:flex; }
.modal .box{
  width: min(620px, 100%);
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(11,15,23,.96);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.modal .box .pad{ padding: 14px; }

/* Tiles */
.tiles{
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 12px;
}
@media (max-width: 520px){
  .tiles{ grid-template-columns: 1fr; }
}
.tile{
  cursor:pointer;
  text-align:left;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,.10);
  background: linear-gradient(180deg, rgba(59,130,246,.14), rgba(255,255,255,.03));
  padding: 14px;
  display:flex;
  gap:12px;
  align-items:center;
  box-shadow: 0 18px 55px rgba(0,0,0,.35);
}
.tile:active{ transform: translateY(1px); }
.tileIcon{
  width: 44px; height: 44px;
  border-radius: 16px;
  display:grid; place-items:center;
  background: rgba(0,0,0,.25);
  border: 1px solid rgba(255,255,255,.12);
  font-size: 20px;
}
.tileTitle{ font-weight: 900; letter-spacing:.2px; }
.tileSub{ font-size: 12px; color: var(--muted); margin-top:2px; }

/* v0.4.0 */
.heroGlow{
  position: absolute;
  inset: -120px -80px auto -80px;
  height: 260px;
  background: radial-gradient(closest-side, rgba(59,130,246,.30), rgba(0,0,0,0));
  filter: blur(10px);
  pointer-events:none;
  z-index:0;
}
.wrap{ position:relative; }
.card{ position:relative; z-index:1; }

.stats{
  display:grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 10px;
  margin-bottom: 10px;
}
@media (max-width: 980px){ .stats{ grid-template-columns: repeat(2,1fr);} }
.stat{
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.10);
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(0,0,0,.14));
  padding: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,.38);
  min-height: 72px;
  display:flex;
  gap:10px;
  align-items:center;
}
.statIcon{
  width: 42px; height: 42px;
  border-radius: 16px;
  display:grid; place-items:center;
  background: rgba(59,130,246,.18);
  border: 1px solid rgba(255,255,255,.12);
  font-size: 18px;
  flex: 0 0 auto;
}
.statNum{ font-size: 18px; font-weight: 900; letter-spacing:.2px; }
.statLab{ font-size: 12px; color: var(--muted); margin-top:2px; }

.filters{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
  margin-top: 8px;
}
.select{
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.20);
  color: var(--text);
  padding: 10px 12px;
  outline:none;
}

.imgPreview{
  margin-top: 10px;
  border-radius: 18px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.18);
  display:none;
}
.imgPreview img{ width:100%; height:auto; display:block; }

.ownerPanel{
  display:grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.row2{ display:grid; grid-template-columns: 1fr 1fr; gap:10px; }
@media (max-width:520px){ .row2{ grid-template-columns: 1fr; } }
