/* Skybee 🐝 */
:root, [data-theme="dark"] {
  --bg: #0f1218; --panel: #171b23; --hover: #1d222c; --line: #262c38; --text: #e6e9ef;
  --muted: #8a93a6; --accent: #f5b301; --accent-ink: #1a1400; --link: #4c9bff;
  --like: #ff4d6d; --repost: #22c55e; --danger: #ef4444;
}
[data-theme="dim"] { --bg: #161e27; --panel: #1e2833; --hover: #24303c; --line: #2e3b49; --text: #e3e8ee; --muted: #8b98a8; }
[data-theme="light"] { --bg: #ffffff; --panel: #f6f7f9; --hover: #f0f2f5; --line: #e3e6ea; --text: #0f1419; --muted: #5b6573; --accent-ink: #1a1400; --link: #0a66d8; }

* { box-sizing: border-box; }
html { color-scheme: dark; }
[data-theme="light"] { color-scheme: light; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-tap-highlight-color: transparent; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; cursor: pointer; color: inherit; }
button:disabled { opacity: .5; cursor: default; }
input, textarea, select { font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
textarea { resize: vertical; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
h1, h2, h3 { margin: 0; }
h3 { font-size: 16px; margin-bottom: 8px; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- buttons ---------- */
.btn { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 999px; padding: 8px 18px; font-weight: 600; }
.btn.danger { background: var(--danger); color: #fff; }
.ghost { background: none; border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: 7px 14px; display: inline-flex; align-items: center; gap: 6px; }
.ghost:hover { background: var(--hover); text-decoration: none; }
.sm { padding: 5px 12px; font-size: 14px; }
.icon { padding: 6px 10px; }
.wide { width: 100%; justify-content: center; display: flex; }
.linklike { background: none; border: 0; color: var(--link); padding: 0; }
.danger { color: var(--danger); }

/* ---------- layout ---------- */
#app { display: grid; grid-template-columns: 240px minmax(0, 600px) 300px; justify-content: center; min-height: 100vh; }
main { border-left: 1px solid var(--line); border-right: 1px solid var(--line); min-height: 100vh; padding-bottom: 80px; }
nav.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 2px; padding: 12px;
  overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; } /* a low window: the menu scrolls on its own */
nav.side > * { flex-shrink: 0; }
nav.side a { display: flex; align-items: center; gap: 14px; padding: 10px 14px; border-radius: 999px; color: var(--text); font-size: 18px; }
nav.side a:hover { background: var(--hover); text-decoration: none; }
nav.side a.on { font-weight: 700; }
nav.side .logo { font-size: 24px; font-weight: 800; margin-bottom: 8px; }
.compose-side { margin-top: 12px; padding: 12px; font-size: 16px; }
.me { margin-top: auto; display: flex; align-items: center; gap: 10px; background: none; border: 0; border-radius: 999px; padding: 8px 10px; text-align: left; min-width: 0; }
.me:hover { background: var(--hover); }
.me .nl { display: flex; flex-direction: column; min-width: 0; }
.me b, .me small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me small { color: var(--muted); }
.ni { position: relative; display: inline-block; width: 26px; text-align: center; }
.dot { position: absolute; top: -6px; right: -10px; background: var(--accent); color: var(--accent-ink); font-style: normal; font-size: 11px; font-weight: 700;
  border-radius: 999px; padding: 0 5px; min-width: 18px; line-height: 18px; text-align: center; }
.dot:empty, .dot[hidden] { display: none; }
aside.right { position: sticky; top: 0; height: 100vh; padding: 12px 16px; }
nav.bottom, .fab, .only-mobile { display: none; }

@media (max-width: 1100px) { #app { grid-template-columns: 80px minmax(0, 600px); } aside.right { display: none; } nav.side .nl, nav.side .logo span, .compose-side span { display: none; } nav.side a, .me { justify-content: center; } }
@media (max-width: 640px) {
  #app { display: block; }
  /* the side menu becomes a drawer opened with the ☰ button */
  nav.side { position: fixed; z-index: 60; left: 0; top: 0; bottom: 0; height: auto; width: min(300px, 84vw); background: var(--bg); border-right: 1px solid var(--line);
    overflow-y: auto; transform: translateX(-105%); transition: transform .2s; padding-bottom: calc(12px + var(--sab)); }
  body.drawer nav.side { transform: none; }
  body.drawer::after { content: ""; position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.55); }
  nav.side .nl, nav.side .logo span, .compose-side span { display: inline; }
  nav.side a, .me { justify-content: flex-start; }
  nav.side .me .nl { display: flex; }
  .only-mobile { display: inline-flex; }
  main { border: 0; padding-bottom: calc(80px + var(--sab)); }
  nav.bottom { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; background: var(--bg); border-top: 1px solid var(--line);
    padding: 6px 0 calc(6px + var(--sab)); justify-content: space-around; }
  nav.bottom a { font-size: 22px; padding: 6px 14px; color: var(--text); opacity: .65; }
  nav.bottom a.on { opacity: 1; }
  .fab { display: block; position: fixed; right: 16px; bottom: calc(76px + var(--sab)); z-index: 21; width: 56px; height: 56px; border-radius: 50%;
    border: 0; background: var(--accent); font-size: 22px; box-shadow: 0 4px 16px rgba(0,0,0,.35); }
}

/* ---------- common ---------- */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 10px; padding: 10px 16px; min-height: 54px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar h2 { font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; margin-top: 12px; }
.row.wrap { flex-wrap: wrap; }
.row.wrap select { width: auto; flex: 1; }
.col { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.pad { padding: 16px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.err { color: var(--danger); font-size: 14px; min-height: 1em; margin: 6px 0; }
.hint { color: var(--muted); font-size: 13px; }
.clip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin: 16px; }
.card > * + * { margin-top: 10px; }
.pill { font-size: 11px; background: var(--hover); color: var(--muted); border-radius: 6px; padding: 1px 6px; }
.badge { background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 700; border-radius: 999px; padding: 0 7px; }
.tabs { display: flex; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs > * { flex: 1 0 auto; background: none; border: 0; padding: 14px 16px; color: var(--muted); font-weight: 600; text-align: center; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs > *:hover { background: var(--hover); text-decoration: none; }
.tabs > .on { color: var(--text); border-bottom-color: var(--accent); }
.seg { display: flex; gap: 6px; }
.seg button { flex: 1; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
.seg button.on { border-color: var(--accent); }
.searchbar { padding: 10px 16px; }
.searchbar input { border-radius: 999px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; color: var(--text); font-size: 14px; }
.rowlink { display: block; padding: 8px 0; color: var(--text); }
.field { display: block; margin: 10px 0; font-size: 13px; color: var(--muted); }
.field input, .field textarea { margin-top: 4px; }
.radio { display: flex; gap: 8px; align-items: center; padding: 6px 0; }
.radio input { width: auto; flex: none; }
.card-row { display: flex; gap: 12px; align-items: flex-start; }
.card-row b, .card-row small { display: block; }

/* ---------- login ---------- */
.login { grid-column: 1 / -1; max-width: 420px; width: 100%; margin: 8vh auto; padding: 16px; text-align: center; }
.login h1 { font-size: 40px; }
.loginform { text-align: left; display: flex; flex-direction: column; gap: 10px; }
.loginform > * { margin: 0; }
.loginform .seg label { flex: 1; display: flex; gap: 6px; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 10px; padding: 8px 6px; font-size: 14px; cursor: pointer; }
.loginform .seg label:has(:checked) { border-color: var(--accent); }
.loginform .seg input, .showpass input { width: auto; }
.showpass { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); }
.loginform input { font-size: 16px; } /* smaller text makes iOS zoom the page on focus */

/* ---------- avatars ---------- */
.avatar { border-radius: 50%; object-fit: cover; flex: none; display: block; background: var(--line); }
.avatar.ph { display: grid; place-items: center; color: var(--muted); font-weight: 700; }

/* ---------- post ---------- */
.post { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
.post:hover { background: color-mix(in srgb, var(--hover) 50%, transparent); }
.post .left { display: flex; flex-direction: column; align-items: center; }
.tline { flex: 1; width: 2px; background: var(--line); margin-top: 4px; }
.post.has-line { border-bottom: 0; }
.post .body { min-width: 0; flex: 1; }
.meta { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; gap: 4px; align-items: center; }
.meta b { color: var(--text); }
.meta a { color: inherit; }
.reason { color: var(--muted); font-size: 13px; font-weight: 600; margin-bottom: 2px; display: flex; gap: 4px; align-items: center; }
.reason svg { width: 14px; height: 14px; }
.reason a { color: inherit; }
.text { white-space: pre-wrap; overflow-wrap: anywhere; margin: 2px 0 8px; }
.text.big { font-size: 18px; margin: 12px 0; }
.actions { display: flex; justify-content: space-between; max-width: 420px; color: var(--muted); margin-left: -8px; }
.actions.big { max-width: none; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 4px 0; margin: 0; }
.actions button { background: none; border: 0; display: flex; align-items: center; gap: 5px; padding: 6px 8px; border-radius: 999px; font-size: 13px; color: inherit; }
.actions button:hover { background: var(--hover); }
.actions .on-like { color: var(--like); } .actions .on-like svg { fill: var(--like); }
.actions .on-repost { color: var(--repost); }
.actions .on-bm { color: var(--accent); } .actions .on-bm svg { fill: var(--accent); }
.post.focus { flex-direction: column; cursor: default; }
.post.focus .who { flex: 1; display: flex; flex-direction: column; }
.stats { display: flex; gap: 16px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.stats a { color: var(--muted); } .stats b { color: var(--text); }
.reply { border-left: 0; }
.reply.d1 { margin-left: 18px; } .reply.d2 { margin-left: 30px; } .reply.d3 { margin-left: 40px; } .reply.d4 { margin-left: 48px; }
.replybox { display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); cursor: text; }
.gate { padding: 10px 16px; border-bottom: 1px solid var(--line); }
.post.mw-hidden > :not(.mw-note) { display: none; }
.mw-note { color: var(--muted); text-align: left; overflow-wrap: anywhere; }

/* ---------- embeds ---------- */
.imgs { display: grid; gap: 4px; margin-bottom: 8px; border-radius: 12px; overflow: hidden; }
.imgs.n2, .imgs.n4 { grid-template-columns: 1fr 1fr; }
.imgs.n3 { grid-template-columns: 1fr 1fr; } .imgs.n3 img:first-child { grid-row: span 2; height: 100%; }
.imgs img { width: 100%; max-height: 520px; object-fit: cover; display: block; cursor: zoom-in; background: var(--line); }
.imgs.n2 img, .imgs.n3 img, .imgs.n4 img { aspect-ratio: 1; max-height: 300px; }
.video { width: 100%; max-height: 520px; margin-bottom: 8px; border-radius: 12px; overflow: hidden; background: #000; }
.video video { width: 100%; height: 100%; display: block; }
.video.gif { position: relative; cursor: pointer; }
.video.gif::after { content: "GIF"; position: absolute; left: 8px; bottom: 8px; background: rgba(0,0,0,.7); color: #fff; font-size: 12px; font-weight: 700; padding: 1px 6px; border-radius: 6px; pointer-events: none; }
.ext { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 8px; color: var(--text); position: relative; }
.ext:hover { text-decoration: none; background: var(--hover); }
.ext img { width: 100%; max-height: 260px; object-fit: cover; }
.ext div { padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.ext small { color: var(--muted); }
.quote { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; color: var(--text); display: block; }
.quote:hover { background: var(--hover); text-decoration: none; }
.quote .meta .avatar { display: inline-block; }
.quote.card-row { display: flex; }
.blurbox { position: relative; margin-bottom: 8px; border-radius: 12px; overflow: hidden; }
.blurbox .blurred { filter: blur(28px); pointer-events: none; }
.blurbox.shown .blurred { filter: none; pointer-events: auto; }
.unblur { position: absolute; inset: auto 12px 12px 12px; background: var(--panel); justify-content: center; }

/* ---------- actors / lists ---------- */
.actor { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-bottom: 1px solid var(--line); cursor: pointer; color: var(--text); width: 100%; text-align: left; }
.actor:hover { background: var(--hover); text-decoration: none; }
.actor.plain { background: none; border: 0; border-bottom: 1px solid var(--line); }
.actor .who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.actor .desc { font-size: 14px; margin-top: 4px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.actor.unread { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.actor.static { cursor: default; align-items: center; }
.actor.static:hover { background: none; }
.accrow { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 6px 0; }
.accrow .who { flex: 1; min-width: 120px; display: flex; flex-direction: column; overflow-wrap: anywhere; }

/* ---------- profile ---------- */
.banner { height: 150px; background: linear-gradient(135deg, #f5b301, #4c9bff) center/cover; }
.phead { padding: 0 16px 12px; }
.phead .bigava { margin-top: -44px; border: 4px solid var(--bg); border-radius: 50%; cursor: zoom-in; }
.phead h1 { font-size: 26px; margin-top: 8px; }
.counts { display: flex; gap: 16px; margin: 10px 0; font-size: 14px; color: var(--muted); }
.counts a { color: var(--muted); } .counts b { color: var(--text); }
.bio { white-space: pre-wrap; overflow-wrap: anywhere; margin: 8px 0; }

/* ---------- notifications ---------- */
.notif { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
.notif:hover { background: var(--hover); }
.notif.unread, .nwrap.unread { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.nicon { width: 44px; text-align: right; font-size: 22px; }
.nicon.r-like, .nicon.r-like-via-repost { color: var(--like); }
.avas { display: flex; gap: 4px; margin-bottom: 6px; }
.notif .muted.clip { margin-top: 4px; }
.ntag { padding: 8px 16px 0 72px; }
.nwrap .post { border-top: 0; }

/* ---------- chat ---------- */
.chat { padding: 12px 16px 90px; }
.msgs { display: flex; flex-direction: column; gap: 4px; }
.msg { display: flex; }
.msg.mine { justify-content: flex-end; }
.bubble { max-width: 75%; padding: 8px 12px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.mine .bubble { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.msg.mine .bubble a { color: inherit; text-decoration: underline; }
.chatbar { position: fixed; bottom: 0; width: min(600px, 100%); display: flex; gap: 8px; padding: 10px 16px calc(10px + var(--sab)); background: var(--bg); border-top: 1px solid var(--line); z-index: 15; }
.chatbar textarea { border-radius: 20px; resize: none; max-height: 120px; }
@media (max-width: 640px) { .chatbar { bottom: calc(58px + var(--sab)); } }
.more { margin: 12px auto; display: flex; }

/* ---------- modal / menu / toast ---------- */
.modal-bg { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.55); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 12px; overflow-y: auto; }
.modal { background: var(--bg); border: 1px solid var(--line); border-radius: 16px; padding: 16px; width: 100%; max-width: 420px; }
.modal.wide { max-width: 600px; }
.modal-bg.dark { background: rgba(0,0,0,.92); }
.modal-bg.dark .modal { background: none; border: 0; max-width: 95vw; }
.lb { position: relative; text-align: center; }
.lb-stage { overflow: hidden; display: flex; align-items: center; justify-content: center; min-height: 60vh; touch-action: none; }
.lb img { max-width: 100%; max-height: 80vh; border-radius: 8px; cursor: zoom-in; transform-origin: center; transition: transform .15s; user-select: none; }
.lb img.zoomed { cursor: grab; transition: none; }
.lb-bar { display: flex; align-items: center; gap: 8px; color: #ddd; padding: 0 4px 8px; }
.lb .lb-btn { position: static; width: 40px; height: 40px; font-size: 18px; }
.lb .alt { color: #ddd; font-size: 14px; }
.lb button { position: absolute; top: 45%; background: rgba(0,0,0,.6); color: #fff; border: 0; font-size: 32px; border-radius: 50%; width: 48px; height: 48px; }
.lb-prev { left: 4px; } .lb-next { right: 4px; }
.popmenu { position: absolute; z-index: 200; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 6px; min-width: 220px; box-shadow: 0 8px 30px rgba(0,0,0,.35); }
.popmenu button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 9px 12px; border-radius: 8px; }
.popmenu button:hover { background: var(--hover); }
.popmenu hr { margin: 4px 0; }
.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 300; background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-size: 14px; transition: opacity .4s; }
.toast.out { opacity: 0; }

/* ---------- composer ---------- */
.composer textarea { border: 0; font-size: 18px; min-height: 140px; padding: 12px 0; resize: none; }
.composer textarea:focus { outline: 0; }
.composer .ctx { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.composer .tools { border-top: 1px solid var(--line); padding-top: 10px; }
.composer .tools, .composer .tools .row { flex-wrap: wrap; }
.gatebox { border-top: 1px solid var(--line); padding: 10px 0; }
.modal > .gatebox { border-top: 0; }
.gate-rules { margin-top: 8px; }
.composer select { width: auto; padding: 6px 8px; }
.composer .counter.over { color: var(--danger); font-weight: 700; }
.previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.pvimg { position: relative; }
.pvimg img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; }
.pvimg input { font-size: 12px; padding: 6px 8px; margin-top: 4px; }
.previews.one { grid-template-columns: 1fr; }
.previews.one img, .pvimg video { width: 100%; aspect-ratio: auto; max-height: 320px; object-fit: contain; border-radius: 10px; background: #000; display: block; }
.x { position: absolute; top: 6px; right: 6px; background: rgba(0,0,0,.7); color: #fff; border: 0; border-radius: 50%; width: 26px; height: 26px; }
label.icon { cursor: pointer; }

/* ---------- loading ---------- */
.sentinel { padding: 24px; display: flex; justify-content: center; }
.spinner { width: 26px; height: 26px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- additions: verification, lists, chat reactions, thread composer ---------- */
.verified { color: var(--link); font-size: .85em; }
.bigemoji { font-size: 32px; line-height: 1; flex: none; }
.results:empty { display: none; }
.results { max-height: 50vh; overflow-y: auto; }
.searchbar + .results { border-bottom: 1px solid var(--line); }
.hidden-replies summary { cursor: pointer; }
.filter { padding: 8px 0; } .filter .seg { margin-top: 6px; }
.seg label { flex: 1; display: flex; gap: 6px; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 10px; padding: 8px 6px; cursor: pointer; }
.seg label:has(:checked) { border-color: var(--accent); } .seg input { width: auto; }
code { background: var(--hover); border-radius: 4px; padding: 1px 4px; overflow-wrap: anywhere; font-size: .9em; }
a.pill:hover { text-decoration: none; }
aside.right { overflow-y: auto; } aside.right .card { margin: 12px 0; }
.sugg { display: flex; gap: 10px; align-items: center; padding: 6px 0; color: var(--text); min-width: 0; }
.sugg .who { display: flex; flex-direction: column; min-width: 0; }
.mcol { display: flex; flex-direction: column; max-width: 75%; min-width: 0; }
.msg.mine .mcol { align-items: flex-end; }
.mcol .bubble { max-width: 100%; cursor: pointer; }
.mcol .bubble:empty { display: none; }
.membed { width: min(360px, 100%); margin-top: 4px; }
.reacts { display: flex; gap: 4px; margin-top: 2px; }
.react { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; font-size: 13px; }
.react.on { border-color: var(--accent); }
.parts:empty { display: none; }
.part { display: flex; gap: 8px; align-items: center; padding: 8px 10px; margin: 6px 0; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; position: relative; }
.part:hover { background: var(--hover); }
.part .x { position: static; flex: none; }
.composer .mentions .actor { padding: 6px 4px; align-items: center; }

/* ---------- narrow screens: nothing may be wider than the page ---------- */
html, body { overflow-x: clip; max-width: 100%; } /* clip, not hidden: hidden turns body into a scroll box and the sticky side columns scroll away */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
main { overflow-x: clip; }
.seg { flex-wrap: wrap; }
.seg > * { flex: 1 1 auto; white-space: nowrap; overflow-wrap: normal; }
.card, .modal { min-width: 0; overflow-wrap: anywhere; }
/* the post header: a long name or handle is cut, the time always stays visible */
.meta > * { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.meta > a:first-child { flex: 0 1 auto; max-width: 62%; }
.meta > span { flex: 0 20 auto; }
.meta > a:last-child, .meta > .avatar { flex: none; overflow: visible; }
.reason { display: block; overflow-wrap: anywhere; }
.reason svg { vertical-align: -2px; }
/* iOS zooms the whole page (and keeps it zoomed) when a focused field has text smaller than 16px */
@media (max-width: 640px) { input, textarea, select, .pvimg input { font-size: max(16px, 1em); } }

/* ---------- every block fits the screen width: long words wrap, rows shrink ---------- */
.imgs.n2, .imgs.n3, .imgs.n4 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.imgs.n3 img:first-child { aspect-ratio: auto; max-height: none; }
.imgs img, .ext img, .video { max-width: 100%; }
.actions { max-width: 100%; }
.actions button { min-width: 0; flex: 0 1 auto; }
.actions button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post.focus .row { min-width: 0; }
.post.focus .who { min-width: 0; overflow: hidden; }
.post.focus .who a, .post.focus .who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post.focus .row > button { flex: none; }
.phead, .bio, .card-row .grow, .desc, .text, .ext, .quote, .bubble, .who { min-width: 0; overflow-wrap: anywhere; }
.phead a, .card-row a, .ext b, .ext small { overflow-wrap: anywhere; word-break: break-word; }
.phead .row.between { flex-wrap: wrap; }
.stats { flex-wrap: wrap; row-gap: 4px; }
.counts { flex-wrap: wrap; row-gap: 4px; }
.topbar h2 { min-width: 0; flex: 0 1 auto; }
.topbar > button { flex: none; }
@media (max-width: 400px) {
  .post { padding: 10px 12px; gap: 10px; }
  .actions { margin-left: -6px; }
  .actions button { padding: 6px 5px; gap: 3px; }
  .stats { gap: 10px; }
}
.pill { white-space: nowrap; display: inline-block; }

/* ---------- own profile card (right column) ---------- */
.sideprof { padding: 0; overflow: hidden; margin: 12px 16px; }
.sideprof > .spinner { margin: 24px auto; }
.sp-banner { display: block; height: 80px; background: linear-gradient(135deg, #f5b301, #4c9bff) center/cover; }
.sp-body { padding: 0 16px 16px; }
.sp-body > * + * { margin-top: 4px; }
.sp-ava { display: inline-block; margin-top: -32px; border: 3px solid var(--panel); border-radius: 50%; }
.sp-name { display: block; color: var(--text); font-size: 17px; }
.sp-counts { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--muted); margin-top: 8px !important; }
.sp-counts a { color: var(--muted); } .sp-counts b { color: var(--text); }
.sp-bio { white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; margin-top: 8px !important; }
.sp-btns { margin-top: 12px !important; }
.sp-btns > * { flex: 1; justify-content: center; }

/* ---------- settings ---------- */
.shead { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 24px 16px 16px; color: var(--text); text-align: center; overflow-wrap: anywhere; }
.shead:hover { text-decoration: none; }
.shead b { font-size: 22px; margin-top: 8px; }
.sgroup { border-bottom: 1px solid var(--line); padding: 4px 0; }
.sgroup:first-of-type { border-top: 1px solid var(--line); }
.srow { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; background: none; border: 0; color: var(--text); text-align: left; font-size: 1.05em; }
.srow:hover { background: var(--hover); text-decoration: none; }
.srow.danger { color: var(--danger); }
.sicon { flex: none; display: grid; place-items: center; width: 26px; color: var(--muted); }
.schev { color: var(--muted); } .schev svg { width: 18px; height: 18px; display: block; }
.savas { display: flex; } .savas .avatar + .avatar { margin-left: -8px; }
.savas .avatar { border: 2px solid var(--bg); }
.stoggle { display: flex; align-items: center; gap: 12px; padding: 8px 0; cursor: pointer; }
.stoggle small { display: block; margin-top: 2px; font-size: 13px; }
.stoggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.stoggle i { flex: none; width: 44px; height: 26px; border-radius: 999px; background: var(--line); position: relative; transition: background .15s; }
.stoggle i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; }
.stoggle input:checked + i { background: var(--accent); }
.stoggle input:checked + i::after { transform: translateX(18px); }
.stoggle input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }
.stoggle input:disabled + i { opacity: .45; }
.nprefrow { border-bottom: 1px solid var(--line); padding: 4px 0 10px; }
.nprefrow:last-of-type { border-bottom: 0; }
.nprefrow select { margin-top: 2px; }
kbd { background: var(--hover); border: 1px solid var(--line); border-radius: 5px; padding: 0 6px; font: inherit; font-size: .9em; }
/* reduce motion */
body.calm *, body.calm *::before, body.calm *::after { transition: none !important; animation-duration: .01s !important; scroll-behavior: auto !important; }
body.calm .spinner { animation-duration: .8s !important; }
/* link cards without the picture */
body.nolinkthumbs .ext img { display: none; }

/* ---------- Skybee look: status bubble, music, page colour, toy (js/flair.js) ---------- */
.banner { position: relative; }
/* page colour: the middle column (profile or post) takes one base colour (--sb) and it fades softly into the side menus.
   Dark and dim themes get its deep shade with light text, the light theme gets the colour as it is;
   --sb-ink (set in js/flair.js) is the text colour that reads on it.
   (the app colour, html.sb-theme, does not tint the page: it replaces the gold accent — see below) */
main.sb-tint, .sideprof.sb-tint { --bg: color-mix(in srgb, var(--sb) 56%, #000); --panel: color-mix(in srgb, var(--sb) 68%, #000); --hover: color-mix(in srgb, var(--sb) 78%, #000);
  --bg2: color-mix(in srgb, var(--sb2, var(--sb)) 56%, #000); --panel2: color-mix(in srgb, var(--sb2, var(--sb)) 68%, #000);
  --bg3: color-mix(in srgb, var(--sb3, var(--sb)) 56%, #000); --panel3: color-mix(in srgb, var(--sb3, var(--sb)) 68%, #000);
  --line: color-mix(in srgb, var(--sb) 92%, #000); --text: #fff; --muted: color-mix(in srgb, var(--sb) 30%, #fff); --link: color-mix(in srgb, var(--sb) 22%, #fff);
  --accent: color-mix(in srgb, var(--sb) 12%, #fff); --accent-ink: color-mix(in srgb, var(--sb) 55%, #000); }
[data-theme="dim"] main.sb-tint, [data-theme="dim"] .sideprof.sb-tint { --bg: color-mix(in srgb, var(--sb) 48%, #10161d); --panel: color-mix(in srgb, var(--sb) 58%, #10161d); --hover: color-mix(in srgb, var(--sb) 68%, #10161d);
  --bg2: color-mix(in srgb, var(--sb2, var(--sb)) 48%, #10161d); --panel2: color-mix(in srgb, var(--sb2, var(--sb)) 58%, #10161d);
  --bg3: color-mix(in srgb, var(--sb3, var(--sb)) 48%, #10161d); --panel3: color-mix(in srgb, var(--sb3, var(--sb)) 58%, #10161d); }
[data-theme="light"] main.sb-tint, [data-theme="light"] .sideprof.sb-tint { --bg: var(--sb); --panel: color-mix(in srgb, var(--sb) 90%, #000); --hover: color-mix(in srgb, var(--sb) 82%, #000);
  --bg2: var(--sb2, var(--sb)); --panel2: color-mix(in srgb, var(--sb2, var(--sb)) 90%, #000);
  --bg3: var(--sb3, var(--sb)); --panel3: color-mix(in srgb, var(--sb3, var(--sb)) 90%, #000);
  --line: color-mix(in srgb, var(--sb) 72%, #000); --text: var(--sb-ink); --muted: color-mix(in srgb, var(--sb-ink) 78%, var(--sb)); --link: var(--sb-ink);
  --accent: var(--sb-ink); --accent-ink: var(--sb); }
main.sb-tint .post a:not(.ghost):not(.btn), main.sb-tint .bio a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
/* the colour fades out of the column into the side menus: one wide layer behind it, solid over the column and easing out on both sides */
main.sb-tint { color: var(--text); border-color: transparent; position: relative; overflow: clip; overflow-clip-margin: 200px; }
main.sb-tint::before { content: ""; display: block; position: sticky; top: 0; z-index: -1; pointer-events: none; transition: background .25s;
  /* exactly one screen tall and stuck to the screen while the page scrolls under it: the flow is always in view
     (a layer as tall as the whole profile showed only a sliver of the gradient, so nothing seemed to move) */
  width: calc(100% + 400px); height: 100vh; height: 100lvh; margin: 0 -200px -100vh; margin-bottom: -100lvh;
  /* the profile gradient (--sb → --sb2 → --sb3) flows slowly to and fro; the mask fades it out to both sides */
  background: linear-gradient(125deg, var(--bg), var(--bg2), var(--bg3), var(--bg2), var(--bg)); background-size: 300% 300%; animation: sb-flow 14s ease-in-out infinite alternate;
  -webkit-mask-image: linear-gradient(90deg, transparent, rgba(0,0,0,.18) 70px, rgba(0,0,0,.5) 130px, rgba(0,0,0,.85) 180px, #000 210px, #000 calc(100% - 210px),
    rgba(0,0,0,.85) calc(100% - 180px), rgba(0,0,0,.5) calc(100% - 130px), rgba(0,0,0,.18) calc(100% - 70px), transparent);
  mask-image: linear-gradient(90deg, transparent, rgba(0,0,0,.18) 70px, rgba(0,0,0,.5) 130px, rgba(0,0,0,.85) 180px, #000 210px, #000 calc(100% - 210px),
    rgba(0,0,0,.85) calc(100% - 180px), rgba(0,0,0,.5) calc(100% - 130px), rgba(0,0,0,.18) calc(100% - 70px), transparent); }
main.sb-tint .phead .bigava { border-color: var(--accent); }
.phead .bigava { position: relative; }
.sb-bubble { position: absolute; left: 86px; bottom: 54px; width: max-content; max-width: min(240px, 56vw); padding: 7px 12px; border-radius: 16px; pointer-events: none;
  background: var(--panel); border: 1px solid var(--line); font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; cursor: default; box-shadow: 0 4px 12px rgba(0,0,0,.3); }
.sb-bubble::before { content: ""; position: absolute; left: 10px; bottom: -6px; width: 10px; height: 10px; background: var(--panel);
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transform: rotate(45deg); }
.sb-music { display: flex; align-items: center; gap: 10px; margin: 8px 0; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--text); max-width: 420px; }
.sb-music a.grow { color: var(--text); } .sb-music a.grow:hover { text-decoration: none; }
.sb-music.flat { border: 0; background: none; margin: 0; max-width: none; }
.sb-music.grow { margin: 0; }
.sb-pick { border-radius: 12px; cursor: pointer; } .sb-pick:hover { background: var(--hover); }
.sb-pick a.grow { pointer-events: none; }
.sb-results { margin-top: 10px; max-height: 56vh; overflow-y: auto; }
.sb-add { width: 100%; justify-content: center; border-style: dashed; padding: 12px; margin-top: 4px; } .sb-add b { font-size: 18px; line-height: 1; }
.sb-swatches { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.sb-sw { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--line); padding: 0; color: var(--muted); }
.sb-sw.none { background: var(--bg); } .sb-sw.on { outline: 3px solid var(--text); outline-offset: 2px; }
/* app colour: big round swatches, the chosen one ringed; «+» opens the system colour picker */
.sb-swatches.app { gap: 12px; margin: 10px 0 4px; }
.sb-swatches.app .sb-sw { width: 44px; height: 44px; border: 2px solid rgba(0,0,0,.35); }
.sb-swatches.app .sb-sw.on { outline: 3px solid var(--accent); outline-offset: 3px; }
.sb-any { position: relative; display: grid; place-items: center; cursor: pointer; overflow: hidden;
  background: conic-gradient(#ff4d4d, #ffee3a, #4cf04c, #4ff0f0, #4a8cff, #ff3df5, #ff4d4d); }
.sb-any[style*="--own"] { background: radial-gradient(circle, var(--own) 0 40%, transparent 42%), conic-gradient(#ff4d4d, #ffee3a, #4cf04c, #4ff0f0, #4a8cff, #ff3df5, #ff4d4d); }
.sb-any b { font-size: 20px; line-height: 1; color: #111; text-shadow: 0 0 3px #fff; pointer-events: none; }
.sb-any[style*="--own"] b { display: none; }
.sb-any input, .sb-dot input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
/* profile colour: gradient pills and «свій: ● → ●» */
.sb-grads { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 8px; }
.sb-gr:not(.none), .sb-flow { background-size: 300% 300% !important; animation: sb-flow 8s ease-in-out infinite alternate; }
.sb-flow { animation-duration: 14s; }
.sb-gr { height: 40px; border-radius: 999px; border: 2px solid rgba(0,0,0,.35); padding: 0; color: var(--muted); }
.sb-gr.none { background: var(--bg); border-color: var(--line); }
.sb-gr.on, .sb-dot.on { outline: 3px solid var(--accent); outline-offset: 3px; }
.sb-own { display: flex; align-items: center; gap: 12px; margin-top: 12px; color: var(--muted); }
.sb-dot { position: relative; width: 40px; height: 40px; border-radius: 50%; border: 2px solid rgba(0,0,0,.35); cursor: pointer; }
.sb-arrow { font-size: 20px; }
.sb-gname { margin: 8px 0 0; }
.sb-music img, .sb-note { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex: none; display: grid; place-items: center; background: var(--hover); font-size: 20px; }
.sb-music .grow { min-width: 0; display: flex; flex-direction: column; }
.sb-play { flex: none; width: 34px; height: 34px; border: 0; padding: 0; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-size: 13px; }
.sb-play:hover { text-decoration: none; filter: brightness(1.1); }
.sb-toy { position: absolute; right: 16px; bottom: 10px; max-width: 96px; max-height: 96px; border-radius: 14px; transform: rotate(6deg); cursor: zoom-in;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,.45)); transition: transform .2s; z-index: 1; }
.sb-toy:hover { transform: rotate(-4deg) scale(1.08); }

/* wide screens show «my profile» as a card in the right column, so the side menu does not repeat it */
@media (min-width: 1101px) { nav.side a[data-nav^="#/profile"] { display: none; } }

/* thin scrollbars everywhere (the desktop app shows Chromium's thick ones with arrows otherwise) */
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--muted) 45%, transparent) transparent; }

/* ---------- deck: several columns side by side ---------- */
body.deckmode #app { grid-template-columns: 240px minmax(0, 1fr); justify-content: stretch; }
body.deckmode aside.right { display: none; }
body.deckmode main { border-right: 0; padding-bottom: 0; height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.deck { flex: 1; min-height: 0; display: flex; gap: 10px; padding: 10px; overflow-x: auto; overscroll-behavior-x: contain; }
.dcol { flex: 0 0 360px; display: flex; flex-direction: column; min-height: 0; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.dhead { display: flex; align-items: center; gap: 2px; padding: 6px 6px 6px 12px; border-bottom: 1px solid var(--line); background: var(--panel); }
.dhead .dtitle { flex: 1; min-width: 0; }
.dhead .icon { border: 0; padding: 4px 8px; }
.dbody { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.dbody .post { padding: 10px 12px; }
.dcol > .muted, .deck > .muted { margin: auto; }
@media (max-width: 1100px) { body.deckmode #app { grid-template-columns: 80px minmax(0, 1fr); } }
/* phones: one column per screen, swiped sideways */
@media (max-width: 640px) {
  body.deckmode main { height: calc(100dvh - 58px - var(--sab)); }
  .deck { padding: 0; gap: 0; scroll-snap-type: x mandatory; }
  .dcol { flex-basis: 100vw; border-radius: 0; border-width: 0 1px 0 0; scroll-snap-align: start; }
}

/* ---------- media grid ---------- */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; padding: 3px; }
.tile { position: relative; aspect-ratio: 1; overflow: hidden; background: var(--panel); border-radius: 4px; }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.tile:hover img { transform: scale(1.04); }
.tile.blur img { filter: blur(18px); }
.tbadge { position: absolute; top: 6px; right: 6px; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; font-weight: 700; border-radius: 6px; padding: 1px 6px; }
.dbody .tiles { grid-template-columns: repeat(2, 1fr); }

/* ---------- reading mode: a thread as one text ---------- */
.reader { padding: 20px 22px 40px; }
.reader > .row { margin-bottom: 18px; }
.reader .who { display: flex; flex-direction: column; }
.reader section { position: relative; padding-bottom: 14px; }
.reader .text { font-size: 18px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.reader .rnum { display: block; text-align: right; margin-top: 4px; opacity: .6; }
.reader section + section { border-top: 1px dashed color-mix(in srgb, var(--line) 70%, transparent); padding-top: 14px; }

/* ---------- own feed builder ---------- */
.builder .field select { margin-top: 4px; }
.builder .row.wrap .field { min-width: 140px; margin: 4px 0; }
.srcrow { display: flex; align-items: center; gap: 8px; padding: 6px 10px; margin: 6px 0; border: 1px solid var(--line); border-radius: 10px; color: var(--text); font-size: 14px; }
label.check { display: flex; gap: 8px; align-items: center; margin: 8px 0; font-size: 14px; }
label.check input { width: auto; }

/* ---------- guest: reading without an account ---------- */
body.guest #app { display: block; max-width: 640px; margin: 0 auto; }
body.guest main { border-top: 0; }
body.guest [data-act="drawer"] { display: none; }
.guestbar { position: sticky; top: 0; z-index: 11; display: flex; align-items: center; gap: 12px; padding: 8px 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.guestbar .logo { color: var(--text); font-size: 18px; }
body.guest .topbar { top: 49px; }

/* ---------- feeds in the right column (wide screens): the home tabs move there ---------- */
.sidefeeds { display: flex; flex-direction: column; gap: 2px; }
.sidefeeds > * + * { margin-top: 0; }
.sidefeeds h3 { margin-bottom: 6px; }
.sfeed { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: none; border: 0; border-radius: 10px; padding: 8px 10px; color: var(--text); font-size: 14px; }
.sfeed:hover { background: var(--hover); }
.sfeed.on { background: var(--hover); font-weight: 700; box-shadow: inset 3px 0 0 var(--accent); }
.sfeed .clip { min-width: 0; }
@media (min-width: 1101px) { #feedTabs { display: none; } }
.dhead [data-d=refresh].fresh { color: var(--accent); position: relative; }
.dhead [data-d=refresh].fresh::after { content: ""; position: absolute; top: 3px; right: 4px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
/* older Chromium (the desktop app) ignores scrollbar-width: thin bars there too, without arrows */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--muted) 45%, transparent); border-radius: 6px; }
::-webkit-scrollbar-button { display: none; height: 0; width: 0; }

/* ---------- notifications: filter chips, days, one person → several posts ---------- */
.nchips { display: flex; gap: 8px; padding: 10px 16px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.nchips::-webkit-scrollbar { display: none; }
.nchip { flex: 0 0 auto; border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; color: var(--text); font-size: 14px; font-weight: 600; white-space: nowrap; }
.nchip:hover { background: var(--hover); text-decoration: none; }
.nchip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.nday { margin: 0; padding: 14px 16px 6px; font-size: 16px; border-bottom: 1px solid var(--line); }
.nline { display: flex; align-items: flex-start; gap: 8px; }
.nall summary { margin-top: 6px; list-style: none; cursor: pointer; color: var(--link); }
.nall summary::-webkit-details-marker { display: none; }
.nall[open] summary { display: none; }
.nsub { display: block; padding: 6px 0; border-top: 1px solid var(--line); color: var(--muted); }
.nsub:hover { color: var(--text); text-decoration: none; }

/* ---------- chat: message sheet, replies ---------- */
.msheet-bg { position: fixed; inset: 0; z-index: 90; background: color-mix(in srgb, var(--bg) 55%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  display: flex; align-items: center; justify-content: center; padding: 16px; animation: fadein .15s; }
.msheet { width: min(440px, 100%); display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.msheet.mine { align-items: flex-end; }
.mreacts { display: flex; gap: 4px; padding: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; box-shadow: 0 6px 24px rgba(0,0,0,.35); }
.mreacts button, .memoji button { background: none; border: 0; font-size: 28px; line-height: 1; padding: 6px; border-radius: 50%; transition: transform .1s; }
.mreacts button:hover, .memoji button:hover { transform: scale(1.18); background: var(--hover); }
.mreacts .more { width: 44px; height: 44px; font-size: 22px; background: var(--hover); color: var(--text); }
.memoji { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; padding: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; width: 100%; }
.memoji button { font-size: 24px; }
.msheet > .bubble { max-width: 90%; white-space: pre-wrap; }
.msheet.mine > .bubble { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.mactions { width: min(340px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 8px; box-shadow: 0 6px 24px rgba(0,0,0,.35); }
.mactions > .muted { padding: 8px 12px 6px; }
.mactions button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 12px; border-radius: 12px; font-size: 16px; color: var(--text); }
.mactions button:hover { background: var(--hover); }
.mactions button.danger { color: var(--danger); }
@keyframes fadein { from { opacity: 0; } }
.mquote { font-size: 13px; color: var(--muted); border-left: 3px solid var(--accent); padding: 2px 8px; margin: 2px 4px 2px; max-width: 75%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.msg.flash .bubble { outline: 2px solid var(--accent); outline-offset: 2px; transition: outline-color 1s; }
.replybar { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-top: 1px solid var(--line); background: var(--panel); font-size: 14px; }
.replybar[hidden] { display: none; }
.chatbar { flex-wrap: wrap; }
.chatbar .replybar { flex: 0 0 100%; border: 0; border-left: 3px solid var(--accent); border-radius: 8px; padding: 4px 4px 4px 10px; }
.chatbar textarea { flex: 1; width: auto; }
.memoji[hidden] { display: none; }
body:has(.chatbar) .fab { display: none; } /* in a chat the ✏️ button would cover the send button */
.mquote { max-width: min(280px, 70vw); }

/* own profile card in the right column takes the same Skybee colour */
.sideprof.sb-tint { background: linear-gradient(125deg, var(--panel), var(--panel2), var(--panel3), var(--panel2), var(--panel)); background-size: 300% 300%; animation: sb-flow 14s ease-in-out infinite alternate; color: var(--text); border-color: color-mix(in srgb, var(--sb) 60%, transparent); transition: background-color .25s; }
.sideprof.sb-tint .sp-ava { border-color: var(--panel); }
.sideprof.sb-tint .ghost { border-color: color-mix(in srgb, var(--text) 30%, transparent); }
/* Liquid Glass and Material give every .card their own surface with a stronger selector: the profile colour wins over it */
:root[data-ui] .card.sideprof.sb-tint { background: linear-gradient(125deg, var(--panel), var(--panel2), var(--panel3), var(--panel2), var(--panel)); background-size: 300% 300%; border: 1px solid color-mix(in srgb, var(--sb) 60%, transparent); }
.sideprof.sb-tint .sp-banner:not([style]) { background: linear-gradient(125deg, var(--sb), var(--sb2, var(--sb)), var(--sb3, var(--sb)), var(--sb2, var(--sb)), var(--sb)); background-size: 300% 300%; animation: sb-flow 14s ease-in-out infinite alternate; }

/* ---------- LIVE ---------- */
.live-ava { position: relative; display: inline-block; flex-shrink: 0; line-height: 0; }
.live-ava .avatar { box-shadow: 0 0 0 2px #e11d48; }
.live-ava b { position: absolute; left: 50%; bottom: -5px; transform: translateX(-50%); background: #e11d48; color: #fff; font-size: 9px; font-weight: 800; letter-spacing: .04em;
  line-height: 1; padding: 2px 4px; border-radius: 4px; border: 2px solid var(--bg); }
.livecard { display: flex; gap: 10px; align-items: center; margin-top: 10px; padding: 8px; border: 1px solid #e11d48; border-radius: 12px; color: var(--text); }
.livecard:hover { text-decoration: none; background: var(--hover); }
.livecard img { width: 72px; height: 44px; object-fit: cover; border-radius: 8px; }
.livedot { color: #e11d48; }
.livecard .clip { display: block; }
.qr { display: flex; justify-content: center; }
.qr img { width: 220px; height: 220px; border-radius: 12px; background: #fff; }
.caps { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; } .caps select { width: auto; padding: 4px 6px; }

/* ---------- players from links (YouTube, Spotify, SoundCloud…) ---------- */
.playwrap { margin-top: 8px; }
.playwrap .ext { margin-top: 0; }
.playbtn { margin-top: 6px; }
.playwrap.pvid { position: relative; border-radius: 12px; overflow: hidden; background: #000; border: 1px solid var(--line); max-height: 560px; }
.playwrap.pvid > img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: .9; }
.bigplay { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 64px; height: 64px; border-radius: 50%; border: 0;
  background: rgba(0,0,0,.65); color: #fff; font-size: 26px; padding-left: 5px; }
.bigplay:hover { background: #e11d48; }
.ptitle { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 12px 8px; background: linear-gradient(transparent, rgba(0,0,0,.8)); color: #fff;
  font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ptitle small { opacity: .75; }
.playwrap iframe { display: block; width: 100%; border: 0; border-radius: 12px; }
.playwrap.pvid iframe { height: 100%; }
.sfilters { margin-top: 8px; }
.sfilters summary { cursor: pointer; color: var(--muted); }
.sfgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0 10px; }
.sfgrid .field { margin: 6px 0; }

/* ---------- new posts pill, pull to refresh ---------- */
.newpill { position: sticky; top: 64px; z-index: 9; display: block; margin: 8px auto -44px; padding: 8px 16px; border: 0; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; box-shadow: 0 4px 16px rgba(0,0,0,.35); }
.newpill[hidden] { display: none; }
.ptr { position: fixed; top: 6px; left: 50%; z-index: 70; width: 38px; height: 38px; border-radius: 50%; background: var(--panel); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; font-size: 20px; color: var(--muted); box-shadow: 0 4px 14px rgba(0,0,0,.3); pointer-events: none; }
.ptr.ready { color: var(--accent); }
.ptr.spin { animation: ptrspin .6s linear infinite; }
@keyframes ptrspin { to { transform: translate(-50%, 66px) rotate(360deg); } }
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); } button.chip { background: none; cursor: pointer; }

/* ---------- moderation services ---------- */
.labeler { margin: 14px 0 0; }
.lrow { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.lrow select { width: auto; padding: 6px 8px; font-size: 13px; }
.lpill { background: color-mix(in srgb, var(--accent) 18%, var(--hover)); color: var(--text); }
.post.fadeout { opacity: 0; transition: opacity .3s; }

/* ---------- the Skybee bee (ui.js `bee()`): always the same gold ---------- */
:root { --bee-hi: #e8c97f; --bee-lo: #b98f45; } /* one gold in every theme, as in the logo */
.bee { display: inline-block; vertical-align: middle; flex-shrink: 0; overflow: visible; }
nav.side .logo, .guestbar .logo { display: flex; align-items: center; gap: 10px; }
.topbar h2.brand { display: flex; align-items: center; gap: 8px; }
.loginbee { display: flex; justify-content: center; margin-bottom: 4px; }
.aboutbee { display: flex; justify-content: center; }
.theend .bee { vertical-align: -4px; }
.toast .bee { vertical-align: -4px; margin-left: 2px; }
.popmenu .bee { vertical-align: -4px; }

/* ---------- welcome scene (js/splash.js) ---------- */
#splash { position: fixed; inset: 0; z-index: 1000; overflow: hidden; cursor: pointer; background: linear-gradient(#f8f3e8, #efe5d2 70%); transition: opacity .6s; }
#splash.out { opacity: 0; pointer-events: none; }
.sp-sun { position: absolute; right: 13%; bottom: 40%; width: min(30vw, 34vh); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #f6e1a0, #e2bf6a 60%, #cfa650); box-shadow: 0 0 80px 20px rgba(233, 201, 120, .35);
  animation: sp-rise 2.6s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes sp-rise { from { transform: translateY(35%); opacity: .2; } }
.sp-hills { position: absolute; left: 0; bottom: 24vh; width: 100%; height: 34vh; }
.sp-meadow { position: absolute; left: 0; bottom: 0; width: 100%; height: 30vh; }
.sp-flower { animation: sp-sway 3s ease-in-out infinite alternate; }
@keyframes sp-sway { from { transform: rotate(-1.5deg); } to { transform: rotate(1.5deg); } }
.sp-trail { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.sp-trail path { fill: none; stroke: #c9a85a; stroke-width: 1.6; stroke-dasharray: 2 9; stroke-linecap: round; opacity: .55; }
.sp-bee { position: absolute; left: 0; top: 0; will-change: transform; filter: drop-shadow(0 6px 10px rgba(120, 90, 30, .18)); }
.sp-bee .bee { width: 100% !important; height: 100% !important; }
.sp-wing { transform-box: view-box; transform-origin: 62px 50px; animation: sp-flap .07s ease-in-out infinite alternate; }
@keyframes sp-flap { from { transform: rotate(4deg) scaleY(1); } to { transform: rotate(-16deg) scaleY(.82); } }
#splash.landed .sp-wing { animation-duration: .12s; }
#splash.landed .sp-bee { transition: transform .5s; }
.sp-title { position: absolute; left: 0; right: 0; top: calc(34vh + min(10vw, 10vh) + 10px); text-align: center; color: #4a4033; opacity: 0; transform: translateY(10px);
  transition: opacity .5s, transform .5s; }
@media (orientation: portrait) { .sp-title { top: calc(36vh + min(10vw, 10vh) + 10px); } }
.sp-title b { display: block; font-size: clamp(34px, 7vmin, 64px); font-weight: 800; letter-spacing: .01em; }
.sp-title span { font-size: clamp(14px, 2.2vmin, 18px); color: #8a7d68; }
#splash.landed .sp-title { opacity: 1; transform: none; }
/* the bee's colour comes from the scene (js/splash.js look()) */
#splash { --sp-bee-hi: #e8c97f; --sp-bee-lo: #b98f45; }
#splash.short .sp-sun { animation-duration: .9s; }
/* night (dark themes): a deep sky, a moon instead of the sun, twinkling stars, the land in shadow, a lighter bee */
#splash.night { background: linear-gradient(var(--sp-sky1, #070b18), var(--sp-sky2, #18203d) 62%, color-mix(in srgb, var(--sp-sky2, #18203d) 70%, #3a3550)); }
#splash.night .sp-sun { width: min(22vw, 26vh); background: radial-gradient(circle at 62% 38%, rgba(0,0,0,.08) 0 9%, transparent 10%),
    radial-gradient(circle at 38% 62%, rgba(0,0,0,.07) 0 6%, transparent 7%), radial-gradient(circle at 70% 70%, rgba(0,0,0,.06) 0 4%, transparent 5%),
    radial-gradient(circle at 35% 30%, #fffdf3, var(--sp-moon, #e7e0c8) 60%, color-mix(in srgb, var(--sp-moon, #e7e0c8) 75%, #000));
  box-shadow: 0 0 60px 14px color-mix(in srgb, var(--sp-moon, #f4ecd0) 30%, transparent), 0 0 160px 60px color-mix(in srgb, var(--sp-moon, #f4ecd0) 10%, transparent); }
#splash.night :is(.sp-hills, .sp-meadow) { filter: brightness(.34) saturate(.75); }
#splash.night .sp-title { color: #f1e8d4; } #splash.night .sp-title span { color: #b9b09c; }
#splash.night .sp-trail path { stroke: #e9d39a; opacity: .45; }
#splash.night .sp-bee { filter: drop-shadow(0 0 14px rgba(255, 228, 160, .35)); }
.sp-stars { position: absolute; inset: 0; pointer-events: none; }
.sp-stars i { position: absolute; border-radius: 50%; background: #fff8e6; box-shadow: 0 0 6px rgba(255,248,230,.8); animation: sp-twinkle 2.6s ease-in-out infinite alternate; }
@keyframes sp-twinkle { from { opacity: .25; } to { opacity: 1; } }
/* the app colour (light theme): the sky and the sun take it */
#splash.tinted:not(.night) { background: linear-gradient(var(--sp-sky1), var(--sp-sky2) 70%); }
#splash.tinted:not(.night) .sp-sun { background: radial-gradient(circle at 40% 35%, var(--sp-sun1), var(--sp-sun2) 65%, color-mix(in srgb, var(--sp-sun2) 80%, #000));
  box-shadow: 0 0 80px 20px color-mix(in srgb, var(--sp-sun2) 35%, transparent); }
#splash.tinted .sp-trail path { stroke: var(--sp-bee-lo); }
/* red: the Eclipse — a black sun with a crimson corona in a blood-red sky, the land black (by the owner's wish) */
#splash.eclipse { background: radial-gradient(circle at 80% 42%, rgba(255,40,40,.55), transparent 38%), linear-gradient(#1a0000, #6e0000 38%, #b3000d 64%, #2a0000); }
#splash.eclipse .sp-sun { background: radial-gradient(circle, #000 0 62%, #120000 70%); width: min(26vw, 30vh);
  box-shadow: 0 0 0 3px #ff2a2a, 0 0 24px 8px rgba(255,40,40,.85), 0 0 90px 36px rgba(220,0,0,.55), 0 0 200px 90px rgba(120,0,0,.45); }
#splash.eclipse :is(.sp-hills, .sp-meadow) { filter: brightness(.12) sepia(1) saturate(3) hue-rotate(-45deg); }
#splash.eclipse .sp-title { color: #ffe1e1; text-shadow: 0 0 18px rgba(255,0,0,.5); } #splash.eclipse .sp-title span { color: #ff9a9a; }
#splash.eclipse .sp-trail path { stroke: #ff5a5a; opacity: .6; }
#splash.eclipse .sp-bee { filter: drop-shadow(0 0 8px rgba(255,40,40,.9)) drop-shadow(0 0 22px rgba(160,0,0,.6)); }
.rhead { margin: 4px 6px 2px; }
.msg.mine .rhead { text-align: right; }
.rquote { max-width: min(320px, 75vw); padding: 6px 10px; margin-bottom: -10px; padding-bottom: 14px; border-radius: 14px 14px 4px 4px; background: var(--hover);
  border: 1px solid var(--line); font-size: 13px; cursor: pointer; display: flex; flex-direction: column; opacity: .9; }
.rquote span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.rquote.mine { background: color-mix(in srgb, var(--accent) 35%, var(--bg)); border-color: transparent; }
.rquote.mine span { color: var(--text); }
.video { position: relative; } .verr { position: absolute; left: 8px; right: 8px; bottom: 8px; padding: 8px 10px; border-radius: 10px; background: rgba(0,0,0,.75); color: #fff; font-size: 13px; }
.gifbtn { font-size: 12px; font-weight: 800; letter-spacing: .03em; }
.gifgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; max-height: 60vh; overflow-y: auto; margin-top: 10px; }
.gifitem { padding: 0; border: 0; background: var(--hover); border-radius: 8px; overflow: hidden; aspect-ratio: 1; cursor: pointer; }
.gifitem img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gifitem:hover { outline: 2px solid var(--accent); }

/* «Для новеньких»: collapsible sections */
details.nb > summary { list-style: none; cursor: pointer; display: flex; align-items: center; }
details.nb > summary::-webkit-details-marker { display: none; }
details.nb > summary h3 { margin: 0; flex: 1; }
details.nb > summary::after { content: "⌄"; color: var(--muted); font-size: 20px; transition: transform .2s; }
details.nb[open] > summary::after { transform: rotate(180deg); }
details.nb[open] > summary { margin-bottom: 10px; }
.nbl { margin: 0; padding-left: 20px; } .nbl li { margin: 6px 0; font-size: 14px; line-height: 1.45; }
.nbh { margin: 16px 0 4px; font-size: 14px; color: var(--muted); }
details.nb .rowlink { display: block; padding: 8px 0; border-top: 1px solid var(--line); }
details.nb .actor { padding-left: 0; padding-right: 0; }
.nbauthor { margin: 0 0 8px; color: var(--muted); }

/* ---------- phone turned sideways (Android/iOS app, phone browser) ---------- */
/* older WebViews let ::-webkit-scrollbar win over scrollbar-width: keep the hidden bars hidden there too */
nav.side::-webkit-scrollbar, .tabs::-webkit-scrollbar, .nchips::-webkit-scrollbar { display: none; width: 0; height: 0; }
@media (orientation: landscape) and (max-height: 500px) and (min-width: 641px) {
  /* a phone sideways: an icon rail on the left, a narrow column with the own profile and the home feeds on the right,
     the posts take all the room between them (the insets keep the rail clear of the Dynamic Island) */
  #app { --side: clamp(150px, 19vw, 180px); grid-template-columns: 76px minmax(0, 1fr) var(--side); padding: 0 var(--sar) 0 var(--sal); justify-content: stretch; }
  body.deckmode #app { grid-template-columns: 64px minmax(0, 1fr); }
  nav.side { justify-self: center; width: 64px; padding: 6px 6px calc(6px + var(--sab)); gap: 0; } /* its column is just a little wider: no empty gap before the posts */
  nav.side .nl, nav.side .logo span, .compose-side span, nav.side .me .nl { display: none; }
  nav.side a, .me { justify-content: center; }
  nav.side a { padding: 6px; }
  nav.side .logo { font-size: 20px; margin-bottom: 2px; }
  .compose-side { margin-top: 6px; padding: 8px; }
  .me { padding: 4px 6px; }
  /* the right column, made small: the feeds are there, so no feed tabs over the posts and no profile item in the rail */
  aside.right { display: block; width: var(--side); padding: 6px 8px 6px 0; font-size: 13px; }
  aside.right .card { margin: 6px 0; padding: 8px 10px; border-radius: 16px; }
  aside.right h3 { font-size: 14px; margin: 0 0 4px; }
  aside.right :is(a, button) { font-size: 13px; }
  .sideprof { margin: 6px 0 !important; padding: 0 !important; }
  .sp-banner { height: 40px; }
  .sp-body { padding: 0 10px 10px; }
  .sp-ava { margin-top: -20px; border-width: 2px; }
  .sp-ava .avatar { width: 40px !important; height: 40px !important; font-size: 15px; }
  .sp-name { font-size: 14px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .sp-counts { font-size: 12px; gap: 0 8px; margin-top: 4px !important; }
  .sp-bio { display: none; }
  .sp-btns { margin-top: 8px !important; display: flex; flex-direction: column; gap: 6px; }
  .sp-btns > * { width: 100%; padding: 5px 8px; font-size: 12px; min-height: 0; white-space: nowrap; }
  #feedTabs, nav.side a[data-nav^="#/profile"] { display: none; }
  /* less chrome on top: more room for posts on a short screen */
  .topbar { min-height: 46px; padding: 5px 16px; }
  .tabs > * { padding: 10px 14px; }
  .imgs img, .video { max-height: 78vh; }
  .imgs.n2 img, .imgs.n3 img, .imgs.n4 img { max-height: 46vh; }
}

/* swipe back from the left edge in the apps (js/native.js) */
.swipeback { position: fixed; left: 0; z-index: 90; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; pointer-events: none;
  background: var(--panel); color: var(--text); border: 1px solid var(--line); font-size: 20px; box-shadow: 0 4px 16px rgba(0,0,0,.35); transition: background .12s, color .12s; }
.swipeback.ready { background: var(--accent); color: var(--accent-ink); border-color: transparent; }

/* =====================================================================
   Skybee 2.0 — «The Social Hive»: the same screens and classes, a look of its own.
   Gold only where it means something (active, important, the bee); honeycomb and the bee's flight path
   as quiet motifs; softer posts, bigger touch targets. Works in all three themes and with the app colour.
   ===================================================================== */
:root { --honey: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='27.713' height='48' viewBox='0 0 27.713 48'%3E%3Cpath d='M13.856 0L27.713 8V24L13.856 32L0 24V8ZM13.856 32V48' fill='none' stroke='%23e0a82e' stroke-opacity='.12' stroke-width='.8'/%3E%3C/svg%3E"); }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
button, a { touch-action: manipulation; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .spinner { animation-duration: .8s !important; }
}

/* buttons: the gold one is the brand's, rounded squares instead of plain pills */
.btn { border-radius: 14px; font-weight: 700; transition: filter .15s, transform .15s; }
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn:active, .ghost:active { transform: scale(.97); }
.ghost { border-radius: 12px; transition: background .15s, border-color .15s, transform .15s; }
.ghost:hover { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); }
.ghost.icon { border-radius: 50%; }

/* feed: one calm surface, more air, a soft hover */
.post { gap: 13px; padding: 14px 18px; transition: background .18s ease; }
.post:hover { background: color-mix(in srgb, var(--hover) 70%, transparent); }
.post.focus:hover { background: none; }
.meta { gap: 5px; }
.meta b { font-weight: 700; }
.text { line-height: 1.55; margin: 4px 0 10px; }
.text.big { font-size: 19px; line-height: 1.5; }
.imgs, .video, .ext, .quote { border-radius: 14px; }

/* actions under a post: bigger targets, each lights up in its own colour */
.actions { max-width: 460px; margin-top: 2px; }
.actions button { min-width: 38px; min-height: 36px; justify-content: center; gap: 6px; border-radius: 12px; padding: 6px 10px;
  transition: background .15s, color .15s, transform .15s; }
.actions button:hover { background: var(--hover); color: var(--text); }
.actions button:active { transform: scale(.92); }
.actions [data-act="like"]:hover { color: var(--like); background: color-mix(in srgb, var(--like) 12%, transparent); }
.actions [data-act="repostMenu"]:hover { color: var(--repost); background: color-mix(in srgb, var(--repost) 12%, transparent); }
.actions [data-act="bookmark"]:hover { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }

/* side menu: a gold bar marks where you are — a Skybee detail */
nav.side a { position: relative; border-radius: 12px; transition: background .15s; }
nav.side a.on { background: var(--hover); }
nav.side a.on::before { content: ""; position: absolute; left: 0; top: 22%; height: 56%; width: 3px; border-radius: 0 4px 4px 0; background: var(--accent);
  box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 60%, transparent); }
nav.side .logo.on { background: none; } nav.side .logo.on::before { display: none; }
nav.side .logo { letter-spacing: -.5px; margin-bottom: 10px; }

/* right column: softer, rounder widgets; links warm up on hover */
aside.right .card { border-radius: 18px; padding: 16px 18px; }
aside.right .card h3 { font-size: 15px; }
aside.right .card a { transition: color .15s; }
aside.right .card a:not(.ghost):not(.btn):hover { color: var(--accent); text-decoration: none; }
.sideprof { border-radius: 18px; }

/* profile: a lower banner, a bolder name */
.banner { height: 135px; }
.phead { padding: 0 20px 16px; }
.phead h1 { font-size: 28px; font-weight: 800; letter-spacing: -.6px; }
.counts { gap: 20px; }
.bio { line-height: 1.6; }

/* settings switches: a warm glow when on */
.stoggle input:checked + i { box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 55%, transparent); }
.stoggle input:checked + i::after { background: radial-gradient(circle at 40% 35%, #fff, #fff4d6 60%, #ffe2a0); }

/* «Колонки»: a workspace — columns as panels with a gold line under the header, honeycomb behind */
.deck { gap: 12px; padding: 14px; background: var(--honey) 0 0 / 44px 76px; }
.dcol { border-radius: 16px; background: var(--bg); box-shadow: 0 4px 18px rgba(0,0,0,.18); transition: border-color .15s; }
.dcol:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.dhead { min-height: 50px; padding: 6px 8px 6px 14px; border-bottom: 2px solid var(--accent); }
.dhead .dtitle { font-size: 15px; font-weight: 750; }
.dhead .icon { min-width: 34px; min-height: 34px; border-radius: 10px; }
.dhead .icon:hover { background: var(--hover); }

/* empty screens: the bee at the end of its flight path, honeycomb fading out around it */
.empty { position: relative; padding: 36px 16px 28px; text-align: center; isolation: isolate; }
.empty::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--honey) center / 44px 76px;
  -webkit-mask: radial-gradient(ellipse at 50% 40%, #000, transparent 70%); mask: radial-gradient(ellipse at 50% 40%, #000, transparent 70%); }
.etrail { position: relative; width: 150px; height: 64px; margin: 0 auto 6px; }
.etrail svg:not(.bee) { position: absolute; inset: 0; width: 100%; height: 100%; stroke: var(--muted); stroke-width: 1.4; stroke-dasharray: 4 5; opacity: .7; }
.etrail .bee { position: absolute; right: -8px; top: -12px; transform: rotate(18deg); filter: drop-shadow(0 0 6px color-mix(in srgb, var(--bee-hi) 45%, transparent)); }
.empty p { margin: 0; }

/* sign-in screen: honeycomb at the edges, clear in the middle */
body:has(.login) { background: radial-gradient(ellipse at 50% 35%, var(--bg) 35%, transparent 80%), var(--honey) 0 0 / 44px 76px, var(--bg); }

/* phone: bigger tap zones, a gold mark under the current tab, a rounder ✏️ */
@media (max-width: 640px) {
  nav.bottom { min-height: 58px; align-items: center; padding: 4px 0 calc(4px + var(--sab));
    background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
  nav.bottom a { position: relative; min-width: 52px; min-height: 48px; display: flex; justify-content: center; align-items: center; font-size: 23px; border-radius: 12px; }
  nav.bottom a.on::after { content: ""; position: absolute; bottom: 3px; left: 50%; width: 18px; height: 3px; margin-left: -9px; border-radius: 3px; background: var(--accent);
    box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 60%, transparent); }
  .fab { width: 58px; height: 58px; right: 18px; box-shadow: 0 5px 22px rgba(0,0,0,.3), 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
  .post { padding: 13px 14px; gap: 10px; }
  .actions { max-width: 100%; }
  .actions button { min-width: 42px; min-height: 40px; }
  .text { font-size: 1.05em; }
}

/* ---------- Skybee 2.0, part 2: the brand's own icons, tabs, banner, status, workspace density ---------- */
/* line icons (ico() in ui.js): muted at rest, text colour on hover, gold where you are */
.ico { display: block; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ni { width: 26px; height: 26px; display: inline-grid; place-items: center; vertical-align: middle; }
nav.side a { color: var(--muted); }
nav.side a:hover, nav.side a.on { color: var(--text); }
nav.side a.on .ico { color: var(--accent); stroke-width: 2.1; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--accent) 45%, transparent)); }
nav.side .logo { color: var(--text); }
.compose-side { display: flex; align-items: center; justify-content: center; gap: 8px; }
.compose-side .ico { stroke-width: 2.2; }
.fab { display: none; place-items: center; color: var(--accent-ink); }
.fab .ico { margin: auto; stroke-width: 2.2; }
.srow .sicon .ico { width: 22px; height: 22px; }
.srow:hover .sicon { color: var(--accent); }

/* tabs and top bar: thinner lines, a short glowing gold underline instead of a full-width bar */
.topbar { border-bottom-color: color-mix(in srgb, var(--line) 70%, transparent); }
.topbar h2 { letter-spacing: -.3px; font-weight: 800; }
.tabs { border-bottom-color: color-mix(in srgb, var(--line) 70%, transparent); }
.tabs > * { position: relative; border-bottom: 0; transition: color .15s, background .15s; }
.tabs > .on::after { content: ""; position: absolute; left: 50%; bottom: 0; width: min(56px, 60%); height: 3px; transform: translateX(-50%); border-radius: 3px 3px 0 0;
  background: var(--accent); box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 55%, transparent); }
.chip { transition: border-color .15s, background .15s; }
.chip:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); text-decoration: none; }

/* fewer frames: cards are surfaces with a hairline, not boxes */
.card { border-color: color-mix(in srgb, var(--line) 65%, transparent); border-radius: 16px; }
.modal { border-radius: 20px; box-shadow: 0 20px 60px rgba(0,0,0,.45); }
.sgroup { border-color: color-mix(in srgb, var(--line) 70%, transparent); }
.post { border-bottom-color: color-mix(in srgb, var(--line) 70%, transparent); }

/* a profile without its own banner: warm honey light over honeycomb instead of the old gold-to-blue */
.banner, .sp-banner { background: var(--honey) 0 0 / 44px 76px, radial-gradient(ellipse at 75% 0%, rgba(245,179,1,.38), transparent 60%),
  linear-gradient(135deg, #3a2a08, #17130b 60%, #0f1218); }
/* a real banner (or the profile colour from flair.js) replaces that: one picture, covering */
.banner[style*="background-image"], .sp-banner[style*="background-image"] { background-size: cover; background-position: center; background-repeat: no-repeat; }

/* Honey Status: the Skybee status bubble with a soft gold outline; the tail is one piece with it (same fill and edge) */
.sb-bubble { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); display: flex; align-items: center; min-height: 32px; }
.sb-bubble::before { left: 12px; bottom: -6px; width: 10px; height: 10px; border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); border-radius: 0 0 3px 0; }

/* Bee Trail on the welcome screen: the bee arrives along its dashed loop */
.loginbee { position: relative; }
.loginbee::before { content: ""; position: absolute; left: 50%; top: 50%; width: 260px; height: 130px; margin: -40px 0 0 -250px; pointer-events: none; opacity: .55;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 260 130'%3E%3Cpath d='M4 122c26-4 42-26 34-48S6 60 16 78s52 20 82-6 70-58 130-50' fill='none' stroke='%23c9a24d' stroke-width='1.6' stroke-dasharray='5 6' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat; }
@media (max-width: 520px) { .loginbee::before { width: 180px; height: 90px; margin: -26px 0 0 -170px; } }

/* «Колонки»: compact mode — narrower columns, denser posts */
.deck.compact { gap: 8px; padding: 10px; }
.deck.compact .dcol { flex-basis: 300px; }
.deck.compact .dbody .post { padding: 8px 10px; gap: 8px; font-size: .93em; }
.deck.compact .dbody .actions button { min-height: 30px; padding: 3px 6px; }
.deck.compact .dhead { min-height: 42px; }

/* phone: line icons in the bottom bar, gold for the current one */
@media (max-width: 640px) {
  nav.bottom a { opacity: 1; color: var(--muted); }
  nav.bottom a.on { color: var(--accent); }
  nav.bottom a.on .ico { stroke-width: 2.1; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--accent) 45%, transparent)); }
  .fab { display: grid; }
}

/* =====================================================================
   Interface styles (Settings → Appearance → «Стиль інтерфейсу», applyLook → html[data-ui]):
   Liquid Glass — iPhone/iPad by default; Material Design 3 — Android by default; any of them on any device.
   Always :root[data-ui=…] — the style buttons in settings carry data-ui too.
   ===================================================================== */
.bl { display: none; }

/* ---------------------------- Liquid Glass ---------------------------- */
:root[data-ui="glass"] { --g-a: 58%; --g-blur: 26px; --g-edge: rgba(255,255,255,.14); --g-hi: rgba(255,255,255,.22); --g-shadow: 0 10px 34px rgba(0,0,0,.32);
  --glass: color-mix(in srgb, var(--panel) var(--g-a), transparent); }
:root[data-ui="glass"][data-glass="clear"] { --g-a: 34%; --g-blur: 18px; }
:root[data-ui="glass"][data-glass="frost"] { --g-a: 80%; --g-blur: 38px; }
:root[data-ui="glass"][data-theme="light"] { --g-edge: rgba(255,255,255,.75); --g-hi: rgba(255,255,255,.9); --g-shadow: 0 10px 30px rgba(15,20,25,.12); }
:root[data-ui="glass"] body { font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  /* soft coloured light behind the glass, so it has something to bend */
  background: radial-gradient(60vw 50vh at 85% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
    radial-gradient(50vw 50vh at -10% 110%, color-mix(in srgb, var(--link) 12%, transparent), transparent 70%), var(--bg) fixed; }
:root[data-ui="glass"] main { border-color: transparent; }
:root[data-ui="glass"] :is(.topbar, nav.bottom, .card, .modal, .popmenu, .toast, .chatbar, .dhead, nav.side, .msheet) {
  background: var(--glass); -webkit-backdrop-filter: blur(var(--g-blur)) saturate(180%); backdrop-filter: blur(var(--g-blur)) saturate(180%); }
:root[data-ui="glass"] :is(.card, .modal, .popmenu, nav.bottom, .toast, .fab, .dcol) { border: 1px solid var(--g-edge);
  box-shadow: inset 0 1px 0 var(--g-hi), inset 0 -1px 0 rgba(255,255,255,.04), var(--g-shadow); }
:root[data-ui="glass"] .topbar { border-bottom: 1px solid var(--g-edge); box-shadow: inset 0 -1px 0 rgba(0,0,0,.06); }
:root[data-ui="glass"] .card { border-radius: 24px; }
:root[data-ui="glass"] .modal { border-radius: 30px; }
:root[data-ui="glass"] .popmenu { border-radius: 20px; padding: 8px; }
:root[data-ui="glass"] .popmenu button { border-radius: 12px; }
:root[data-ui="glass"] .toast { color: var(--text); }
:root[data-ui="glass"] .modal-bg { background: rgba(0,0,0,.35); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
/* capsule buttons with a light catching the top edge */
:root[data-ui="glass"] .btn { border-radius: 999px; background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 78%, #fff), var(--accent) 55%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55), 0 4px 14px color-mix(in srgb, var(--accent) 35%, transparent); }
:root[data-ui="glass"] .ghost { border-radius: 999px; background: var(--glass); border-color: var(--g-edge); box-shadow: inset 0 1px 0 var(--g-hi);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
:root[data-ui="glass"] .ghost.icon { border-radius: 50%; }
:root[data-ui="glass"] .imgs, :root[data-ui="glass"] .video, :root[data-ui="glass"] .ext, :root[data-ui="glass"] .quote { border-radius: 20px; }
/* segmented control: a glass track with a brighter sliding thumb */
:root[data-ui="glass"] .seg { gap: 2px; padding: 3px; border-radius: 999px; background: color-mix(in srgb, var(--text) 8%, transparent); }
:root[data-ui="glass"] .seg button, :root[data-ui="glass"] .seg label { border: 0; border-radius: 999px; background: none; }
:root[data-ui="glass"] .seg button.on, :root[data-ui="glass"] .seg label:has(:checked) { background: color-mix(in srgb, #fff 16%, var(--glass));
  box-shadow: inset 0 1px 0 var(--g-hi), 0 2px 8px rgba(0,0,0,.18); font-weight: 600; }
:root[data-ui="glass"][data-theme="light"] .seg button.on, :root[data-ui="glass"][data-theme="light"] .seg label:has(:checked) { background: #fff; }
/* iOS switch */
:root[data-ui="glass"] .stoggle i { width: 51px; height: 31px; }
:root[data-ui="glass"] .stoggle i::after { top: 2px; left: 2px; width: 27px; height: 27px; background: #fff; box-shadow: 0 3px 8px rgba(0,0,0,.25); }
:root[data-ui="glass"] .stoggle input:checked + i { box-shadow: none; }
:root[data-ui="glass"] .stoggle input:checked + i::after { transform: translateX(20px); background: #fff; }
/* side menu: a floating glass panel; where you are — a glass pill */
:root[data-ui="glass"] nav.side { top: 10px; height: calc(100vh - 20px); margin: 10px 0; border-radius: 28px; border: 1px solid var(--g-edge); box-shadow: inset 0 1px 0 var(--g-hi), var(--g-shadow); }
:root[data-ui="glass"] nav.side a { border-radius: 999px; }
:root[data-ui="glass"] nav.side a.on { background: color-mix(in srgb, #fff 10%, transparent); box-shadow: inset 0 1px 0 var(--g-hi); }
:root[data-ui="glass"] nav.side a.on::before { display: none; }
:root[data-ui="glass"] .tabs > .on::after { width: auto; left: 18%; right: 18%; transform: none; height: 3px; border-radius: 3px; bottom: 4px; }
:root[data-ui="glass"] .dcol { border-radius: 24px; background: var(--glass); }
:root[data-ui="glass"] .dhead { border-bottom: 1px solid var(--g-edge); }
@media (max-width: 640px) {
  :root[data-ui="glass"] nav.side { top: 0; height: auto; margin: 0; border-radius: 0 28px 28px 0; }
  /* tab bar: icons over small labels, the current one in a glass pill */
  :root[data-ui="glass"] nav.bottom { border-width: 0; border-top: 1px solid var(--g-edge); box-shadow: inset 0 1px 0 var(--g-hi); }
  :root[data-ui="glass"] nav.bottom a { flex-direction: column; gap: 1px; min-height: 52px; color: var(--muted); }
  :root[data-ui="glass"] nav.bottom a.on { color: var(--accent); }
  :root[data-ui="glass"] nav.bottom a.on::after { display: none; }
  :root[data-ui="glass"] nav.bottom .bl { display: block; font-size: 10px; font-weight: 600; }
  :root[data-ui="glass"] nav.bottom .ico { width: 24px !important; height: 24px !important; }
  /* floating capsule over the feed */
  :root[data-ui="glass"].glass-float nav.bottom { left: 14px; right: 14px; bottom: calc(10px + var(--sab)); padding: 5px 6px; border-radius: 34px; border: 1px solid var(--g-edge);
    box-shadow: inset 0 1px 0 var(--g-hi), var(--g-shadow); justify-content: space-between; }
  :root[data-ui="glass"].glass-float nav.bottom a { flex: 1; border-radius: 28px; }
  :root[data-ui="glass"].glass-float nav.bottom a.on { background: color-mix(in srgb, var(--text) 10%, transparent); box-shadow: inset 0 1px 0 var(--g-hi); }
  :root[data-ui="glass"].glass-float main { padding-bottom: calc(110px + var(--sab)); }
  :root[data-ui="glass"].glass-float .fab { bottom: calc(92px + var(--sab)); }
  :root[data-ui="glass"].glass-float .chatbar { bottom: calc(80px + var(--sab)); border-radius: 26px; left: 10px; right: 10px; width: auto; border: 1px solid var(--g-edge); }
  :root[data-ui="glass"] .fab { background: color-mix(in srgb, var(--accent) 72%, transparent); -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%); }
}

/* ---------------------------- Material Design 3 ---------------------------- */
:root[data-ui="material"] { --m-s1: var(--panel); --m-s2: var(--hover); --m-c: color-mix(in srgb, var(--text) 14%, var(--bg)); --m-on-c: var(--text); --m-out: var(--line); }
:root[data-ui="material"].m-tonal { --m-s1: color-mix(in srgb, var(--accent) 6%, var(--bg)); --m-s2: color-mix(in srgb, var(--accent) 11%, var(--bg));
  --m-c: color-mix(in srgb, var(--accent) 26%, var(--bg)); --m-out: color-mix(in srgb, var(--accent) 22%, var(--line)); }
:root[data-ui="material"] body { font-family: Roboto, "Google Sans", "Segoe UI", system-ui, sans-serif; letter-spacing: .01em; }
:root[data-ui="material"] main { border-color: transparent; }
:root[data-ui="material"] .topbar { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; border-bottom: 0; min-height: 64px; }
:root[data-ui="material"] .topbar h2 { font-weight: 500; font-size: 22px; letter-spacing: 0; }
/* filled cards and dialogs, no outlines */
:root[data-ui="material"] .card { background: var(--m-s1); border: 0; border-radius: 16px; }
:root[data-ui="material"] .modal { background: var(--m-s2); border: 0; border-radius: 28px; padding: 24px; box-shadow: 0 8px 24px rgba(0,0,0,.35); }
:root[data-ui="material"] .popmenu { background: var(--m-s2); border: 0; border-radius: 12px; padding: 8px 0; box-shadow: 0 4px 16px rgba(0,0,0,.3); }
:root[data-ui="material"] .popmenu button { border-radius: 0; padding: 12px 16px; }
:root[data-ui="material"] .toast { border-radius: 8px; background: var(--text); color: var(--bg); padding: 14px 18px; box-shadow: 0 4px 12px rgba(0,0,0,.3); }
:root[data-ui="material"] .post { border-bottom-color: var(--m-out); }
/* buttons: filled and outlined pills, 40px tall */
:root[data-ui="material"] .btn { border-radius: 999px; min-height: 40px; padding: 10px 24px; font-weight: 500; letter-spacing: .02em; box-shadow: none; filter: none; }
:root[data-ui="material"] .btn:hover { box-shadow: 0 1px 3px rgba(0,0,0,.3); filter: none; }
:root[data-ui="material"] .ghost { border-radius: 999px; border-color: var(--m-out); font-weight: 500; }
:root[data-ui="material"] .ghost:hover { border-color: var(--m-out); background: color-mix(in srgb, var(--accent) 8%, transparent); }
:root[data-ui="material"] .ghost.icon { border: 0; }
:root[data-ui="material"] :is(.btn, .ghost):active { transform: none; }
:root[data-ui="material"] .chip { border-radius: 8px; border-color: var(--m-out); }
:root[data-ui="material"] .chip.on { background: var(--m-c); color: var(--m-on-c); border-color: transparent; }
/* segmented buttons: one outlined pill split into parts, the chosen one filled */
:root[data-ui="material"] .seg { gap: 0; }
:root[data-ui="material"] .seg > * { border-radius: 0; border: 1px solid var(--m-out); margin-left: -1px; background: none; min-height: 40px; font-weight: 500; }
:root[data-ui="material"] .seg > :first-child { border-radius: 999px 0 0 999px; margin-left: 0; }
:root[data-ui="material"] .seg > :last-child { border-radius: 0 999px 999px 0; }
:root[data-ui="material"] .seg > :only-child { border-radius: 999px; }
:root[data-ui="material"] .seg button.on, :root[data-ui="material"] .seg label:has(:checked) { background: var(--m-c); color: var(--m-on-c); border-color: var(--m-out); }
:root[data-ui="material"] .seg button.on::before { content: "✓ "; }
/* M3 switch: outlined track off, filled on, the thumb grows */
:root[data-ui="material"] .stoggle i { width: 52px; height: 32px; background: var(--m-s2); border: 2px solid var(--muted); box-shadow: none; }
:root[data-ui="material"] .stoggle i::after { top: 6px; left: 6px; width: 16px; height: 16px; background: var(--muted); transition: transform .15s, width .15s, height .15s, top .15s, left .15s; }
:root[data-ui="material"] .stoggle input:checked + i { background: var(--accent); border-color: var(--accent); box-shadow: none; }
:root[data-ui="material"] .stoggle input:checked + i::after { top: 2px; left: 2px; width: 24px; height: 24px; transform: translateX(20px); background: var(--accent-ink); }
/* navigation drawer: tall pill items, the current one in a tonal container */
:root[data-ui="material"] nav.side a { border-radius: 999px; min-height: 52px; }
:root[data-ui="material"] nav.side a.on { background: var(--m-c); color: var(--m-on-c); }
:root[data-ui="material"] nav.side a.on::before { display: none; }
:root[data-ui="material"] nav.side a.on .ico { color: var(--m-on-c); filter: none; }
:root[data-ui="material"] .compose-side { border-radius: 16px; min-height: 56px; background: var(--m-c); color: var(--m-on-c); box-shadow: 0 3px 6px rgba(0,0,0,.25); }
/* primary tabs: the indicator as wide as the label */
:root[data-ui="material"] .tabs { border-bottom-color: var(--m-out); }
:root[data-ui="material"] .tabs > .on { color: var(--accent); }
:root[data-ui="material"][data-theme="light"] .tabs > .on { color: var(--text); }
:root[data-ui="material"] .tabs > .on::after { left: 16px; right: 16px; width: auto; transform: none; box-shadow: none; }
:root[data-ui="material"] .dcol { border: 0; background: var(--m-s1); border-radius: 16px; box-shadow: none; }
:root[data-ui="material"] .dhead { background: var(--m-s2); border-bottom: 0; }
:root[data-ui="material"] aside.right .card, :root[data-ui="material"] .sideprof { border-radius: 16px; }
/* ripple */
:root[data-ui="material"] :is(.btn, .ghost, .actions button, .srow, nav.side a, nav.bottom a, .tabs > *, .chip, .popmenu button, .seg button) { position: relative; overflow: hidden; }
:root[data-ui="material"] .fab { overflow: hidden; } /* the ✏️ button stays fixed: only clip the ripple */
.ripple { position: absolute; border-radius: 50%; pointer-events: none; background: currentColor; opacity: .16; transform: scale(0); animation: ripple .55s ease-out forwards; }
@keyframes ripple { to { transform: scale(1); opacity: 0; } }
@media (max-width: 640px) {
  :root[data-ui="material"] nav.side { background: var(--m-s1); border-right: 0; border-radius: 0 16px 16px 0; }
  /* navigation bar: 80dp, an indicator pill behind the icon, label below */
  :root[data-ui="material"] nav.bottom { min-height: 80px; padding: 12px 0 calc(16px + var(--sab)); background: var(--m-s2); border-top: 0;
    -webkit-backdrop-filter: none; backdrop-filter: none; align-items: flex-start; }
  :root[data-ui="material"] nav.bottom a { flex: 1; flex-direction: column; gap: 4px; min-height: 0; padding: 0; border-radius: 0; overflow: visible; color: var(--muted); }
  :root[data-ui="material"] nav.bottom a.on { color: var(--text); }
  :root[data-ui="material"] nav.bottom a.on::after { display: none; }
  :root[data-ui="material"] nav.bottom .ni { width: 64px; height: 32px; border-radius: 16px; transition: background .2s; }
  :root[data-ui="material"] nav.bottom a.on .ni { background: var(--m-c); }
  :root[data-ui="material"] nav.bottom a.on .ico { color: var(--m-on-c); filter: none; }
  :root[data-ui="material"] nav.bottom .ico { width: 24px !important; height: 24px !important; }
  :root[data-ui="material"].m-labels nav.bottom .bl { display: block; font-size: 12px; font-weight: 500; letter-spacing: .03em; }
  :root[data-ui="material"]:not(.m-labels) nav.bottom { min-height: 64px; padding-top: 16px; }
  :root[data-ui="material"] main { padding-bottom: calc(100px + var(--sab)); }
  /* FAB: a 56dp rounded square in the tonal container */
  :root[data-ui="material"] .fab { width: 56px; height: 56px; border-radius: 16px; right: 16px; bottom: calc(96px + var(--sab)); background: var(--m-c); color: var(--m-on-c);
    box-shadow: 0 3px 6px rgba(0,0,0,.3), 0 2px 4px rgba(0,0,0,.2); }
  :root[data-ui="material"] .chatbar { bottom: calc(80px + var(--sab)); background: var(--m-s2); border-top: 0; }
  :root[data-ui="material"]:not(.m-labels) .chatbar { bottom: calc(64px + var(--sab)); }
}

/* the three style tiles in settings */
.uipreview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.uipv { position: relative; height: 96px; border-radius: 16px; border: 2px solid var(--line); overflow: hidden; padding: 0; display: block; text-align: left; }
.uipv.on { border-color: var(--accent); }
.uipv b { position: absolute; left: 8px; bottom: 6px; font-size: 12px; font-weight: 700; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.5); }
.uipv i { position: absolute; display: block; }
.uipv-glass { background: radial-gradient(circle at 80% 10%, #f5b301aa, transparent 55%), radial-gradient(circle at 0 100%, #4c9bffaa, transparent 55%), #1b2030; }
.uipv-glass i:nth-child(1) { left: 10px; right: 10px; top: 10px; height: 18px; border-radius: 9px; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.35); backdrop-filter: blur(6px); }
.uipv-glass i:nth-child(2) { left: 14px; right: 14px; bottom: 26px; height: 22px; border-radius: 12px; background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.4); box-shadow: inset 0 1px 0 rgba(255,255,255,.6); }
.uipv-glass i:nth-child(3) { left: 50%; bottom: 31px; width: 24px; height: 12px; margin-left: -12px; border-radius: 6px; background: rgba(255,255,255,.45); }
.uipv-material { background: #1f1b13; }
.uipv-material i:nth-child(1) { left: 10px; right: 10px; top: 12px; height: 28px; border-radius: 12px; background: #3a3220; }
.uipv-material i:nth-child(2) { left: 0; right: 0; bottom: 0; height: 26px; background: #2c2618; }
.uipv-material i:nth-child(3) { right: 10px; bottom: 32px; width: 22px; height: 22px; border-radius: 7px; background: #f5c94a; }
.uipv-material b { bottom: auto; top: 18px; left: 16px; color: #f5e6c0; text-shadow: none; }
.uipv-skybee { background: var(--honey) 0 0 / 22px 38px, #0f1218; }
.uipv-skybee i:nth-child(1) { left: 0; top: 0; bottom: 0; width: 26px; background: #171b23; }
.uipv-skybee i:nth-child(2) { left: 0; top: 16px; width: 3px; height: 14px; border-radius: 0 3px 3px 0; background: #f5b301; box-shadow: 0 0 8px #f5b301; }
.uipv-skybee i:nth-child(3) { left: 36px; right: 10px; top: 14px; height: 18px; border-radius: 9px; background: #f5b301; }

/* =====================================================================
   Review pass (second opinion): three different characters, not three skins of one theme
   ===================================================================== */
/* a readable gold for small marks on a light page (#f5b301 on white is too faint) */
:root { --accent-mark: var(--accent); }
:root[data-theme="light"] { --accent-mark: color-mix(in srgb, var(--accent) 62%, #000); }
nav.side a.on .ico, nav.bottom a.on .ico { color: var(--accent-mark); }
.tabs > .on::after { box-shadow: 0 0 7px color-mix(in srgb, var(--accent) 35%, transparent); }
/* a bit more compact posts, a calmer ✏️ button */
.post { padding: 12px 16px; }
@media (max-width: 640px) { .fab { box-shadow: 0 4px 16px rgba(0,0,0,.28); } .post { padding: 12px 14px; } }
/* the welcome screen keeps its honeycomb a little brighter */
body:has(.login) { background: radial-gradient(ellipse at 50% 35%, var(--bg) 35%, transparent 80%),
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='27.713' height='48' viewBox='0 0 27.713 48'%3E%3Cpath d='M13.856 0L27.713 8V24L13.856 32L0 24V8ZM13.856 32V48' fill='none' stroke='%23e0a82e' stroke-opacity='.2' stroke-width='.8'/%3E%3C/svg%3E") 0 0 / 44px 76px, var(--bg); }

/* ---------- Skybee Classic: gold only where it means something ---------- */
:root[data-ui="skybee"] .post:hover { background: var(--hover); }
:root[data-ui="skybee"] .card { border-radius: 14px; box-shadow: none; }
:root[data-ui="skybee"] .tabs > .on { color: var(--text); }
:root[data-ui="skybee"] .empty::before { opacity: .65; }
:root[data-ui="skybee"] nav.side a.on .ico, :root[data-ui="skybee"] nav.bottom a.on .ico { filter: none; }

/* ---------- Liquid Glass: glass is the navigation layer; content stays solid ---------- */
:root[data-ui="glass"] { --g-a: 76%; --g-blur: 24px; --g-edge: rgba(255,255,255,.17); --g-hi: rgba(255,255,255,.24); --g-shadow: 0 8px 28px rgba(0,0,0,.20); }
:root[data-ui="glass"][data-glass="clear"] { --g-a: 52%; --g-blur: 18px; }
:root[data-ui="glass"][data-glass="frost"] { --g-a: 88%; --g-blur: 34px; }
:root[data-ui="glass"][data-theme="light"] { --g-a: 82%; --g-edge: rgba(255,255,255,.82); --g-hi: rgba(255,255,255,.95); --g-shadow: 0 6px 24px rgba(20,30,50,.10); }
:root[data-ui="glass"] :is(.card, .dcol, .dhead) { background: var(--panel); -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none;
  border-color: color-mix(in srgb, var(--line) 70%, transparent); }
:root[data-ui="glass"] .dhead { border-color: transparent; border-bottom: 1px solid var(--line); }
:root[data-ui="glass"] :is(.topbar, nav.bottom, nav.side, .modal, .popmenu, .toast, .chatbar, .msheet) { border-color: var(--g-edge); }
/* secondary buttons are plain, not glass: one yellow main action, the rest quiet */
:root[data-ui="glass"] .ghost { background: none; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; border-color: color-mix(in srgb, var(--text) 18%, transparent); }
:root[data-ui="glass"] .btn { background: var(--accent); box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 3px 10px color-mix(in srgb, var(--accent) 22%, transparent); }
/* no glow around active icons; the active item changes shape smoothly */
:root[data-ui="glass"] :is(nav.side, nav.bottom) a.on .ico { filter: none; }
:root[data-ui="glass"] :is(nav.side, nav.bottom) a { transition: background .25s ease, box-shadow .25s ease, color .2s, transform .25s cubic-bezier(.3,1.5,.6,1); }
:root[data-ui="glass"] :is(nav.side, nav.bottom) a.on { transform: scale(1.02); }
:root[data-ui="glass"] nav.bottom a:active { transform: scale(.94); }
@media (max-width: 640px) {
  :root[data-ui="glass"] .fab { background: var(--accent); color: var(--accent-ink); border: 1px solid rgba(255,255,255,.35);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 5px 18px rgba(0,0,0,.22); -webkit-backdrop-filter: none; backdrop-filter: none; }
  :root[data-ui="glass"].glass-float nav.bottom { border-radius: 32px; padding: 5px 7px; }
  :root[data-ui="glass"].glass-float main { padding-bottom: calc(140px + var(--sab)); }
  :root[data-ui="glass"].glass-float .fab { bottom: calc(94px + var(--sab)); }
  :root[data-ui="glass"] nav.bottom a.on { color: var(--text); }
}
@media (prefers-reduced-transparency: reduce) {
  :root[data-ui="glass"] :is(.topbar, nav.bottom, nav.side, .modal, .popmenu, .toast, .chatbar, .msheet) { background: var(--panel); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* ---------- Material 3: tonal surfaces, the brand gold as a hint, not a flood ---------- */
:root[data-ui="material"].m-tonal { --m-s1: color-mix(in srgb, var(--accent) 3%, var(--bg)); --m-s2: color-mix(in srgb, var(--accent) 7%, var(--bg));
  --m-c: color-mix(in srgb, var(--accent) 17%, var(--bg)); --m-out: var(--line); }
:root[data-ui="material"] .card { border-radius: 18px; box-shadow: none; }
:root[data-ui="material"] .modal { box-shadow: 0 8px 24px rgba(0,0,0,.20); }
:root[data-ui="material"] nav.side a.on, :root[data-ui="material"] nav.side a.on .ico { color: var(--text); }
:root[data-ui="material"] .compose-side { background: var(--accent); color: var(--accent-ink); }
:root[data-ui="material"] .seg button.on, :root[data-ui="material"] .seg label:has(:checked) { color: var(--text); font-weight: 600; }
:root[data-ui="material"] .btn { box-shadow: none; font-weight: 600; }
:root[data-ui="material"] .tabs > .on { color: var(--text); }
@media (max-width: 640px) {
  :root[data-ui="material"] nav.bottom { box-shadow: 0 -2px 12px rgba(0,0,0,.06); }
  :root[data-ui="material"] nav.bottom a.on, :root[data-ui="material"] nav.bottom a.on .ico { color: var(--text); }
  :root[data-ui="material"].m-labels nav.bottom .bl { letter-spacing: 0; }
  :root[data-ui="material"] main { padding-bottom: calc(120px + var(--sab)); }
}

/* ---------- accessibility, every style ---------- */
@media (pointer: coarse) { :root[data-ui] .actions button { min-width: 44px; min-height: 44px; } }
@media (max-width: 640px) { :root[data-ui] nav.bottom a { min-height: 48px; min-width: 48px; } }
:root[data-ui] :focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
@media (prefers-contrast: more) {
  :root[data-ui] { --line: var(--muted); }
  :root[data-ui] .ghost { border-width: 2px; }
}
@media (forced-colors: active) { :root[data-ui] :focus-visible { outline: 2px solid Highlight; } }

/* ---------- status bar, notch and Android's bottom bar (phones): nothing goes under them ----------
   --sat/--sab/--sal/--sar are the safe-area insets. iPhone (viewport-fit=cover, contentInset never) gives them through env();
   Android draws the page edge to edge behind the bars but its WebView may report 0 there, so js/native.js puts the real
   insets from the SafeArea plugin into these variables. The bars reach up behind the status bar with their own background. */
:root { --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px); --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px); }
.topbar, .guestbar { padding-top: calc(10px + var(--sat)); min-height: calc(54px + var(--sat)); }
.guestbar { padding-top: calc(8px + var(--sat)); min-height: 0; }
body.guest .topbar { top: calc(49px + var(--sat)); padding-top: 10px; min-height: 54px; }
.newpill { top: calc(64px + var(--sat)); }
nav.side { padding-top: calc(12px + var(--sat)); }
.modal-bg { padding-top: calc(6vh + var(--sat)); }
.msheet-bg { padding-top: var(--sat); }
@media (orientation: landscape) and (max-height: 500px) and (min-width: 641px) {
  .topbar { padding-top: calc(5px + var(--sat)); min-height: calc(46px + var(--sat)); }
  nav.side { padding-top: calc(6px + var(--sat)); }
}
:root[data-ui="material"] .topbar { min-height: calc(64px + var(--sat)); }
.login { padding-bottom: calc(16px + var(--sab)); }
/* «no colour» swatch: the usual dark look with the gold bee, so it can't be mistaken for «Жовтий» */
.sb-sw.none { display: grid; place-items: center; background: #0f1218; border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }

/* ---------- bottom bar: a bubble slides to the current tab; drag a finger along the bar to switch (js: navLens in app.js) ---------- */
nav.bottom a:hover { text-decoration: none; }
.navlens { display: none; }
@media (max-width: 640px) {
  nav.bottom { touch-action: none; }
  nav.bottom a { position: relative; z-index: 1; -webkit-tap-highlight-color: transparent; }
  :root[data-ui="glass"] nav.bottom a.on, :root[data-ui="glass"].glass-float nav.bottom a.on { background: none; box-shadow: none; }
  :root[data-ui="glass"] .navlens { display: block; position: absolute; z-index: 0; left: 0; top: 5px; bottom: calc(5px + var(--sab)); border-radius: 28px; pointer-events: none;
    background: rgba(255,255,255,.13); box-shadow: inset 0 1px 0 rgba(255,255,255,.28), 0 2px 10px rgba(0,0,0,.18);
    transform: translateX(var(--lx, 0px)); transition: transform .38s cubic-bezier(.3,1.35,.5,1), width .38s cubic-bezier(.3,1.35,.5,1), opacity .2s; }
  :root[data-ui="glass"].glass-float .navlens { bottom: 5px; }
  :root[data-ui="glass"][data-theme="light"] .navlens { background: rgba(0,0,0,.07); box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 2px 8px rgba(0,0,0,.08); }
  /* while dragging, the bubble swells like a lens — scaled after the move, around its own centre
     (the separate «scale» property multiplied the move too in Safari: the bubble drifted right, more on every tab) */
  :root[data-ui="glass"] nav.bottom.dragging .navlens { transform: translateX(var(--lx, 0px)) scale(1.12); background: rgba(255,255,255,.2); transition-duration: .22s; }
  :root[data-ui="glass"] nav.bottom.dragging a.peek { color: var(--accent-mark); }
  /* Material / Skybee: the tab under the finger takes the indicator */
  :root[data-ui="material"] nav.bottom.dragging a.on:not(.peek) .ni { background: none; }
  :root[data-ui="material"] nav.bottom.dragging a.peek .ni { background: var(--m-c); }
  :root:not([data-ui="material"]):not([data-ui="glass"]) nav.bottom.dragging a.on:not(.peek)::after { display: none; }
  :root:not([data-ui="material"]):not([data-ui="glass"]) nav.bottom.dragging a.peek::after { content: ""; position: absolute; bottom: 3px; left: 50%; width: 18px; height: 3px;
    margin-left: -9px; border-radius: 3px; background: var(--accent); }
  /* the side menu (☰) reaches the screen edges: no floating card on a phone */
  :root[data-ui="glass"] nav.side { top: 0; bottom: 0; height: 100%; margin: 0; border-radius: 0; border-width: 0 1px 0 0; padding-bottom: calc(12px + var(--sab)); }
}

/* =====================================================================
   Liquid Glass, iOS 26 behaviour (phone): bars are not slabs but floating glass —
   - top: no bar, only a soft blur that fades out under the status bar («scroll edge»); buttons are separate glass circles
   - bottom: the tabs in one capsule, «Пошук» in its own glass circle at the trailing end;
     scrolling down shrinks the capsule to the current tab (html.tab-min, set in app.js), scrolling up brings it back
   ===================================================================== */
@media (max-width: 640px) {
  :root[data-ui="glass"] .topbar { background: none; -webkit-backdrop-filter: none; backdrop-filter: none; border-bottom: 0; box-shadow: none; isolation: isolate; }
  :root[data-ui="glass"] .topbar::before { content: ""; position: absolute; inset: 0 0 -22px; z-index: -1; pointer-events: none;
    background: linear-gradient(to bottom, var(--bg) 0, color-mix(in srgb, var(--bg) 82%, transparent) calc(var(--sat) + 26px), transparent 100%);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent); mask-image: linear-gradient(to bottom, #000 55%, transparent); }
  :root[data-ui="glass"] .topbar .ghost { min-width: 40px; min-height: 40px; justify-content: center; border: 1px solid var(--g-edge);
    background: var(--glass); -webkit-backdrop-filter: blur(16px) saturate(180%); backdrop-filter: blur(16px) saturate(180%);
    box-shadow: inset 0 1px 0 var(--g-hi), 0 2px 10px rgba(0,0,0,.18); }
  :root[data-ui="glass"] .topbar h2 { font-size: 20px; }

  /* the tab capsule and the separate search circle */
  :root[data-ui="glass"].glass-float nav.bottom { background: none; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none;
    padding: 5px 72px 5px 7px; overflow: visible; transition: padding .35s cubic-bezier(.3,1.2,.5,1); }
  :root[data-ui="glass"].glass-float nav.bottom::before { content: ""; position: absolute; z-index: 0; top: 0; bottom: 0; left: 0; right: 66px; border-radius: 34px; pointer-events: none;
    background: var(--glass); -webkit-backdrop-filter: blur(var(--g-blur)) saturate(180%); backdrop-filter: blur(var(--g-blur)) saturate(180%);
    border: 1px solid var(--g-edge); box-shadow: inset 0 1px 0 var(--g-hi), var(--g-shadow); transition: right .35s cubic-bezier(.3,1.2,.5,1); }
  :root[data-ui="glass"].glass-float nav.bottom a[data-nav="#/search"] { position: absolute; right: 0; top: 0; bottom: 0; width: 62px; flex: none; border-radius: 50%;
    background: var(--glass); -webkit-backdrop-filter: blur(var(--g-blur)) saturate(180%); backdrop-filter: blur(var(--g-blur)) saturate(180%);
    border: 1px solid var(--g-edge); box-shadow: inset 0 1px 0 var(--g-hi), var(--g-shadow); }
  :root[data-ui="glass"].glass-float nav.bottom a[data-nav="#/search"] .bl { display: none; }
  :root[data-ui="glass"].glass-float nav.bottom a[data-nav="#/search"].on { color: var(--accent-mark); }
  /* minimized while reading: only the current tab stays, the capsule hugs it */
  :root[data-ui="glass"].glass-float.tab-min nav.bottom { padding-right: calc(100% - 70px); }
  :root[data-ui="glass"].glass-float.tab-min nav.bottom::before { right: calc(100% - 64px); }
  :root[data-ui="glass"].glass-float.tab-min nav.bottom a:not(.on):not([data-nav="#/search"]) { display: none; }
  :root[data-ui="glass"].glass-float.tab-min nav.bottom a.on .bl { display: none; }
  :root[data-ui="glass"].glass-float.tab-min .fab { bottom: calc(92px + var(--sab)); }
}

/* ---------- audit fixes (every screen, three styles, fake data) ---------- */
/* a four-way choice fits one line on a phone: no ✓ there, labels shrink instead of wrapping */
:root[data-ui="material"] .seg:has(> :nth-child(4)) button.on::before { content: none; }
:root[data-ui="glass"] .seg, :root[data-ui="material"] .seg { flex-wrap: nowrap; }
:root[data-ui="glass"] .seg > *, :root[data-ui="material"] .seg > * { flex: 1 1 0; min-width: 0; padding-left: 4px; padding-right: 4px; overflow: hidden; text-overflow: ellipsis; }
/* a button next to an input stays on one line */
.row > :is(input, select) + :is(.btn, .ghost, button) { flex: none; white-space: nowrap; }
/* «Колонки» on a phone: the density button is just its icon, so the title fits */
@media (max-width: 640px) { [data-d="density"] .dl { display: none; } }
@media (max-width: 640px) { :root[data-ui="glass"] .seg > *, :root[data-ui="material"] .seg > * { font-size: .9em; } }
.sp-btns > * { white-space: nowrap; min-width: 0; padding-left: 8px; padding-right: 8px; font-size: 13px; }
.sfeed { display: flex; align-items: center; gap: 10px; } .sfeed .ico { flex: none; color: var(--muted); } .sfeed.on .ico { color: var(--accent-mark); }
/* file pickers (banner, avatar, toy, list image): the system control styled like the app's buttons */
input[type="file"] { width: 100%; padding: 6px; border: 1px dashed var(--line); border-radius: 12px; background: none; color: var(--muted); font-size: 13px; }
input[type="file"]::file-selector-button { font: inherit; font-weight: 600; margin-right: 10px; padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--hover); color: var(--text); cursor: pointer; }

/* App colour (Settings → Appearance → Колір, skybee.color): the chosen colour takes the place of the gold accent —
   buttons, switches, the current tab and menu item, badges — while the page keeps the theme's background.
   The bee logo stays gold. --sb-ink is the text colour that reads on it (js/flair.js inkFor). */
html.sb-theme { --accent: var(--sb); --accent-ink: var(--sb-ink); }

/* ---------- Settings, the Telegram way ---------- */
/* my profile on top over my Skybee profile colour (--pc, from flair), melting softly into the page; no colour → a faint accent glow */
.shead { position: relative; isolation: isolate; padding-top: 28px; padding-bottom: 22px; }
.shead::before { content: ""; position: absolute; z-index: -1; left: 0; right: 0; top: calc(-64px - var(--sat)); bottom: 0; pointer-events: none;
  background: radial-gradient(ellipse 90% 70% at 50% 30%, color-mix(in srgb, var(--pc, var(--accent)) 38%, transparent), transparent 72%),
    linear-gradient(to bottom, color-mix(in srgb, var(--pc2, var(--pc, var(--accent))) 26%, var(--bg)) 0%, var(--bg) 100%); }
.shead:not([style*="--pc"])::before { opacity: .45; }
.shead .avatar { box-shadow: 0 6px 24px color-mix(in srgb, var(--pc, #000) 35%, rgba(0,0,0,.25)); }
.shead b { font-size: 24px; }
/* rounded groups, separators that start after the icon */
.sgroup, .sgroup:first-of-type { margin: 0 12px 14px; padding: 2px 0; border: 0; border-radius: 18px; background: var(--panel); overflow: hidden; }
.sgroup > .srow + .srow { box-shadow: inset 52px 1px 0 var(--panel), inset 0 1px 0 color-mix(in srgb, var(--line) 80%, transparent); }
.srow { padding: 12px 16px; }
:root[data-ui="glass"] .sgroup { border-radius: 24px; }
:root[data-ui="material"] .sgroup { border-radius: 20px; background: var(--m-s1); }
/* the accounts list: avatar, name over handle, unread count */
.srow.acc { gap: 12px; padding-top: 9px; padding-bottom: 9px; }
.srow.acc .grow { display: flex; flex-direction: column; min-width: 0; }
.srow.acc b, .srow.acc small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srow.acc small { font-size: 13px; }
.acc-n:empty { display: none; }
.acc-n { min-width: 24px; padding: 2px 8px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 13px; font-weight: 700; text-align: center; }
.sgroup > .srow + .srow.acc, .sgroup > .srow.acc + .srow { box-shadow: inset 62px 1px 0 var(--panel), inset 0 1px 0 color-mix(in srgb, var(--line) 80%, transparent); }
:root[data-ui="material"] .sgroup > .srow + .srow { box-shadow: inset 52px 1px 0 var(--m-s1), inset 0 1px 0 color-mix(in srgb, var(--line) 80%, transparent); }

/* =====================================================================
   Material 3, as Google's own apps do it (Gmail, Messages, Android 16 Settings)
   ===================================================================== */
.fab .fl { display: none; }
/* top app bar: flat over the page, takes the «scrolled» container colour once content goes under it */
:root[data-ui="material"] .topbar { transition: background-color .2s; }
:root[data-ui="material"].scrolled .topbar { background: var(--m-s2); }
/* search bar: a 56dp pill on the container colour, no outline */
:root[data-ui="material"] .searchbar input { min-height: 56px; border: 0; border-radius: 28px; padding-left: 22px; background: var(--m-s2); }
:root[data-ui="material"] .searchbar input:focus { outline: 2px solid var(--accent); }
/* switch: a ✓ in the thumb when on */
:root[data-ui="material"] .stoggle input:checked + i::after { content: "✓"; display: grid; place-items: center; color: var(--accent); font-size: 14px; font-weight: 900; line-height: 1; }
/* Android 16 Settings: every row its own rounded tile, small gaps, large outer corners */
:root[data-ui="material"] .sgroup { background: none; border-radius: 0; overflow: visible; display: flex; flex-direction: column; gap: 2px; }
:root[data-ui="material"] .sgroup > .srow { background: var(--m-s1); border-radius: 4px; box-shadow: none !important; }
:root[data-ui="material"] .sgroup > .srow:first-child { border-radius: 22px 22px 4px 4px; }
:root[data-ui="material"] .sgroup > .srow:last-child { border-radius: 4px 4px 22px 22px; }
:root[data-ui="material"] .sgroup > .srow:only-child { border-radius: 22px; }
:root[data-ui="material"] .sgroup > .srow .sicon { width: 36px; height: 36px; border-radius: 50%; background: var(--m-c); color: var(--m-on-c); }
:root[data-ui="material"] .sgroup > .srow .sicon .ico { width: 20px; height: 20px; }
@media (max-width: 640px) {
  /* flexible navigation bar (M3 Expressive): shorter, the pill around the icon, label under it */
  :root[data-ui="material"] nav.bottom { min-height: 64px; padding: 6px 0 calc(6px + var(--sab)); }
  :root[data-ui="material"] nav.bottom a { gap: 2px; }
  :root[data-ui="material"] nav.bottom .ni { width: 56px; height: 32px; }
  :root[data-ui="material"].m-labels nav.bottom .bl { font-size: 12px; font-weight: 600; }
  :root[data-ui="material"] main { padding-bottom: calc(150px + var(--sab)); }
  :root[data-ui="material"] .chatbar, :root[data-ui="material"]:not(.m-labels) .chatbar { bottom: calc(64px + var(--sab)); }
  /* extended FAB «✏️ Новий пост», shrinking to the icon while you scroll down */
  :root[data-ui="material"] .fab { display: flex; align-items: center; justify-content: center; gap: 12px; width: auto; min-width: 56px; height: 56px; padding: 0 20px;
    bottom: calc(80px + var(--sab)); transition: padding .25s, min-width .25s; }
  :root[data-ui="material"] .fab .fl { display: inline; font-size: 15px; font-weight: 600; letter-spacing: .01em; white-space: nowrap; }
  :root[data-ui="material"] .fab .ico { margin: 0; }
  :root[data-ui="material"].fab-min .fab { padding: 0; width: 56px; }
  :root[data-ui="material"].fab-min .fab .fl { display: none; }
  /* dialogs become bottom sheets with a drag handle (the photo viewer stays full screen) */
  :root[data-ui="material"] .modal-bg:not(.dark) { align-items: flex-end; padding: 0; }
  :root[data-ui="material"] .modal-bg:not(.dark) > .modal { max-width: none; border-radius: 28px 28px 0 0; padding: 30px 20px calc(20px + var(--sab)); max-height: 92vh; overflow-y: auto;
    position: relative; animation: m-sheet .28s cubic-bezier(.2,.9,.3,1); }
  :root[data-ui="material"] .modal-bg:not(.dark) > .modal::before { content: ""; position: absolute; top: 10px; left: 50%; width: 32px; height: 4px; margin-left: -16px; border-radius: 2px;
    background: color-mix(in srgb, var(--text) 40%, transparent); }
  /* snackbar: over the navigation bar, full width, text left */
  :root[data-ui="material"] .toast { left: 12px; right: 12px; transform: none; bottom: calc(76px + var(--sab)); text-align: left; border-radius: 8px; }
}
@keyframes m-sheet { from { transform: translateY(40%); opacity: .4; } }

/* the profile gradient flows slowly between its two colours (js/flair.js, css above); still with «Зменшити анімацію» or reduced motion */
@keyframes sb-flow { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }
body.calm :is(main.sb-tint, .sideprof.sb-tint, .sp-banner, .sb-gr, .sb-flow), body.calm main.sb-tint::before { animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  :is(main.sb-tint, .sideprof.sb-tint, .sp-banner, .sb-gr, .sb-flow), main.sb-tint::before { animation: none !important; }
}

/* home: swiping the feed sideways switches feeds (js/views.js home); the browser keeps only the vertical scroll */
@media (pointer: coarse) { #feedBody { touch-action: pan-y; } }
/* a phone sideways: the rail's items closer together in every style, so the whole menu fits the short screen */
@media (orientation: landscape) and (max-height: 500px) and (min-width: 641px) {
  :root[data-ui] nav.side a { min-height: 0; height: 36px; margin: 1px 0; padding-block: 0; }
  :root[data-ui] nav.side .logo { height: 40px; }
  nav.side { overflow-y: auto; }
}
/* the own profile is open (js/app.js route → body.myprofile): no profile card on the right, the feeds move up */
body.myprofile #sideProf { display: none; }

/* =====================================================================
   MOTION — every interface style moves in its own way (js: playNav in app.js, leave() in ui.js)
   Skybee  — «honey»: things rise and settle softly, a warm golden pulse on what you touch
   Glass   — iOS: springs, the push from the right / back from the left, sheets and menus that grow from where they come from
   Material — Material 3: emphasized easing, the shared X axis, «fade through» between tabs, menus that unfold from the top
   With «Зменшити анімацію» (body.calm) or the system's reduced motion all of it is off (see the end of this block).
   ===================================================================== */
:root {
  --ease-move: cubic-bezier(.2, .8, .2, 1);          /* Skybee: a soft settle */
  --ease-spring: cubic-bezier(.34, 1.36, .64, 1);    /* a little overshoot */
  --dur-screen: .34s; --dur-pop: .3s; --dur-out: .18s;
}
:root[data-ui="glass"] { --ease-move: cubic-bezier(.32, .72, 0, 1); --ease-spring: cubic-bezier(.34, 1.56, .64, 1); --dur-screen: .44s; --dur-pop: .42s; --dur-out: .22s; }
:root[data-ui="material"] { --ease-move: cubic-bezier(.05, .7, .1, 1); --ease-spring: cubic-bezier(.2, 0, 0, 1); --dur-screen: .4s; --dur-pop: .3s; --dur-out: .15s; }

.leaving { pointer-events: none !important; }

/* ---------- screens ---------- */
@keyframes sb-screen-in { from { opacity: 0; translate: 0 18px; scale: .985; } }
@keyframes sb-screen-back { from { opacity: 0; translate: 0 -12px; } }
@keyframes sb-tab-in { from { opacity: 0; scale: .99; } }
main.nav-push { animation: sb-screen-in var(--dur-screen) var(--ease-move); }
main.nav-pop { animation: sb-screen-back var(--dur-screen) var(--ease-move); }
main.nav-tab { animation: sb-tab-in .24s ease-out; }
@keyframes ios-push { from { translate: min(32%, 160px) 0; opacity: .35; } }
@keyframes ios-pop { from { translate: max(-26%, -120px) 0; opacity: .5; } }
@keyframes ios-tab { from { opacity: 0; } }
:root[data-ui="glass"] main.nav-push { animation: ios-push var(--dur-screen) var(--ease-move); }
:root[data-ui="glass"] main.nav-pop { animation: ios-pop var(--dur-screen) var(--ease-move); }
:root[data-ui="glass"] main.nav-tab { animation: ios-tab .2s ease-out; }
@keyframes m-axis-in { 0% { translate: 30px 0; opacity: 0; } 35% { opacity: 0; } }
@keyframes m-axis-back { 0% { translate: -30px 0; opacity: 0; } 35% { opacity: 0; } }
@keyframes m-fade-through { 0% { opacity: 0; scale: .92; } 30% { opacity: 0; scale: .92; } }
:root[data-ui="material"] main.nav-push { animation: m-axis-in var(--dur-screen) var(--ease-move); }
:root[data-ui="material"] main.nav-pop { animation: m-axis-back var(--dur-screen) var(--ease-move); }
:root[data-ui="material"] main.nav-tab { animation: m-fade-through .3s var(--ease-move); }

/* posts arrive one after another at the top of a list, then simply appear as more load */
@keyframes sb-item-in { from { opacity: 0; translate: 0 10px; } }
@keyframes ios-item-in { from { opacity: 0; translate: 0 6px; } }
@keyframes m-item-in { from { opacity: 0; } }
.plist > :is(.post, .notif, .actor) { animation: sb-item-in .36s var(--ease-move) backwards; }
:root[data-ui="glass"] .plist > :is(.post, .notif, .actor) { animation-name: ios-item-in; }
:root[data-ui="material"] .plist > :is(.post, .notif, .actor) { animation-name: m-item-in; animation-duration: .25s; }
.plist > :nth-child(2) { animation-delay: .03s; } .plist > :nth-child(3) { animation-delay: .06s; }
.plist > :nth-child(4) { animation-delay: .09s; } .plist > :nth-child(5) { animation-delay: .12s; }
.plist > :nth-child(6) { animation-delay: .15s; }

/* ---------- windows (modal), bottom sheets, the chat message sheet ---------- */
@keyframes fade-in { from { opacity: 0; } } @keyframes fade-out { to { opacity: 0; } }
@keyframes sb-drop { 0% { opacity: 0; translate: 0 -20px; scale: .96; } 65% { opacity: 1; translate: 0 3px; scale: 1.004; } }
@keyframes sb-lift { to { opacity: 0; translate: 0 -10px; scale: .98; } }
.modal-bg, .msheet-bg { animation: fade-in .2s ease-out; }
.modal-bg.leaving, .msheet-bg.leaving { animation: fade-out var(--dur-out) ease-in forwards; }
.modal-bg > .modal { animation: sb-drop .42s var(--ease-move); }
.modal-bg.leaving > .modal { animation: sb-lift var(--dur-out) ease-in forwards; }
.msheet-bg > .msheet { animation: sb-drop .36s var(--ease-move); }
.msheet-bg.leaving > .msheet { animation: sb-lift var(--dur-out) ease-in forwards; }
/* iOS: windows grow out of the glass with a spring and shrink back; on a phone they come up from the bottom edge */
@keyframes ios-grow { from { opacity: 0; scale: .86; } }
@keyframes ios-shrink { to { opacity: 0; scale: .92; } }
@keyframes ios-sheet-up { from { translate: 0 100vh; } }
@keyframes ios-sheet-down { to { translate: 0 100vh; } }
:root[data-ui="glass"] .modal-bg > .modal, :root[data-ui="glass"] .msheet-bg > .msheet { animation: ios-grow var(--dur-pop) var(--ease-spring); }
:root[data-ui="glass"] .modal-bg.leaving > .modal, :root[data-ui="glass"] .msheet-bg.leaving > .msheet { animation: ios-shrink var(--dur-out) ease-in forwards; }
/* Material: dialogs unfold (emphasized decelerate), sheets slide up; they leave fast (emphasized accelerate) */
@keyframes m-dialog-in { from { opacity: 0; scale: .9; translate: 0 -12px; } }
@keyframes m-dialog-out { to { opacity: 0; scale: .96; } }
@keyframes m-sheet-in { from { translate: 0 100%; } }
@keyframes m-sheet-out { to { translate: 0 100%; } }
:root[data-ui="material"] .modal-bg > .modal, :root[data-ui="material"] .msheet-bg > .msheet { animation: m-dialog-in var(--dur-pop) var(--ease-move); }
:root[data-ui="material"] .modal-bg.leaving > .modal, :root[data-ui="material"] .msheet-bg.leaving > .msheet { animation: m-dialog-out var(--dur-out) cubic-bezier(.3, 0, .8, .15) forwards; }
@media (max-width: 640px) {
  :root[data-ui="material"] .modal-bg:not(.dark) > .modal { animation: m-sheet-in .4s var(--ease-move); }
  :root[data-ui="material"] .modal-bg.leaving:not(.dark) > .modal { animation: m-sheet-out .2s cubic-bezier(.3, 0, .8, .15) forwards; }
  :root[data-ui="glass"] .msheet-bg > .msheet { animation: ios-sheet-up .5s var(--ease-move); }
  :root[data-ui="glass"] .msheet-bg.leaving > .msheet { animation: ios-sheet-down .28s ease-in forwards; }
}
.modal-bg.dark > .modal { animation-name: fade-in; } /* the photo viewer only fades */

/* ---------- menus («⋯») ---------- */
@keyframes sb-menu-in { from { opacity: 0; translate: 0 -8px; scale: .97; } }
@keyframes ios-menu-in { from { opacity: 0; scale: .5; filter: blur(6px); } }
@keyframes m-menu-in { from { opacity: 0; scale: 1 .6; } }
.popmenu { transform-origin: top right; animation: sb-menu-in .22s var(--ease-move); }
.popmenu.leaving { animation: fade-out .12s ease-in forwards; }
:root[data-ui="glass"] .popmenu { animation: ios-menu-in .4s var(--ease-spring); }
:root[data-ui="glass"] .popmenu.leaving { animation: ios-shrink .18s ease-in forwards; }
:root[data-ui="material"] .popmenu { transform-origin: top; animation: m-menu-in .25s var(--ease-move); }

/* ---------- toasts / snackbars ---------- */
@keyframes sb-toast-in { 0% { opacity: 0; translate: 0 18px; scale: .9; } 70% { opacity: 1; translate: 0 -2px; scale: 1.02; } }
@keyframes ios-toast-in { from { opacity: 0; translate: 0 40px; } }
@keyframes m-toast-in { from { opacity: 0; scale: 1 .8; } }
.toast { animation: sb-toast-in .42s var(--ease-move); transition: opacity .25s, translate .25s; }
.toast.out { translate: 0 10px; }
:root[data-ui="glass"] .toast { animation: ios-toast-in .5s var(--ease-spring); }
:root[data-ui="material"] .toast { transform-origin: bottom; animation: m-toast-in .25s var(--ease-move); }
:root[data-ui="material"] .toast.out { translate: none; }

/* ---------- the side menu on a phone (☰) ---------- */
@media (max-width: 640px) {
  nav.side { transition: transform .32s var(--ease-move); }
  :root[data-ui="glass"] nav.side { transition-duration: .45s; }
}

/* ---------- touch: buttons answer the finger ---------- */
:root:not([data-ui="material"]) :is(.btn, .ghost, .actions button, .fab, .compose-side, .sb-sw, .sb-gr) { transition: scale .35s var(--ease-spring), background .2s, color .2s, border-color .2s, box-shadow .2s; }
:root:not([data-ui="material"]) :is(.btn, .ghost, .actions button, .fab, .compose-side, .sb-sw, .sb-gr):active { scale: .95; transition-duration: .08s; }
:root[data-ui="glass"] :is(.btn, .ghost, .fab, .compose-side):active { scale: .93; }
/* Skybee: the gold glows up where you press */
:root:not([data-ui="material"]):not([data-ui="glass"]) :is(.btn, .fab, .compose-side):active { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 30%, transparent), 0 0 18px color-mix(in srgb, var(--accent) 45%, transparent); }
/* Material: no squeeze (the ripple and the state layer answer), the FAB lifts a little */
:root[data-ui="material"] .fab { transition: width .3s var(--ease-move), padding .3s var(--ease-move), box-shadow .2s; }
:root[data-ui="material"] .fab:active { box-shadow: 0 6px 18px rgba(0,0,0,.4); }

/* ---------- the like ---------- */
@keyframes sb-like { 0% { scale: 1; } 25% { scale: .8; } 55% { scale: 1.35; } 100% { scale: 1; } }
@keyframes sb-like-ring { from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--like) 55%, transparent); } to { box-shadow: 0 0 0 14px transparent; } }
@keyframes ios-like { 0% { scale: 1; } 30% { scale: 1.45; } 60% { scale: .9; } 100% { scale: 1; } }
@keyframes m-like { 0% { scale: .7; } 60% { scale: 1.15; } 100% { scale: 1; } }
.actions .pop svg { animation: sb-like .5s var(--ease-move); }
.actions .pop { border-radius: 999px; animation: sb-like-ring .6s ease-out; }
:root[data-ui="glass"] .actions .pop svg { animation: ios-like .55s var(--ease-spring); }
:root[data-ui="glass"] .actions .pop { animation: none; }
:root[data-ui="material"] .actions .pop svg { animation: m-like .35s var(--ease-move); }
:root[data-ui="material"] .actions .pop { animation: none; }

/* ---------- the tab bar and the side menu: the chosen tab answers ---------- */
@keyframes sb-hop { 0% { translate: 0 0; } 40% { translate: 0 -4px; } 100% { translate: 0 0; } }
@keyframes ios-bounce { 0% { scale: 1; } 35% { scale: .82; } 70% { scale: 1.12; } 100% { scale: 1; } }
@keyframes m-pill { from { scale: .4 1; opacity: .3; } }
:is(nav.bottom, nav.side) a.on .ico { animation: sb-hop .4s var(--ease-move); }
:root[data-ui="glass"] :is(nav.bottom, nav.side) a.on .ico { animation: ios-bounce .45s var(--ease-spring); }
:root[data-ui="material"] :is(nav.bottom, nav.side) a.on .ico { animation: none; }
:root[data-ui="material"] nav.bottom a.on .ni { animation: m-pill .35s var(--ease-move); }

/* ---------- switches and segmented buttons glide ---------- */
.stoggle i, .stoggle i::before, .stoggle i::after { transition-timing-function: var(--ease-spring) !important; transition-duration: .3s !important; }
:root[data-ui="material"] .stoggle i, :root[data-ui="material"] .stoggle i::before, :root[data-ui="material"] .stoggle i::after { transition-timing-function: var(--ease-move) !important; }

/* ---------- reduced motion: everything above is still ---------- */
body.calm :is(main, .modal-bg, .modal, .msheet-bg, .msheet, .popmenu, .toast, .actions .pop, .actions .pop svg, nav.bottom .ico, nav.side .ico, nav.bottom .ni),
body.calm .plist > * { animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  :is(main, .modal-bg, .modal, .msheet-bg, .msheet, .popmenu, .toast, .actions .pop, .actions .pop svg, nav.bottom .ico, nav.side .ico, nav.bottom .ni),
  .plist > * { animation: none !important; }
}

/* =====================================================================
   Phone feedback: action icons, top bar icons in Material, labels in the Glass tab bar, the Glass bubble in every row
   ===================================================================== */
/* under a post: icons at full size that never shrink, counts never cut («1,2К» keeps them short) */
.actions svg { flex: none; width: 20px; height: 20px; }
.actions button { font-size: 14px; flex: 0 0 auto; }
.actions button span { overflow: visible; text-overflow: clip; }
@media (max-width: 400px) { .actions button { padding-left: 5px; padding-right: 5px; } }
:root[data-ui="material"] .actions svg { width: 22px; height: 22px; }

/* Material: top bar icons 24dp inside 48dp round targets, as in Google's apps */
:root[data-ui="material"] .topbar .ghost.icon { width: 48px; height: 48px; min-width: 48px; padding: 0; display: inline-grid; place-items: center; border-radius: 50%; font-size: 24px; line-height: 1; }
:root[data-ui="material"] .topbar .ghost.icon svg, :root[data-ui="material"] .topbar .ghost.icon .ico { width: 24px !important; height: 24px !important; }

/* Liquid Glass on a phone: the tab bar shows icons only (the labels ran into each other), a little bigger */
@media (max-width: 640px) {
  :root[data-ui="glass"] nav.bottom .bl { display: none !important; }
  :root[data-ui="glass"] nav.bottom .ico { width: 27px !important; height: 27px !important; }
}

/* Liquid Glass: the bubble under the chosen item of every segmented control and tab row (js: «the bubble in every row» in app.js) */
.rowlens { display: none; }
:root[data-ui="glass"] :is(.seg, .tabs) { position: relative; }
:root[data-ui="glass"] :is(.seg, .tabs) > :not(.rowlens) { position: relative; z-index: 1; }
:root[data-ui="glass"] .rowlens { display: block; position: absolute; left: 0; z-index: 0; padding: 0; margin: 0; flex: none; pointer-events: none; border-radius: 999px;
  background: color-mix(in srgb, #fff 16%, var(--glass)); box-shadow: inset 0 1px 0 var(--g-hi), 0 2px 8px rgba(0,0,0,.18);
  transform: translateX(var(--lx, 0px)); transition: transform .38s cubic-bezier(.3,1.35,.5,1), width .38s cubic-bezier(.3,1.35,.5,1), top .2s, height .2s, background .2s; }
:root[data-ui="glass"][data-theme="light"] .rowlens { background: rgba(0,0,0,.07); box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 2px 8px rgba(0,0,0,.08); }
:root[data-ui="glass"] :is(.seg, .tabs).dragging .rowlens { transform: translateX(var(--lx, 0px)) scale(1.08); background: rgba(255,255,255,.22); transition-duration: .22s; }
:root[data-ui="glass"] :is(.seg, .tabs) .peek { color: var(--accent-mark, var(--accent)); }
:root[data-ui="glass"] .seg button.on, :root[data-ui="glass"] .seg label:has(:checked) { background: none !important; box-shadow: none !important; }
:root[data-ui="glass"] .tabs > .on::after { display: none; }
:root[data-ui="glass"] :is(.seg, .tabs).rowfit { touch-action: pan-y; } /* sideways belongs to the bubble there */
body.calm .rowlens { transition: none !important; }

/* ---------- Liquid Glass on a wide screen: the middle column (feed, profile, search…) is a glass bubble too,
   like the menu and the right column. No backdrop-filter on main: it would become the containing block of fixed children. ---------- */
@media (min-width: 641px) and (min-height: 501px) {
  :root[data-ui="glass"] main { margin: 10px 12px; min-height: calc(100vh - 20px); border: 1px solid var(--g-edge); border-radius: 28px;
    background: color-mix(in srgb, var(--panel) 82%, transparent); box-shadow: inset 0 1px 0 var(--g-hi), var(--g-shadow);
    position: relative; isolation: isolate; overflow: clip; overflow-clip-margin: 0; }
  :root[data-ui="glass"][data-theme="light"] main { background: color-mix(in srgb, var(--panel) 90%, transparent); }
  /* the page colour stays inside the bubble (no soft spill into the side panels — they are separate glass now) */
  :root[data-ui="glass"] main.sb-tint { border-color: var(--g-edge); overflow-clip-margin: 0; }
  :root[data-ui="glass"] main.sb-tint::before { width: 100%; margin-left: 0; margin-right: 0; -webkit-mask-image: none; mask-image: none; }
  /* the sticky header keeps the bubble's round top when the column scrolls under it */
  :root[data-ui="glass"] main .topbar { border-radius: 27px 27px 0 0; }
  /* «Колонки»: the bubble fits the window exactly; the chat input sits inside the bubble's round bottom */
  :root[data-ui="glass"] body.deckmode main { height: calc(100vh - 20px); min-height: 0; }
  :root[data-ui="glass"] .chatbar { width: min(574px, calc(100% - 26px)); bottom: 11px; border-radius: 0 0 27px 27px; }
}

/* ---------- profile colours on posts in any feed (js/flair.js tintPosts; Налаштування → Вміст і медіа) ----------
   a calm wash of the author's gradient behind the post, flowing like their profile page */
article.post.sb-post { background: linear-gradient(125deg, color-mix(in srgb, var(--sb) var(--sbp, 22%), transparent), color-mix(in srgb, var(--sb2) var(--sbp, 22%), transparent),
    color-mix(in srgb, var(--sb3, var(--sb)) var(--sbp, 22%), transparent), color-mix(in srgb, var(--sb2) var(--sbp, 22%), transparent), color-mix(in srgb, var(--sb) var(--sbp, 22%), transparent));
  background-size: 300% 300%; animation: sb-flow 14s ease-in-out infinite alternate; }
[data-theme="light"] article.post.sb-post { --sbp: 28%; }
main.sb-tint article.post.sb-post { background: none; animation: none; } /* on the author's own page the whole page already has the colour */
/* «переливання» switched off in the author's «✨ Оформлення»: the gradient stays still */
.sb-still, .sb-still::before, .sb-still .sp-banner, .sb-still .banner { animation: none !important; }
body.calm article.post.sb-post { animation: none !important; }
@media (prefers-reduced-motion: reduce) { article.post.sb-post { animation: none !important; } }
.sb-third { display: inline-flex; align-items: center; gap: 4px; }
.sb-add3 { display: grid; place-items: center; font-size: 20px; color: var(--muted); background: var(--hover) !important; border-style: dashed !important; }
.sb-rm3 { width: 28px; height: 28px; min-width: 0; padding: 0; font-size: 13px; }

/* =====================================================================
   LIQUID GLASS 2 — as in Apple's own apps (iOS 26 / iPadOS 26 / macOS 26)
   • a clearer material: little blur, a lot of saturation, content shows through
   • a specular rim lit from one side (--gx/--gy: the tilt of the phone or the mouse moves the light, js in app.js)
   • something to see through: a soft colour field behind the whole app
   • optional refraction (html.lg-refract, Chromium only: an SVG displacement filter in index.html)
   • posts sit on glass cards; buttons are glass (the main action tinted with the accent)
   ===================================================================== */
:root[data-ui="glass"] {
  --gx: -1; --gy: -1;
  --lg-fill: rgba(255,255,255,.07); --lg-fill-2: rgba(255,255,255,.13); --lg-blur: 12px; --lg-sat: 190%;
  --lg-rim-a: .5; --lg-rim-b: .14; --lg-drop: 0 10px 30px rgba(0,0,0,.30), 0 1px 3px rgba(0,0,0,.25);
  --lg-filter: blur(var(--lg-blur)) saturate(var(--lg-sat));
  --lg-rim: inset calc(var(--gx) * -1px) calc(var(--gy) * -1px) 0 rgba(255,255,255,var(--lg-rim-a)),
            inset calc(var(--gx) * 1px) calc(var(--gy) * 1px) 0 rgba(255,255,255,var(--lg-rim-b)),
            inset 0 0 0 .5px rgba(255,255,255,.10), inset 0 0 18px rgba(255,255,255,.035);
}
:root[data-ui="glass"][data-glass="clear"] { --lg-fill: rgba(255,255,255,.035); --lg-blur: 6px; }
:root[data-ui="glass"][data-glass="frost"] { --lg-fill: rgba(255,255,255,.14); --lg-blur: 26px; }
:root[data-ui="glass"][data-theme="light"] {
  --lg-fill: rgba(255,255,255,.5); --lg-fill-2: rgba(255,255,255,.7); --lg-rim-a: .95; --lg-rim-b: .5;
  --lg-drop: 0 8px 28px rgba(30,40,70,.12), 0 1px 3px rgba(30,40,70,.08);
}
:root[data-ui="glass"][data-theme="light"][data-glass="clear"] { --lg-fill: rgba(255,255,255,.32); }
:root[data-ui="glass"][data-theme="light"][data-glass="frost"] { --lg-fill: rgba(255,255,255,.72); }
/* refraction: the edges of the glass bend what is behind them (Chromium: desktop app, Android) */
html.lg-refract:root[data-ui="glass"] { --lg-filter: url(#lg-refract) blur(var(--lg-blur)) saturate(var(--lg-sat)); }

/* a soft colour field behind everything — glass needs something to show through */
:root[data-ui="glass"] body::before { content: ""; position: fixed; inset: -12%; z-index: -1; pointer-events: none;
  background: radial-gradient(42% 34% at 12% 6%, color-mix(in srgb, var(--accent) 24%, transparent), transparent 70%),
    radial-gradient(38% 32% at 94% 26%, rgba(91,140,255,.20), transparent 70%),
    radial-gradient(46% 38% at 26% 96%, rgba(196,113,245,.17), transparent 70%),
    radial-gradient(36% 30% at 86% 88%, rgba(62,230,190,.12), transparent 70%); }
:root[data-ui="glass"][data-theme="light"] body::before { opacity: .9; filter: saturate(1.2); }

/* the material on the floating chrome */
:root[data-ui="glass"] :is(nav.side, .modal, .popmenu, .toast, .chatbar, .msheet .mactions, .dcol, .dhead, .seg, .card),
:root[data-ui="glass"].glass-float nav.bottom::before,
:root[data-ui="glass"].glass-float nav.bottom a[data-nav="#/search"],
:root[data-ui="glass"]:not(.glass-float) nav.bottom {
  background: var(--lg-fill); -webkit-backdrop-filter: var(--lg-filter); backdrop-filter: var(--lg-filter);
  border: 0; box-shadow: var(--lg-rim), var(--lg-drop); }
:root[data-ui="glass"] :is(.modal, .popmenu, .msheet .mactions) { background: var(--lg-fill-2); }
:root[data-ui="glass"] .seg { box-shadow: var(--lg-rim); }
/* the lens under the chosen tab / segment: a brighter drop of the same glass */
:root[data-ui="glass"] :is(.navlens, .rowlens) { background: var(--lg-fill-2) !important; box-shadow: var(--lg-rim), 0 3px 12px rgba(0,0,0,.18) !important; }
:root[data-ui="glass"][data-theme="light"] :is(.navlens, .rowlens) { background: rgba(255,255,255,.85) !important; }
/* the lens moves with JS (a liquid stretch on the way, app.js); only its size eases here */
@media (max-width: 640px) { :root[data-ui="glass"] .navlens { transition: width .45s var(--ease-spring), opacity .2s; } }
:root[data-ui="glass"] .rowlens { transition: width .45s var(--ease-spring), top .2s, height .2s, background .2s; }

/* the top: transparent, the content blurs softly as it slides under (as in Mail and Music) */
@media (max-width: 640px) {
  :root[data-ui="glass"] .topbar::before { background: linear-gradient(to bottom, color-mix(in srgb, var(--bg) 55%, transparent) 0, color-mix(in srgb, var(--bg) 25%, transparent) calc(var(--sat) + 30px), transparent 100%); }
}
:root[data-ui="glass"] .topbar { background: color-mix(in srgb, var(--bg) 35%, transparent); border-bottom: 0; box-shadow: none; }
@media (max-width: 640px) { :root[data-ui="glass"] .topbar { background: none; } }

/* buttons: round glass for icons, glass capsules, the main action tinted with the accent */
:root[data-ui="glass"] .topbar .ghost, :root[data-ui="glass"] .ghost.icon {
  background: var(--lg-fill); -webkit-backdrop-filter: var(--lg-filter); backdrop-filter: var(--lg-filter); border: 0; box-shadow: var(--lg-rim), 0 2px 10px rgba(0,0,0,.16); }
:root[data-ui="glass"] .ghost:not(.icon) { background: var(--lg-fill); border: 0; box-shadow: var(--lg-rim); }
:root[data-ui="glass"] .btn, :root[data-ui="glass"] .fab {
  background: color-mix(in srgb, var(--accent) 82%, transparent); color: var(--accent-ink); border: 0;
  -webkit-backdrop-filter: var(--lg-filter); backdrop-filter: var(--lg-filter);
  box-shadow: inset calc(var(--gx) * -1px) calc(var(--gy) * -1px) 0 rgba(255,255,255,.55), inset 0 0 0 .5px rgba(255,255,255,.25), 0 4px 16px color-mix(in srgb, var(--accent) 30%, transparent); }

/* posts: each on its own glass card */
:root[data-ui="glass"] .plist > article.post { margin: 8px 10px; border: 0 !important; border-radius: 24px; box-shadow: var(--lg-rim), 0 2px 12px rgba(0,0,0,.10); }
:root[data-ui="glass"] .plist > article.post:not(.sb-post) { background: var(--lg-fill); }
:root[data-ui="glass"][data-theme="light"] .plist > article.post:not(.sb-post) { background: rgba(255,255,255,.62); }
:root[data-ui="glass"] .plist > article.post.sb-post { box-shadow: var(--lg-rim), 0 2px 12px rgba(0,0,0,.10); }
:root[data-ui="glass"] main.sb-tint .plist > article.post { background: var(--lg-fill); }

/* «Reduce transparency» (system) / «Зменшити анімацію»: solid surfaces, no colour field, the light stays put */
@media (prefers-reduced-transparency: reduce) {
  :root[data-ui="glass"] body::before { display: none; }
  :root[data-ui="glass"] { --lg-fill: var(--panel); --lg-fill-2: var(--panel); --lg-filter: none; }
}
/* menus, windows and sheets are mostly solid glass, as in iOS: what is under them must never mix with their text */
:root[data-ui="glass"] :is(.popmenu, .modal, .msheet .mactions) { background: color-mix(in srgb, var(--panel) 86%, transparent);
  -webkit-backdrop-filter: blur(30px) saturate(190%); backdrop-filter: blur(30px) saturate(190%); }
:root[data-ui="glass"][data-theme="light"] :is(.popmenu, .modal, .msheet .mactions) { background: color-mix(in srgb, #fff 82%, transparent); }

/* ---------- war positions of artists (js/stars.js; data from starsaboutwar.in.ua) ---------- */
.saw-line { display: flex; flex-wrap: wrap; gap: 4px 10px; padding: 0 10px 8px 64px; font-size: 13px; }
.saw-mark { font-size: 13px; font-weight: 600; }
.saw-mark a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.saw-za { color: #ff5a5f; } .saw-proty { color: #3ec27a; } .saw-movchat { color: var(--muted); } .saw-spirno { color: #e0a800; } .saw-none { color: var(--muted); font-weight: 500; }
[data-theme="light"] .saw-za { color: #c62828; } [data-theme="light"] .saw-proty { color: #1b7f46; } [data-theme="light"] .saw-spirno { color: #9a6b00; }
.saw-q { margin: 6px 0 2px; }
.saw-q summary { cursor: pointer; list-style: none; font-size: 14px; color: var(--muted); width: max-content; padding: 4px 0; }
.saw-q summary::-webkit-details-marker { display: none; }
.saw-q[open] summary { color: var(--text); }
.saw-body { padding: 8px 12px; border-radius: 14px; background: color-mix(in srgb, var(--text) 6%, transparent); margin-top: 4px; }
.saw-item + .saw-item { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.saw-item p { margin: 6px 0; }
.saw-src { margin: 10px 0 0; }
/* the glow of the sun / moon is a round gradient behind it (a wide box-shadow showed a square edge while it rose) */
#splash .sp-sun { box-shadow: none !important; }
#splash .sp-sun::before { content: ""; position: absolute; inset: -70%; z-index: -1; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, var(--sp-glow, rgba(233, 201, 120, .45)) 0 34%, transparent 70%); }
#splash.tinted:not(.night) { --sp-glow: color-mix(in srgb, var(--sp-sun2) 40%, transparent); }
#splash.night { --sp-glow: color-mix(in srgb, var(--sp-moon, #f4ecd0) 30%, transparent); }
#splash.eclipse { --sp-glow: rgba(255, 30, 30, .55); }
#splash.eclipse .sp-sun { outline: 3px solid #ff2a2a; outline-offset: -1px; }
#splash .sp-sun::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: inherit; } /* the disk over its own glow */
.saw-points { margin: 6px 0; padding-left: 18px; color: var(--muted); } .saw-points li { margin: 2px 0; }

/* =====================================================================
   TABLETS & UNFOLDED PHONES (touch screens wider than a phone): iPad, Galaxy Fold / Pixel Fold opened
   • upright (portrait): an icon rail and a long, wide feed; the feeds as tabs on top (like the phone)
   • sideways (landscape): the icon rail (no text), the feed, and on the right the own profile and the feeds;
     a post tapped in a list opens beside it, in place of the right column (#detail, js: detailRoute in app.js)
   • narrower than a phone (Split View ⅓, a folded Fold) — the phone layout (max-width: 640px) as everywhere
   ===================================================================== */
@media (pointer: coarse) and (min-width: 641px) and (min-height: 501px) {
  nav.side .nl, nav.side .logo span, .compose-side span, nav.side .me .nl { display: none !important; }
  nav.side a, .me { justify-content: center; }
  nav.side { width: 68px; justify-self: center; padding: 10px 6px calc(10px + var(--sab)); }
  nav.side a { padding: 10px; }
  .compose-side { padding: 10px; }
  #app { padding: 0 var(--sar) 0 var(--sal); justify-content: stretch; }
  /* «Колонки»: two columns side by side upright, three sideways */
  .deck .dcol { flex-basis: calc((100% - 10px) / 2); }
}
@media (pointer: coarse) and (min-width: 641px) and (min-height: 501px) and (orientation: portrait) {
  #app { grid-template-columns: 84px minmax(0, 1fr); }
  aside.right { display: none !important; }
  #feedTabs { display: flex !important; }
  nav.side a[data-nav^="#/profile"] { display: flex !important; }
  main { max-width: none; }
}
@media (pointer: coarse) and (min-width: 641px) and (min-height: 501px) and (orientation: landscape) {
  #app { --side: clamp(260px, 30vw, 360px); grid-template-columns: 84px minmax(0, 1fr) var(--side); }
  aside.right { display: block !important; padding: 10px 12px 10px 0; }
  #feedTabs, nav.side a[data-nav^="#/profile"] { display: none !important; }
  .deck .dcol { flex-basis: calc((100% - 20px) / 3); }
  /* a post beside the list */
  body.detail #app { grid-template-columns: 84px minmax(0, 1fr) minmax(0, 1.05fr); }
  body.detail aside.right { display: none !important; }
  body.detail #detail { display: block; }
}
#detail { display: none; position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; overscroll-behavior: contain;
  border-left: 1px solid var(--line); background: var(--bg); position: sticky; }
:root[data-ui="glass"] #detail { margin: 10px 12px 10px 0; height: calc(100dvh - 20px); top: 10px; border: 0; border-radius: 28px;
  background: var(--lg-fill-2, var(--panel)); -webkit-backdrop-filter: var(--lg-filter, none); backdrop-filter: var(--lg-filter, none); box-shadow: var(--lg-rim, none), var(--lg-drop, none); }
:root[data-ui="material"] #detail { border: 0; background: var(--m-s1, var(--panel)); border-radius: 16px; margin: 8px 8px 8px 0; height: calc(100dvh - 16px); top: 8px; }
#detail .topbar { position: sticky; top: 0; }
#detail.sb-tint::before { width: 100%; margin-left: 0; margin-right: 0; }
/* the post that is open beside the list stays marked in it */
body.detail main article.post.is-open { box-shadow: inset 3px 0 0 var(--accent); }
article.post.kbd-on { box-shadow: inset 3px 0 0 var(--accent), 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); border-radius: 12px; }
.kbd-help td { padding: 5px 10px 5px 0; vertical-align: top; } .kbd-help kbd { white-space: nowrap; }
