/* ============================================================
   Growvia — layar Chat (screens/chat.js): channel, guild, DM,
   kartu pamer di tiap pesan (avatar + border, title, badge, level),
   kartu profil, dan editor kartu.
   Border = .av-frame.f-<id> (registry di discord-activity/chat-profile.js).
   ============================================================ */

.ch-view { max-width: 1180px; height: calc(100dvh - var(--top-h) - 24px); min-height: 440px; }
.ch {
  display: grid; grid-template-columns: 272px minmax(0, 1fr); height: 100%; min-height: 0;
  border: 2px solid var(--line); background: var(--panel); box-shadow: var(--shadow);
}
.main .ch img.pix, .main .pc img.pix, .main .ce-preview img.pix { max-width: none; max-height: none; }

/* ─────────── daftar room ─────────── */
.ch-rooms { display: flex; flex-direction: column; min-height: 0; border-right: 2px solid var(--line); background: var(--bg2); }
.ch-rooms-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 12px 8px; }
.ch-rooms-h h2 { margin: 0; font-family: var(--font-pixel); font-size: 12px; color: var(--head); }
.ch-new { padding: 0 10px 10px; border-bottom: 2px solid var(--line); }
.ch-new input { width: 100%; padding: 7px 9px; background: var(--panel); border: 2px solid var(--line); color: var(--text); font-size: 12px; }
.ch-new input:focus { outline: none; border-color: var(--accent); }
.ch-results { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.ch-result { display: flex; align-items: center; gap: 8px; padding: 6px 8px; background: var(--panel); border: 1px solid var(--line); color: var(--text); text-align: left; font-size: 12px; }
.ch-result:hover { border-color: var(--accent); }
.ch-result span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-result em { font-style: normal; font-size: 10px; color: var(--muted); }
.ch-rooms-list { flex: 1; overflow-y: auto; padding: 8px 6px 12px; }
.ch-group + .ch-group { margin-top: 12px; }
.ch-group-h { display: block; padding: 4px 8px 6px; font-family: var(--font-pixel); font-size: 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.ch-hint { margin: 0 8px; font-size: 11px; color: var(--muted); line-height: 1.4; }
.ch-room {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 6px 8px; margin-bottom: 1px;
  background: transparent; border: 2px solid transparent; color: var(--text); text-align: left;
  transition: background .12s ease;
}
.ch-room:hover { background: var(--panel); }
.ch-room.on { background: var(--panel2); border-color: var(--line2); box-shadow: inset 3px 0 0 var(--accent); }
.ch-room.unread .ch-room-t strong { color: #fff; }
.ch-room-ic { position: relative; flex: none; width: 30px; height: 30px; display: grid; place-items: center; }
.ch-room.k-guild .ch-room-ic { border: 2px solid var(--line); border-radius: 50%; background: var(--panel); }
.ch-room-ic b { position: absolute; left: -2px; top: -6px; font-family: var(--font-pixel); font-size: 9px; color: var(--muted); }
.main .ch-room-ic img { width: 18px; height: 18px; }
.ch-room.on .ch-room-ic { border-color: var(--accent); }
.ch-room-ic.lg { width: 36px; height: 36px; }
.main .ch-room-ic.lg img { width: 22px; height: 22px; }
.ch-room-t { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 1px; }
.ch-room-t strong { font-size: 13px; color: var(--head); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-room-t span { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-badge { flex: none; min-width: 20px; padding: 1px 6px; border-radius: 10px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; text-align: center; }

/* ─────────── kepala & percakapan ─────────── */
.ch-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.ch-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 2px solid var(--line); background: var(--panel2); }
.ch-head strong { display: block; font-size: 14px; color: var(--head); }
.ch-head span { font-size: 11px; color: var(--muted); }
.ch-back { display: none; width: 32px; height: 32px; background: transparent; border: 2px solid var(--line); color: var(--text); font-size: 18px; }
.ch-thread { flex: 1; overflow-y: auto; padding: 8px 0 12px; display: flex; flex-direction: column; }
.ch-thread .empty { margin: auto; }
.ch-day { display: flex; align-items: center; gap: 10px; margin: 14px 16px 6px; font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.ch-day::before, .ch-day::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.ch-msg { position: relative; display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 10px; padding: 6px 16px 2px; }
.ch-msg.cont { padding-top: 1px; }
.ch-msg:hover { background: rgba(255, 255, 255, .025); }
.ch-msg.mine { background: linear-gradient(90deg, rgba(138, 201, 38, .07), transparent 60%); }
.ch-msg.mine:hover { background: linear-gradient(90deg, rgba(138, 201, 38, .1), rgba(255, 255, 255, .02) 60%); }
.ch-av { padding: 0; background: none; border: 0; cursor: pointer; align-self: start; justify-self: center; }
.ch-gutter { align-self: center; justify-self: end; font-size: 9px; color: transparent; padding-right: 4px; }
.ch-msg.cont:hover .ch-gutter { color: var(--muted); }
.ch-body { min-width: 0; }
.ch-msg-h { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 2px; }
.ch-name { padding: 0; background: none; border: 0; color: var(--head); font-size: 13px; font-weight: 700; cursor: pointer; }
.ch-name:hover { text-decoration: underline; }
.ch-msg-h time { font-size: 10px; color: var(--muted); }
.ch-text { margin: 0; font-size: 13px; line-height: 1.5; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }

/* title, level, badge */
.ch-title {
  padding: 1px 6px; font-size: 10px; font-weight: 700; letter-spacing: .3px;
  color: #ffe9b0; background: linear-gradient(90deg, #5a3f0c, #3a2a0c); border: 1px solid #7a5a1e;
}
.lv-pill {
  display: inline-flex; align-items: center; gap: 3px; padding: 1px 6px;
  font-family: var(--font-pixel); font-size: 8px; color: var(--head); background: var(--bg2); border: 1px solid var(--line2);
}
.lv-pill i { font-style: normal; color: var(--gold); }
.lv-pill.asc { border-color: #8350b5; background: #24163a; color: #e6d3ff; }
.ch-badges { display: inline-flex; gap: 2px; }
.ch-bdg { display: inline-grid; place-items: center; width: 18px; height: 18px; font-size: 13px; line-height: 1; }
.main .ch-bdg img, .ch-bdg img { width: 16px; height: 16px; }

/* ─────────── composer ─────────── */
.ch-compose { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-top: 2px solid var(--line); background: var(--bg2); }
.ch-compose > .ch-row { display: flex; gap: 8px; align-items: flex-end; }
.ch-compose > .ch-row > .btn { flex: none; min-height: 38px; }
.ch-me { flex: none; padding: 0; background: none; border: 0; cursor: pointer; align-self: center; }
.ch-ta { position: relative; flex: 1; display: flex; min-width: 0; }
.ch-compose .ch-input {
  flex: 1; min-width: 0; min-height: 38px; max-height: 120px; overflow-y: auto; padding: 9px 10px;
  background: var(--panel); border: 2px solid var(--line); color: var(--text); font: inherit; font-size: 13px; line-height: 1.35;
  white-space: pre-wrap; overflow-wrap: anywhere; cursor: text;
}
.ch-compose .ch-input:focus { outline: none; border-color: var(--accent); }
.ch-compose .ch-input.is-empty::before { content: attr(data-ph); color: var(--muted); pointer-events: none; }
.ch-input .pix, .ch-text .pix, .ch-quote .pix, .ch-replybar-t .pix { width: 1.15em; height: 1.15em; vertical-align: -0.2em; }
.ch-count { position: absolute; right: 8px; bottom: 4px; font-size: 10px; color: var(--muted); pointer-events: none; }
.ch-ico { flex: none; align-self: center; padding: 0 4px; background: none; border: 0; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; }
.ch-ico .pix { width: 18px; height: 18px; vertical-align: middle; }
.ch-ico:hover { color: var(--text); }
.ch-ico.rec { animation: ch-pulse 1s ease-in-out infinite; }
@keyframes ch-pulse { 50% { opacity: .35; } }

/* Palet emoji + bilah pratinjau pesan suara (di atas baris tulis) */
.ch-emoji-pop {
  display: flex; flex-wrap: wrap; gap: 2px; max-height: 148px; overflow-y: auto; margin: 0 0 6px; padding: 6px;
  background: var(--panel2); border: 2px solid var(--line2); box-shadow: var(--shadow);
}
.ch-emoji-pop[hidden] { display: none; }
.ch-emoji-i { font-size: 18px; line-height: 1; padding: 2px 4px; background: none; border: 0; cursor: pointer; }
.ch-emoji-i .pix { width: 22px; height: 22px; }
.ch-emoji-i:hover { background: var(--bg2); }
.ch-voicebar { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; padding: 6px 8px; background: var(--panel2); border: 2px solid var(--line2); }
.ch-voicebar[hidden] { display: none; }
.ch-voice-grow { flex: 1; }
.ch-audio { display: block; width: min(260px, 100%); height: 34px; margin-top: 2px; }
.ch-media { display: flex; flex-direction: column; gap: 2px; }

/* ─────────── avatar + border ─────────── */
.av-frame { --s: 40px; --b: 2px; --c1: #6b5236; --c2: #4a3826; position: relative; display: inline-block; flex: none; width: var(--s); height: var(--s); }
.av-frame.sm { --s: 30px; }
.av-frame.lg { --s: 84px; --b: 4px; }
.av-img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: var(--bg2); image-rendering: auto; }
.av-ring { position: absolute; inset: calc(var(--b) * -1 - 1px); border-radius: 50%; pointer-events: none; background: conic-gradient(var(--c1), var(--c2), var(--c1)); padding: var(--b); mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
.f-none { --c1: #4a3826; --c2: #3a2b1d; }
.f-wood { --c1: #a07a52; --c2: #5a3a22; }
.f-iron { --c1: #d6dbe0; --c2: #7a8590; }
.f-gold { --c1: #ffe08a; --c2: #b9761a; }
.f-crystal { --c1: #a8f0ff; --c2: #6a7cff; }
.f-ascended { --c1: #f3c6ff; --c2: #8350b5; }
.f-casino { --c1: #ff5c7a; --c2: #f2b23a; }
.f-merchant { --c1: #6ff0c0; --c2: #2f7fb5; }
.f-booster { --c1: #ff8af2; --c2: #9a5cff; }
.f-pumpkin { --c1: #ffb340; --c2: #3a1a0c; }
.f-chosen { --c1: #ff4f40; --c2: #1a0505; }
/* Border rare ke atas berkilau/berputar pelan. */
.av-frame.f-gold .av-ring, .av-frame.f-crystal .av-ring, .av-frame.f-ascended .av-ring,
.av-frame.f-casino .av-ring, .av-frame.f-merchant .av-ring, .av-frame.f-booster .av-ring,
.av-frame.f-pumpkin .av-ring, .av-frame.f-chosen .av-ring { background: conic-gradient(var(--c1), var(--c2), var(--c1), var(--c2), var(--c1)); animation: av-spin 6s linear infinite; }
.av-frame.f-crystal::after, .av-frame.f-ascended::after, .av-frame.f-booster::after, .av-frame.f-chosen::after {
  content: ''; position: absolute; inset: -6px; border-radius: 50%; pointer-events: none;
  box-shadow: 0 0 10px color-mix(in srgb, var(--c1) 60%, transparent); animation: av-glow 2.4s ease-in-out infinite;
}
.av-frame.f-pumpkin::before { content: '\1F383'; position: absolute; right: -6px; bottom: -6px; z-index: 1; font-size: calc(var(--s) * .38); line-height: 1; filter: drop-shadow(0 1px 0 #000); }
.av-frame.f-chosen::before { content: '\1F608'; position: absolute; right: -6px; bottom: -6px; z-index: 1; font-size: calc(var(--s) * .38); line-height: 1; filter: drop-shadow(0 1px 0 #000); }
.av-frame.f-booster::before { content: '\1F680'; position: absolute; right: -6px; bottom: -6px; z-index: 1; font-size: calc(var(--s) * .34); line-height: 1; }
.av-frame.f-ascended::before { content: '\2726'; position: absolute; left: 50%; top: -9px; transform: translateX(-50%); z-index: 1; font-size: calc(var(--s) * .32); color: #f3c6ff; text-shadow: 0 0 6px #b07ce0; }
/* Nama ikut warna border pada border langka. */
.ch-name.f-gold { color: #ffd469; }
.ch-name.f-crystal { color: #a8f0ff; }
.ch-name.f-ascended { color: #e6c2ff; }
.ch-name.f-casino { color: #ff8fa3; }
.ch-name.f-merchant { color: #8ff5cf; }
.ch-name.f-booster { color: #ff9ff5; }
.ch-name.f-pumpkin { color: #ffb340; }
.ch-name.f-chosen { color: #ff6b5c; }
@keyframes av-spin { to { transform: rotate(360deg); } }
@keyframes av-glow { 50% { opacity: .45; } }

/* ─────────── kartu profil ─────────── */
.pc { --c1: #4a3826; --c2: #3a2b1d; position: relative; margin: -8px -8px 0; overflow: hidden; }
.pc-banner { height: 70px; background: linear-gradient(135deg, var(--c1), var(--c2)); opacity: .55; }
.pc-top { display: flex; align-items: flex-end; gap: 14px; margin: -42px 14px 0; position: relative; }
.pc-top .av-frame { box-shadow: 0 0 0 4px var(--panel); border-radius: 50%; }
.pc-id { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; padding-bottom: 4px; }
.pc-id .ch-name { font-size: 16px; cursor: default; }
.pc-id .ch-name:hover { text-decoration: none; }
.pc-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pc-clan { font-size: 11px; color: var(--muted); }
.pc-skills { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 14px 14px 0; }
.pc-skill { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 4px; background: var(--bg2); border: 1px solid var(--line); font-size: 10px; color: var(--muted); }
.main .pc-skill img, .pc-skill img { width: 20px; height: 20px; }
.pc-skill b { font-family: var(--font-pixel); font-size: 10px; color: var(--head); }
.pc-badges { margin: 12px 14px 4px; }
.pc-k { display: block; margin-bottom: 6px; font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.pc-bgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; max-height: 190px; overflow-y: auto; }
.pc-b { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 4px; background: var(--bg2); border: 1px solid var(--line); text-align: center; font-size: 18px; }
.pc-b img { width: 22px; height: 22px; }
.pc-b small { font-size: 9px; color: var(--muted); line-height: 1.2; }
.pc-b.pinned { border-color: var(--gold); background: #2a2010; }

/* ─────────── editor kartu ─────────── */
.ce-preview { margin-bottom: 12px; padding: 4px 0; background: var(--bg2); border: 1px solid var(--line); }
.ce-preview .ch-msg { padding: 8px 12px; }
.ce-sec { margin-top: 12px; }
.ce-frames { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 6px; }
.ce-frame { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px 6px; background: var(--bg2); border: 2px solid var(--line); color: var(--text); }
.ce-frame small { font-size: 10px; }
.ce-frame em { position: absolute; top: 2px; right: 2px; font-style: normal; font-size: 7px; font-weight: 700; color: #fff; background: var(--red); padding: 1px 3px; }
.ce-frame.on { border-color: var(--gold); background: #2a2010; }
.ce-frame.locked { opacity: .4; }
.ce-frame.locked .av-img { filter: grayscale(1); }
.ce-badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; max-height: 200px; overflow-y: auto; }
.ce-badge { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 4px; background: var(--bg2); border: 2px solid var(--line); color: var(--text); font-size: 18px; }
.ce-badge img { width: 22px; height: 22px; }
.ce-badge small { font-size: 9px; color: var(--muted); line-height: 1.2; }
.ce-badge.on { border-color: var(--gold); background: #2a2010; }
.ce-badge:disabled { opacity: .45; }

/* ─────────── responsif ─────────── */
@media (max-width: 760px) {
  .ch-view { height: calc(100dvh - var(--top-h) - 16px); }
  .ch { grid-template-columns: minmax(0, 1fr); }
  .ch-rooms { display: none; border-right: 0; }
  .ch.list .ch-rooms { display: flex; }
  .ch.list .ch-main { display: none; }
  .ch-back { display: inline-grid; place-items: center; }
  .ch-msg { grid-template-columns: 38px minmax(0, 1fr); gap: 8px; padding: 6px 10px 2px; }
  .ch-msg .av-frame:not(.lg) { --s: 32px; }
  .pc-skills { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { .av-ring, .av-frame::after { animation: none !important; } }

/* ─────────────── Balas pesan (kutipan) ─────────────── */
.ch-quote {
  display: flex; flex-direction: column; gap: 1px; text-align: left;
  margin: 0 0 4px; padding: 4px 8px; max-width: 100%;
  background: var(--bg2); border: 0; border-left: 3px solid var(--line2);
  color: var(--muted); font-size: 11px; cursor: pointer;
}
.ch-quote:hover { border-left-color: var(--gold); }
.ch-quote b { color: var(--head); font-size: 11px; }
.ch-quote span { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Tombol balas: muncul saat baris disorot (tetap bisa diklik di layar sentuh). */
.ch-reply-btn {
  position: absolute; top: 4px; right: 8px; z-index: 2;
  width: 26px; height: 26px; line-height: 1; font-size: 14px;
  background: var(--panel2); border: 2px solid var(--line); color: var(--muted);
  opacity: 0; transition: opacity .12s ease;
}
.ch-msg:hover .ch-reply-btn, .ch-msg:focus-within .ch-reply-btn { opacity: 1; }
/* Layar sentuh tidak punya hover: tombol balas harus selalu terlihat. */
@media (hover: none) { .ch-reply-btn { opacity: 1; } }
.ch-msg.pinged { background: linear-gradient(90deg, rgba(242, 178, 58, .16), transparent 70%); box-shadow: inset 3px 0 0 var(--gold); }
.ch-msg.flash { animation: ch-flash 1.1s ease-out 1; }
@keyframes ch-flash { 0%, 40% { background: rgba(242, 178, 58, .28); } 100% { background: transparent; } }

/* Kotak kutipan di atas kolom tulis */
.ch-replybar {
  display: flex; align-items: center; gap: 8px; margin: 0 0 6px;
  padding: 6px 8px; background: var(--bg2); border: 2px solid var(--line); border-left: 3px solid var(--gold);
}
.ch-replybar-t { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ch-replybar-t b { color: var(--head); font-size: 11px; }
.ch-replybar-t span { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-x { flex: none; width: 24px; height: 24px; background: var(--panel2); border: 2px solid var(--line); color: var(--muted); }

/* ─────────────── Mention ─────────────── */
.ch-mention {
  padding: 0 4px; border-radius: 6px; font-weight: 700;
  color: #cfe9ff; background: rgba(96, 165, 250, .18);
}
.ch-mention.guild { color: #ffe0a3; background: rgba(242, 178, 58, .2); }
.ch-mention.me { color: #1a1206; background: var(--gold); }
.ch-badge.ping { background: var(--gold); color: #1a1206; margin-left: 4px; }

/* Autocomplete mention */
.ch-ac {
  display: flex; flex-direction: column; gap: 2px; margin: 0 0 6px; padding: 4px;
  background: var(--panel2); border: 2px solid var(--line2); box-shadow: var(--shadow);
}
.ch-ac[hidden] { display: none; }
.ch-ac-i { display: flex; align-items: center; gap: 8px; padding: 6px 8px; text-align: left; color: var(--text); }
.ch-ac-i.on, .ch-ac-i:hover { background: var(--bg2); color: var(--head); }

/* Baris komposer (avatar + kolom tulis + tombol kirim) */
.ch-row { display: flex; align-items: flex-end; gap: 8px; }

/* Penanda teman Discord */
.ch-friend { flex: none; color: var(--blue); }
.ch-friend img { width: 14px; height: 14px; }

/* Event SDK: HP panas -> kurangi animasi; mode PIP -> rapatkan tata letak */
html.reduce-fx *, html.reduce-fx *::before, html.reduce-fx *::after { animation: none !important; transition: none !important; }
html.pip .sidebar, html.pip .rightbar { display: none; }
html.pip .shell { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'top' 'main'; }

/* ─────────── Developer: tag DEV + border khusus (hanya DEV_IDS) ─────────── */
.ch-dev {
  display: inline-flex; align-items: center; gap: 3px; padding: 1px 6px 1px 5px;
  font-family: var(--font-pixel); font-size: 8px; letter-spacing: .6px; color: #fff;
  background: linear-gradient(180deg, #ff3b3b, #b3121b); border: 1px solid #ff8a8a;
  box-shadow: 0 0 0 1px #4a0508, 0 0 8px rgba(255, 50, 50, .55); text-shadow: 0 1px 0 #5a0008;
  animation: dev-pulse 2.2s ease-in-out infinite;
}
.ch-dev b { font-weight: 700; }
@keyframes dev-pulse { 50% { box-shadow: 0 0 0 1px #4a0508, 0 0 14px rgba(255, 60, 60, .9); } }

.f-developer { --c1: #ff2a2a; --c2: #12060a; }
.ch-name.f-developer {
  background: linear-gradient(90deg, #ff6b6b, #ffd0d0, #ff3b3b, #ff6b6b); background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: dev-shine 3s linear infinite;
}
@keyframes dev-shine { to { background-position: -200% 0; } }
/* Cincin ganda: luar merah-hitam berputar, dalam garis putus-putus berputar berlawanan. */
.av-frame.f-developer .av-ring {
  background: conic-gradient(#ff2a2a, #12060a 20%, #ff6b6b 35%, #12060a 50%, #ff2a2a 65%, #12060a 80%, #ff2a2a);
  animation: av-spin 3.5s linear infinite;
}
.av-frame.f-developer::after {
  content: ''; position: absolute; inset: calc(var(--b) + 1px); border-radius: 50%; pointer-events: none;
  border: 1px dashed rgba(255, 120, 120, .75);
  box-shadow: 0 0 12px rgba(255, 40, 40, .7), inset 0 0 6px rgba(255, 40, 40, .45);
  animation: av-spin 9s linear infinite reverse;
}
.av-frame.f-developer::before {
  content: '</>'; position: absolute; right: -7px; bottom: -5px; z-index: 1;
  padding: 1px 3px; font-family: var(--font-pixel); font-size: max(6px, calc(var(--s) * .16)); line-height: 1.2;
  color: #fff; background: #c4121c; border: 1px solid #ff9a9a; box-shadow: 0 0 6px rgba(255, 40, 40, .9);
}
.ch-msg.f-developer { background: linear-gradient(90deg, rgba(255, 40, 40, .07), transparent 60%); }
.pc.f-developer .pc-banner { opacity: 1; background: repeating-linear-gradient(135deg, #3a0a0e 0 10px, #24060a 10px 20px), #24060a; box-shadow: inset 0 -2px 0 #ff2a2a; }
.badge-pill.g-staff { color: #fff; border-color: #ff6b6b; background: linear-gradient(90deg, #b3121b, #4a0508); box-shadow: 0 0 8px rgba(255, 50, 50, .45); }
.ce-frame.r-mythic { border-color: #ff4a4a; }
@media (prefers-reduced-motion: reduce) { .ch-dev, .ch-name.f-developer, .av-frame.f-developer::after { animation: none !important; } }

/* ─────────── panel Trade (channel Trade) ─────────── */
.ch-trade-host { padding: 10px 14px; border-bottom: 2px solid var(--line); background: var(--bg2); }
.ch-trade { display: flex; flex-direction: column; gap: 8px; }
.ch-trade-h { display: flex; align-items: flex-start; gap: 10px; }
.ch-trade-h .grow { display: flex; flex-direction: column; }
.ch-trade-h strong { font-family: var(--font-pixel); font-size: 11px; color: var(--head); }
.ch-trade-h span { font-size: 11px; color: var(--muted); }
.ch-trade-pick { display: flex; gap: 8px; }
.ch-trade-search { flex: 1; padding: 7px 9px; background: var(--panel); border: 2px solid var(--line); color: var(--text); font-size: 12px; }
.ch-trade-search:focus { outline: none; border-color: var(--accent); }
.ch-trade-results { display: flex; flex-direction: column; gap: 2px; }
.ch-trade-hit { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 9px; background: var(--panel); border: 2px solid var(--line); color: var(--text); text-align: left; font-size: 12px; }
.ch-trade-hit:hover { border-color: var(--accent); }
.ch-trade-hit small { color: var(--muted); font-size: 10px; }
.ch-trade-btns { display: flex; flex-wrap: wrap; gap: 8px; }

/* Jendela trade ala Growtopia: dua kolom petak (tawaran) + inventaris di bawah. */
.ch-trade-window { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ch-trade-col { padding: 8px; background: var(--panel); border: 2px solid var(--line); min-width: 0; }
.ch-trade-col-h { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.ch-trade-col-h strong { font-size: 11px; color: var(--head); }
.ch-trade-col-h span { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-trade-ready { width: 8px; height: 8px; flex: none; background: var(--muted); }
.ch-trade-ready.on { background: var(--accent); }
.ch-trade-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
.ch-trade-grid.inv { grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); max-height: 190px; overflow-y: auto; }
.ch-trade-slot { position: relative; aspect-ratio: 1; display: grid; place-items: center; padding: 3px;
  background: var(--bg2); border: 2px solid var(--line); }
.ch-trade-slot.empty { border-style: dashed; opacity: .5; }
.ch-trade-slot.inv { cursor: pointer; }
.ch-trade-slot.inv:hover { border-color: var(--accent); }
.ch-trade-slot.inv.on { border-color: var(--accent); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .08); }
.ch-trade-slot img.pix { max-width: 100%; max-height: 100%; object-fit: contain; }
.ch-trade-slot b { position: absolute; right: 1px; bottom: 0; font-size: 10px; color: var(--text);
  background: rgba(0, 0, 0, .55); padding: 0 3px; }
.ch-trade-line { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.ch-trade-line .grow { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-trade-tax { display: flex; flex-direction: column; gap: 3px; padding: 8px 10px; background: var(--panel2); border: 1px solid var(--line); }
.tc-give { color: #ff6b6b; }
.tc-get { color: #7bd86a; }
@media (max-width: 620px) { .ch-trade-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
