@media(min-width:1001px) {
  body .hero:has(#realm-chat:not([hidden])),body.community-rails-enabled .hero:has(#realm-chat:not([hidden])) {
    grid-template-columns:minmax(0,1fr) minmax(360px,min(40vw,630px));
  }
}
#realm-chat {
  --chat-line:#334352;
  --chat-gold:#e1c690;
  position:relative; isolation:isolate; overflow:hidden; text-align:left;
  border:1px solid #746852; border-radius:9px; color:#e2e9ed;
  background:#101923; box-shadow:0 14px 40px #02091388,0 0 0 3px #111b2566;
}
#realm-chat[hidden],#realm-chat [hidden] {display:none}
#realm-chat + * {margin-top:16px}
.chat-heading {
  display:flex; align-items:center; gap:15px; padding:17px 22px;
  border-bottom:1px solid #71664e; position:relative;
  background:linear-gradient(90deg,#152536 15%,#203246c9 55%,#111e2dd9),url('/assets/frozen-citadel.png') 78% 40%/cover;
}
.chat-heading:after {content:''; position:absolute; bottom:-1px; left:18px; width:78px; height:2px; background:linear-gradient(90deg,#b39255,#f4dfae,transparent)}
.chat-sigil { display:grid;place-items:center; width:34px;height:34px;flex:none; margin:0 3px; transform:rotate(45deg); border:1px solid #b69d6a; outline:1px solid #6f735e; outline-offset:3px; background:radial-gradient(circle,#395262,#1a2837); }
.chat-sigil b {transform:rotate(-45deg); color:#efdcb1;font:30px/1 Georgia,serif}
.chat-heading h2 { margin:0; font:600 clamp(24px,2vw,31px)/1.1 Georgia,serif; letter-spacing:-.03em; color:#fff0d0; }
.chat-room {display:block; margin-top:4px; color:#b7c9d8; font:500 12px/1.2 system-ui}
.chat-channel {margin-left:auto; display:inline-flex; align-items:center; gap:7px; padding:5px 10px; background:#101e25d9; color:#cde5db; border:1px solid #52645f; border-radius:20px; font:600 11px system-ui}
.chat-channel:before {content:'';width:6px;height:6px;border-radius:50%;background:#91d8b8;box-shadow:0 0 7px #70d5a570}
.chat-offline .chat-channel:before {background:#e0b576}
.chat-feed {height:clamp(285px,36vh,375px); overflow:auto; padding:0 20px 9px; overscroll-behavior:contain; scrollbar-color:#536270 #101922; scrollbar-width:thin; overflow-anchor:none; background:linear-gradient(120deg,#182531 0%,#101a25 80%)}
.chat-feed ol {list-style:none;padding:0;margin:0}
.chat-feed li {display:grid;grid-template-columns:38px minmax(0,1fr);align-items:start;column-gap:12px;padding:10px 0;border-bottom:1px solid #8497a517}
.chat-feed li:last-child {border-bottom:0}
.chat-day-start:before {content:attr(data-day); grid-column:1/-1; justify-self:center; margin:3px 0 14px; padding:2px 16px; border-inline:1px solid #605b4c; color:#c6bda9; font:600 10px/1.3 system-ui; letter-spacing:.08em;text-transform:uppercase}
.chat-feed li>img,.chat-compose img {box-sizing:border-box;width:38px;height:38px;object-fit:cover;border:1px solid #778393;border-radius:8px;box-shadow:0 2px 6px #0006}
.chat-feed .chat-staff>img {border-color:#d87875}
.chat-meta {display:flex;flex-wrap:wrap;align-items:center;gap:7px;min-height:17px}
.chat-meta strong {font:650 14px/1.2 system-ui;color:#e4dfd0;overflow-wrap:anywhere}
.chat-role {border:1px solid #485969;border-radius:4px;color:#b6c4d0;padding:1px 5px;font:600 9px/1.35 system-ui;letter-spacing:.06em;text-transform:uppercase}
.chat-staff .chat-role {background:#40272f;border-color:#935658;color:#ffb0a9}
.chat-meta time {margin-left:auto;font:11px system-ui;color:#a7b7c5;font-variant-numeric:tabular-nums}
.chat-feed p {margin:4px 0 0;white-space:pre-wrap;overflow-wrap:anywhere;font:14px/1.5 system-ui;color:#e1e9ef}
.chat-feed .chat-empty {padding:85px 14px;text-align:center;color:#b6c6d1;font:italic 17px/1.5 Georgia,serif}
.chat-older,.chat-jump {display:block;cursor:pointer;margin:8px auto;border:1px solid #526471;border-radius:20px;padding:4px 14px;background:#1b2c38;color:#d2dfe5;font:12px system-ui}
.chat-compose,.chat-guest {display:flex;align-items:center;gap:10px;padding:13px 17px;margin:0;border-top:1px solid var(--chat-line);background:#101a24;font:14px system-ui}
.chat-compose input {flex:1;min-width:0;padding:11px 12px;background:#0b141e;color:#f0f3f5;border:1px solid #455564;border-radius:6px;font:14px system-ui}
.chat-compose input:focus {outline:2px solid #b19a66;outline-offset:1px}
.chat-compose button,.chat-guest a {border:1px solid #b49a63;border-radius:5px;background:linear-gradient(#e8cea0,#c1a16a);color:#261f17;padding:10px 15px;cursor:pointer;text-decoration:none;font:700 13px system-ui}
.chat-compose .chat-avatar {padding:0;display:grid;border:0;background:transparent}
.chat-avatar:hover img,.chat-avatar:focus-visible img {outline:2px solid var(--chat-gold)}
.chat-guest {justify-content:space-between;color:#ced8e1}
.chat-status {margin:0;color:#ffc49b;font:12px system-ui}
.chat-status:not(:empty){padding:8px 16px}
.chat-tools {margin-top:4px;color:#acbbc7;font:11px system-ui}
.chat-tools summary {width:fit-content;cursor:pointer}
.chat-tools button,.chat-tools a {display:inline-block;margin:5px 6px 0 0;padding:4px 7px;border:1px solid #435769;border-radius:4px;background:#223341;color:#e3d4ad;font:12px system-ui;cursor:pointer}
@media(max-width:520px) {
 .chat-heading {padding:14px 16px;gap:12px}
 .chat-feed {height:300px;padding-inline:12px}
 .chat-feed li {grid-template-columns:32px minmax(0,1fr);column-gap:9px}
 .chat-feed li>img {width:32px;height:32px}
 .chat-meta {gap:5px}
 .chat-compose,.chat-guest {padding:10px;gap:7px}
}
.chat-avatars { width:min(370px,90vw); box-sizing:border-box; border:1px solid #867349; border-radius:6px; padding:20px; background:#15222d; color:#ead9b5; }
.chat-avatars::backdrop { background:#060c14b8 }
.chat-avatars h2 { margin:0 0 16px; font:22px Georgia,serif }
.chat-portrait-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:7px }
.chat-avatars button { background:#253540; color:#e5d2a7; border:1px solid #64717c; border-radius:3px; cursor:pointer; padding:5px }
.chat-portrait-grid button { padding:2px; display:grid; }
.chat-portrait-grid button[aria-pressed=true] { outline:2px solid #ebca79 }
.chat-portrait-grid img { width:100%; aspect-ratio:1; object-fit:cover }
