/* OAPal app styles: big, bright, clear and easy to tap. */
:root {
  --ink: #121a2f;
  --muted: #56617a;
  --bg: #f3f5f9;
  --card: #ffffff;
  --line: #dfe4ec;
  --line2: #c3cbd8;
  --blue: #1558d6;
  --green: #13803e;
  --orange: #c4470b;
  --pink: #c4205c;
  --purple: #6538dd;
  --teal: #0a6f82;
  --red: #c62828;
  --yellow: #ffc531;
  --indigo: #3a4bc4;
  --slate: #46526b;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(18, 26, 47, .06), 0 6px 18px rgba(18, 26, 47, .06);
  --side: 304px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 21px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
}
a { color: var(--blue); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; text-wrap: balance; letter-spacing: -.01em; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 .8em; }
img, video { max-width: 100%; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.huge { font-size: 4rem; margin: 0; line-height: 1.1; }
.lead { font-size: 1.25rem; font-weight: 600; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { width: 1.25em; height: 1.25em; flex: none; }

/* Colour keys: one bright colour per section */
.k-blue { --c: var(--blue); } .k-green { --c: var(--green); } .k-orange { --c: var(--orange); }
.k-pink { --c: var(--pink); } .k-purple { --c: var(--purple); } .k-teal { --c: var(--teal); }
.k-red { --c: var(--red); } .k-indigo { --c: var(--indigo); } .k-slate { --c: var(--slate); }
.k-ink { --c: var(--ink); } .k-yellow { --c: #e9a800; }

/* ---------- Layout: menu down the side, content in the main panel ---------- */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column;
  padding: 22px 14px 18px;
  background: #fff; border-right: 1px solid var(--line);
}
.side-logo { display: inline-block; padding: 0 10px 20px; text-decoration: none; }
.logo { display: inline-flex; align-items: center; gap: 12px; font-size: 1.6rem; font-weight: 800; color: var(--ink); letter-spacing: -.02em; }
.logo b { color: var(--blue); }
.side-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.side-group { margin: 20px 12px 6px; font-size: .75rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.nav {
  display: flex; align-items: center; gap: 14px;
  min-height: 64px; padding: 8px 12px 8px 8px;
  border-radius: 14px; color: var(--ink); text-decoration: none;
  font-weight: 700; font-size: 1.02rem; line-height: 1.2;
  transition: background .12s;
}
.nav:hover { background: #eef2f8; }
.nav-ic { width: 48px; height: 48px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--c); color: #fff; }
.nav-ic .ic { width: 26px; height: 26px; }
.nav-txt { flex: 1; min-width: 0; }
.nav.on { background: var(--c); color: #fff; }
.nav.on .nav-ic { background: rgba(255, 255, 255, .2); }
.nav-badge {
  min-width: 34px; height: 34px; padding: 0 10px; display: grid; place-items: center;
  border-radius: 999px; background: var(--red); color: #fff; font-size: .9rem; font-weight: 800;
}
.nav-badge.ok { background: var(--green); }
.nav.on .nav-badge { background: #fff; color: var(--c); }
.side-foot { display: grid; gap: 12px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.side-foot form { margin: 0; }
.side-me { display: flex; align-items: center; gap: 12px; padding: 6px 8px; border-radius: 12px; color: var(--ink); text-decoration: none; }
.side-me:hover { background: #eef2f8; }
.side-me > span { min-width: 0; }
.side-me b { display: block; font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-me b + span { display: block; color: var(--muted); font-size: .85rem; }

.main { min-width: 0; display: flex; flex-direction: column; }
.sticky { position: sticky; top: 0; z-index: 20; }
.top {
  display: flex; align-items: center; gap: 16px;
  min-height: 88px; padding: 14px 36px;
  background: rgba(243, 245, 249, .94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.top h1 { flex: 1; margin: 0; font-size: 1.75rem; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-me .avatar { width: 52px; height: 52px; }
.top-public { justify-content: center; background: #fff; }
.top-public .side-logo { padding: 0; }
.menu-btn { display: none; }
.wrap { width: 100%; max-width: 920px; margin: 0 auto; padding: 30px 36px 90px; }
.wrap-wide { max-width: 1220px; }
.scrim { display: none; }

/* "View as" banner */
.viewas {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px 36px; background: #fff1c2; border-bottom: 2px solid #eec140; color: #3d2e00; font-size: 1rem;
}
.viewas > .ic { width: 30px; height: 30px; color: #8a6200; }
.viewas > div { flex: 1; min-width: 240px; line-height: 1.35; }
.viewas b { display: block; font-size: 1.1rem; }
.viewas form { margin: 0; }
body.viewing .side { border-right: 4px solid #eec140; }

@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .side {
    position: fixed; inset: 0 auto 0 0; z-index: 50; width: min(340px, 88vw); height: 100%;
    transform: translateX(-102%); transition: transform .2s ease;
  }
  body.menu-open { overflow: hidden; }
  body.menu-open .side { transform: none; box-shadow: 0 0 40px rgba(18, 26, 47, .3); }
  body.menu-open .scrim { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(18, 26, 47, .45); }
  .menu-btn {
    display: inline-flex; align-items: center; gap: 8px; flex: none;
    min-height: 56px; padding: 10px 18px; border-radius: 12px;
    background: var(--blue); color: #fff; font-weight: 800; font-size: 1.05rem; text-decoration: none;
  }
  .menu-btn .ic { width: 26px; height: 26px; }
  .top { min-height: 78px; padding: 10px 16px; gap: 12px; }
  .top h1 { font-size: 1.3rem; }
  .viewas { padding: 10px 16px; }
  .wrap { padding: 22px 16px 80px; }
}
@media (max-width: 540px) {
  body { font-size: 19px; }
  .top-me { display: none; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 60px; padding: 14px 26px;
  font: inherit; font-weight: 700; font-size: 1.08rem; line-height: 1.2; text-decoration: none; text-align: center;
  color: #fff; background: var(--blue);
  border: 2px solid transparent; border-radius: 12px; cursor: pointer;
  transition: filter .12s, background .12s, transform .06s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { filter: brightness(.92); }
.btn:active { transform: translateY(1px); }
.btn .ic { width: 1.3em; height: 1.3em; }
.btn:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 4px solid var(--yellow); outline-offset: 2px;
}
.btn-blue { background: var(--blue); }
.btn-green { background: var(--green); }
.btn-orange { background: var(--orange); }
.btn-pink { background: var(--pink); }
.btn-purple { background: var(--purple); }
.btn-teal { background: var(--teal); }
.btn-red { background: var(--red); }
.btn-slate { background: var(--slate); }
.btn-ink { background: var(--ink); }
.btn-yellow { background: var(--yellow); color: var(--ink); }
.btn-white { background: #fff; color: var(--ink); border-color: var(--line2); }
.btn-white:hover { filter: none; background: #eef2f8; }
.btn-block { display: flex; width: 100%; }
.btn-sm { min-height: 46px; padding: 8px 16px; font-size: .92rem; border-radius: 10px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn-row.end { justify-content: flex-end; }
form.inline { display: inline; }

/* ---------- Home tiles ---------- */
.hello { margin: 0 0 24px; }
.hello h2 { font-size: 2.1rem; margin-bottom: 2px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.tile {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  min-height: 190px; padding: 22px;
  color: #fff; background: var(--c); text-decoration: none;
  border-radius: 20px; box-shadow: var(--shadow);
  transition: transform .14s, box-shadow .14s;
}
.tile::after { content: ""; position: absolute; right: -40px; bottom: -40px; width: 150px; height: 150px; border-radius: 50%; background: rgba(255, 255, 255, .08); }
.tile:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(18, 26, 47, .16); }
.tile .ico { width: 64px; height: 64px; display: grid; place-items: center; margin-bottom: auto; border-radius: 16px; background: rgba(255, 255, 255, .18); }
.tile .ico .ic { width: 36px; height: 36px; }
.tile-label { margin-top: 18px; font-size: 1.35rem; font-weight: 800; line-height: 1.15; }
.tile small { font-size: .92rem; font-weight: 500; opacity: .9; }
.k-yellow.tile { background: var(--yellow); color: var(--ink); }
.k-yellow.tile .ico { background: rgba(18, 26, 47, .08); }
.badge {
  position: absolute; top: 20px; right: 20px; z-index: 1;
  min-width: 46px; height: 46px; padding: 0 12px; display: grid; place-items: center;
  background: #fff; color: var(--red); border-radius: 999px; font-size: 1.25rem; font-weight: 900;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
}
.badge-ok { color: var(--green); }
@media (max-width: 540px) {
  .tiles { grid-template-columns: 1fr 1fr; gap: 12px; }
  .tile { min-height: 160px; padding: 16px; }
  .tile .ico { width: 52px; height: 52px; }
  .tile .ico .ic { width: 30px; height: 30px; }
  .tile-label { font-size: 1.1rem; }
  .tile small { display: none; }
  .badge { top: 12px; right: 12px; min-width: 38px; height: 38px; font-size: 1.05rem; }
}

/* ---------- Cards and lists ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; box-shadow: var(--shadow); }
.card-yellow { background: #fff6d6; border-color: #f2d478; }
.card-red { background: #fdecea; border-color: #f2b3ac; }
.card-green { background: #e6f6eb; border-color: #a6d9b5; }
.flash { padding: 16px 20px; border-radius: 12px; font-weight: 700; margin-bottom: 20px; border: 1px solid; border-left-width: 6px; }
.flash-ok { background: #e6f6eb; border-color: var(--green); }
.flash-err { background: #fdecea; border-color: var(--red); }
.section-title { font-size: 1.2rem; margin: 28px 0 12px; }

.avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex: none; display: inline-grid; place-items: center; background: #ddd; }
.avatar-i { color: #fff; font-weight: 800; font-size: 1.3rem; }
.avatar.lg { width: 120px; height: 120px; font-size: 2.6rem; }
.avatar.xl { width: 180px; height: 180px; font-size: 4rem; }
.avatar.sm { width: 46px; height: 46px; font-size: 1rem; }
.c0 { background: var(--blue); } .c1 { background: var(--green); } .c2 { background: var(--orange); }
.c3 { background: var(--pink); } .c4 { background: var(--purple); } .c5 { background: var(--teal); }

.person {
  position: relative; display: flex; align-items: center; gap: 16px;
  min-height: 92px; padding: 14px 18px; margin-bottom: 12px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  color: var(--ink); text-decoration: none;
}
a.person { transition: border-color .12s, transform .12s; }
a.person:hover { border-color: var(--blue); transform: translateY(-1px); }
.person .who { flex: 1; min-width: 0; }
.person .who b { display: block; font-size: 1.2rem; }
.person .who span { color: var(--muted); font-size: .95rem; }
.person .go { font-size: 1.8rem; color: var(--blue); font-weight: 900; }
.person .badge { position: static; box-shadow: none; background: var(--red); color: #fff; }
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.people-grid .pcard {
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  padding: 20px 10px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  color: var(--ink); text-decoration: none; transition: border-color .12s, transform .12s;
}
.people-grid .pcard:hover { border-color: var(--blue); transform: translateY(-2px); }
.people-grid .pcard b { font-size: 1.12rem; }
.people-grid .pcard span { color: var(--muted); font-size: .9rem; }
@media (max-width: 540px) { .people-grid { grid-template-columns: 1fr 1fr; } }

/* Admin lists */
.list { padding: 6px 20px; }
.list-row { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.list-row .who { flex: 1; min-width: 0; }
.list-row .who b { display: block; font-size: 1.1rem; }
.list-row .who > span { color: var(--muted); font-size: .9rem; }
.list-row form { margin: 0; }
.filters { display: grid; grid-template-columns: 1.3fr 1fr 1.3fr auto; gap: 16px; align-items: end; }
.filters .field { margin: 0; }
@media (max-width: 760px) { .filters { grid-template-columns: 1fr; } .list-row { flex-wrap: wrap; } }

/* ---------- Forms ---------- */
label, .big-label { display: block; font-weight: 700; margin: 0 0 6px; }
.field { margin-bottom: 18px; }
input[type=text], input[type=password], input[type=email], input[type=tel], input[type=datetime-local], select, textarea {
  width: 100%; font: inherit; color: var(--ink);
  padding: 14px 16px; min-height: 60px;
  background: #fff; border: 2px solid var(--line2); border-radius: 12px;
  transition: border-color .12s;
}
input:focus, select:focus, textarea:focus { border-color: var(--blue); }
textarea { min-height: 120px; resize: vertical; }
.hint { color: var(--muted); font-size: .9rem; font-weight: 500; margin-top: 4px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }
.filebtn { cursor: pointer; margin: 0; }
.filebtn.chosen { background: var(--green); }

/* ---------- Posts ---------- */
.post { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 20px; box-shadow: var(--shadow); }
.post.pinned { border-color: var(--orange); border-left: 6px solid var(--orange); }
.post.hidden-post { opacity: .6; border-style: dashed; }
.post-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.post-head b { font-size: 1.12rem; display: block; }
.post-head span { color: var(--muted); font-size: .9rem; }
.post-body { font-size: 1.18rem; white-space: pre-wrap; overflow-wrap: anywhere; margin-bottom: 12px; }
.media { display: block; width: 100%; max-height: 70vh; object-fit: contain; background: #111; border-radius: 12px; margin-bottom: 12px; }
.pin-flag { display: inline-block; background: var(--orange); color: #fff; font-weight: 800; padding: 4px 14px; border-radius: 999px; font-size: .85rem; margin-bottom: 10px; letter-spacing: .02em; }
.comments { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 14px; }
.comment { display: flex; gap: 12px; margin-bottom: 10px; }
.comment .bubble { background: #f0f3f8; border-radius: 14px; padding: 10px 14px; flex: 1; overflow-wrap: anywhere; }
.comment .bubble b { font-size: .95rem; }
.comment-form { display: flex; gap: 10px; margin-top: 10px; }
.comment-form input { flex: 1; min-width: 0; }
.mod { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line2); }
.wall-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.wall-head .who { flex: 1; min-width: 200px; }
.wall-head h2 { margin: 0; font-size: 1.7rem; }

/* ---------- Chat ---------- */
.chat { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.msg { max-width: 82%; padding: 12px 18px; border-radius: 20px; font-size: 1.18rem; overflow-wrap: anywhere; white-space: pre-wrap; }
.msg time { display: block; font-size: .78rem; opacity: .8; margin-top: 4px; white-space: normal; }
.msg.them { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 6px; box-shadow: var(--shadow); }
.msg.mine { align-self: flex-end; background: var(--blue); color: #fff; border-bottom-right-radius: 6px; }
.msg .media { margin: 0 0 6px; max-height: 50vh; }
.quick { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.chat-form { position: sticky; bottom: 0; background: var(--bg); padding: 14px 0; border-top: 1px solid var(--line); }
.chat-form textarea { min-height: 76px; margin-bottom: 10px; }

/* ---------- Check-in ---------- */
.moods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.mood {
  font: inherit; font-weight: 800; font-size: 1.2rem; color: var(--ink);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 24px 8px; border-radius: 20px; border: 4px solid transparent; cursor: pointer;
  transition: transform .12s, border-color .12s;
}
.mood span { font-size: 4.2rem; line-height: 1; }
.mood-1 { background: #c6f1d1; } .mood-2 { background: #ffe79a; } .mood-3 { background: #ffcbc4; }
.mood:hover { transform: translateY(-2px); }
.mood.on { border-color: var(--ink); }
@media (max-width: 540px) { .moods { grid-template-columns: 1fr; } .mood { flex-direction: row; justify-content: center; gap: 16px; } }
.dots { display: inline-flex; gap: 4px; vertical-align: middle; }
.dot { width: 18px; height: 18px; border-radius: 50%; background: #e1e5ec; display: inline-block; }
.dot.m1 { background: #2e9e55; } .dot.m2 { background: #e0a800; } .dot.m3 { background: var(--red); }

/* ---------- Events ---------- */
.event { display: grid; grid-template-columns: auto 1fr; gap: 20px; }
.event .when { width: 96px; text-align: center; background: var(--teal); color: #fff; border-radius: 14px; padding: 12px 6px; font-weight: 800; align-self: start; }
.event .when .d { font-size: 2.2rem; line-height: 1; display: block; }
.event .when .m { font-size: .9rem; text-transform: uppercase; letter-spacing: .06em; }
.event h3 { font-size: 1.4rem; margin-bottom: 4px; }
@media (max-width: 480px) { .event { grid-template-columns: 1fr; } .event .when { width: auto; display: flex; gap: 10px; justify-content: center; align-items: baseline; } }

/* ---------- Staff / admin tables ---------- */
.tabs { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.tabs a { padding: 12px 22px; border-radius: 12px; background: #fff; border: 1px solid var(--line2); color: var(--ink); font-weight: 700; text-decoration: none; }
.tabs a.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 1rem; }
th, td { text-align: left; padding: 14px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { background: #fff; border: 1px solid var(--line); border-top: 5px solid var(--blue); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.stat:nth-child(2) { border-top-color: var(--green); }
.stat:nth-child(3) { border-top-color: var(--orange); }
.stat:nth-child(4) { border-top-color: var(--purple); }
.stat b { display: block; font-size: 2.3rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: .95rem; font-weight: 600; }
.pill { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: .8rem; font-weight: 800; background: #e6eaf1; color: var(--ink); }
.pill-green { background: #d2f0dc; color: #0d5a2b; } .pill-red { background: #ffd9d4; color: #8e1c1c; } .pill-yellow { background: #ffeaa8; color: #5c4500; }
.pill-blue { background: #dbe7ff; color: #0f3f9c; } .pill-purple { background: #e7deff; color: #4421a8; }
.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.5rem; font-weight: 800; letter-spacing: .08em; background: #fff1c2; padding: 6px 14px; border-radius: 10px; display: inline-block; }
details.card > summary { cursor: pointer; font-weight: 800; font-size: 1.2rem; }
details.card[open] > summary { margin-bottom: 16px; }

/* ---------- Sign-in ---------- */
.auth { max-width: 540px; margin: 5vh auto 0; }
.auth .card { padding: 32px; }

/* Keep initials readable wherever an avatar sits. */
span.avatar-i { color: #fff !important; font-size: 1.3rem !important; font-weight: 800; }
span.avatar-i.lg { font-size: 2.6rem !important; }
span.avatar-i.xl { font-size: 4rem !important; }
span.avatar-i.sm { font-size: 1rem !important; }

/* Fit the whole menu on shorter laptop screens */
@media (min-width: 961px) and (max-height: 960px) {
  .side { padding-top: 16px; }
  .side-logo { padding-bottom: 12px; }
  .nav { min-height: 54px; padding-top: 5px; padding-bottom: 5px; }
  .nav-ic { width: 42px; height: 42px; }
  .nav-ic .ic { width: 24px; height: 24px; }
  .side-group { margin-top: 12px; }
}
.filters input, .filters select { height: 60px; min-height: 60px; }
.auth h2 { font-size: 1.9rem; margin-bottom: .6em; }

/* ---------- Photo picker, preview and photo grid ---------- */
.uploader { margin-top: 14px; }
.up-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-top: 14px; }
.up-list:empty { display: none; }
.up-item { position: relative; aspect-ratio: 1; overflow: hidden; border-radius: 12px; background: #e6eaf1; }
.up-item img, .up-item video { display: block; width: 100%; height: 100%; object-fit: cover; }
.up-rm {
  position: absolute; top: 8px; right: 8px;
  min-height: 40px; padding: 6px 12px; border: 0; border-radius: 999px; cursor: pointer;
  background: rgba(18, 26, 47, .85); color: #fff; font: inherit; font-size: .82rem; font-weight: 700;
}
.up-rm:hover { background: var(--red); }
.up-kind { position: absolute; left: 8px; bottom: 8px; padding: 2px 10px; border-radius: 999px; background: rgba(18, 26, 47, .8); color: #fff; font-size: .75rem; font-weight: 700; }
.up-note { margin: 12px 0 0; font-weight: 700; color: var(--green); }
.up-note.err { color: var(--red); }
.preview { margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--line2); }
.preview-label { margin: 0 0 10px; font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.preview .post { margin: 0; background: #fafbfd; box-shadow: none; }
.composer-send { margin-top: 20px; }
.chat-send { display: flex; flex-wrap: wrap; gap: 12px; }
.chat-send .uploader { display: contents; }
.chat-send .filebtn { order: 1; }
.chat-send > .btn { order: 2; flex: 1; }
.chat-send .up-list, .chat-send .up-note { order: 3; flex: 1 1 100%; margin-top: 0; }
.chat-send .up-list { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }

.gallery { display: grid; gap: 6px; margin-bottom: 12px; overflow: hidden; border-radius: 12px; }
.g-item { position: relative; display: block; overflow: hidden; background: #e6eaf1; cursor: zoom-in; }
.g-item img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.g-item:hover img { transform: scale(1.03); }
.g-extra { display: none; }
.g1 .g-item { background: #111; }
.g1 .g-item img { max-height: 70vh; object-fit: contain; }
.g2 { grid-template-columns: 1fr 1fr; aspect-ratio: 2 / 1; }
.g3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 3 / 2; }
.g3 .g-item:first-child { grid-row: span 2; }
.g4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 4 / 3; }
.more { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(18, 26, 47, .55); color: #fff; font-size: 2.4rem; font-weight: 800; }
.msg a[data-lightbox] { display: block; }

body.lb-open { overflow: hidden; }
.lightbox { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: rgba(8, 12, 24, .94); }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 94vw; max-height: 86vh; object-fit: contain; border-radius: 6px; }
.lightbox button {
  position: absolute; border: 0; cursor: pointer; font: inherit; font-weight: 800;
  background: rgba(255, 255, 255, .14); color: #fff; border-radius: 14px;
}
.lightbox button:hover { background: rgba(255, 255, 255, .26); }
.lb-close { top: 18px; right: 18px; min-height: 56px; padding: 0 22px; font-size: 1.05rem; }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); width: 72px; height: 96px; font-size: 3rem; line-height: 1; }
.lb-prev { left: 18px; } .lb-next { right: 18px; }
.lb-count { position: absolute; bottom: 22px; left: 0; right: 0; text-align: center; color: #fff; font-weight: 700; font-size: 1.05rem; }
@media (max-width: 540px) { .up-rm { top: 6px; right: 6px; min-height: 36px; padding: 4px 10px; } .lb-prev, .lb-next { width: 56px; height: 72px; font-size: 2.4rem; } .lb-prev { left: 8px; } .lb-next { right: 8px; } }
