/* ===== TRADES ===== */
.trade-card { background: var(--card); border: 1px solid var(--stroke); border-radius: 18px; padding: 15px; }
.trade-sides { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: stretch; margin-top: 12px; }
.trade-side { background: var(--card-2); border-radius: 14px; padding: 11px; }
.trade-side .side-label { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin-bottom: 8px; }
.trade-arrow { display: grid; place-items: center; color: var(--grad-b); }
.trade-arrow svg { width: 18px; height: 18px; }
.titem { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 12.5px; font-weight: 700; }
.titem img { width: 30px; height: 38px; border-radius: 8px; object-fit: cover; }
.coin-offer {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--gold); font-weight: 800; font-size: 12.5px;
  padding: 4px 0;
}
.coin-offer::before { content:''; width: 11px; height: 11px; border-radius: 50%; background: radial-gradient(circle at 32% 30%, #FFE7A8, #F5B93E 70%); }

.pill-tabs { display: flex; gap: 6px; background: var(--card); border: 1px solid var(--stroke); border-radius: 999px; padding: 4px; margin-bottom: 14px; }
.pill-tab { flex: 1; text-align: center; padding: 9px 4px; border-radius: 999px; font-size: 12.5px; font-weight: 800; color: var(--muted); transition: all .15s ease; }
.pill-tab.active { background: var(--gradient); color: var(--on-accent); }

.picked-items { display: flex; flex-direction: column; gap: 6px; min-height: 40px; }
.pick-slot { display: flex; align-items: center; gap: 8px; background: var(--card-2); border-radius: 11px; padding: 6px 10px; font-size: 12.5px; font-weight: 700; }
.pick-slot img { width: 26px; height: 34px; border-radius: 7px; object-fit: cover; }
.pick-slot .rm { margin-left: auto; color: var(--danger); font-weight: 800; padding: 4px 7px; }

/* ===== CHAT ===== */
.conv-row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 4px;
  border-bottom: 1px solid var(--stroke);
}
.conv-row:active { background: var(--hover-soft); }
.conv-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 17px; font-weight: 800; color: #fff;
  flex-shrink: 0;
}
.conv-body { flex: 1; min-width: 0; }
.conv-name { font-weight: 800; font-size: 14.5px; }
.conv-last { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.conv-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.conv-time { font-size: 10.5px; color: var(--muted); font-weight: 700; }
.conv-unread {
  min-width: 19px; height: 19px; padding: 0 5px;
  background: var(--gradient);
  color: var(--on-accent);
  border-radius: 999px;
  font-size: 10.5px; font-weight: 800;
  display: grid; place-items: center;
}

.chat-wrap { display: flex; flex-direction: column; min-height: calc(100dvh - var(--topbar-h) - var(--tabbar-h) - 40px); }
.chat-scroll { flex: 1; overflow-y: auto; padding: 8px 0 14px; display: flex; flex-direction: column; gap: 8px; }
.msg-row { display: flex; gap: 8px; max-width: 84%; animation: msgIn .18s ease both; }
@keyframes msgIn { from { opacity: 0; transform: translateY(6px);} to {opacity:1;} }
.msg-row.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg-bubble {
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.4;
  background: var(--card);
  border: 1px solid var(--stroke);
  word-break: break-word;
  white-space: pre-wrap;
}
.msg-row.mine .msg-bubble {
  background: var(--gradient);
  border-color: transparent;
  color: var(--on-accent);
}
.msg-card {
  width: 190px;
  background: var(--card-2);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--stroke-strong);
}
.msg-card img { width: 100%; aspect-ratio: 3/3.4; object-fit: cover; }
.msg-card .mc-body { padding: 8px 10px 10px; }
.msg-card .mc-nm { font-size: 12.5px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-time { font-size: 9.5px; opacity: .65; margin-top: 3px; }

.chat-composer {
  position: sticky;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  display: flex; gap: 8px; align-items: center;
  padding: 10px 2px 4px;
  background: linear-gradient(0deg, var(--bg) 72%, transparent);
}
.chat-composer input {
  flex: 1; min-width: 0;
  height: 44px;
  padding: 0 16px;
  border-radius: 22px;
  background: var(--card);
  border: 1px solid var(--border);
  font-size: 14.5px; font-weight: 500;
}
.chat-composer input:focus {
  border-color: var(--accent);
  box-shadow: none;
}
.chat-composer input:focus-visible { outline: none; }
.send-btn {
  width: 44px; height: 44px; flex: 0 0 44px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  display: grid; place-items: center;
  transition: background .18s ease, color .18s ease, transform .15s ease;
}
.send-btn:active { transform: scale(.94); }
.send-btn.is-empty {
  background: var(--card);
  color: var(--muted);
  border: 1px solid var(--border);
  box-shadow: none;
}
.send-btn svg { width: 20px; height: 20px; }
.attach-btn {
  width: 44px; height: 44px; flex: 0 0 44px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid transparent;
  color: var(--muted);
  display: grid; place-items: center;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .15s ease;
}
.attach-btn:active { transform: scale(.94); }
.attach-btn.is-active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}
.attach-btn svg { width: 21px; height: 21px; }

/* ===== NOTIFICATIONS ===== */
.notif-row {
  display: flex; gap: 12px;
  padding: 14px 6px;
  border-bottom: 1px solid var(--stroke);
  align-items: flex-start;
  position: relative;
}
.notif-ic {
  width: 40px; height: 40px; border-radius: 14px;
  display: grid; place-items: center;
  flex-shrink: 0;
  background: var(--card-2);
  border: 1px solid var(--stroke);
}
.notif-ic svg { width: 19px; height: 19px; }
.notif-row h4 { font-size: 14px; }
.notif-row p { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.notif-time { font-size: 10.5px; color: var(--muted); margin-top: 5px; font-weight: 700; }
.unread-ind { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 8px; height: 8px; border-radius: 50%; background: var(--grad-b); box-shadow: 0 0 10px rgba(var(--accent-b-rgb),.7); }
.notif-actions { display: flex; gap: 8px; margin-top: 10px; }
.notif-act {
  height: 32px; padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: var(--card);
  color: var(--text);
  font-family: inherit;
  font-size: 12px; font-weight: 800;
  cursor: pointer;
  transition: transform .14s ease, opacity .14s ease, background .14s ease;
}
.notif-act:active { transform: scale(.96); }
.notif-act.is-primary {
  background: var(--gradient);
  color: var(--on-accent);
  border-color: transparent;
}
.notif-act:disabled { opacity: .55; cursor: default; }

/* ===== LEADERBOARD ===== */
.podium { display: flex; align-items: flex-end; gap: 8px; justify-content: center; margin: 18px 0 22px; }
.pod {
  flex: 1; max-width: 120px;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 18px 18px 10px 10px;
  padding: 14px 8px 12px;
  text-align: center;
}
.pod .p-av {
  width: 46px; height: 46px; margin: 0 auto 8px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 800; color: var(--muted);
  background: var(--card-2);
}
.pod.first .p-av { width: 58px; height: 58px; background: var(--gold-fill); color: var(--on-gold); }
.pod.second .p-av { background: linear-gradient(135deg, #CDD3E8, #8f96b3); color: #22263a; }
.pod.third .p-av { background: linear-gradient(135deg, #E8926B, #B05C33); }
.pod .p-name { font-size: 12px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pod .p-score { font-size: 11.5px; color: var(--gold); font-weight: 800; margin-top: 3px; }
.pod.first {
  padding-bottom: 30px;
  border-color: rgba(255,209,102,.45);
  background: linear-gradient(180deg, rgba(255,209,102,.09), var(--card) 62%);
}
.pod.second { border-color: rgba(205,211,232,.3); }
.pod.third { border-color: rgba(232,146,107,.3); }
.pod .medal {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 30px; height: 20px;
  margin: 0 auto 7px;
  padding: 0 7px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: var(--chip-bg);
  color: var(--muted);
  font-size: 10px; font-weight: 800; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.pod.first .medal { background: var(--gold-fill); border-color: transparent; color: var(--on-gold); }
.pod.second .medal { background: rgba(205,211,232,.16); border-color: rgba(205,211,232,.3); color: #DDE2F2; }
.pod.third .medal { background: rgba(232,146,107,.16); border-color: rgba(232,146,107,.3); color: #F0A37F; }

.lb-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 8px;
  border-bottom: 1px solid var(--stroke);
  border-bottom: 1px solid color-mix(in srgb, var(--stroke) 55%, transparent);
  border-radius: 0;
}
.lb-row:active { background: var(--hover-soft); }
.lb-row.me-row {
  background: rgba(var(--accent-rgb),.13);
  border: 1px solid rgba(var(--accent-rgb),.35);
  border-radius: 14px;
}
.lb-rank { width: 28px; text-align: center; font-weight: 800; color: var(--muted); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.lb-av { width: 36px; height: 36px; border-radius: 50%; background: var(--card-2); display: grid; place-items: center; font-size: 13px; font-weight: 800; color: var(--muted); overflow: hidden; }
.p-av img, .lb-av img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.lb-name { font-weight: 700; font-size: 13.5px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-score { font-weight: 800; font-size: 13px; color: var(--gold); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ===== PROFILE ===== */
.pf-page { position: relative; }

.pf-cover {
  position: relative;
  height: clamp(210px, 62vw, 248px);
  margin: -14px -16px 0;
  border-radius: 0 0 30px 30px;
  overflow: hidden;
  background: linear-gradient(160deg, var(--card-2), var(--surface-deep));
  isolation: isolate;
}
.pf-cover-art {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 50% 20%;
}
.pf-cover-scrim {
  position: absolute; inset: 0; z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0,0,0,.42), rgba(0,0,0,.04) 34%, transparent 52%),
    linear-gradient(0deg, rgba(0,0,0,.55), transparent 42%);
}
.pf-gear {
  position: absolute; top: 12px; right: 14px; z-index: 3;
  width: 42px; height: 42px; padding: 0;
  display: grid; place-items: center;
  background: none; border: 0;
  color: #fff;
  filter: drop-shadow(0 2px 7px rgba(0,0,0,.65));
  transition: transform .15s ease, opacity .15s ease;
}
.pf-gear:active { transform: scale(.88); opacity: .82; }
.pf-gear svg { width: 21px; height: 21px; }
.pf-identity {
  position: relative; z-index: 2;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
  margin-top: -44px;
}
.pf-av-wrap {
  flex: 0 0 96px; width: 96px; height: 96px;
  padding: 0; border-radius: 50%;
  background: var(--card-2);
  box-shadow: none;
}
.pf-av,
.pf-av-wrap .avatar {
  width: 96px; height: 96px;
  display: block; border-radius: 50%;
  object-fit: cover;
  border: 0;
}
.pf-av-wrap .avatar {
  display: grid; place-items: center;
  background: var(--gradient);
  color: var(--on-accent);
  font-size: 32px; font-weight: 800;
  box-shadow: none;
}
.pf-edit {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 14px;
  margin-bottom: 6px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--stroke-strong);
  color: var(--text);
  font-family: inherit;
  font-size: 12px; font-weight: 800;
  transition: transform .14s ease, background .15s ease;
}
.pf-edit:active { transform: scale(.96); background: var(--hover-soft); }
.pf-edit svg { width: 14px; height: 14px; }

.pf-info { padding-top: 13px; }
.pf-name {
  font-size: clamp(22px, 6.2vw, 28px);
  line-height: 1.12; font-weight: 800; letter-spacing: -.2px;
  overflow-wrap: anywhere;
}
.pf-bio {
  margin-top: 9px;
  font-size: 15px; line-height: 1.65;
  color: var(--text); opacity: .86;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.pf-bio[hidden] { display: none; }

.pf-figures {
  display: flex; align-items: center; gap: 9px;
  margin-top: 15px; padding: 11px 0;
  border-top: 1px solid var(--stroke);
  border-bottom: 1px solid var(--stroke);
}
.pf-fig { display: inline-flex; align-items: baseline; gap: 5px; min-width: 0; }
.pf-fig b {
  font-family: var(--font-display);
  font-size: 16px; line-height: 1; font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.pf-fig span {
  font-size: 9.5px; font-weight: 800; letter-spacing: .7px;
  text-transform: uppercase; color: var(--muted);
}
.pf-fig.gold b { color: var(--gold); }
.pf-fig-sep {
  flex: 0 0 3px; width: 3px; height: 3px;
  border-radius: 50%; background: var(--stroke-strong);
}
.pf-id-row {
  position: relative; z-index: 2;
  display: flex; padding-top: 7px;
}
.pf-id {
  display: inline-flex; align-items: center; gap: 4px;
  max-width: 100%;
  padding: 3px 8px 3px 6px;
  border-radius: 999px;
  background: var(--chip-bg);
  border: 1px solid var(--stroke);
  color: var(--muted);
  font-family: inherit;
  font-size: 10px; font-weight: 700; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.pf-id > span:last-child {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pf-id svg { width: 11px; height: 11px; opacity: .8; }
.pf-id:active { opacity: .55; }

.pf-cover-art-host { position: absolute; inset: 0; }
.pf-cover-banner { object-position: 50% 50%; }

.pf-av-wrap { position: relative; }
.pf-av-btn {
  display: inline-flex;
  padding: 0;
  border: 0;
  font-family: inherit;
  cursor: pointer;
  text-align: center;
}
.pf-av-btn:active { transform: scale(.98); }
.pf-av-cam {
  position: absolute; right: 1px; bottom: 1px;
  width: 27px; height: 27px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--bg);
  color: var(--text);
  box-shadow: 0 3px 10px rgba(0,0,0,.32);
}
.pf-av-cam svg { width: 13px; height: 13px; }

.pf-social {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px;
  margin-top: 13px;
}
.pf-social.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pf-social-stat {
  min-width: 0;
  padding: 9px 3px 10px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  transition: background .15s ease;
}
button.pf-social-stat:active { background: var(--hover-soft); }
.pf-social-stat[disabled] { opacity: 1; }
.pf-social-stat b {
  font-family: var(--font-display);
  font-size: 17px; line-height: 1; font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.pf-social-stat span {
  font-size: 9px; font-weight: 800; letter-spacing: .7px;
  text-transform: uppercase; color: var(--muted);
  white-space: nowrap;
}

.pf-collection { margin-top: 24px; }
.pf-col-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
  margin-bottom: 11px; padding: 0 2px;
}
.pf-col-head h2 { font-size: 18px; line-height: 1.1; font-weight: 800; }
.pf-col-head p {
  margin-top: 3px;
  font-size: 10px; font-weight: 700; letter-spacing: .4px;
  text-transform: uppercase; color: var(--muted);
}
.pf-col-all {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 0;
  color: var(--accent);
  font-family: inherit;
  font-size: 10.5px; font-weight: 800; letter-spacing: .2px;
}
.pf-col-all svg { width: 12px; height: 12px; }
.pf-col-all:active { opacity: .6; }
.pf-show {
  display: flex; gap: 10px;
  overflow-x: auto; overflow-y: hidden;
  padding: 2px 2px 4px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.pf-show::-webkit-scrollbar { display: none; }
.pf-show-card {
  flex: 0 0 106px; width: 106px;
  display: block; padding: 0;
  background: none; border: 0;
  color: var(--text);
  font-family: inherit; text-align: left;
  scroll-snap-align: start;
}
.pf-show-art {
  position: relative; display: block;
  width: 106px; height: 140px;
  border-radius: 15px; overflow: hidden;
  background: linear-gradient(160deg, var(--card-2), var(--surface-deep));
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--rc) 55%, transparent),
    0 12px 22px -16px rgba(0,0,0,.8);
}
.pf-show-img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 50% 18%;
  transition: transform .3s ease;
}
.pf-show-art::after {
  content: ''; position: absolute; inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 62%, rgba(0,0,0,.35));
}
.pf-show-card:active .pf-show-img,
.pf-show-art:active .pf-show-img { transform: scale(1.04); }
.pf-show-name {
  display: block; margin-top: 7px;
  font-size: 11px; font-weight: 800; line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pf-show-card:active .pf-show-name { color: var(--accent); }

.pf-links {
  margin-top: 22px;
  border-top: 1px solid var(--stroke);
}
.pf-link {
  width: 100%;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 2px;
  background: none; border: 0; border-bottom: 1px solid var(--stroke);
  color: var(--text);
  font-family: inherit; font-size: 13px; font-weight: 700;
  text-align: left;
  transition: color .15s ease;
}
.pf-link:active { color: var(--accent); }
.pf-link-ic { flex: 0 0 20px; width: 20px; display: inline-flex; color: var(--muted); }
.pf-link-ic svg { width: 17px; height: 17px; }
.pf-link-label { flex: 1; min-width: 0; }
.pf-link-chev { flex: 0 0 auto; display: inline-flex; color: var(--muted); opacity: .55; }
.pf-link-chev svg { width: 15px; height: 15px; }

.sheet textarea { resize: none; min-height: 90px; line-height: 1.5; }

/* ===== PUBLIC USER PROFILE ===== */
.up-page .pf-cover { height: clamp(195px, 58vw, 232px); }
.up-back {
  position: absolute; top: 12px; left: 14px; z-index: 3;
  width: 40px; height: 40px; padding: 0;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(12, 11, 17, .32);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,.18);
  transition: transform .15s ease, background .15s ease;
}
.up-back:active { transform: scale(.92); background: rgba(12, 11, 17, .45); }
.up-back svg { width: 22px; height: 22px; }
.up-cover-fallback {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background:
    radial-gradient(80% 120% at 20% 0%, rgba(var(--accent-rgb), .28), transparent 62%),
    radial-gradient(80% 120% at 90% 100%, rgba(var(--accent-b-rgb), .2), transparent 60%),
    linear-gradient(155deg, var(--card-2), var(--surface-deep));
  color: var(--muted);
}
.up-cover-glyph {
  font-family: var(--font-display);
  font-size: 64px; line-height: 1;
  font-weight: 800;
  color: rgba(255,255,255,.3);
  text-shadow: 0 8px 30px rgba(0,0,0,.28);
}
.up-cover-word {
  font-size: 8px; font-weight: 800; letter-spacing: 2.6px;
  text-transform: uppercase; color: rgba(255,255,255,.44);
}
.up-avatar { display: inline-flex; }
.up-handle {
  margin-top: 7px;
  align-self: flex-start;
}
.up-rep-stat b { color: var(--gold); }
.up-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 14px;
}
.up-action {
  min-width: 0;
  height: 46px;
  padding: 0 14px;
  border-radius: 13px;
  border: 1px solid transparent;
  font-size: 13px;
  letter-spacing: .1px;
  box-shadow: none;
}
.up-action svg { width: 17px; height: 17px; }
.up-follow {
  background: var(--gradient);
  color: var(--on-accent);
  box-shadow: 0 9px 22px -15px rgba(var(--accent-b-rgb), .95);
}
.up-follow.is-following {
  background: var(--card-2);
  border-color: var(--stroke-strong);
  color: var(--text);
  box-shadow: none;
}
.up-rep-btn {
  background: var(--card);
  border-color: var(--gold-border);
  color: var(--gold);
}
.up-rep-btn.is-given {
  background: var(--card-2);
  border-color: var(--stroke);
  color: var(--muted);
}
.up-rep-btn.is-given[disabled] { opacity: 1; }
.up-note {
  grid-column: 1 / -1;
  margin: 0;
  padding: 11px 14px;
  border-radius: 13px;
  background: var(--card);
  border: 1px solid var(--stroke);
  text-align: center;
  font-size: 11.5px; font-weight: 600; color: var(--muted);
}

/* ===== RELATIONSHIP LISTS ===== */
.ul-list { margin-top: 4px; }
.ul-loading { display: grid; place-items: center; padding: 34px; }
.ul-row {
  width: 100%;
  display: flex; align-items: center; gap: 11px;
  padding: 10px 2px;
  border: 0; border-bottom: 1px solid var(--stroke);
  background: transparent;
  color: var(--text);
  font-family: inherit;
  text-align: left;
}
.ul-row:active { background: var(--hover-soft); }
.ul-av {
  flex: 0 0 42px; width: 42px; height: 42px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--gradient);
  display: grid; place-items: center;
}
.ul-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ul-initial { font-size: 15px; font-weight: 800; color: var(--on-accent); }
.ul-body { flex: 1; min-width: 0; display: block; }
.ul-body b {
  display: block;
  font-size: 13px; font-weight: 800;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ul-body small {
  display: block; margin-top: 1px;
  font-size: 10px; font-weight: 600; color: var(--muted);
}
.ul-bio {
  display: block; margin-top: 2px;
  font-size: 10.5px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ul-side { flex: 0 0 auto; display: flex; align-items: center; gap: 5px; }
.ul-side small { font-size: 9px; font-weight: 800; color: var(--accent); }
.ul-chev { display: inline-flex; color: var(--muted); opacity: .55; }
.ul-chev svg { width: 14px; height: 14px; }
.pod, .lb-row { cursor: pointer; }

/* ===== SUBPAGE HEADER (settings/theme/transactions) ===== */
.subpage-bar {
  display: flex; align-items: center; gap: 10px;
  margin: 2px 0 18px;
}
.subpage-back {
  flex: 0 0 38px; width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: transparent;
  border: 0;
  color: var(--text);
  transition: transform .14s ease, background .14s ease;
}
.subpage-back:active { transform: scale(.94); background: var(--hover-soft); }
.subpage-back svg { width: 18px; height: 18px; }
.subpage-title {
  flex: 1; min-width: 0;
  font-size: 23px; font-weight: 800; text-align: left;
}
.subpage-spacer { flex: 0 0 38px; width: 38px; }
.subpage-bar .coin-pill { flex: 0 0 auto; }

/* ===== SETTINGS ===== */
.set-card {
  border-radius: 18px;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--stroke);
}
.set-row {
  width: 100%;
  display: flex; align-items: center; gap: 13px;
  padding: 12px 14px;
  border: 0;
  border-top: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px; font-weight: 700;
  text-align: left;
  transition: background .15s ease;
}
.set-row:first-child { border-top: 0; }
.set-row:active { background: var(--hover-soft); }
.set-ic {
  flex: 0 0 34px; width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 0;
  background: none;
  color: var(--accent);
}
.set-ic svg { width: 17px; height: 17px; }
.set-body { flex: 1; min-width: 0; }
.set-label { display: block; }
.set-sub {
  display: block; margin-top: 1px;
  font-size: 10.5px; font-weight: 600; color: var(--muted);
}
.set-chev { flex: 0 0 auto; display: inline-flex; color: var(--muted); opacity: .7; }
.set-chev svg { width: 15px; height: 15px; }

/* ===== THEME PICKER ===== */
.thm-lead {
  margin: -6px 2px 14px;
  font-size: 12.5px; line-height: 1.55; color: var(--muted);
}
.thm-list {
  border-radius: 18px;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--stroke);
}
.thm-row {
  width: 100%;
  display: flex; align-items: center; gap: 13px;
  padding: 12px 14px;
  border: 0;
  border-top: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-family: inherit;
  text-align: left;
  transition: background .15s ease;
}
.thm-row:first-child { border-top: 0; }
.thm-row:active { background: var(--hover-soft); }
.thm-row.active { background: var(--accent-soft); }
.thm-orb {
  flex: 0 0 38px; width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--tb, var(--accent));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14);
}
.thm-name { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 700; }
.thm-check {
  flex: 0 0 22px; width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1.5px solid var(--stroke-strong);
  color: transparent;
}
.thm-row.active .thm-check {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.thm-check svg { width: 13px; height: 13px; }
.thm-note {
  margin: 14px 2px 0;
  font-size: 11.5px; line-height: 1.6; color: var(--muted);
}

@media (max-width: 350px) {
  .pf-cover { height: 202px; }
  .pf-av-wrap { flex-basis: 86px; width: 86px; height: 86px; }
  .pf-av,
  .pf-av-wrap .avatar { width: 86px; height: 86px; }
  .pf-av-wrap .avatar { font-size: 28px; }
  .pf-name { font-size: 21px; }
  .pf-bio { font-size: 15px; line-height: 1.62; }
  .pf-fig b { font-size: 15px; }
  .pf-fig span { font-size: 9px; letter-spacing: .5px; }
  .pf-id { font-size: 9.5px; }
  .pf-show-card,
  .pf-show-art { flex-basis: 100px; width: 100px; }
  .pf-show-art { height: 132px; }
  .pf-social-stat b { font-size: 15px; }
  .pf-social-stat span { font-size: 8px; letter-spacing: .5px; }
  .pf-av-cam { width: 24px; height: 24px; }
  .up-cover-glyph { font-size: 52px; }
  .up-actions { gap: 7px; }
  .up-action { padding: 11px 8px; font-size: 12px; }
  .subpage-title { font-size: 21px; }
}

/* Short phones: keep public-profile actions clear of the fixed tabbar. */
@media (max-width: 380px) and (max-height: 640px) {
  .up-page .pf-cover { height: 170px; }
  .up-page .up-cover-glyph { font-size: 48px; }
  .up-page .pf-info { padding-top: 9px; }
  .up-page .pf-social { margin-top: 10px; }
  .up-page .up-actions { margin-top: 10px; }
  .up-page .up-action { height: 42px; padding: 0 10px; font-size: 12px; }
}

/* ===== TRANSACTIONS ===== */
.tx-row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 4px;
  border-bottom: 1px solid var(--stroke);
}
.tx-ic {
  width: 38px; height: 38px;
  border-radius: 13px;
  display: grid; place-items: center;
  background: var(--card-2);
  border: 1px solid var(--stroke);
  font-weight: 800; font-size: 15px;
}
.tx-ic.in { color: var(--success); }
.tx-ic.out { color: var(--danger); }
.tx-body { flex: 1; min-width: 0; }
.tx-title { font-size: 13.5px; font-weight: 700; }
.tx-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.tx-amt { font-weight: 800; font-size: 14px; }
.tx-amt.in { color: var(--success); }
.tx-amt.out { color: var(--danger); }

/* ===== GATE (not in telegram) ===== */
.gate {
  min-height: 100dvh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 30px;
  gap: 14px;
}
.gate .g-logo {
  display: grid; place-items: center;
  background: none;
  box-shadow: none;
}
.gate .g-logo .brand-mark {
  width: 76px; height: 76px;
  border-radius: 26px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .24),
    inset 0 -3px 7px rgba(0, 0, 0, .4),
    0 18px 38px -18px rgba(0, 0, 0, .8),
    0 6px 16px -8px color-mix(in srgb, var(--accent) 42%, transparent);
}
.gate-copy {
  max-width: 290px;
  font-size: 14px; line-height: 1.5;
}
.gate-actions {
  display: flex; flex-direction: column; gap: 9px;
  width: min(100%, 280px);
  margin-top: 2px;
}
.gate-actions .btn { width: 100%; }
.gate [hidden] { display: none !important; }
.gate-dev-form {
  width: min(100%, 280px);
  display: flex; flex-direction: column; gap: 7px;
  margin-top: 2px;
  text-align: left;
}
.gate-dev-label {
  font-size: 11.5px; font-weight: 700; color: var(--muted);
}
.gate-dev-input {
  width: 100%;
  padding: 11px 13px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: 14px;
}
.gate-dev-input:focus {
  outline: 2px solid rgba(var(--accent-rgb), .45);
  outline-offset: 1px;
}
.gate-hint {
  max-width: 290px;
  font-size: 11.5px; line-height: 1.45;
}

/* ===== Trade cards inside chat ===== */
.trade-chat-card {
  width: min(78vw, 300px);
  background: var(--card);
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  border-radius: 16px;
  padding: 12px;
}
.msg-row.mine .trade-chat-card {
  background: linear-gradient(150deg, rgba(var(--accent-rgb),.14), rgba(var(--accent-b-rgb),.10));
  border-color: rgba(var(--accent-rgb), .4);
}
.trade-chat-card .tcc-side {
  background: var(--card-2);
  border-radius: 11px;
  padding: 8px 10px;
  margin-top: 8px;
}
.trade-chat-card .side-label {
  font-size: 9.5px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .5px; color: var(--muted); margin-bottom: 4px;
}

/* ===== Global community chat ===== */
.gmsg-row {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  margin-bottom: 10px;
  align-items: flex-end;
  overflow: hidden;
}
.gmsg-row.mine { justify-content: flex-end; }
.gmsg-row.grouped { margin-bottom: 3px; }

/* Telegram-style swipe to reply: the whole row follows the finger and
   springs back when the pull is short. */
.gmsg-swipe {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  gap: 9px;
  width: 100%;
  min-width: 0;
  touch-action: pan-y;
  will-change: transform;
  transition: transform .24s cubic-bezier(.22, .9, .3, 1);
}
.gmsg-row.mine .gmsg-swipe { justify-content: flex-end; }
.gmsg-swipe.is-dragging {
  transition: none;
  user-select: none;
  -webkit-user-select: none;
}
.gmsg-swipe-reply {
  position: absolute;
  right: 7px;
  top: 50%;
  z-index: 0;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  opacity: 0;
  transform: translateY(-50%) scale(.62);
  transition: opacity .12s ease, transform .12s ease;
  pointer-events: none;
}
.gmsg-swipe-reply svg { width: 15px; height: 15px; }

.gavatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
  background: var(--gradient);
  color: var(--on-accent); font-weight: 800; font-size: 14px;
  display: grid; place-items: center;
}
.gavatar.spacer { visibility: hidden; }

.gmsg-col { max-width: 76%; min-width: 0; }
.gmsg-name {
  font-size: 11.5px; font-weight: 800;
  color: var(--cyan);
  margin: 0 4px 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gmsg-row.mine .gmsg-col { display: flex; flex-direction: column; align-items: flex-end; }

.gmsg-bubble {
  display: inline-block;
  padding: 9px 13px;
  border-radius: 16px 16px 16px 5px;
  background: var(--card);
  border: 1px solid var(--stroke);
  font-size: 14px;
  line-height: 1.42;
  word-break: break-word;
  white-space: pre-wrap;
}
.gmsg-row.grouped .gmsg-bubble { border-radius: 5px 16px 16px 5px; }
.gmsg-row.mine .gmsg-bubble {
  background: var(--gradient);
  border-color: transparent;
  color: var(--on-accent);
  border-radius: 16px 16px 5px 16px;
}
.gmsg-row.mine.grouped .gmsg-bubble { border-radius: 5px 16px 5px 16px; }

/* ===== Sticker message (compact, Telegram-like) ===== */
.chat-sticker-img {
  display: block;
  width: auto;
  height: auto;
  max-width: 150px;
  max-height: 150px;
  border-radius: 12px;
  background: var(--card);
}

/* ===== Sticker picker ===== */
.sticker-panel {
  max-height: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  margin-bottom: 0;
  overflow: hidden;
  background: var(--card);
  border: 1px solid transparent;
  border-radius: 16px;
  box-shadow: none;
  transition:
    max-height .26s cubic-bezier(.2,.75,.25,1),
    opacity .18s ease,
    transform .26s cubic-bezier(.2,.75,.25,1),
    margin-bottom .26s cubic-bezier(.2,.75,.25,1),
    border-color .18s ease,
    box-shadow .18s ease,
    visibility 0s linear .26s;
}
.sticker-panel.is-open {
  max-height: 320px;
  max-height: min(320px, 56dvh);
  opacity: 1;
  visibility: visible;
  transform: none;
  margin-bottom: 8px;
  border-color: var(--border);
  box-shadow: var(--shadow-soft);
  transition:
    max-height .26s cubic-bezier(.2,.75,.25,1),
    opacity .18s ease,
    transform .26s cubic-bezier(.2,.75,.25,1),
    margin-bottom .26s cubic-bezier(.2,.75,.25,1),
    border-color .18s ease,
    box-shadow .18s ease,
    visibility 0s;
}
@media (prefers-reduced-motion: reduce) {
  .sticker-panel,
  .sticker-panel.is-open { transition: none; }
}
.sticker-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  padding: 10px 12px 2px;
}
.sticker-title {
  color: var(--text);
  font-size: 12px; font-weight: 800; letter-spacing: .3px;
  text-transform: uppercase;
}
.sticker-close {
  width: 28px; height: 28px; flex: 0 0 28px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: var(--muted);
  transition: background .15s ease, color .15s ease;
}
.sticker-close:active { background: var(--hover-soft); color: var(--text); }
.sticker-close svg { width: 15px; height: 15px; }
.pack-tabs {
  display: flex; gap: 6px; padding: 6px 12px 0;
  overflow-x: auto; scrollbar-width: none;
}
.pack-tabs::-webkit-scrollbar { display: none; }
.pack-tab {
  flex-shrink: 0; padding: 6px 11px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; color: var(--muted);
  border: 1px solid transparent; background: transparent;
}
.pack-tab.active {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: transparent;
}
.sticker-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 6px; padding: 10px 12px 12px; overflow-y: auto;
  max-height: 190px;
  max-height: min(190px, 30dvh);
}
.sticker-cell {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  transition: transform .12s ease;
}
.sticker-cell:hover { transform: scale(1.08); }
.sticker-cell:active { transform: scale(.96); }
.sticker-cell img,
.sticker-cell video {
  width: 100%; aspect-ratio: 1; object-fit: contain;
  border-radius: 8px;
  pointer-events: none;
}

/* ===== Reply bar ===== */
.reply-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--accent-soft);
  border-radius: 10px;
  padding: 8px 12px; margin-bottom: 6px;
}
.rm-btn { color: var(--muted); cursor: pointer; }
.rm-btn svg { width: 16px; height: 16px; }

/* ===== Reply quote inside bubble ===== */
.reply-quote {
  background: var(--accent-soft);
  border-left: 2px solid var(--accent);
  border-radius: 8px;
  padding: 7px 10px;
  margin-bottom: 6px;
  cursor: pointer;
  font-size: 12.5px;
}
.reply-quote-name { font-weight: 800; font-size: 11px; color: var(--accent); }
.reply-quote-text { color: var(--muted); margin-top: 2px; }

/* ===== Sticker message bubble ===== */
.sticker-bubble img {
  max-width: 180px; max-height: 180px;
  border-radius: 14px;
}

/* ===== Online indicator ===== */
.online-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--success);
  display: inline-block;
}
.gc-online {
  display: flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 700; color: var(--success);
}

/* ===== Global chat fixed layout: only the message list scrolls ===== */
.gc-fixed {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - var(--tabbar-h) - env(safe-area-inset-bottom, 0px) - 32px);
  min-height: 0;
}
.gc-fixed .chat-composer { position: static; }

/* ===== Global chat header ===== */
.gc-head { flex: 0 0 auto; min-height: 36px; }
.gc-head-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.gc-menu-btn {
  width: 36px; height: 36px; flex: 0 0 36px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--text);
  transition: background .15s ease, transform .15s ease;
}
.gc-menu-btn:active { transform: scale(.94); background: var(--hover-soft); }
.gc-menu-btn svg { width: 20px; height: 20px; }
.gc-title { margin: 0; font-size: 19px; line-height: 1.2; font-weight: 800; letter-spacing: -.2px; }
.gc-presence {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--muted);
  font-size: 11px; font-weight: 700;
}
.gc-presence .online-dot { background: var(--success); }

/* ===== Community drawer ===== */
body.rooms-open { overflow: hidden; }
.rooms-layer {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top, 0px)); right: 0;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 20px);
  left: 0;
  z-index: 90;
  pointer-events: none;
}
.rooms-layer.is-open { pointer-events: auto; }
.rooms-scrim {
  position: absolute; inset: 0;
  background: var(--scrim);
  opacity: 0;
  transition: opacity .24s ease;
}
.rooms-layer.is-open .rooms-scrim { opacity: 1; }
.rooms-drawer {
  position: absolute; top: 0; bottom: 0; left: 0;
  width: clamp(190px, 58vw, 280px);
  max-width: calc(100vw - 48px);
  display: flex; flex-direction: column;
  overflow: hidden;
  background: var(--card);
  border-right: 1px solid var(--border);
  border-radius: 0 18px 18px 0;
  box-shadow: 0 18px 48px -32px rgba(0, 0, 0, .55);
  transform: translateX(-100%);
  transition: transform .28s cubic-bezier(.22,.9,.3,1);
  will-change: transform;
  touch-action: pan-y;
}
.rooms-layer.is-open .rooms-drawer { transform: translateX(0); }
.rooms-drawer.is-dragging { transition: none; }
.rooms-close {
  width: 32px; height: 32px; flex: 0 0 32px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  transition: background .15s ease, transform .15s ease, color .15s ease;
}
.rooms-close:active {
  transform: scale(.94);
  background: var(--hover-soft);
  color: var(--text);
}
.rooms-close svg { width: 16px; height: 16px; }

.cm-head {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 15px 14px 4px;
}
.cm-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 21px; line-height: 1.15; font-weight: 800;
  letter-spacing: .1px;
}
.cm-body {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column; gap: 22px;
  padding: 16px 14px 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}
.cm-section {
  display: flex; flex-direction: column; gap: 8px;
}
.cm-label {
  margin: 0;
  padding: 0 2px;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 10px; line-height: 1.2; font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.cm-card {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px;
  border: 0;
  border-radius: 14px;
  background: var(--card-2);
  color: var(--text);
  font-family: inherit;
  text-align: left;
  transition: background .15s ease, transform .15s ease;
}
.cm-card:active {
  background: var(--hover-soft);
  transform: scale(.995);
}
.cm-card-main {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.cm-card-title {
  font-size: 14px; line-height: 1.25; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cm-stack {
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
}
.cm-channel {
  font-size: 14px; line-height: 1.25; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cm-meta {
  display: flex; align-items: center; gap: 10px;
  color: var(--muted);
  font-size: 11.5px; font-weight: 600;
  min-width: 0;
}
.cm-meta-online {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cm-dot {
  width: 7px; height: 7px; flex: 0 0 7px;
  border-radius: 50%;
  background: var(--success);
}
.cm-badge {
  display: inline-flex; align-items: center; justify-content: center;
  margin-left: auto;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10px; line-height: 1.15; font-weight: 800;
  white-space: nowrap;
}
.cm-badge[hidden] { display: none; }
.cm-updates .cm-badge { margin-left: auto; }
.cm-meta .cm-badge { margin-left: 0; }
.cm-card.is-active {
  background: var(--accent-soft);
}
.cm-card.is-active .cm-card-title,
.cm-card.is-active .cm-channel { color: var(--accent); }
.cm-card.is-active .cm-meta-online { color: var(--text-muted); }

/* ===== Announcements — themed read-only channel ===== */
#page.upd-shell {
  padding: 0 0 calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
}

.upd-page {
  --ch-bg: #140E17;
  --ch-text: #F8F2F5;
  --ch-muted: rgba(248, 242, 245, .62);
  --ch-surface: rgba(30, 21, 33, .78);
  --ch-surface-2: rgba(255, 255, 255, .06);
  --ch-line: rgba(255, 255, 255, .115);
  --ch-accent: #F1A4B8;
  --ch-accent-ink: #2A0F17;
  --ch-accent-soft: rgba(241, 164, 184, .14);
  --ch-shadow: 0 22px 40px -34px rgba(0, 0, 0, .8);
  min-height: 100dvh;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px
    calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 24px);
  color: var(--ch-text);
  background: transparent;
  position: relative;
  z-index: 1;
}

/* Fixed channel wallpaper. It lives outside the animated page view so fast
   scrolling can never drag the theme with the posts. */
.upd-wallpaper {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-color: #140E17;
  background-image:
    radial-gradient(120% 70% at 108% -8%, rgba(214, 51, 89, .34), transparent 62%),
    radial-gradient(90% 60% at -18% 104%, rgba(255, 140, 110, .15), transparent 62%),
    radial-gradient(rgba(255, 255, 255, .055) 1px, transparent 1.2px),
    linear-gradient(165deg, #1B121C 0%, #120D14 100%);
  background-size: auto, auto, 22px 22px, auto;
  background-position: center;
}
.upd-wallpaper[data-ch="pearl"] {
  background-color: #F5EEE2;
  background-image:
    radial-gradient(120% 70% at 110% -8%, rgba(214, 130, 150, .22), transparent 62%),
    radial-gradient(90% 60% at -18% 104%, rgba(255, 186, 132, .16), transparent 62%),
    radial-gradient(rgba(80, 58, 30, .055) 1px, transparent 1.2px),
    linear-gradient(165deg, #FBF6EC 0%, #EFE4D2 100%);
}
.upd-wallpaper[data-ch="midnight"] {
  background-color: #0A0F1E;
  background-image:
    radial-gradient(120% 70% at 108% -8%, rgba(96, 76, 214, .32), transparent 62%),
    radial-gradient(90% 60% at -18% 104%, rgba(34, 211, 238, .12), transparent 62%),
    radial-gradient(rgba(255, 255, 255, .05) 1px, transparent 1.2px),
    linear-gradient(165deg, #10162B 0%, #080C17 100%);
}
.upd-wallpaper[data-ch="mint"] {
  background-color: #E7F4EE;
  background-image:
    radial-gradient(120% 70% at 108% -8%, rgba(45, 178, 155, .22), transparent 62%),
    radial-gradient(90% 60% at -18% 104%, rgba(106, 176, 255, .14), transparent 62%),
    radial-gradient(rgba(21, 80, 68, .05) 1px, transparent 1.2px),
    linear-gradient(165deg, #F2FBF7 0%, #DCEFE6 100%);
}
.upd-wallpaper[data-ch="ember"] {
  background-color: #120D08;
  background-image:
    radial-gradient(120% 70% at 108% -8%, rgba(245, 158, 11, .26), transparent 62%),
    radial-gradient(90% 60% at -18% 104%, rgba(214, 80, 60, .13), transparent 62%),
    radial-gradient(rgba(255, 220, 170, .05) 1px, transparent 1.2px),
    linear-gradient(165deg, #1C140C 0%, #0E0905 100%);
}
.upd-wallpaper.has-image {
  background-image:
    linear-gradient(180deg,
      rgba(8, 6, 10, .62) 0%,
      rgba(8, 6, 10, .30) 28%,
      rgba(8, 6, 10, .36) 72%,
      rgba(8, 6, 10, .60) 100%),
    var(--upd-image);
  background-size: cover;
  background-position: center;
}

/* With a custom photo the channel uses Telegram-style dark scrim cards so the
   fixed image stays readable in every theme. */
.upd-page.has-wallpaper {
  --ch-text: #F8F2F5;
  --ch-muted: rgba(248, 242, 245, .68);
  --ch-surface: rgba(18, 14, 22, .72);
  --ch-surface-2: rgba(255, 255, 255, .09);
  --ch-line: rgba(255, 255, 255, .16);
  --ch-shadow: 0 22px 40px -34px rgba(0, 0, 0, .9);
}

/* Scrolling must not expose a different colour behind the fixed wallpaper. */
body.upd-open {
  background-color: #140E17;
  background-image: none;
}
body.upd-open[data-upd-ch="pearl"] { background-color: #F5EEE2; }
body.upd-open[data-upd-ch="midnight"] { background-color: #0A0F1E; }
body.upd-open[data-upd-ch="mint"] { background-color: #E7F4EE; }
body.upd-open[data-upd-ch="ember"] { background-color: #120D08; }
body.upd-open #app {
  position: relative;
  z-index: 1;
}

.upd-page[data-ch="pearl"] {
  --ch-bg: #F5EEE2;
  --ch-text: #2A231B;
  --ch-muted: #716657;
  --ch-surface: rgba(255, 252, 246, .90);
  --ch-surface-2: rgba(80, 58, 30, .06);
  --ch-line: rgba(80, 58, 30, .12);
  --ch-accent: #A92C51;
  --ch-accent-ink: #FFFFFF;
  --ch-accent-soft: rgba(169, 44, 81, .10);
  --ch-shadow: 0 18px 34px -30px rgba(90, 60, 20, .28);
}

.upd-page[data-ch="midnight"] {
  --ch-bg: #0A0F1E;
  --ch-text: #EEF2FA;
  --ch-muted: rgba(238, 242, 250, .60);
  --ch-surface: rgba(17, 24, 43, .82);
  --ch-surface-2: rgba(255, 255, 255, .055);
  --ch-line: rgba(255, 255, 255, .105);
  --ch-accent: #A99BFF;
  --ch-accent-ink: #17102E;
  --ch-accent-soft: rgba(169, 155, 255, .15);
  --ch-shadow: 0 22px 40px -34px rgba(0, 0, 0, .85);
}

.upd-page[data-ch="mint"] {
  --ch-bg: #E7F4EE;
  --ch-text: #15352E;
  --ch-muted: #4F6D63;
  --ch-surface: rgba(255, 255, 255, .88);
  --ch-surface-2: rgba(21, 80, 68, .06);
  --ch-line: rgba(21, 80, 68, .12);
  --ch-accent: #0F766E;
  --ch-accent-ink: #FFFFFF;
  --ch-accent-soft: rgba(15, 118, 110, .10);
  --ch-shadow: 0 18px 34px -30px rgba(10, 70, 60, .24);
}

.upd-page[data-ch="ember"] {
  --ch-bg: #120D08;
  --ch-text: #FAF0E0;
  --ch-muted: rgba(250, 240, 224, .60);
  --ch-surface: rgba(31, 22, 13, .82);
  --ch-surface-2: rgba(255, 255, 255, .05);
  --ch-line: rgba(255, 200, 120, .12);
  --ch-accent: #F2B45E;
  --ch-accent-ink: #2A1A00;
  --ch-accent-soft: rgba(242, 180, 94, .14);
  --ch-shadow: 0 22px 40px -34px rgba(0, 0, 0, .85);
}

.upd-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 0 16px;
}
.upd-head-left {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}
.upd-head-copy { min-width: 0; }
.upd-kicker {
  display: block;
  color: var(--ch-muted);
  font-size: 9px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: .17em;
  text-transform: uppercase;
}
.upd-head-title {
  margin: 2px 0 0;
  color: var(--ch-text);
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -.3px;
}
.upd-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.upd-action-slot { display: flex; }
.upd-icon-btn {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--ch-line);
  border-radius: 11px;
  background: var(--ch-surface-2);
  color: var(--ch-text);
  transition: transform .14s ease, background .16s ease;
}
.upd-icon-btn:active {
  transform: scale(.94);
  background: var(--ch-surface);
}
.upd-icon-btn svg { width: 18px; height: 18px; }
.upd-page .gc-menu-btn {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border: 1px solid var(--ch-line);
  border-radius: 11px;
  background: var(--ch-surface-2);
  color: var(--ch-text);
}
.upd-page .gc-menu-btn:active { background: var(--ch-surface); }
.upd-page .gc-menu-btn svg { width: 19px; height: 19px; }

.upd-stage { display: flex; flex-direction: column; }
.upd-channel {
  display: flex;
  gap: 12px;
  padding: 14px;
  margin-bottom: 14px;
  border: 1px solid var(--ch-line);
  border-radius: 20px;
  background: var(--ch-surface);
  box-shadow: var(--ch-shadow);
}
.upd-ch-avatar {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: var(--ch-accent);
  color: var(--ch-accent-ink);
}
.upd-ch-avatar svg { width: 22px; height: 22px; }
.upd-ch-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.upd-ch-name {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--ch-text);
  font-size: 15px;
  line-height: 1.25;
  font-weight: 800;
}
.upd-verified {
  display: inline-flex;
  color: var(--ch-accent);
}
.upd-verified svg { width: 14px; height: 14px; }
.upd-ch-desc {
  margin: 0;
  color: var(--ch-muted);
  font-size: 12px;
  line-height: 1.45;
}
.upd-ch-meta {
  color: var(--ch-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .01em;
}

.upd-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.upd-card {
  padding: 13px 14px 14px;
  border: 1px solid var(--ch-line);
  border-radius: 18px;
  background: var(--ch-surface);
  color: var(--ch-text);
  box-shadow: var(--ch-shadow);
  overflow: hidden;
}
.upd-card.has-media { padding-bottom: 0; }
.upd-post-head {
  display: flex;
  align-items: center;
  gap: 9px;
}
.upd-post-avatar {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--ch-accent);
  color: var(--ch-accent-ink);
}
.upd-post-avatar svg { width: 15px; height: 15px; }
.upd-post-author {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.upd-author-row {
  display: flex;
  align-items: center;
  gap: 4px;
}
.upd-author-name {
  font-size: 12.5px;
  line-height: 1.2;
  font-weight: 800;
}
.upd-author-sub {
  color: var(--ch-muted);
  font-size: 9.5px;
  font-weight: 600;
}
.upd-time {
  margin-left: auto;
  color: var(--ch-muted);
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}
.upd-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 11px;
}
.upd-kind, .upd-pin {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 9.5px;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.upd-kind {
  background: var(--ch-accent-soft);
  color: var(--ch-accent);
}
.upd-pin {
  background: var(--ch-surface-2);
  color: var(--ch-muted);
}
.upd-pin svg { width: 11px; height: 11px; }
.upd-title {
  margin: 8px 0 0;
  color: var(--ch-text);
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.32;
  font-weight: 800;
  letter-spacing: -.1px;
}
.upd-body {
  margin: 5px 0 0;
  color: var(--ch-text);
  font-size: 13px;
  line-height: 1.58;
  font-weight: 500;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  opacity: .9;
}
.upd-media {
  margin: 12px -14px 0;
  background: var(--ch-surface-2);
  overflow: hidden;
}
.upd-card.has-media .upd-media { border-radius: 0 0 18px 18px; }
.upd-media img {
  display: block;
  width: 100%;
  max-height: 520px;
  object-fit: contain;
  background: var(--ch-surface-2);
  cursor: zoom-in;
  transition: opacity .18s ease;
}
.upd-media img:active { opacity: .88; }
.upd-caption {
  padding: 10px 14px 12px;
  color: var(--ch-muted);
  font-size: 12px;
  line-height: 1.5;
}

.upd-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 38px 20px;
  text-align: center;
  border: 1px solid var(--ch-line);
  border-radius: 20px;
  background: var(--ch-surface);
  color: var(--ch-muted);
}
.upd-empty-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  margin-bottom: 2px;
  border-radius: 50%;
  background: var(--ch-accent-soft);
  color: var(--ch-accent);
}
.upd-empty-icon svg { width: 20px; height: 20px; }
.upd-empty h3 {
  margin: 0;
  color: var(--ch-text);
  font-size: 15px;
}
.upd-empty p {
  max-width: 260px;
  margin: 0;
  color: var(--ch-muted);
  font-size: 12px;
  line-height: 1.5;
}
.upd-retry {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  margin-top: 6px;
  padding: 0 12px;
  border: 1px solid var(--ch-line);
  border-radius: 10px;
  background: var(--ch-surface-2);
  color: var(--ch-text);
  font-size: 11.5px;
  font-weight: 700;
}
.upd-retry svg { width: 14px; height: 14px; }

.upd-skel {
  border: 1px solid var(--ch-line);
  background: var(--ch-surface);
  animation: updPulse 1.1s ease-in-out infinite alternate;
}
.upd-skel { height: 82px; border-radius: 20px; margin-bottom: 14px; }
.upd-skel-post { height: 132px; border-radius: 18px; margin-bottom: 12px; }
@keyframes updPulse {
  from { opacity: .55; }
  to { opacity: .9; }
}

/* Composer media + caption */
.upd-attach-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}
.upd-attach {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px dashed var(--border-strong);
  border-radius: 11px;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
}
.upd-attach:active { background: var(--hover-soft); color: var(--text); }
.upd-attach:disabled { opacity: .55; }
.upd-attach svg { width: 16px; height: 16px; }
.upd-compose-media {
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface-2);
}
.upd-compose-media img {
  display: block;
  width: 100%;
  max-height: 200px;
  object-fit: cover;
}
.upd-compose-media-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-top: 1px solid var(--border);
  background: var(--card);
}
.upd-upload-note {
  min-width: 0;
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 600;
}
.upd-remove-media {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: grid;
  place-items: center;
  margin-left: auto;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text-muted);
}
.upd-remove-media:active { background: var(--hover-soft); color: var(--danger); }
.upd-remove-media svg { width: 14px; height: 14px; }
.upd-media-fields {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.upd-compose-media[hidden],
.upd-media-fields[hidden] { display: none; }
.upd-caption-input { min-height: 86px; }
.upd-theme-sub {
  margin: 3px 0 0;
  color: var(--text-muted);
  font-size: 11.5px;
  line-height: 1.45;
}
.upd-wall-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0 2px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
}
.upd-wall-preview {
  flex: 0 0 62px;
  width: 62px;
  height: 82px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background-color: #140E17;
  background-position: center;
  background-size: cover;
}
.upd-wall-preview[data-ch="pearl"] { background-color: #F5EEE2; }
.upd-wall-preview[data-ch="midnight"] { background-color: #0A0F1E; }
.upd-wall-preview[data-ch="mint"] { background-color: #E7F4EE; }
.upd-wall-preview[data-ch="ember"] { background-color: #120D08; }
.upd-wall-preview.has-image { background-image: var(--upd-image); }
.upd-wall-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.upd-wall-title { font-size: 13px; font-weight: 700; }
.upd-wall-hint {
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.4;
}
.upd-wall-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 5px;
}
.upd-wall-action {
  min-height: 36px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card-2);
  color: var(--text);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
}
.upd-wall-action svg { width: 14px; height: 14px; }
.upd-wall-action:disabled { opacity: .6; }
.upd-wall-action.is-danger { color: #ff7d9a; }
.upd-theme-divider {
  height: 1px;
  margin: 14px 0 11px;
  background: var(--border);
}
.upd-theme-section {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 800;
}

/* Channel theme picker */
.upd-theme-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 4px;
}
.upd-theme-opt {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  color: var(--text);
  text-align: left;
}
.upd-theme-opt:active { background: var(--hover-soft); }
.upd-theme-opt.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.upd-swatch {
  display: block;
  height: 50px;
  border-radius: 9px;
  border: 1px solid rgba(0, 0, 0, .08);
}
.upd-swatch[data-ch="sakura"] {
  background:
    radial-gradient(120% 100% at 100% 0%, rgba(214, 51, 89, .85), transparent 60%),
    radial-gradient(90% 90% at 0% 100%, rgba(255, 140, 110, .28), transparent 62%),
    linear-gradient(160deg, #241626, #120D14);
}
.upd-swatch[data-ch="pearl"] {
  background:
    radial-gradient(120% 100% at 100% 0%, rgba(214, 130, 150, .42), transparent 60%),
    radial-gradient(90% 90% at 0% 100%, rgba(255, 186, 132, .32), transparent 62%),
    linear-gradient(160deg, #FBF6EC, #EFE4D2);
}
.upd-swatch[data-ch="midnight"] {
  background:
    radial-gradient(120% 100% at 100% 0%, rgba(96, 76, 214, .8), transparent 60%),
    radial-gradient(90% 90% at 0% 100%, rgba(34, 211, 238, .26), transparent 62%),
    linear-gradient(160deg, #10162B, #080C17);
}
.upd-swatch[data-ch="mint"] {
  background:
    radial-gradient(120% 100% at 100% 0%, rgba(45, 178, 155, .48), transparent 60%),
    radial-gradient(90% 90% at 0% 100%, rgba(106, 176, 255, .3), transparent 62%),
    linear-gradient(160deg, #F2FBF7, #DCEFE6);
}
.upd-swatch[data-ch="ember"] {
  background:
    radial-gradient(120% 100% at 100% 0%, rgba(245, 158, 11, .62), transparent 60%),
    radial-gradient(90% 90% at 0% 100%, rgba(214, 80, 60, .28), transparent 62%),
    linear-gradient(160deg, #1C140C, #0E0905);
}
.upd-theme-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.upd-theme-name {
  font-size: 12px;
  line-height: 1.25;
  font-weight: 800;
}
.upd-theme-hint {
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.3;
}
.upd-theme-check {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 18px;
  height: 18px;
  display: none;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
}
.upd-theme-opt.active .upd-theme-check { display: grid; }
.upd-theme-check svg { width: 11px; height: 11px; }

/* Image lightbox */
.upd-lightbox {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.upd-lightbox img {
  display: block;
  width: 100%;
  max-height: 62dvh;
  object-fit: contain;
  border-radius: 14px;
  background: var(--surface-2);
}
.upd-lightbox-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 2px 4px;
}
.upd-lightbox-kicker {
  color: var(--accent);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .12em;
}
.upd-lightbox-title {
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
}
.upd-lightbox-caption {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}

/* Legacy composer helper kept for the announcement form */
.upd-textarea {
  height: auto;
  min-height: 118px;
  padding: 10px 12px;
  resize: vertical;
  line-height: 1.45;
}
select.rm-field-input { appearance: none; -webkit-appearance: none; }

@media (max-width: 360px) {
  .upd-head { gap: 8px; }
  .upd-head-left { gap: 8px; }
  .upd-head-title { font-size: 18px; }
  .upd-head-actions { gap: 6px; }
  .upd-page .gc-menu-btn,
  .upd-icon-btn {
    width: 34px; height: 34px; flex: 0 0 34px;
    border-radius: 10px;
  }
  .upd-page { padding-left: 13px; padding-right: 13px; }
}

/* ===== Create room + invite sheets ===== */
.sheet.rm-modal-sheet { padding-top: 14px; }
.rm-modal { display: flex; flex-direction: column; gap: 11px; }
.rm-modal-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px;
}
.rm-modal-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 19px; line-height: 1.15; font-weight: 800;
  letter-spacing: .15px;
}
.rm-modal-sub { margin: 3px 0 0; color: var(--muted); font-size: 11.5px; }
.rm-modal-close {
  width: 32px; height: 32px; flex: 0 0 32px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
}
.rm-modal-close:active { background: var(--hover-soft); color: var(--text); }
.rm-modal-close svg { width: 15px; height: 15px; }
.rm-field-label {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11.5px; font-weight: 700;
}
.rm-field { display: flex; }
.rm-field-input {
  width: 100%; height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--input-bg);
  color: var(--text);
  font-family: inherit;
  font-size: 14px; font-weight: 600;
}
.rm-field-input::placeholder { color: var(--muted); font-weight: 500; }
.rm-field-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.rm-private-hint {
  margin: -4px 1px 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}
.rm-code-input {
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 17px;
  font-weight: 800;
}
.rm-invite-picker { display: flex; flex-direction: column; gap: 8px; }
.rm-invite-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rm-invite-chips[hidden], .rm-modal-error[hidden] { display: none; }
.rm-chip {
  max-width: 100%;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 6px 5px 10px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11.5px; font-weight: 700;
}
.rm-chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rm-chip-x {
  width: 18px; height: 18px; padding: 0;
  display: grid; place-items: center;
  border: 0; background: transparent;
  color: inherit;
}
.rm-chip-x svg { width: 12px; height: 12px; }
.rm-invite-search {
  display: flex; align-items: center; gap: 8px;
  height: 42px; padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--input-bg);
  color: var(--muted);
}
.rm-invite-search svg { width: 15px; height: 15px; flex: 0 0 15px; }
.rm-invite-search input {
  flex: 1; min-width: 0;
  border: 0; background: transparent;
  color: var(--text);
  font-family: inherit; font-size: 13px;
  outline: none;
}
.rm-invite-results {
  display: flex; flex-direction: column;
  max-height: 170px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.rm-invite-results:empty { display: none; }
.rm-invite-result {
  width: 100%;
  display: flex; align-items: center; gap: 9px;
  padding: 7px 4px;
  border: 0; border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-family: inherit;
  text-align: left;
}
.rm-invite-result:last-child { border-bottom: 0; }
.rm-invite-result:active { background: var(--hover-soft); }
.rm-invite-result-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rm-invite-result-name {
  font-size: 12.5px; font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rm-invite-result-id { color: var(--muted); font-size: 10px; font-weight: 600; }
.rm-invite-note { padding: 8px 4px; color: var(--muted); font-size: 11.5px; }
.rm-modal-error { color: var(--danger); font-size: 12px; line-height: 1.4; }
.rm-modal-primary {
  width: 100%; height: 46px;
  margin-top: 4px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--accent);
  border-radius: 11px;
  background: var(--accent);
  color: var(--on-accent);
  font-family: inherit;
  font-size: 14px; font-weight: 700;
}
.rm-modal-primary:active { background: var(--accent-hover); border-color: var(--accent-hover); }
.rm-modal-primary:disabled { opacity: .65; }
.rm-modal-primary svg { width: 17px; height: 17px; }
.rm-modal-primary.is-busy svg { opacity: .5; }

@media (max-width: 350px) {
  .cm-head { padding: 14px 12px 4px; }
  .cm-body { padding: 14px 12px 18px; gap: 20px; }
  .cm-title { font-size: 20px; }
  .gc-title { font-size: 17px; }
  .gc-head-left { gap: 8px; }
  .rm-modal-title { font-size: 18px; }
  .rm-modal-primary { height: 44px; font-size: 13.5px; }
}

@media (hover: none) {
  .gmsg-swipe { touch-action: pan-y; }
}

/* ============================================================
   PROFILE — native-feeling edit studio
   ============================================================ */
.sheet.pf-edit-sheet-wrap {
  height: min(92dvh, 780px);
  max-height: 92dvh;
  padding-top: 10px;
  padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--card);
}
.pf-edit-sheet-wrap .sheet-grip { margin-top: -2px; margin-bottom: 2px; }
.pf-edit-sheet {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.pf-edit-head {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 1px 0 14px;
  border-bottom: 1px solid var(--border);
}
.pf-edit-title {
  margin: 0;
  font-size: 22px; line-height: 1.15; letter-spacing: -.2px;
}
.pf-edit-close {
  flex: 0 0 auto;
  width: 34px; height: 34px; padding: 0;
  display: grid; place-items: center;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  transition: transform .15s ease, color .15s ease, background .15s ease;
}
.pf-edit-close svg { width: 16px; height: 16px; }
.pf-edit-close:active { transform: scale(.94); color: var(--text); background: var(--hover-soft); }

.pf-edit-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 18px 0 20px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.pf-edit-photos { display: flex; flex-direction: column; gap: 18px; }

.pf-photo-row { display: flex; align-items: center; gap: 15px; }
.pf-photo-preview {
  flex: 0 0 auto;
  overflow: hidden;
  display: grid; place-items: center;
  background: var(--card-2);
  border: 1px solid var(--border);
}
.pf-photo-preview.is-avatar { width: 76px; height: 76px; border-radius: 50%; }
.pf-photo-preview.is-banner { width: 100%; height: 112px; border-radius: 14px; }
.pf-photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.pf-photo-preview.is-avatar img { border-radius: 50%; }
.pf-photo-ph { color: var(--muted); display: inline-flex; }
.pf-photo-ph svg { width: 22px; height: 22px; }

.pf-photo-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.pf-photo-label {
  display: block;
  color: var(--muted);
  font-size: 11.5px; font-weight: 700; letter-spacing: .1px;
}
.pf-photo-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 8px;
}
.pf-photo-block { display: flex; flex-direction: column; }
.pf-photo-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pf-photo-block .pf-photo-actions { margin-top: 10px; }
.pf-photo-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--accent-soft);
  color: var(--accent);
  font-family: inherit;
  font-size: 12.5px; font-weight: 700;
  transition: transform .15s ease, background .15s ease;
}
.pf-photo-btn svg { width: 15px; height: 15px; }
.pf-photo-btn:active { transform: scale(.97); }
.pf-photo-btn:disabled { opacity: .55; }
.pf-photo-btn.is-busy svg { opacity: .5; }
.pf-photo-remove {
  height: 36px; padding: 0 10px;
  border: 0; background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 12px; font-weight: 600;
  transition: color .15s ease;
}
.pf-photo-remove:active { color: var(--danger); }
.pf-photo-remove[hidden] { display: none; }
.pf-photo-remove:disabled { opacity: .5; }

.pf-edit-fields { display: flex; flex-direction: column; gap: 17px; }
.pf-field { display: flex; flex-direction: column; gap: 8px; }
.pf-field + .pf-field { margin-top: 0; }
.pf-field-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
}
.pf-field-label {
  color: var(--text);
  font-size: 12.5px; font-weight: 700; letter-spacing: .1px;
}
.pf-field-count {
  color: var(--muted);
  font-size: 11px; font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: color .15s ease;
}
.pf-field-count.warn { color: var(--danger); }
.pf-input-shell {
  position: relative;
  display: flex; align-items: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--input-bg);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.pf-input-shell:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.pf-input-ic {
  position: absolute; left: 14px; top: 50%;
  width: 17px; height: 17px;
  display: inline-flex;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.pf-input-ic svg { width: 17px; height: 17px; }
.pf-input-shell.area { align-items: flex-start; }
.pf-input-shell.area .pf-input-ic { top: 15px; transform: none; }
.pf-input-shell input,
.pf-input-shell textarea {
  width: 100%;
  border: 0;
  border-radius: 12px;
  background: transparent;
  box-shadow: none;
  padding: 13px 14px 13px 42px;
  color: var(--text);
  font-size: 15px; line-height: 1.45;
}
.pf-input-shell input { font-weight: 600; }
.pf-input-shell textarea {
  min-height: 112px;
  resize: none;
  font-weight: 500;
}
.pf-input-shell input:focus,
.pf-input-shell textarea:focus { border: 0; box-shadow: none; outline: none; }

.pf-edit-actions {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  background: var(--card);
}
.pf-edit-actions .btn {
  width: 100%; height: 48px;
  padding: 0 16px;
  border-radius: 12px;
  font-size: 14px; font-weight: 700;
  box-shadow: none;
}
.pf-btn-cancel {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text);
}
.pf-btn-cancel:active { background: var(--hover-soft); }
.pf-btn-save {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: var(--on-accent);
}
.pf-btn-save:active {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.pf-btn-save svg { width: 17px; height: 17px; }
.pf-btn-save.is-busy svg { opacity: .5; }

/* ============================================================
   PROFILE — card polish + cheaper paint
   ============================================================ */
.pf-cover { contain: paint; }
.pf-show-art { contain: paint; }
.pf-showcase-host:empty { display: none; }
.pf-show-skel {
  display: flex; gap: 10px;
  overflow: hidden;
  margin-top: 24px;
  padding: 2px 2px 4px;
}
.pf-show-skel .skeleton {
  flex: 0 0 106px; width: 106px; height: 140px;
  border-radius: 15px;
}

.pf-social {
  margin-top: 13px;
  padding: 4px;
  gap: 3px;
  border: 1px solid var(--stroke);
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow-soft);
}
.pf-social-stat {
  padding: 9px 2px 10px;
  border-radius: 14px;
}
button.pf-social-stat { transition: background .15s ease, transform .15s ease; }
button.pf-social-stat:active { transform: scale(.97); }
.pf-social-stat b { font-size: 18px; }

.pf-links {
  margin-top: 16px;
  border: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pf-link {
  height: 54px;
  padding: 0 13px;
  border: 1px solid var(--stroke);
  border-radius: 16px;
  background: var(--card);
  transition: transform .14s ease, border-color .15s ease, background .15s ease;
}
.pf-link:last-child { border-bottom: 1px solid var(--stroke); }
.pf-link:active {
  transform: scale(.99);
  border-color: rgba(var(--accent-rgb), .3);
  background: var(--hover-soft);
}
.pf-link-ic {
  flex: 0 0 32px; width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent);
}
.pf-link-ic svg { width: 16px; height: 16px; }
.pf-link-chev { opacity: .4; }

/* ============================================================
   RELATIONSHIP SHEET — peek / full / drag dismiss
   ============================================================ */
.ul-sheet-wrap {
  padding-top: 8px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
}
.ul-sheet-wrap .sheet-grip { margin-top: -2px; margin-bottom: 0; }
.ul-sheet {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.ul-sheet-head {
  flex: 0 0 auto;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 7px 2px 12px;
  border-bottom: 1px solid var(--stroke);
}
.ul-sheet-head-copy { min-width: 0; }
.ul-sheet-title {
  margin-top: 0;
  font-family: var(--font-display);
  font-size: 23px; line-height: 1.1; font-weight: 800;
  letter-spacing: -.2px;
}
.ul-sheet-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px; line-height: 1.4;
}
.ul-close {
  flex: 0 0 auto;
  width: 34px; height: 34px; padding: 0;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--card-2);
  border: 1px solid var(--stroke);
  color: var(--muted);
  transition: transform .15s ease, color .15s ease, background .15s ease;
}
.ul-close svg { width: 16px; height: 16px; }
.ul-close:active { transform: scale(.9); color: var(--text); background: var(--hover-soft); }
.ul-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  margin: 0 -4px;
  padding: 4px 4px 12px;
}
.ul-list .empty-state { padding: 34px 12px 26px; }
.ul-row {
  gap: 11px;
  padding: 9px 7px;
  border-bottom: 1px solid var(--stroke);
  border-radius: 14px;
  transition: background .14s ease, transform .14s ease;
  contain: paint;
}
.ul-row:last-child { border-bottom: 0; }
.ul-row:active { background: var(--hover-soft); transform: scale(.992); }
.ul-av {
  flex: 0 0 46px; width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--gradient);
  box-shadow: 0 0 0 2px var(--card), 0 0 0 3px rgba(var(--accent-rgb), .18);
}
.ul-av img { border-radius: 50%; }
.ul-initial { font-size: 16px; }
.ul-body b { font-size: 13px; letter-spacing: .05px; }
.ul-body small { margin-top: 1px; font-size: 9.5px; }
.ul-bio { margin-top: 3px; font-size: 10px; }
.ul-side small {
  padding: 3px 6px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 8.5px;
  line-height: 1;
}
.ul-chev { opacity: .38; }
.ul-skeleton {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 7px;
  border-bottom: 1px solid var(--stroke);
}
.ul-skeleton .skel-av {
  flex: 0 0 46px; width: 46px; height: 46px;
  border-radius: 50%;
}
.ul-skeleton .skel-lines { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.ul-skeleton .skel-line { height: 9px; border-radius: 999px; }
.ul-skeleton .skel-line.short { width: 44%; }

@media (max-width: 350px) {
  .sheet.pf-edit-sheet-wrap { padding-left: 16px; padding-right: 16px; }
  .pf-edit-sheet-wrap .sheet-grip { margin-left: -16px; margin-right: -16px; }
  .pf-edit-title { font-size: 21px; }
  .pf-photo-preview.is-avatar { width: 68px; height: 68px; }
  .pf-photo-preview.is-banner { height: 98px; }
  .pf-photo-btn { height: 34px; padding: 0 12px; font-size: 12px; }
  .pf-photo-remove { height: 34px; font-size: 11.5px; }
  .pf-edit-actions .btn { height: 46px; font-size: 13px; }
  .pf-input-shell textarea { min-height: 104px; }
  .pf-social-stat b { font-size: 17px; }
  .ul-sheet-title { font-size: 21px; }
  .ul-list { margin-left: -2px; margin-right: -2px; padding-left: 2px; padding-right: 2px; }
}

/* Profile pages scroll a lot of imagery — keep the dock opaque and cheap. */
body.no-topbar .tabbar {
  background: var(--card);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

/* ============================================================
   TOPBAR — player search action + narrow-phone spacing
   ============================================================ */
.top-search-btn { width: 38px; height: 38px; border-radius: 13px; }
.top-search-btn svg { width: 18px; height: 18px; }

@media (max-width: 420px) {
  .brand small { display: none; }
}

@media (max-width: 380px) {
  .topbar { padding-left: 10px; padding-right: 10px; gap: 8px; }
  .brand { min-width: 0; gap: 7px; font-size: 15.5px; }
  .brand-copy { min-width: 0; }
  .brand-copy span {
    display: block; max-width: 118px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .brand small { display: none; }
  .top-actions { gap: 6px; }
  .coin-pill { gap: 5px; padding: 5px 9px 5px 7px; font-size: 12.5px; }
  .coin-pill .coin-ic { width: 16px; height: 16px; }
  .topbar .icon-btn,
  .topbar .top-search-btn { width: 35px; height: 35px; border-radius: 11px; }
  .topbar .icon-btn svg,
  .topbar .top-search-btn svg { width: 17px; height: 17px; }
}

@media (max-width: 340px) {
  .topbar { padding-left: 8px; padding-right: 8px; }
  .brand { font-size: 14.2px; letter-spacing: 0; gap: 6px; }
  .brand-copy span { max-width: 104px; }
  .top-actions { gap: 5px; }
  .coin-pill { padding-right: 8px; font-size: 12px; }
}

/* ============================================================
   PLAYER SEARCH — polished player directory sheet
   ============================================================ */
.sheet.us-sheet-wrap {
  height: min(78dvh, 700px);
  max-height: calc(100dvh - 28px);
  padding-top: 8px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.us-sheet-wrap .sheet-grip { margin-top: -2px; margin-bottom: 0; }
.us-sheet {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.us-head {
  flex: 0 0 auto;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 8px 2px 14px;
}
.us-head-copy { min-width: 0; }
.us-title {
  font-family: var(--font-display);
  font-size: 23px; line-height: 1.1; font-weight: 800;
  letter-spacing: -.2px;
}
.us-subtitle {
  margin-top: 4px;
  font-size: 11px; line-height: 1.4; color: var(--muted);
}
.us-search { flex: 0 0 auto; margin: 0 0 12px; }
.us-search input {
  height: 47px;
  padding: 0 42px 0 42px;
  border-radius: 15px;
  background: var(--card-2);
  border: 1px solid var(--stroke-strong);
  font-size: 15px; font-weight: 600;
}
.us-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.us-search input:focus-visible { outline: none; }
.us-search svg {
  left: 14px; width: 18px; height: 18px;
  transition: color .16s ease;
}
.us-search:focus-within svg { color: var(--accent); }
.us-search input::-webkit-search-cancel-button,
.us-search input::-webkit-search-decoration { -webkit-appearance: none; display: none; }
.us-clear {
  position: absolute; right: 9px; top: 50%; z-index: 2;
  transform: translateY(-50%);
  width: 28px; height: 28px; padding: 0;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--stroke);
  color: var(--muted);
}
.us-clear[hidden] { display: none; }
.us-search .us-clear svg {
  position: static;
  width: 12px; height: 12px;
  transform: none;
  color: currentColor;
  pointer-events: none;
}
.us-search:focus-within .us-clear svg { color: currentColor; }
.us-clear:active { transform: translateY(-50%) scale(.9); color: var(--text); }

.us-results {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  margin: 0 -4px;
  padding: 2px 4px 10px;
}
.us-row {
  width: 100%;
  display: flex; align-items: center; gap: 12px;
  padding: 11px 8px;
  border: 0; border-bottom: 1px solid var(--stroke);
  border-radius: 15px;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  text-align: left;
  transition: background .14s ease, transform .14s ease;
  contain: paint;
}
.us-row:last-child { border-bottom: 0; }
.us-row:active { background: var(--hover-soft); transform: scale(.994); }
.us-av {
  flex: 0 0 48px; width: 48px; height: 48px;
  border-radius: 50%;
  overflow: hidden;
  display: grid; place-items: center;
  background: var(--gradient);
  color: var(--on-accent);
  font-family: var(--font-display);
  font-size: 17px; font-weight: 800;
}
.us-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.us-av-bot,
.us-av-empty {
  background: linear-gradient(150deg, var(--card-2), var(--surface-deep));
  color: var(--muted);
}
.us-body { flex: 1; min-width: 0; display: block; }
.us-body b {
  display: block;
  font-size: 13.5px; font-weight: 800;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.us-body small {
  display: block; margin-top: 2px;
  font-size: 10.5px; font-weight: 600; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.us-sub {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-top: 4px;
  font-size: 10.5px; font-weight: 700; color: var(--muted);
}
.us-chev {
  flex: 0 0 28px; width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--card-2);
  color: var(--muted);
  opacity: .7;
}
.us-chev svg { width: 14px; height: 14px; }
.us-empty {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 42px 20px 34px;
  color: var(--muted);
}
.us-empty-ic {
  width: 64px; height: 64px;
  margin-bottom: 14px;
  border-radius: 22px;
  display: grid; place-items: center;
  background: var(--card-2);
  border: 1px solid var(--stroke);
  color: var(--accent);
}
.us-empty-ic svg { width: 27px; height: 27px; }
.us-empty h3 { color: var(--text); font-size: 16px; margin-bottom: 6px; }
.us-empty p { max-width: 285px; font-size: 12.5px; line-height: 1.55; }
.us-skel {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 8px;
  border-bottom: 1px solid var(--stroke);
}
.us-skel-av { flex: 0 0 48px; width: 48px; height: 48px; border-radius: 50%; }
.us-skel-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.us-skel-line { height: 10px; border-radius: 999px; }
.us-skel-line.short { width: 44%; }

@media (max-width: 350px) {
  .us-title { font-size: 21px; }
  .us-head { padding-top: 4px; padding-bottom: 12px; }
  .us-row { gap: 10px; padding: 10px 6px; }
  .us-av { flex-basis: 44px; width: 44px; height: 44px; font-size: 16px; }
  .us-body b { font-size: 13px; }
  .us-skel { gap: 10px; padding: 10px 6px; }
  .us-skel-av { flex-basis: 44px; width: 44px; height: 44px; }
}

/* ============================================================
   PUBLIC PROFILE — bot players + public collection
   ============================================================ */
.pf-av-wrap .avatar.up-avatar-blank {
  background: linear-gradient(145deg, var(--card-2), var(--surface-deep));
  color: transparent;
}
.up-cover-blank .pf-cover-scrim {
  background: linear-gradient(180deg, rgba(0,0,0,.36), transparent 46%);
}
.up-collection-host { margin-top: 24px; }
.up-col-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
  margin-bottom: 12px; padding: 0 2px;
}
.up-col-head h2 {
  font-family: var(--font-display);
  font-size: 19px; line-height: 1.1; font-weight: 800;
  letter-spacing: -.1px;
}
.up-col-sub {
  margin-top: 4px;
  font-size: 10px; font-weight: 700; letter-spacing: .4px;
  text-transform: uppercase; color: var(--muted);
}
.up-col-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.up-col-card { border-radius: 16px; }
.up-col-card .char-info { padding: 9px 10px 11px; }
.up-col-card .char-name { font-size: 12.5px; }
.up-col-card .char-sub { font-size: 9.5px; gap: 4px; margin-top: 4px; }
.up-col-card .char-anime { max-width: 58%; }
.up-col-card .count-chip { top: 7px; right: 7px; padding: 2px 7px; font-size: 9.5px; }
.up-col-body .skel-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.up-col-body .skel-card {
  overflow: hidden;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--stroke);
}
.up-col-foot { display: flex; justify-content: center; margin-top: 14px; }
.up-col-more {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--stroke-strong);
  color: var(--text);
  font-size: 12px; font-weight: 800;
  box-shadow: var(--shadow-soft);
  transition: transform .14s ease, border-color .15s ease, opacity .15s ease;
}
.up-col-more[hidden] { display: none; }
.up-col-more svg { width: 14px; height: 14px; transform: rotate(90deg); }
.up-col-more:active { transform: scale(.97); border-color: rgba(var(--accent-rgb), .35); }
.up-col-more:disabled { opacity: .55; }
.up-col-empty,
.up-col-error {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 26px 18px;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--stroke);
  color: var(--muted);
}
.up-col-empty-ic,
.up-col-error-ic {
  width: 46px; height: 46px;
  margin-bottom: 10px;
  border-radius: 16px;
  display: grid; place-items: center;
  background: var(--card-2);
  color: var(--muted);
}
.up-col-empty-ic svg,
.up-col-error-ic svg { width: 21px; height: 21px; }
.up-col-empty p,
.up-col-error p { font-size: 12.5px; line-height: 1.5; }
.up-col-error .btn { margin-top: 12px; }

/* ===== PUBLIC COLLECTION — in-profile character sheet ===== */
.sheet.up-char-sheet-wrap {
  height: min(90dvh, 780px);
  max-height: calc(100dvh - 22px);
  padding-top: 8px;
  padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.up-char-sheet {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0 1px 2px;
}
.up-char-top {
  flex: 0 0 auto;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 2px 1px 12px;
}
.up-char-owner { min-width: 0; }
.up-char-kicker {
  display: block;
  font-size: 8.5px; font-weight: 800; letter-spacing: 1.6px;
  text-transform: uppercase; color: var(--muted);
}
.up-char-owner-name {
  margin-top: 3px;
  font-size: 11.5px; font-weight: 700; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.up-char-visual {
  flex: 0 0 auto;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--stroke);
  background: var(--card-2);
}
.up-char-visual .up-char-art {
  width: 100%;
  aspect-ratio: 3 / 3.5;
}
.up-char-body { padding: 14px 2px 0; }
.up-char-name {
  font-family: var(--font-display);
  font-size: 22px; line-height: 1.1; font-weight: 800;
  letter-spacing: -.15px;
  overflow-wrap: anywhere;
}
.up-char-anime {
  margin-top: 5px;
  font-size: 12.5px; line-height: 1.4; font-weight: 600;
  color: var(--muted);
}
.up-char-badges {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin-top: 10px;
}
.up-char-id {
  margin-left: auto;
  font-size: 10px; font-weight: 800; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.up-char-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}
.up-char-stat {
  min-width: 0;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--card-2);
  border: 1px solid var(--stroke);
}
.up-char-stat b {
  display: block;
  font-family: var(--font-display);
  font-size: 18px; line-height: 1.05; font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.up-char-stat span {
  display: block; margin-top: 3px;
  font-size: 8px; font-weight: 800; letter-spacing: .7px;
  text-transform: uppercase; color: var(--muted);
}
.up-char-note {
  margin-top: 13px;
  font-size: 10.5px; line-height: 1.4; font-weight: 600;
  text-align: center; color: var(--muted);
}

/* ============================================================
   GLOBAL CHAT — avatar opens the player profile
   ============================================================ */
.gavatar-btn {
  flex: 0 0 34px; width: 34px; height: 34px;
  padding: 0;
  border-radius: 50%;
  overflow: hidden;
  display: block;
  background: var(--card-2);
  transition: transform .14s ease, opacity .14s ease;
}
.gavatar-btn .gavatar { width: 100%; height: 100%; }
.gavatar-btn:active { transform: scale(.9); opacity: .85; }
.gavatar-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 350px) {
  .up-col-head h2 { font-size: 18px; }
  .up-col-grid,
  .up-col-body .skel-grid { gap: 8px; }
  .up-col-card .char-name { font-size: 12px; }
  .up-col-card .char-info { padding: 8px 9px 10px; }
  .up-col-card .char-sub { font-size: 9px; }
  .up-char-name { font-size: 20px; }
  .up-char-stat b { font-size: 16px; }
}

/* ===== Server badges in lists ===== */
.p-name {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  max-width: 100%;
}
.p-name-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lb-name {
  display: flex;
  align-items: center;
  min-width: 0;
}
.lb-name-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.us-body b,
.ul-body b {
  display: flex;
  align-items: center;
  min-width: 0;
}
.us-name-text,
.ul-name-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
