/* SinWAP 2.0 — design system. Frosted glass: graphite base, translucent
   layers, one restrained accent, crisp type. No dependencies. */
:root{
  --bg:#0e1013;
  --surface:rgba(255,255,255,.055); --surface-2:rgba(255,255,255,.09);
  --line:rgba(255,255,255,.09);
  --text:#f4f6fa; --muted:#aab3c2;
  --accent:#0a84ff; --accent-2:#4aa8ff;
  --danger:#ff453a; --ok:#30d158;
  --radius:20px; --tab-h:64px; --maxw:560px;
  --glass:saturate(160%) blur(22px);
  color-scheme:dark;   /* native widgets (checkboxes, dropdowns, scrollbars) render dark */
}
*{box-sizing:border-box}
/* Form controls don't inherit font-family from the page. Without this every
   <button> and <input> on the site rendered in the browser's default (Arial on
   Chrome) while every link-styled button used system-ui — two typefaces in the
   same row and nobody could say why it looked off. */
button,input,select,textarea{font-family:inherit}
html,body{margin:0;padding:0}
body{
  background:var(--bg); color:var(--text);
  font:16px/1.5 system-ui,-apple-system,"Segoe UI",Roboto,"Noto Sans Sinhala",sans-serif;
  -webkit-font-smoothing:antialiased;
  letter-spacing:.01em;
}
/* soft ambient washes the glass sits over */
body::before{content:'';position:fixed;inset:0;z-index:-1;pointer-events:none;
  background:
    radial-gradient(640px 420px at 88% -6%,  rgba(10,132,255,.17), transparent 62%),
    radial-gradient(520px 400px at -12% 18%, rgba(94,92,230,.11),  transparent 60%),
    radial-gradient(720px 520px at 50% 112%, rgba(10,132,255,.08), transparent 62%)}
h1,h2,h3{letter-spacing:-.02em}
/* inline svg icons */
.ic{flex:0 0 auto;vertical-align:-4px}
a{color:var(--accent-2);text-decoration:none}
.app{max-width:var(--maxw);margin:0 auto;min-height:100dvh;padding-bottom:calc(var(--tab-h) + env(safe-area-inset-bottom));position:relative}

/* Top bar */
.topbar{position:sticky;top:0;z-index:5;display:flex;align-items:center;justify-content:space-between;
  padding:14px 18px;background:rgba(14,16,19,.6);
  backdrop-filter:var(--glass);-webkit-backdrop-filter:var(--glass);
  border-bottom:1px solid var(--line)}
.brand{font-weight:800;letter-spacing:-.02em;background:linear-gradient(90deg,#f2f6ff,var(--accent-2));
  -webkit-background-clip:text;background-clip:text;color:transparent}
.who{color:var(--muted);font-size:14px}

.content{padding:16px}

/* Cards — frosted panes over the ambient wash */
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);
  padding:20px;margin:0 0 16px;
  box-shadow:0 10px 28px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.06)}
/* Safety net. Everything below this line is member-supplied text — usernames,
   bios, group descriptions, chat, forum posts — and a single unbroken 90-char
   string (a pasted URL, a file path) used to widen the whole page. Break it
   instead. Cheap insurance against content we can't predict. */
.card,.bub-t,.post-body,.cmt-t,.bio,.room-main,.a-t,.dm-snip,.topic-title,
.uname,.lname,.reset-req{overflow-wrap:anywhere}
/* ...but not on controls. Breaking a label mid-word ("Creat / e") looks like a
   bug; a button should wrap at spaces like normal text. */
.btn,.chip,.ftab,.tab,.badge,.linkbtn,button,label{overflow-wrap:normal}
.card h1{margin:.1em 0 .3em;font-size:22px}
.welcome h1{font-size:24px}
.muted{color:var(--muted)}
.small{font-size:13px}
.center{text-align:center}
.mt{margin-top:16px}

/* Badges */
.badges{display:flex;gap:8px;flex-wrap:wrap;margin:14px 0}
.badge{background:var(--surface-2);border:1px solid var(--line);color:var(--muted);
  padding:5px 12px;border-radius:999px;font-size:13px;font-weight:600}
.badge-founder{background:linear-gradient(90deg,rgba(10,132,255,.2),rgba(94,92,230,.2));
  border-color:transparent;color:var(--accent-2)}

/* Forms */
label{display:block;margin:14px 0;font-weight:600;font-size:14px}
input[type=text],input[type=password],input[type=email],input[type=tel],
input[type=search],input[type=number],input[type=url],input:not([type]),
textarea{
  width:100%;margin-top:6px;padding:13px 14px;border-radius:12px;border:1px solid var(--line);
  background:var(--surface-2);color:var(--text);font-size:16px}
textarea{font-family:inherit;line-height:1.5;resize:vertical}
input:focus,textarea:focus,select:focus{outline:2px solid var(--accent);border-color:transparent}
/* Keyboard users could not see where they were: only form fields had a focus
   ring, so tabbing through the nav, the tab bar, buttons or any link was
   invisible. :focus-visible keeps it off for mouse clicks. */
a:focus-visible,button:focus-visible,summary:focus-visible,
[tabindex]:focus-visible,label.attach:focus-within{
  outline:2px solid var(--accent-2);outline-offset:2px;border-radius:8px}
.tab:focus-visible,.ftab:focus-visible,.chip:focus-visible,.btn:focus-visible{outline-offset:3px}
/* the skip link only appears once it has focus */
.skiplink:focus{outline:2px solid var(--accent-2);outline-offset:2px}
input::placeholder,textarea::placeholder{color:var(--muted);opacity:.75}
/* Chrome/Safari autofill would otherwise paint fields white on our dark theme */
input:-webkit-autofill,input:-webkit-autofill:hover,input:-webkit-autofill:focus{
  -webkit-text-fill-color:var(--text);caret-color:var(--text);
  -webkit-box-shadow:0 0 0 1000px #242830 inset;box-shadow:0 0 0 1000px #242830 inset;
  border:1px solid var(--line);transition:background-color 999999s ease-in-out 0s}
/* visible file pickers (e.g. profile photo) */
input[type=file]{width:100%;margin-top:6px;color:var(--muted);font-size:14px}
input[type=file]::file-selector-button{
  margin-right:10px;padding:9px 14px;border:1px solid var(--line);border-radius:10px;
  background:var(--surface-2);color:var(--text);font-weight:700;font-size:14px;cursor:pointer}
label.row{display:flex;align-items:center;gap:10px;font-weight:500}
label.row input{width:auto;margin:0}
small{display:block;margin-top:6px;font-weight:400}

/* An <a> inherits line-height 1.5 from the body; a <button> gets "normal"
   (~1.15) from the UA. Same padding, different heights — 41px against 34px
   wherever the two sat side by side. Pin it so they always agree. */
.btn{display:inline-block;width:100%;padding:14px;border:0;border-radius:14px;cursor:pointer;
  line-height:1.35;text-align:center;
  font-size:16px;font-weight:700;color:#fff;
  background:linear-gradient(180deg,#3ba0ff,var(--accent));
  box-shadow:0 6px 18px rgba(10,132,255,.35), inset 0 1px 0 rgba(255,255,255,.25);
  transition:transform .12s ease, box-shadow .12s ease}
.btn:active{transform:scale(.98);box-shadow:0 3px 10px rgba(10,132,255,.3)}
.btn-ghost{background:var(--surface);color:var(--text);border:1px solid var(--line);box-shadow:none}

/* Flash */
.flash{padding:12px 14px;border-radius:12px;margin:12px 0;font-size:14px}
.flash-ok{background:rgba(32,209,127,.12);color:var(--ok);border:1px solid rgba(32,209,127,.3)}
.flash-err{background:rgba(255,93,108,.12);color:var(--danger);border:1px solid rgba(255,93,108,.3)}
.flash-info{background:var(--surface-2);color:var(--muted);border:1px solid var(--line)}

/* Skeleton placeholder */
.placeholder .ph-row{height:14px;border-radius:7px;margin:10px 0;
  background:linear-gradient(90deg,var(--surface-2),var(--line),var(--surface-2));
  background-size:200% 100%;animation:shine 1.4s infinite}
.placeholder .short{width:55%}
@keyframes shine{0%{background-position:200% 0}100%{background-position:-200% 0}}

/* Bottom tab bar — floating glass */
.tabbar{position:fixed;left:50%;transform:translateX(-50%);bottom:0;width:100%;max-width:var(--maxw);
  height:calc(var(--tab-h) + env(safe-area-inset-bottom));padding-bottom:env(safe-area-inset-bottom);
  display:flex;align-items:center;justify-content:space-around;
  background:rgba(16,18,22,.68);
  backdrop-filter:var(--glass);-webkit-backdrop-filter:var(--glass);
  border-top:1px solid var(--line);z-index:10}
.tab{display:flex;flex-direction:column;align-items:center;gap:3px;color:var(--muted);font-size:11px;flex:1;
  font-weight:600;transition:color .15s ease}
.tab .ico{display:grid;place-items:center;width:46px;height:28px;border-radius:999px;
  transition:background .18s ease, color .18s ease}
.tab.active{color:var(--text)}
.tab.active .ico{background:rgba(10,132,255,.22);color:var(--accent-2)}
.tab-create .ico{width:48px;height:48px;border-radius:50%;color:#fff;
  background:linear-gradient(180deg,#3ba0ff,var(--accent));margin-top:-16px;
  box-shadow:0 8px 20px rgba(10,132,255,.45), inset 0 1px 0 rgba(255,255,255,.3)}
.tab-create:active .ico{transform:scale(.94)}

.auth{margin-top:24px}

/* Standalone controls (as opposed to links inside a sentence, which the touch
   guidance exempts) get a comfortable target height. */
.brand{display:inline-flex;align-items:center;min-height:40px}
.ob-label{display:inline-flex;align-items:center;min-height:36px}
summary{min-height:36px;display:flex;align-items:center}
.xp-lead{display:inline-flex;align-items:center;min-height:32px}

/* ===================== social features ===================== */
.btn-sm{width:auto;padding:9px 16px;font-size:14px;min-height:40px;
  display:inline-flex;align-items:center;justify-content:center}
.pad{padding:0 4px}
.sub{font-size:16px;margin:4px 0 10px}
h2.sub.pad{margin:18px 4px 8px}

/* top bar "me" */
.topme{display:flex;align-items:center;justify-content:center;gap:8px;min-width:40px;min-height:40px}
.topbar .brand{font-size:19px}

/* avatars */
.av{border-radius:50%;object-fit:cover;display:inline-block;vertical-align:middle;background:var(--surface-2)}
.av-letter{color:#04121f;text-align:center;font-weight:800;border-radius:50%}
.uchip{display:inline-flex;align-items:center;gap:9px;color:var(--text);position:relative}
/* a username is user-supplied and can be 28 chars — let it truncate rather
   than push the row wider than the screen */
.uchip>.av{flex:none}
.uchip .uname{font-weight:700;font-size:14px;min-width:0;display:inline-flex;
  align-items:center;gap:6px;overflow:hidden}
.uchip .uname>b{font-weight:inherit;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.uchip .uname>.rtag{flex:none}
.dot{width:10px;height:10px;border-radius:50%;display:inline-block;background:var(--muted)}
.dot.on{background:var(--ok);box-shadow:0 0 0 2px rgba(32,209,127,.2)}
.uchip .dot{position:absolute;left:30px;top:26px;border:2px solid var(--surface)}

/* role tags */
.rtag{font-size:10px;font-weight:800;padding:2px 6px;border-radius:6px;background:var(--surface-2);color:var(--accent);vertical-align:middle;white-space:nowrap;flex:none}
.rtag-owner,.rtag-ceo,.rtag-head_admin{background:rgba(255,93,108,.15);color:var(--danger)}
.rtag-admin,.rtag-super_mod,.rtag-moderator,.rtag-chat_mod{background:rgba(79,124,255,.15);color:var(--accent-2)}
.rtag-vip,.rtag-gold{background:rgba(245,166,35,.15);color:#f5a623}

/* composer */
.composer .composer-row{display:flex;gap:10px;align-items:flex-start}
.composer textarea{flex:1;margin:0;background:var(--surface-2);border:1px solid var(--line);border-radius:12px;color:var(--text);padding:10px;font:inherit;resize:vertical}
.composer-foot{display:flex;justify-content:space-between;align-items:center;margin-top:10px}
.attach{cursor:pointer;color:var(--muted);font-size:14px;font-weight:600;min-height:38px;
  display:inline-flex;align-items:center;gap:6px}
.attach.has{color:var(--accent)}

/* posts */
.post .post-head{display:flex;justify-content:space-between;align-items:center;gap:10px;min-width:0}
.post .post-head>.uchip{min-width:0}
.post .post-head>.ago,.post .post-head>time{flex:none;white-space:nowrap}
.ago{color:var(--muted);font-size:12px;white-space:nowrap}
.post-body{margin:10px 0;white-space:normal;word-wrap:break-word}
.pimg img{width:100%;border-radius:12px;margin-top:6px;display:block}
.post-actions{display:flex;gap:18px;margin-top:10px;border-top:1px solid var(--line);padding-top:10px}
/* like / comment / report sat at 21px tall — comfortably missable with a
   thumb. The padding grows the target without changing how it looks. */
.act{background:none;border:0;color:var(--muted);font-size:14px;font-weight:700;cursor:pointer;display:inline-flex;gap:6px;align-items:center;min-height:38px;padding:0 6px;margin-left:-6px;
  transition:color .15s ease}
.act .ic{vertical-align:0}
.act.like.on{color:var(--danger)}
.act.like.on .ic{fill:var(--danger);stroke:var(--danger);animation:heartpop .4s cubic-bezier(.2,1.6,.4,1)}
@keyframes heartpop{0%{transform:scale(.6)}55%{transform:scale(1.35)}100%{transform:scale(1)}}

/* comments */
/* The comment thread lives inside the post's own card. A rule and a small
   indent do the nesting — a reply should look attached to what it answers,
   not like a separate panel that happens to sit underneath. */
.post-thread{margin-top:14px;padding-top:14px;border-top:1px solid var(--line)}
.thread-h{margin:0 0 10px;font-size:14px;font-weight:800;letter-spacing:.01em}
.thread-h .muted{font-weight:600}
.post-thread .nocmt{margin:2px 0 0}
.post-thread .pager{margin:8px 0}
/* the rail that ties the replies to the post above them */
.post-thread .cmt{position:relative;padding-left:14px}
.post-thread .cmt::before{content:'';position:absolute;left:3px;top:-6px;bottom:-6px;width:2px;
  border-radius:2px;background:var(--line)}
.post-thread .cmt:first-of-type::before{top:0}
.post-thread .cmt:last-of-type::before{bottom:auto;height:22px}
.cmt{display:flex;gap:9px;margin:12px 0}
.cmt-b{flex:1;background:var(--surface-2);border-radius:12px;padding:8px 12px}
.cmt-h{font-size:13px;font-weight:700;display:flex;gap:6px;align-items:center}
.cmt-h a{color:var(--text)}
.cmt-t{margin-top:2px}
.cmt-form{display:flex;gap:8px;margin-top:14px;align-items:center}
.cmt-form .av{flex:none}
.cmt-form input{flex:1;margin:0}

/* profile */
.card.profile{position:relative}
.profile-top{display:flex;gap:16px;align-items:center}
.profile-top .profile-id{flex:1;min-width:0}
/* Log out sits up at name level so the action row below never carries four
   buttons. Anchored to the card corner rather than placed in the flex flow,
   so a long username can never squeeze it. Kept quiet on purpose — it's the
   one destructive control on this card. */
/* right:20px matches .card's padding, so the button lines up with the content
   column rather than floating out toward the border */
.logout-top{position:absolute;top:18px;right:20px;margin:0}
.profile-id h1{padding-right:52px;overflow-wrap:anywhere}
.badge-online{display:inline-flex;align-items:center;gap:6px;color:var(--ok)}
.logout-top button{display:inline-flex;align-items:center;gap:6px;cursor:pointer;
  background:var(--surface);border:1px solid var(--line);border-radius:999px;
  color:var(--muted);font:inherit;font-size:13px;font-weight:600;
  padding:8px;min-width:40px;min-height:40px;justify-content:center}
.logout-top button:hover{color:var(--text);border-color:var(--muted)}
.logout-top svg{flex:none}
/* below ~340px the 84px avatar plus the name plus the corner button is one
   thing too many — shrink the avatar rather than let the name wrap awkwardly */
@media (max-width:359px){
  .profile-top{gap:12px}
  .profile-top>.av{width:60px!important;height:60px!important}
  .profile-id h1{font-size:18px}
}
.profile-id h1{margin:0;font-size:20px}
.bio{margin:12px 0}
.meta-row{display:flex;flex-wrap:wrap;gap:14px;color:var(--muted);font-size:13px;margin:8px 0}
.stat-row{display:flex;gap:20px;margin:10px 0;font-size:14px}
.stat-row b{color:var(--text)}
/* wrap, not overflow — Sinhala labels are a good deal wider than English */
.profile-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:12px}

/* archive banner — reading a 2009 thread should say so */
.archnote{margin:0 0 12px;padding:9px 14px;border-radius:12px;font-size:12.5px;
  color:var(--muted);background:rgba(255,255,255,.04);border:1px solid var(--line)}
.archnote b{color:var(--text)}
.card.room-head.arch{border-color:rgba(255,255,255,.16)}
/* empty-state action rows */
.emptyacts{display:flex;gap:10px;justify-content:center;flex-wrap:wrap;margin-top:14px}
.emptyacts .btn{width:auto}
.footfeedback{margin-top:8px}
.footfeedback a{color:var(--muted);font-size:13px}
.footfeedback a:hover{color:var(--accent-2)}

/* rooms */
.roomlist,.dmlist,.memberlist,.alertlist{display:flex;flex-direction:column;gap:10px}
.room-item{display:flex;align-items:center;gap:12px;color:var(--text)}
.room-ic{font-size:26px}
.room-main{flex:1;min-width:0}
.room-main>.muted{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.room-name{font-weight:800;display:flex;align-items:center;gap:6px;min-width:0;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.room-name .here{font-size:11px;color:var(--ok);font-weight:700;flex:none}
.room-count{white-space:nowrap;flex:none}
/* group activity line — a card has to say when the group last spoke, or a
   dormant 2010 club reads exactly like a live one */
.room-act{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin-top:3px;font-size:12px}
.room-act .livedot{display:inline-flex;align-items:center;gap:5px;color:var(--ok);font-weight:700}
.cbadge{font-size:10px;font-weight:800;letter-spacing:.02em;padding:2px 7px;border-radius:999px;
  background:rgba(255,255,255,.08);color:var(--muted);border:1px solid var(--line)}
/* five filter tabs don't fit a phone — let this row scroll instead of squeezing */
.feedtabs.scrolltabs{overflow-x:auto;-ms-overflow-style:none;scrollbar-width:none}
.feedtabs.scrolltabs::-webkit-scrollbar{display:none}
.feedtabs.scrolltabs .ftab{flex:0 0 auto;padding-left:14px;padding-right:14px}
/* below ~400px "302 members" steals the width the group's name needs, so drop
   the word and keep the number */
@media (max-width:399px){.room-count .cw{display:none}}

/* chat */
.room-head{display:flex;justify-content:space-between;align-items:center}
.room-head h1{margin:2px 0 0;font-size:18px}
.here-count{color:var(--ok);font-size:13px;font-weight:700;white-space:nowrap}
.chat{display:flex;flex-direction:column;gap:8px;padding:6px 2px 12px}
.msg{display:flex;gap:8px;align-items:flex-end;max-width:85%}
.msg.mine{margin-left:auto;flex-direction:row-reverse}
.bub{background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:8px 12px}
.msg.mine .bub{background:linear-gradient(180deg,rgba(59,160,255,.32),rgba(10,132,255,.26));border-color:transparent}
.bub-name{font-size:12px;font-weight:800;color:var(--accent);margin-bottom:2px}
.bub-t{word-wrap:break-word}
.bub-ago{font-size:10px;color:var(--muted);margin-top:3px;text-align:right}
.chat-form{position:sticky;bottom:calc(var(--tab-h) + env(safe-area-inset-bottom));display:flex;gap:8px;
  background:var(--bg);padding:8px 0}
.chat-form input{flex:1;margin:0}

/* DM safety menu + first-contact notice */
/* the card is a sibling of the notice below it, so the open menu needs its own
   stacking context or that card's border paints across it */
.dm-safety{position:relative}
.card.room-head:has(.dm-safety[open]){position:relative;z-index:20}
.dm-safety[open]{z-index:21}
.dm-safety>summary{list-style:none;cursor:pointer;width:40px;height:40px;display:grid;place-items:center;
  border-radius:999px;border:1px solid var(--line);background:var(--surface);color:var(--muted);
  font-size:20px;line-height:1}
.dm-safety>summary::-webkit-details-marker{display:none}
.dm-safety[open]>summary{color:var(--text)}
.dm-safety-menu{position:absolute;right:0;top:46px;z-index:21;min-width:180px;padding:6px;
  background:#171a20;border:1px solid var(--line);border-radius:14px;
  box-shadow:0 12px 30px rgba(0,0,0,.45)}
.dm-safety-menu a,.dm-safety-menu button{display:block;width:100%;text-align:left;padding:10px 12px;
  border:0;border-radius:10px;background:none;color:var(--text);font:inherit;font-size:14px;cursor:pointer}
.dm-safety-menu a:hover,.dm-safety-menu button:hover{background:var(--surface-2)}
.dm-safety-menu form{margin:0}
.dm-safety-menu .danger{color:var(--danger);font-weight:700}
.dm-firsttime{border-color:rgba(255,159,10,.35);background:rgba(255,159,10,.08)}

/* dm list */
.dm-item,.member{display:flex;align-items:center;gap:12px;color:var(--text);min-width:0}
.dm-main{flex:1;min-width:0}
.dm-name{font-weight:700;display:flex;gap:6px;align-items:center;justify-content:space-between}
.dm-snip{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dm-item.unread .dm-name{color:#fff}
.member{justify-content:space-between}
/* Member rows: identity plus when they were last around on the left, actions
   on the right. The two action buttons must be the same size as each other in
   both orientations — a grid does that reliably, where flex left the form
   shrink-wrapping its button while the link sized to its own text. */
.member{align-items:flex-start}
.member-who{display:flex;flex-direction:column;gap:4px;min-width:0;flex:1}
.member-seen{line-height:1.2}
.member-acts{display:grid;gap:8px;flex:none;justify-items:stretch;align-content:start}
.member-acts form{margin:0;display:grid}
.member-acts .btn{width:100%;white-space:nowrap;min-width:96px;text-align:center;
  /* the accent glow bled across the 8px gutter and closed it up visually */
  box-shadow:none}
.member-acts .btn:active{box-shadow:none}
@media (min-width:420px){
  .member-acts{grid-auto-flow:column;grid-auto-columns:1fr}
}
.member .uchip{min-width:0}
.member>.btn,.member>span{flex:none;white-space:nowrap}
/* keep enough of the name readable next to a role tag */
.member .uname>b{min-width:5.5em}

/* alerts */
.alert-row{display:flex;align-items:center;gap:12px;color:var(--text)}
.alert-row.unread{border-color:var(--accent-2)}
.a-ic{font-size:22px;width:38px;text-align:center}
.a-t{flex:1;font-size:14px}

/* badges / search */
.nbadge{background:var(--danger);color:#fff;font-size:10px;font-weight:800;border-radius:999px;
  padding:1px 6px;min-width:16px;text-align:center;display:inline-block}
.nbadge.inline{position:static}
.ico{position:relative}
.ico .nbadge{position:absolute;top:-4px;right:2px}
.search{display:flex;gap:8px;margin-top:10px}
.search input{flex:1;margin:0}

/* ===================== moderation ===================== */
.btn-danger{background:var(--danger);color:#fff}
.inline-form{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.inline-form select,.inline-form input{margin:0;width:auto;flex:1;min-width:120px}
select{width:100%;margin-top:6px;padding:12px 14px;border-radius:12px;border:1px solid var(--line);background:var(--surface-2);color:var(--text);font-size:16px}
.act.rep,.rep{color:var(--muted);font-size:13px;text-decoration:none}
.act.rep:hover,.rep:hover{color:var(--danger)}
.cmt-h .rep,.cmt-h .linkbtn{margin-left:auto}
.linkbtn{background:none;border:0;color:var(--muted);cursor:pointer;font-size:13px;
  min-width:34px;min-height:34px;padding:0 6px;display:inline-flex;align-items:center;justify-content:center}
.report .rep-top{display:flex;justify-content:space-between;gap:10px}
.rep-label{font-weight:700}
.rep-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
.report-preview{background:var(--surface-2);border-radius:10px;padding:10px 12px;margin:6px 0}
.logrow{padding:5px 0;border-bottom:1px solid var(--line)}
.profile-sub{display:flex;gap:16px;margin-top:10px}

/* ===================== stories ===================== */
.storyrail{display:flex;gap:12px;overflow-x:auto;padding:2px 2px 12px;margin:0 0 6px;
  -webkit-overflow-scrolling:touch;scrollbar-width:none}
.storyrail::-webkit-scrollbar{display:none}
.story-ring{flex:0 0 auto;width:66px;text-align:center;color:var(--text)}
.story-ring .ring{position:relative;display:inline-grid;place-items:center;width:66px;height:66px;
  border-radius:50%;padding:3px;background:linear-gradient(135deg,#8fc6ff,var(--accent),#5e5ce6)}
.story-ring:not(.seen) .ring{animation:ringpulse 2.6s ease-in-out infinite}
@keyframes ringpulse{0%,100%{box-shadow:0 0 0 0 rgba(10,132,255,.35)}50%{box-shadow:0 0 0 5px rgba(10,132,255,0)}}
.story-ring.seen .ring{background:var(--line)}
.story-ring .ring .av{border:2px solid var(--bg);width:56px !important;height:56px !important}
.story-ring .story-name{display:block;font-size:11px;color:var(--muted);margin-top:5px;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.story-add{position:absolute;right:0;bottom:0;width:20px;height:20px;border-radius:50%;
  background:var(--accent-2);color:#04121f;font-weight:900;font-size:13px;line-height:1;
  display:grid;place-items:center;border:2px solid var(--bg)}

/* add-to-story page */
.attach.big{display:block;text-align:center;padding:26px;border:1px dashed var(--line);
  border-radius:14px;background:var(--surface-2);color:var(--muted);font-weight:700;cursor:pointer}
.attach.big.has{color:var(--accent);border-color:var(--accent)}
.story-pv{margin:12px 0}
.story-pv img{width:100%;border-radius:12px;display:block}
.mystories{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-top:12px}
.mystory{position:relative}
.mystory img{width:100%;aspect-ratio:9/16;object-fit:cover;border-radius:12px;display:block}
.mystory-meta{display:flex;justify-content:space-between;align-items:center;margin-top:4px;font-size:11px}
.mystory-meta form{margin:0}

/* full-screen story viewer */
.story-viewer{position:fixed;inset:0;z-index:60;background:#000;display:flex;
  align-items:center;justify-content:center;overflow:hidden}
.sv-bars{position:absolute;top:8px;left:8px;right:8px;display:flex;gap:4px;z-index:3}
.sv-bar{flex:1;height:3px;border-radius:3px;background:rgba(255,255,255,.28);overflow:hidden}
.sv-bar i{display:block;height:100%;width:var(--p,0%);background:#fff;border-radius:3px}
.sv-bar.done i{width:100%}
.sv-top{position:absolute;top:20px;left:12px;right:12px;display:flex;align-items:center;
  justify-content:space-between;z-index:3}
.sv-top .uchip .uname,.sv-top .uchip{color:#fff}
.sv-close{color:#fff;font-size:22px;font-weight:700;padding:4px 8px}
.sv-slide{display:none;margin:0;width:100%;height:100%;max-width:var(--maxw)}
.sv-slide.on{display:flex;flex-direction:column;justify-content:center}
.sv-slide img{width:100%;max-height:100dvh;object-fit:contain}
.sv-info{position:absolute;left:0;right:0;bottom:0;padding:16px 16px 26px;
  background:linear-gradient(transparent,rgba(0,0,0,.75));z-index:3}
.sv-cap{color:#fff;margin:0 0 8px;font-size:15px}
.sv-actrow{display:flex;align-items:center;gap:16px}
.sv-actrow .ago{color:rgba(255,255,255,.8)}
.sv-actrow .rep{color:rgba(255,255,255,.85)}
.sv-actrow .linkbtn{color:#fff}
.sv-actrow form{margin:0}
.sv-nav{position:absolute;top:0;bottom:0;width:35%;background:none;border:0;z-index:2;cursor:pointer}
.sv-nav.prev{left:0}
.sv-nav.next{right:0}

/* ===================== gamification ===================== */
.lvchip{display:inline-block;font-size:10px;font-weight:800;padding:1px 6px;border-radius:6px;
  background:rgba(79,124,255,.16);color:var(--accent-2);vertical-align:middle}
.xp-box{margin:14px 0 4px}
.xp-head{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:6px}
.lvbadge{font-weight:800;font-size:14px;padding:2px 10px;border-radius:999px;color:#04121f;
  background:linear-gradient(90deg,var(--accent),var(--accent-2))}
.streak{font-size:13px;font-weight:700;color:#f5a623}
.xp-lead{margin-left:auto}
.xp-bar{height:8px;border-radius:8px;background:var(--surface-2);overflow:hidden}
.xp-bar i{display:block;height:100%;background:linear-gradient(90deg,var(--accent),var(--accent-2));border-radius:8px}
.ach-row{display:flex;gap:8px;flex-wrap:wrap;margin:12px 0 2px}
.ach{background:var(--surface-2);border:1px solid var(--line);border-radius:999px;
  padding:5px 12px;font-size:13px;font-weight:700}

/* leaderboard */
.lboard{display:flex;flex-direction:column;gap:8px}
.lrow{display:flex;align-items:center;gap:12px;color:var(--text);background:var(--surface);
  border:1px solid var(--line);border-radius:14px;padding:12px 14px}
.lrow.me{border-color:var(--accent-2);background:var(--surface-2)}
.lrank{font-size:18px;font-weight:800;width:30px;text-align:center;flex:0 0 auto}
.lname{flex:1;font-weight:700;display:flex;align-items:center;gap:6px;min-width:0;overflow:hidden}
/* the name is the point of the row — never let the badges squeeze it to one
   letter. Below 400px the Lv chip goes: the score beside it says the same. */
.lname>b{font-weight:inherit;min-width:5.5em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.lname .lvchip,.lname .rtag,.lname .badge{flex:none}
/* rank, name and score are what a leaderboard is for — the level chip and the
   role tag are both shown on the profile, so drop them rather than show a
   sliver of each */
@media (max-width:399px){.lname .lvchip,.lname .rtag{display:none}}
.lscore{font-weight:800;white-space:nowrap;flex:none}
.lscore small{color:var(--muted);font-weight:600;font-size:11px}

/* typing indicator + read receipt */
.typing-ind{color:var(--muted);font-size:12px;font-style:italic;padding:2px 6px 6px;
  position:sticky;bottom:calc(var(--tab-h) + env(safe-area-inset-bottom) + 52px);opacity:.9}
.seen-mark{font-size:10px;color:var(--muted);text-align:right;margin:-2px 2px 6px}

/* ===================== gallery + reels ===================== */
.gallery-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:4px}
.gcell{position:relative;display:block;aspect-ratio:1/1;overflow:hidden;border-radius:4px;background:var(--surface-2)}
.gcell img{width:100%;height:100%;object-fit:cover;display:block}
.gcell .gcount{position:absolute;left:6px;bottom:6px;font-size:11px;font-weight:800;color:#fff;
  text-shadow:0 1px 3px rgba(0,0,0,.6)}

.reels{position:fixed;inset:0;z-index:60;background:#000;overflow-y:scroll;
  scroll-snap-type:y mandatory;-webkit-overflow-scrolling:touch}
.reels-close{position:fixed;top:18px;right:16px;z-index:3;color:#fff;font-size:22px;font-weight:700;
  padding:4px 8px;text-shadow:0 1px 4px rgba(0,0,0,.6)}
.reel{position:relative;height:100dvh;scroll-snap-align:start;display:flex;align-items:center;
  justify-content:center;max-width:var(--maxw);margin:0 auto}
.reel-img{width:100%;max-height:100dvh;object-fit:contain}
.reel-overlay{position:absolute;left:0;right:0;bottom:0;padding:16px 16px 28px;
  background:linear-gradient(transparent,rgba(0,0,0,.78));z-index:2}
.reel-head .uchip,.reel-head .uchip .uname{color:#fff}
.reel-cap{color:#fff;margin:8px 0;font-size:14px;line-height:1.4}
.reel-actions{display:flex;gap:20px;align-items:center}
.reel-actions .act{color:#fff;font-size:15px}
.reel-actions .act.like.on{color:var(--danger)}
.reel-actions .rep{color:rgba(255,255,255,.85)}

/* topbar icon row (search + messages) */
.topicons{display:flex;align-items:center;gap:14px}
.topico{position:relative;color:var(--muted);display:grid;place-items:center;width:34px;height:34px;
  border-radius:50%;transition:color .15s ease}
.topico:active{color:var(--text)}
.topico .nbadge{position:absolute;top:-2px;right:-4px}

/* pagination */
.pager{display:flex;justify-content:space-between;align-items:center;gap:10px;margin:14px 0}
.pager .btn{width:auto}

/* site footer links */
.sitefoot{text-align:center;color:var(--muted);font-size:12px;padding:18px 0 8px}
.sitefoot a{color:var(--muted)}

/* word-filter manager */
.wordlist{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}
.wordchip{display:inline-flex;align-items:center;gap:6px;background:var(--surface-2);
  border:1px solid var(--line);border-radius:999px;padding:5px 6px 5px 12px;font-size:13px;font-weight:700;margin:0}
.wordchip em{font-style:normal;font-weight:600}

/* auth: separator + password-reset requests */
.sep{border:0;border-top:1px solid var(--line);margin:22px 0}
.reset-req{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;
  padding:10px 0;border-bottom:1px solid var(--line)}
.reset-req:last-child{border-bottom:0}
.reset-req>div:first-child{min-width:0}
.reset-req .mod-bar{flex:0 0 auto}
/* a moderation row is quoted text plus three buttons — side by side that
   leaves the quote about 60px on a small phone, so stack it instead */
@media (max-width:519px){
  .reset-req{flex-direction:column;align-items:stretch}
  .reset-req .mod-bar{flex:none;width:100%}
}

/* ===================== welcome hero (login / register) ===================== */
.hero{text-align:center;padding:24px 16px 4px}
.hero-logo{font-size:46px;font-weight:900;letter-spacing:-.03em;line-height:1.05;
  background:linear-gradient(135deg,#f5f8ff 30%,var(--accent-2));
  -webkit-background-clip:text;background-clip:text;color:transparent}
.hero-tag{font-size:20px;font-weight:800;margin:8px 0 4px}
.hero-sub{color:var(--muted);margin:0 auto;max-width:34ch}
.hero-pills{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;margin:16px 0 2px}
.hpill{background:var(--surface-2);border:1px solid var(--line);border-radius:999px;
  padding:6px 12px;font-size:13px;font-weight:700}
.hero-sm{padding-top:12px}
.hero-sm .hero-logo{font-size:34px}

/* ===================== new-user onboarding ===================== */
.onboard{border-color:rgba(10,132,255,.4);
  background:linear-gradient(180deg,rgba(10,132,255,.08),var(--surface))}
.onboard .onboard-top{display:flex;justify-content:space-between;align-items:center}
.onboard-top h2{margin:0;font-size:18px}
.onboard-top form{margin:0}
.onboard-bar{height:6px;border-radius:6px;background:var(--surface-2);overflow:hidden;margin:10px 0 12px}
.onboard-bar i{display:block;height:100%;border-radius:6px;
  background:linear-gradient(90deg,var(--accent),var(--accent-2));transition:width .4s ease}
.onboard-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:9px}
.onboard-list li{display:flex;align-items:center;gap:10px;font-size:14px}
.onboard-list .ob-ic{width:26px;height:26px;border-radius:50%;display:grid;place-items:center;
  background:var(--surface-2);font-size:14px;flex:0 0 auto}
.onboard-list li.done .ob-ic{background:rgba(32,209,127,.18);color:var(--ok)}
.onboard-list li.done .ob-label{color:var(--muted);text-decoration:line-through}
.onboard-list .ob-label{font-weight:700;color:var(--text)}
.onboard-list a.ob-label{color:var(--accent-2)}

/* subtle card entrance — respects reduced-motion */
@media (prefers-reduced-motion:no-preference){
  .content > .card{animation:rise .34s ease both}
  @keyframes rise{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
}

/* feed tabs (Following | Latest) — segmented control */
.feedtabs{display:flex;gap:6px;background:var(--surface);border:1px solid var(--line);
  border-radius:999px;padding:4px;margin:0 0 16px}
.ftab{flex:1;min-width:0;text-align:center;padding:9px 0;border-radius:999px;font-size:14px;
  font-weight:700;color:var(--muted);transition:background .18s ease,color .18s ease;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
/* five tabs with Sinhala labels don't fit a 320px phone — drop a point of type
   rather than clip a word */
@media (max-width:359px){.ftab{font-size:12.5px;padding:9px 2px}}
.ftab.on{background:rgba(255,255,255,.14);color:#fff;
  box-shadow:0 2px 8px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.12)}

/* ===================== forums ===================== */
.chipnav{display:flex;gap:8px;margin:0 0 16px;flex-wrap:nowrap;overflow-x:auto;
  -webkit-overflow-scrolling:touch;scrollbar-width:none;padding-bottom:2px}
.chipnav::-webkit-scrollbar{display:none}
.chip{display:inline-flex;align-items:center;gap:6px;white-space:nowrap;flex:0 0 auto;
  background:var(--surface);border:1px solid var(--line);border-radius:999px;
  padding:8px 14px;font-size:13px;font-weight:700;color:var(--text);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.05)}
.chip .ic{color:var(--accent-2)}
.chip:active{transform:scale(.97)}
.topiclist{display:flex;flex-direction:column;gap:10px}
.topic-item{display:flex;align-items:center;gap:12px;color:var(--text)}
.topic-main{flex:1;min-width:0}
.topic-title{font-weight:700}
.fpost .post-head{display:flex;justify-content:space-between;align-items:center;gap:10px;min-width:0}
.fpost .post-head>.uchip{min-width:0}
.fpost .post-head>.ago{flex:none;white-space:nowrap}
.fpost-img{display:block;margin:10px 0 2px;border-radius:14px;overflow:hidden;
  border:1px solid var(--line);background:var(--surface)}
.fpost-img img{display:block;width:100%;height:auto;max-height:70vh;object-fit:contain}
.mod-bar{display:flex;gap:8px;flex-wrap:wrap}

/* guest topbar login button */
.topbar-login{width:auto;padding:8px 16px;font-size:14px}

/* "online now" social proof (AraWap-style) */
.brandwrap{display:flex;align-items:center;gap:10px;min-width:0}
.brandwrap .brand{white-space:nowrap}
.onlinepill{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  display:inline-flex;align-items:center;gap:5px}
.onlinepill .dot{flex:none}
.topicons{flex:none}
/* On a very narrow phone (Fold cover screen, ~280px) the brand, the active
   pill and three icons don't all fit. The pill is the least important of the
   three, so it goes first rather than pushing the avatar off-screen. */
@media (max-width:379px){.topbar{padding-left:14px;padding-right:14px;gap:10px}.topicons{gap:11px}}
@media (max-width:319px){
  .onlinepill{display:none}
  .topbar{gap:8px}
  .topbar .brand{font-size:17px}
  .topicons{gap:10px}
}
.onlinepill{display:inline-flex;align-items:center;gap:5px;font-size:11px;font-weight:700;color:var(--ok);
  background:rgba(48,209,88,.12);border:1px solid rgba(48,209,88,.28);border-radius:999px;padding:3px 9px;white-space:nowrap}
.onlinepill .dot{width:7px;height:7px}
.hero-online{display:inline-flex;align-items:center;gap:6px;color:var(--ok);font-weight:700;font-size:14px;margin:6px 0 0}

/* language switch in footer */
.langswitch{margin-top:8px;font-weight:700}

/* group member preview row */
.gmembers{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin-top:12px}
.gmember .av{border:2px solid var(--line)}
.gmore{padding-left:4px;font-weight:700}

/* v23: accessibility + new sections */
.skiplink{position:absolute;left:-9999px;top:0;z-index:100;background:var(--accent);color:#fff;
  padding:10px 16px;border-radius:0 0 12px 0;font-weight:700}
.skiplink:focus{left:0}
.modmenu summary{cursor:pointer;font-weight:700;color:var(--muted);list-style:none}
.modmenu summary::before{content:'▸ '}
.modmenu[open] summary::before{content:'▾ '}
.archive-sec summary{cursor:pointer;list-style:none;margin:18px 4px 8px}
.archive-sec summary::marker{content:''}
.discover{padding:14px 20px}
.discover .disc-row{margin:4px 0;font-size:14px}
.totp-secret{font-family:ui-monospace,monospace;font-size:16px;letter-spacing:1px;font-weight:700;
  background:var(--surface-2);border:1px solid var(--line);border-radius:10px;padding:10px 14px;
  user-select:all;word-break:break-all}

/* ===================================================================
   DESKTOP LAYOUT (v24) — three columns from 1024px up.
   Everything below 1024px is untouched: the phone design is the default.
   =================================================================== */
.deskonly, .deskpost, .siderail { display: none; }   /* phone: hidden */

@media (min-width: 1024px) {
  :root { --maxw: 1160px; --rail: 232px; --aside: 300px; }

  /* .app becomes the page grid; existing children are placed by area */
  .app {
    max-width: var(--maxw);
    display: grid;
    grid-template-columns: var(--rail) minmax(0, 1fr) var(--aside);
    grid-template-areas:
      "top   top   top"
      "nav   flash aside"
      "nav   main  aside"
      "nav   foot  aside";
    grid-template-rows: auto auto 1fr auto;
    column-gap: 26px;
    padding: 0 20px;                         /* never hug the window edge */
    padding-bottom: 0;                       /* no bottom bar to clear */
  }
  .topbar   { grid-area: top; padding-left: 4px; padding-right: 4px; }
  .flashwrap{ grid-area: flash; }
  .content  { grid-area: main; padding: 20px 0 40px; }
  .sitefoot { grid-area: foot; text-align: left; padding-left: 2px; }
  .siderail { grid-area: aside; display: block; }

  /* ---- left rail (was the bottom tab bar) ---- */
  .tabbar {
    grid-area: nav;
    position: sticky; top: 76px; align-self: start;
    left: auto; bottom: auto; transform: none;
    width: auto; max-width: none; height: auto;
    display: flex; flex-direction: column; align-items: stretch; gap: 2px;
    background: none; backdrop-filter: none; -webkit-backdrop-filter: none;
    border: 0; padding: 14px 0 0; z-index: 1;
  }
  .tabbar .deskonly { display: flex; }
  .tab {
    flex-direction: row; justify-content: flex-start; gap: 14px;
    padding: 10px 14px; border-radius: 12px; font-size: 15px; flex: 0 0 auto;
    transition: background .15s ease, color .15s ease;
  }
  .tab:hover { background: var(--surface); color: var(--text); }
  .tab .ico { width: 24px; height: 24px; background: none !important; }
  .tab.active { background: var(--surface-2); color: var(--text); }
  .tab.active .ico { background: none !important; color: var(--accent-2); }
  .tab .ico .nbadge { top: -5px; right: -9px; }
  /* the round ＋ button is a phone thing; desktop gets a full-width Post button */
  .tab-create { display: none; }
  .deskpost {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; margin-top: 14px; padding: 12px; font-size: 15px;
  }

  /* ---- right rail widgets ---- */
  /* the rail scrolls inside itself, so a short page stays a short page */
  .siderail {
    position: sticky; top: 76px; align-self: start; padding: 20px 0 30px;
    max-height: calc(100dvh - 96px); overflow-y: auto;
    scrollbar-width: none;
  }
  .siderail::-webkit-scrollbar { display: none; }
  .railcard {
    background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
    padding: 14px 16px; margin: 0 0 14px;
    box-shadow: 0 8px 22px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.05);
  }
  .railh { margin: 0 0 10px; font-size: 13px; font-weight: 800; letter-spacing: .02em;
           display: flex; align-items: center; gap: 6px; }
  .railsearch { display: flex; align-items: center; gap: 8px; padding: 8px 14px; }
  .railsearch .ic { color: var(--muted); }
  .railsearch input { margin: 0; padding: 8px 0; background: none; border: 0; font-size: 14px; }
  .railsearch input:focus { outline: none; }
  .railpeople { display: flex; flex-wrap: wrap; gap: 8px 10px; }
  .railperson { display: inline-flex; align-items: center; gap: 6px; color: var(--text);
                font-size: 12px; font-weight: 600; max-width: 100%; }
  .railperson span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .railrow { display: flex; align-items: center; gap: 10px; padding: 6px 0; color: var(--text); }
  .railrow:hover .railrow-main b { color: var(--accent-2); }
  .railrow-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
  .railrow-main b { font-size: 13px; font-weight: 700; }
  .railrank { width: 20px; text-align: center; font-weight: 800; font-size: 13px; }
  .railtopic { display: block; font-weight: 700; font-size: 14px; line-height: 1.35; }
  .raillink { display: inline-block; margin-top: 10px; font-size: 12px; font-weight: 700; color: var(--accent-2); }
  .railfoot { padding: 0 4px; }
  .railfoot a { color: var(--muted); }

  /* ---- content tweaks for the wider column ---- */
  .chipnav { display: none; }                    /* those links live in the left rail now */
  .gallery-grid { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .mystories { grid-template-columns: repeat(5, 1fr); }
  .chat-form { bottom: 0; padding-bottom: 16px; }
  .hero { padding-top: 40px; }
  .hero-logo { font-size: 60px; }
  .card { padding: 22px 24px; }
  /* chat scrolls inside its own panel instead of the whole window */
  .chat {
    max-height: calc(100dvh - 300px); overflow-y: auto; padding: 10px 4px;
    border: 1px solid var(--line); border-radius: var(--radius);
    background: rgba(255,255,255,.02);
  }
  .chat-form { position: static; padding: 12px 0 0; }
  .typing-ind { position: static; padding: 6px 4px 0; }
}

/* Wider desktops: a little more air, nothing structural */
@media (min-width: 1400px) {
  :root { --maxw: 1280px; --aside: 340px; }
}

/* tiny "here right now" dot inside the recently-active rail list */
.dot.tiny{width:6px;height:6px;box-shadow:none;vertical-align:middle;margin-left:2px}
