:root {
  --bg: #0d1117;
  --panel: #161b22;
  --panel-2: #1c2230;
  --border: #2a3140;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #3b82f6;
  --accent-2: #2563eb;
  --ok: #3fb950;
  --warn: #d29922;
  --err: #f85149;
  --radius: 12px;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f8fa; --panel: #fff; --panel-2: #f0f3f7; --border: #d0d7de;
    --text: #1f2328; --muted: #57606a;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", Tahoma, "Noto Naskh Arabic", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--border);
  background: var(--panel); position: sticky; top: 0; z-index: 5;
}
.brand { font-weight: 700; font-size: 1.15rem; }
.brand.big { font-size: 1.6rem; }
.who { display: flex; align-items: center; gap: 12px; color: var(--muted); }

main { max-width: 760px; margin: 0 auto; padding: 18px 16px 64px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chip {
  border: 1px solid var(--border); background: var(--panel);
  color: var(--text); border-radius: 999px; padding: 6px 16px;
  font-size: .92rem; cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }

.feed-wrap { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.feed-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.feed-head h2 { font-size: 1.05rem; margin: 0; }
.status { font-size: .8rem; color: var(--muted); }
.status.live { color: var(--ok); }
.status.down { color: var(--err); }

.feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.feed li {
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px;
  /* reduced-motion safe: start visible, animation only enhances */
  opacity: 1;
}
@media (prefers-reduced-motion: no-preference) {
  .feed li.fresh { animation: rise .25s ease-out; }
  @keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}
.feed li .time { color: var(--muted); font-size: .78rem; }
.feed li .body { white-space: pre-wrap; word-break: break-word; }

.empty { color: var(--muted); text-align: center; padding: 18px; }

.publish { margin-top: 18px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.publish h3 { margin: 0 0 8px; font-size: 1rem; }
textarea {
  width: 100%; resize: vertical; background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px; padding: 10px; font: inherit;
}
.pub-row { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; gap: 12px; }
.pub-topic { color: var(--muted); font-size: .85rem; }
.pub-err { color: var(--err); margin: 8px 0 0; font-size: .9rem; }

button, .primary, .ghost {
  font: inherit; cursor: pointer; border-radius: 10px; padding: 8px 18px; border: 1px solid var(--border);
}
.primary { background: var(--accent-2); color: #fff; border-color: var(--accent-2); text-decoration: none; display: inline-block; }
.primary:hover { background: var(--accent); }
.ghost { background: transparent; color: var(--muted); }

.signin { display: grid; place-items: center; min-height: 70vh; padding: 20px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; text-align: center; max-width: 380px; }
.card .brand { margin-bottom: 14px; }
.card p { color: var(--muted); margin: 0 0 20px; }
.signin-hint { font-size: 12px; margin-top: 14px !important; line-height: 1.6; }
