/* MTG v2 / Chatbox — oparty na oryginalnym cellpicgl.png z MTG_v2.xml.
 * Aktualny moduł ma inne klasy niż historyczny BIM Chatbox — tutaj są
 * odwzorowane jego powierzchnie, belka, avatar, wiersze i pole wysyłania.
 */
.mtgcb{
  --cb-accent:#9e1529;--cb-text:#f0e8e8;--cb-dim:#7f6e70;
  width:100%;min-width:0;max-width:none;
  margin:12px 0 20px!important;padding:0!important;
  position:relative;isolation:isolate;overflow:visible!important;
  background:transparent!important;border:0!important;border-radius:0!important;
  box-shadow:none!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important;
  color:var(--cb-text);font:inherit;font-size:12px;
}
.mtgcb,.mtgcb *,.mtgcb *::before,.mtgcb *::after{box-sizing:border-box}
.mtgcb::before,.mtgcb::after{content:none!important}
.mtgcb__header{
  height:110px;min-height:110px;display:flex;align-items:center;justify-content:space-between;
  position:relative;padding:14px 11% 14px 14.5%!important;gap:12px;
  border:0!important;border-radius:0!important;box-shadow:none!important;
  background:url('/mtg-v2-modules/cellpicgl.png') center center/100% 100% no-repeat!important;
}
.mtgcb__brand{display:flex;align-items:center;min-width:0;gap:0}
.mtgcb__brand .mtgcb__symbol{display:none!important}
.mtgcb__brand small{display:none!important}
.mtgcb__brand h2{
  margin:0!important;padding:0!important;color:#f8f8f8!important;font:700 16px/1.3 Arial,Helvetica,sans-serif!important;
  text-transform:uppercase;letter-spacing:.2px;
}
.mtgcb__headerRight{display:flex;align-items:center;gap:6px}
.mtgcb__online{display:none!important}
.mtgcb__refresh{
  background:none!important;color:#c9b6b8!important;border:0!important;
  box-shadow:none!important;border-radius:0!important;cursor:pointer;
  padding:3px!important;width:26px;height:26px;font-size:18px;line-height:1;
  transition:transform .18s,color .18s;
}
.mtgcb__refresh:hover{transform:rotate(35deg);color:#fff!important}
.mtgcb__feed{
  height:266px;min-height:180px;max-height:540px;
  overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;
  margin:-5px 7.2% 0!important;padding:2px 0 0!important;
  background:rgba(0,0,0,.28)!important;border:0!important;border-radius:0!important;
  scrollbar-color:#7a1927 #070104;scrollbar-width:thin;
}
.mtgcb__feed::-webkit-scrollbar{width:6px}
.mtgcb__feed::-webkit-scrollbar-track{background:#090205}
.mtgcb__feed::-webkit-scrollbar-thumb{background:#68111e;border-radius:0}
.mtgcb__message{
  display:flex;align-items:flex-start;gap:10px;position:relative;
  min-height:55px;margin:0;padding:9px 8px!important;
  border:0!important;border-bottom:1px solid rgba(94,10,20,.72)!important;
  background:rgba(0,0,0,.28)!important;border-radius:0!important;
  box-shadow:none!important;transition:background .18s;
}
.mtgcb__message:hover{background:rgba(84,9,24,.17)!important}
.mtgcb__avatar{
  width:32px!important;height:32px!important;min-width:32px!important;flex:0 0 32px!important;
  object-fit:cover;border:1px solid #62222d!important;border-radius:50%!important;
  background:#130407;color:#d5b4b9;box-shadow:0 0 0 2px #070104;
}
.mtgcb__avatar--fallback{display:grid;place-items:center;font-weight:800;font-size:12px}
.mtgcb__msgbody{flex:1;min-width:0}
.mtgcb__msgmeta{display:flex;align-items:center;gap:6px;flex-wrap:wrap;min-height:18px;margin:0 0 3px}
.mtgcb__user{
  font-size:12px;font-weight:750;line-height:1.35;color:#e1c6a0;text-decoration:none!important;
  white-space:normal;overflow:visible;
}
.mtgcb__user:hover{text-decoration:underline!important}
/* IPS odpowiada za kolor i animacje rang. Nie nakładamy twardych kolorów na klasy ACP. */
.mtgcb .mtgcb__ipsformat{display:inline-block;position:relative;isolation:isolate;overflow:visible!important;vertical-align:middle}
.mtgcb .mtgcb__ipsformat.mtg-rank-badge{background:transparent!important;border:0!important;box-shadow:none!important;overflow:visible!important;padding:0 2px!important}
.mtgcb .mtgcb__ipsformat > .mtgcb__formatted-text{position:relative;z-index:2}
.mtgcb__rank{font-size:10px;font-weight:600;color:#bda1a6;padding:0!important;border:0!important;background:transparent!important;box-shadow:none!important;overflow:visible!important;white-space:nowrap}
.mtgcb__rank--ips{display:inline-flex;align-items:center;gap:2px}
.mtgcb__rank--ips .mtg-rank-badge{font-size:10px!important;overflow:visible!important}
.mtgcb__time{color:#655559;font:400 10px/1.3 Arial,Helvetica,sans-serif;margin-left:auto;white-space:nowrap}
.mtgcb__text{font-size:12px;line-height:1.5;color:#e0d2d3;white-space:pre-wrap;overflow-wrap:anywhere}
.mtgcb__remove{margin-left:2px;background:transparent;border:0;color:#8e2835;cursor:pointer;font-size:16px;width:20px;height:20px;padding:0}
.mtgcb__remove:hover{color:#fff;background:rgba(92,8,23,.6)}
.mtgcb__compose{
  margin:0 7.2%!important;padding:4px 0 6px!important;
  background:#040102!important;border:0!important;border-top:1px solid rgba(85,11,20,.95)!important;
}
.mtgcb__form{display:flex;align-items:center;gap:8px}
.mtgcb__form textarea{
  flex:1;min-width:0;min-height:37px!important;max-height:110px!important;height:37px;
  margin:0!important;padding:9px 10px!important;
  color:#e9d7d9!important;caret-color:#d7475d;
  background:#030102!important;border:0!important;border-bottom:1px solid #470a14!important;
  box-shadow:none!important;border-radius:0!important;resize:vertical;
  font:400 12px/1.4 Arial,Helvetica,sans-serif!important;
}
.mtgcb__form textarea:focus{outline:0!important;border-bottom-color:#a91d32!important;box-shadow:0 2px 0 -1px #9f182c!important}
.mtgcb__form textarea::placeholder{color:#837478!important}
.mtgcb__form button{
  display:grid;place-items:center;flex:0 0 32px;min-width:32px!important;
  height:32px!important;min-height:32px!important;padding:0!important;
  color:transparent!important;font-size:0!important;
  border:1px solid #87182a!important;border-radius:50%!important;
  background:radial-gradient(circle at 40% 40%,#8e152b,#2e050e)!important;
  box-shadow:0 0 5px rgba(132,17,33,.3)!important;
  cursor:pointer;transition:filter .2s;
}
.mtgcb__form button::before{content:'➤';display:block;font:700 13px Arial,sans-serif;color:#ff4c69;transform:translateX(1px)}
.mtgcb__form button span{display:none!important}
.mtgcb__form button:hover:not(:disabled){filter:brightness(1.35)}
.mtgcb__form button:disabled{opacity:.55;cursor:wait}
.mtgcb__foot{display:flex;justify-content:space-between;gap:8px;flex-wrap:wrap;padding:4px 0;color:#564247;font-size:9px}
.mtgcb__notice{padding:26px 8px;text-align:center;font-size:12px;color:#8a7177}
.mtgcb__refresh:focus-visible,.mtgcb__form textarea:focus-visible,.mtgcb__form button:focus-visible{outline:1px solid #b9364f;outline-offset:2px}
@media(max-width:720px){
  .mtgcb__header{height:80px;min-height:80px;padding-left:10%!important}
  .mtgcb__brand h2{font-size:14px!important}
  .mtgcb__feed{height:235px;margin:0 2%!important}
  .mtgcb__compose{margin:0 2%!important}
  .mtgcb__message{gap:7px;padding:8px 4px!important;min-height:49px}
  .mtgcb__avatar{width:28px!important;height:28px!important;min-width:28px!important;flex-basis:28px!important}
  .mtgcb__time{font-size:9px}
}
@media(prefers-reduced-motion:reduce){.mtgcb__message,.mtgcb__refresh,.mtgcb__form button{transition:none!important}}
.mtgcb__brand {
    margin-left: 25px !important;
}