* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }
button { border: 1px solid var(--line); background: var(--panel); border-radius: 6px; padding: 4px 12px; cursor: pointer; }
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button.danger { color: var(--err); }
button.link { border: none; background: none; padding: 2px 4px; color: var(--muted); }
button.link:hover { color: var(--accent); }
button:disabled { opacity: .45; cursor: default; }
input, select, textarea { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 6px 9px; }
textarea { resize: vertical; width: 100%; }
a { color: var(--accent); }
.muted { color: var(--muted); } .small { font-size: .86em; }
.birds { flex: 1; display: grid; grid-template-columns: 210px minmax(0, 680px) 290px; gap: 18px; justify-content: center; padding: 16px; }
@media (max-width: 1100px) { .birds { grid-template-columns: 190px minmax(0, 1fr); } .b-side { display: none; } }
@media (max-width: 700px) { .birds { grid-template-columns: 1fr; padding: 10px; } .b-nav { flex-direction: row !important; flex-wrap: wrap; position: static !important; } }
.b-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 12px; align-self: start; }
.b-nav a { padding: 8px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; display: flex; gap: 8px; align-items: center; }
.b-nav a:hover { background: var(--chip); }
.b-nav a.on { background: var(--accent-soft); font-weight: 600; }
.b-nav a span { width: 20px; text-align: center; }
.b-main { min-width: 0; }
.b-side { align-self: start; position: sticky; top: 12px; display: flex; flex-direction: column; gap: 12px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.card h3, .card h4 { margin: 0 0 8px; }
.seg { display: inline-flex; background: var(--chip); border-radius: 8px; padding: 2px; gap: 2px; margin-bottom: 10px; }
.seg button { border: none; background: transparent; color: var(--muted); }
.seg button.on { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.composer { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.composer .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.posts { display: flex; flex-direction: column; }
.post { display: grid; grid-template-columns: 40px 1fr; gap: 10px; padding: 12px 14px; background: var(--panel); border: 1px solid var(--line); border-top: none; }
.post:first-child { border-top: 1px solid var(--line); border-radius: 12px 12px 0 0; }
.post:last-child { border-radius: 0 0 12px 12px; }
.post:only-child { border-radius: 12px; }
.post.focus { background: var(--accent-soft); }
.post.hidden-post { opacity: .7; }
.av { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: flex; align-items: center; justify-content: center;
  font-weight: 700; text-transform: uppercase; font-size: .9em; text-decoration: none; }
.av.small { width: 28px; height: 28px; font-size: .72em; }
.p-head { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.p-head a.name { color: var(--ink); font-weight: 600; text-decoration: none; }
.p-head .h { color: var(--muted); font-size: .9em; }
.p-body { white-space: pre-wrap; word-wrap: break-word; margin: 4px 0 6px; line-height: 1.45; }
.p-acts { display: flex; gap: 12px; }
.chip { display: inline-block; font-size: .78em; padding: 0 8px; border-radius: 99px; background: var(--chip); color: var(--muted); }
.chip.bad { color: var(--err); } .chip.acc { color: var(--accent); background: var(--accent-soft); }
.more { text-align: center; margin: 12px 0; }
.profile-head { display: flex; gap: 14px; align-items: center; }
.profile-head .av { width: 64px; height: 64px; font-size: 1.3em; }
.facts { display: grid; grid-template-columns: 120px 1fr; gap: 4px 10px; margin-top: 10px; font-size: .92em; }
.facts dt { color: var(--muted); } .facts dd { margin: 0; }
.acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.list .li { display: flex; gap: 10px; align-items: center; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.list .li:last-child { border-bottom: none; }
.list .li .grow { flex: 1; min-width: 0; }
.list .li a.t { color: var(--ink); font-weight: 600; text-decoration: none; }
.chat { display: grid; grid-template-columns: 230px 1fr; gap: 12px; min-height: 60vh; }
@media (max-width: 700px) { .chat { grid-template-columns: 1fr; } }
.convs .li { cursor: pointer; border-radius: 8px; padding: 8px; }
.convs .li.on { background: var(--accent-soft); }
.thread { display: flex; flex-direction: column; min-height: 60vh; }
.msgs { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 6px; padding: 4px; max-height: 62vh; }
.msg { max-width: 78%; padding: 7px 11px; border-radius: 14px; background: var(--chip); white-space: pre-wrap; word-wrap: break-word; }
.msg.mine { align-self: flex-end; background: var(--accent); color: var(--accent-ink); }
.msg .t { display: block; font-size: .72em; opacity: .7; margin-top: 2px; }
.send { display: flex; gap: 8px; margin-top: 8px; align-items: flex-end; }
.form { display: grid; grid-template-columns: 140px 1fr; gap: 8px 10px; align-items: center; }
.form label { color: var(--muted); }
#toasts { position: fixed; bottom: 16px; right: 16px; display: flex; flex-direction: column; gap: 6px; z-index: 95; }
.toast { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; box-shadow: 0 4px 14px rgba(0,0,0,.15); max-width: 420px; }
.toast.warning { border-color: var(--warn); } .toast.error { border-color: var(--err); }
.empty { text-align: center; padding: 30px 10px; color: var(--muted); }
.av.img { background: var(--chip); overflow: hidden; padding: 0; }
.av.img img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* groups: pictures, a group that needs its manager, the people picker */
.gpic { width: 28px; height: 28px; border-radius: 8px; background: var(--chip); display: inline-flex; align-items: center; justify-content: center;
  overflow: hidden; flex: none; font-size: .95em; vertical-align: middle; }
.gpic.big { width: 56px; height: 56px; font-size: 1.6em; border-radius: 12px; }
.gpic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.title-line { display: flex; gap: 12px; align-items: center; }
.li.attn { background: color-mix(in srgb, var(--err) 8%, transparent); border-radius: 8px; }
.chip.bad { color: var(--err); text-decoration: none; }
.side-g { display: flex; align-items: center; gap: 4px; margin: 3px 0; }
.side-g a { display: inline-flex; align-items: center; gap: 6px; }
.side-g .gpic { width: 20px; height: 20px; font-size: .75em; border-radius: 5px; }
.picker { position: absolute; left: 0; right: 0; top: calc(100% + 2px); z-index: 30; background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.18); max-height: 320px; overflow: auto; padding: 4px 0; }
.picker .pk { display: flex; gap: 8px; align-items: center; padding: 5px 10px; cursor: pointer; }
.picker .pk:hover, .picker .pk.cur { background: var(--accent-soft); }
.attn-card { border-color: var(--err); border-width: 2px; }
