  .chat-box {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  .chat-header {
    background: var(--red);
    padding: 12px 16px;
    display: flex; align-items: center; gap: 10px;
    color: white;
  }
  .chat-header-title { font-family: var(--font-head); font-weight: 700; font-size: 1rem; text-transform: uppercase; letter-spacing: 0.05em; }
  .chat-online { font-size: 0.72rem; color: rgba(255,255,255,0.82); display: flex; align-items: center; gap: 5px; margin-left: auto; padding: 6px 9px; border-radius: 999px; background: rgba(0,0,0,0.14); border: 1px solid rgba(255,255,255,0.12); }
  .chat-online:active { transform: scale(0.96); }
  .online-dot { width: 7px; height: 7px; background: #2ecc71; border-radius: 50%; animation: blink-badge 2s infinite; }
  .chat-online-list { padding: 10px 14px; border-bottom: 1px solid var(--light-gray); background: #fff8ef; }
  .chat-online-list[hidden] { display: none; }
  .chat-online-title { font-family: var(--font-head); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); margin-bottom: 7px; }
  .chat-online-names { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .chat-online-name { display: block; width: 100%; max-width: 100%; padding: 5px 8px; border-radius: 8px; background: var(--white); border: 1px solid var(--light-gray); color: var(--dark); font-size: 0.78rem; overflow-wrap: anywhere; box-shadow: 0 1px 4px rgba(0,0,0,0.05); }
  .chat-messages { height: 320px; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--off-white); }
  .chat-msg { display: flex; gap: 10px; align-items: flex-start; }
  .chat-msg.is-self { flex-direction: row-reverse; }
  .chat-msg.is-self .chat-bubble { background: var(--cream); border-color: rgba(232,168,32,0.28); border-radius: 16px 0 16px 16px; }
  .chat-msg.is-self .chat-name, .chat-msg.is-self .chat-ts { text-align: right; }
  .chat-msg.is-self .chat-name { color: var(--gold); }
  .chat-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; box-shadow: 0 4px 10px rgba(0,0,0,0.14); }
  .chat-bubble { background: var(--white); border-radius: 0 14px 14px 14px; padding: 9px 11px; max-width: calc(100% - 52px); border: 1px solid rgba(0,0,0,0.04); box-shadow: 0 1px 6px rgba(0,0,0,0.08); }
  .chat-name { font-size: 0.72rem; font-weight: 700; color: var(--red); margin-bottom: 3px; }
  .chat-text { font-size: 0.88rem; color: var(--dark); line-height: 1.38; overflow-wrap: anywhere; }
  .chat-ts { font-size: 0.66rem; color: var(--gray); margin-top: 4px; }
  .chat-nickbar { padding: 10px 12px 12px; border-top: 1px solid var(--light-gray); background: #fff; }
  .chat-nickcopy { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
  .chat-nicklabel, .chat-field-label { font-family: var(--font-head); font-size: 0.68rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gray); }
  .chat-nickcurrent { color: var(--red); font-size: 0.78rem; font-weight: 700; }
  .chat-nickform, .chat-avatar-tools { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 8px; align-items: center; }
  .chat-avatar-tools { margin-top: 8px; }
  .chat-nickform input[type="text"], .chat-upload-field { width: 100%; min-width: 0; padding: 10px 12px; border: 1px solid var(--light-gray); border-radius: 10px; font-size: 16px; outline: none; background: var(--off-white); }
  .chat-upload-wrap { position: relative; min-width: 0; }
  .chat-upload-field { min-height: 86px; display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; color: var(--dark); overflow: hidden; }
  .chat-upload-field.has-preview { padding: 0; }
  .chat-upload-field.has-preview span { display: none; }
  .chat-nicksave, .chat-nickedit { min-height: 34px; padding: 0 12px; border-radius: 10px; font-family: var(--font-head); font-size: 0.68rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; }
  .chat-nicksave { background: var(--red); color: white; }
  .chat-nickedit { border: 1px solid var(--light-gray); background: var(--off-white); color: var(--dark); }
  .chat-nicksave { width: 100%; margin-top: 10px; }
  .chat-nickbar.is-locked .chat-nickform, .chat-nickbar.is-locked .chat-avatar-tools, .chat-nickbar.is-locked .chat-nicksave { display: none; }
  .chat-nickbar.is-editing .chat-nickedit { display: none; }
  .chat-nickbar.is-locked .chat-nickedit { display: inline-flex; align-items: center; justify-content: center; }
  .chat-avatar-preview { display: none; width: 100%; height: 86px; border-radius: 10px; object-fit: cover; background: var(--off-white); border: 0; }
  .chat-upload-field.has-preview .chat-avatar-preview { display: block; }
  .chat-avatar-clear { display: none; position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%; background: rgba(0,0,0,0.62); color: #fff; font-size: 16px; line-height: 1; }
  .chat-upload-wrap.has-preview .chat-avatar-clear { display: flex; align-items: center; justify-content: center; }
  .chat-avatar-file { display: none; }
  .chat-input-wrap { padding: 10px; border-top: 1px solid var(--light-gray); display: flex; gap: 8px; }
  .chat-input-wrap input {
    flex: 1; padding: 8px 12px; border-radius: 20px;
    border: 1.5px solid var(--light-gray);
    font-family: var(--font-body); font-size: 16px;
    outline: none; background: var(--off-white);
    transition: border-color 0.2s;
  }
  .chat-input-wrap input:focus { border-color: var(--red); }
  .chat-send {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--red); color: white; font-size: 0.8rem;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; transition: background 0.2s;
  }
  .chat-send:hover { background: var(--red-dark); }

.chat-status {
  min-height: 32px;
  padding: 8px 14px;
  border-top: 1px solid rgba(215, 43, 43, 0.08);
  border-bottom: 1px solid rgba(215, 43, 43, 0.08);
  background: #fff8f0;
  color: var(--gray);
  font-size: 0.72rem;
  line-height: 1.3;
}

.chat-status.is-ready {
  color: #1f7a48;
}

.chat-status.is-warning {
  color: #9a5a12;
}

.chat-status.is-error {
  color: #a42424;
}

.chat-nickbar {
  display: grid;
  gap: 10px;
  padding: 10px 12px 12px;
  border-bottom: 1px solid rgba(215, 43, 43, 0.08);
  background: #fffdf9;
}

.chat-nickcopy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.chat-nicklabel,
.chat-field-label {
  font-family: var(--font-head);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray);
}

.chat-nickcurrent {
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 700;
}

.chat-nickform,
.chat-avatar-tools {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.chat-avatar-tools {
  margin-top: 8px;
}

.chat-nickform input[type="text"],
.chat-upload-field {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--light-gray);
  border-radius: 10px;
  background: var(--off-white);
  color: var(--dark);
  font-size: 16px;
  outline: none;
}

.chat-nickform input[type="text"]:focus,
.chat-upload-field:focus {
  border-color: var(--red);
}

.chat-upload-wrap {
  position: relative;
  min-width: 0;
}

.chat-upload-field {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  overflow: hidden;
}

.chat-upload-field.has-preview {
  padding: 0;
}

.chat-upload-field.has-preview span {
  display: none;
}

.chat-nicksave,
.chat-nickedit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 0;
  font-family: var(--font-head);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  -webkit-appearance: none;
  appearance: none;
}

.chat-nicksave {
  background: var(--red);
  color: #fff;
  width: 100%;
  margin-top: 10px;
}

.chat-nickedit {
  border: 1px solid rgba(215, 43, 43, 0.14);
  background: #fff8f0;
  color: var(--dark);
}

.chat-nickbar.is-locked .chat-nickform,
.chat-nickbar.is-locked .chat-avatar-tools,
.chat-nickbar.is-locked .chat-nicksave,
.chat-nickbar.is-editing .chat-nickedit {
  display: none;
}

.chat-nickbar.is-locked .chat-nickedit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chat-avatar-preview {
  display: none;
  width: 100%;
  height: 86px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--off-white);
  border: 0;
}

.chat-upload-field.has-preview .chat-avatar-preview {
  display: block;
}

.chat-avatar-clear {
  display: none;
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  font-size: 16px;
  line-height: 1;
}

.chat-upload-wrap.has-preview .chat-avatar-clear {
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-avatar-file {
  display: none;
}

.chat-reactions {
  position: absolute;
  right: -33px;
  bottom: 6px;
  z-index: 2;
}

.chat-reactions:has(.chat-reaction-trigger.has-reaction) {
  right: -10px;
  bottom: -13px;
}

.chat-msg.is-self .chat-reactions {
  right: auto;
  left: -33px;
}

.chat-msg.is-self .chat-reactions:has(.chat-reaction-trigger.has-reaction) {
  right: auto;
  left: -10px;
}

.chat-reply-trigger {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  right: -59px;
  bottom: 6px;
  z-index: 2;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: #111;
  box-shadow: none;
  font-size: 0.72rem;
  opacity: 0.5;
}

.chat-msg.is-self .chat-reply-trigger {
  right: auto;
  left: -59px;
}

.chat-reply-trigger:hover {
  background: transparent;
  color: #111;
  opacity: 1;
  transform: translateY(-1px);
}

.chat-bubble {
  position: relative;
  overflow: visible;
  max-width: calc(100% - 52px);
  margin-top: 16px;
  padding: 10px 13px;
  border-radius: 16px;
  background: var(--white);
  color: var(--dark);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
}

.chat-msg.is-self .chat-bubble {
  background: var(--white);
}

.chat-bubble .chat-name {
  position: absolute;
  left: 0;
  top: -18px;
  margin: 0;
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.chat-msg.is-self .chat-bubble .chat-name {
  right: 0;
  left: auto;
  text-align: right;
}

.chat-bubble .chat-text {
  color: var(--dark);
}

.chat-bubble .chat-ts {
  color: var(--gray);
}

.chat-messages {
  overflow-x: hidden;
}

.chat-box {
  position: relative;
}

.chat-online[aria-expanded="true"] {
  background: rgba(0, 0, 0, 0.24);
  border-color: rgba(255, 255, 255, 0.22);
}

.chat-online-list {
  width: min(220px, calc(100% - 24px));
  max-height: 178px;
  position: absolute;
  top: 54px;
  right: 12px;
  z-index: 20;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(215, 43, 43, 0.12);
  background: #fffdf9;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.18);
  overflow-y: auto;
}

.chat-online-names {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
}

.chat-online-name {
  display: block;
  width: 100%;
  max-width: 100%;
  padding: 5px 8px;
  border-radius: 8px;
  background: #fff8f0;
  border: 1px solid rgba(215, 43, 43, 0.1);
  color: var(--dark);
  font-size: 0.78rem;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  overflow-wrap: anywhere;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.chat-online-name:not(.is-empty):hover,
.chat-online-name:not(.is-empty):focus-visible {
  border-color: rgba(215, 43, 43, 0.4);
  background: #fff0e5;
  outline: none;
}

.chat-mention {
  color: #a3131c;
  font-weight: 800;
}

.chat-mention.is-self {
  padding: 1px 4px;
  border-radius: 5px;
  background: rgba(255, 210, 74, 0.45);
}

.chat-online-name.is-empty {
  display: block;
  background: transparent;
  border: 0;
  color: var(--gray);
  box-shadow: none;
}

.chat-reply-quote {
  width: 100%;
  display: block;
  margin: 0 0 8px;
  padding: 7px 9px;
  border: 0;
  border-left: 3px solid var(--red);
  border-radius: 8px;
  background: rgba(215, 43, 43, 0.07);
  text-align: left;
}

.chat-reply-quote-name,
.chat-reply-preview-label {
  display: block;
  color: var(--red);
  font-size: 0.72rem;
  font-weight: 800;
}

.chat-reply-quote-text,
.chat-reply-preview-text {
  display: block;
  margin-top: 2px;
  color: var(--gray);
  font-size: 0.78rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.chat-reaction-trigger {
  min-width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  position: relative;
  padding: 0;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: #111;
  box-shadow: none;
  font-family: Arial, sans-serif;
  font-size: 0.98rem;
  font-weight: 800;
  opacity: 0.5;
}

.chat-reaction-trigger.has-reaction {
  min-width: 28px;
  height: 28px;
  padding: 0 7px;
  border-radius: 999px;
  background: #fff;
  color: var(--dark);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  opacity: 1;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.16);
}

.chat-reactions.is-open .chat-reaction-trigger {
  background: transparent;
  color: #111;
  opacity: 1;
}

.chat-reactions.is-open .chat-reaction-trigger.has-reaction {
  background: #fff;
  color: var(--dark);
}

.chat-reaction-trigger-icons {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  line-height: 1;
  filter: grayscale(1);
}

.chat-reaction-trigger.has-reaction .chat-reaction-trigger-icons,
.chat-reactions.is-open .chat-reaction-trigger-icons {
  filter: none;
}

.chat-reaction-trigger-count {
  min-width: 13px;
  height: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  right: -5px;
  bottom: -4px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 0.54rem;
  font-weight: 800;
}

.chat-reaction-tray {
  position: fixed;
  left: var(--reaction-tray-left, 50%);
  top: var(--reaction-tray-top, 50%);
  bottom: auto;
  display: grid;
  grid-template-columns: repeat(8, 30px);
  gap: 7px;
  padding: 12px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(215, 43, 43, 0.12);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  max-width: calc(100vw - 24px);
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) scale(0.96);
  transform-origin: top center;
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
  z-index: 1000;
}

.chat-msg.is-self .chat-reaction-tray {
  left: var(--reaction-tray-left, 50%);
  right: auto;
  transform-origin: top center;
}

.chat-reactions.is-open .chat-reaction-tray {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) scale(1);
}

@media (max-width: 420px) {
  .chat-reaction-tray {
    grid-template-columns: repeat(8, minmax(0, 1fr));
    width: calc(100vw - 24px);
    gap: 5px;
    padding: 10px;
  }

  .chat-reaction-tray .chat-reaction {
    width: 100%;
    max-width: 36px;
    justify-self: center;
  }
}

.chat-reaction {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-radius: 50%;
  border: 0;
  background: #fff8f0;
  color: var(--dark);
  font-size: 1rem;
  line-height: 1;
  transition: background 0.18s ease, transform 0.18s ease;
}

.chat-reaction span {
  min-width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  right: -4px;
  bottom: -2px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--dark);
  color: #fff;
  font-size: 0.58rem;
  font-weight: 800;
}

.chat-reaction:hover,
.chat-reaction.is-active {
  background: var(--gold);
  transform: translateY(-2px) scale(1.08);
}

.chat-input-wrap {
  position: relative;
}

.chat-reply-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-top: 1px solid rgba(215, 43, 43, 0.08);
  background: #fff8f0;
}

.chat-reply-preview[hidden] {
  display: none;
}

.chat-reply-preview-copy {
  min-width: 0;
  padding-left: 9px;
  border-left: 3px solid var(--red);
}

.chat-reply-preview-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-reply-cancel {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(215, 43, 43, 0.1);
  color: var(--red);
  font-size: 1rem;
  font-weight: 800;
}

.chat-input-wrap input:disabled {
  cursor: not-allowed;
  opacity: 0.78;
}

.chat-emoji-toggle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(215, 43, 43, 0.14);
  background: #fff8f0;
  color: var(--dark);
  font-size: 1rem;
  line-height: 1;
  transition: transform 0.2s, background 0.2s;
}

.chat-emoji-toggle:hover,
.chat-emoji-toggle[aria-expanded="true"] {
  background: var(--cream);
  transform: translateY(-1px);
}

.chat-emoji-toggle:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
}

.chat-emoji-picker {
  position: absolute;
  right: 52px;
  bottom: calc(100% + 8px);
  z-index: 20;
  width: min(236px, calc(100vw - 48px));
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  padding: 10px;
  border: 1px solid rgba(215, 43, 43, 0.14);
  border-radius: 12px;
  background: #fffdf9;
  box-shadow: 0 14px 34px rgba(26, 10, 10, 0.18);
}

.chat-emoji-picker[hidden] {
  display: none;
}

.chat-emoji-option {
  min-width: 0;
  aspect-ratio: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: var(--off-white);
  color: var(--dark);
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1;
  transition: background 0.2s, transform 0.2s;
}

.chat-emoji-option.is-flag {
  font-size: 0.86rem;
  letter-spacing: 0;
}

.chat-emoji-option:hover {
  background: var(--gold);
  transform: translateY(-1px);
}

.chat-send:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
}

.community-room{display:grid;grid-template-columns:1fr 1fr;gap:6%;padding-block:2.6rem;border-top:1px solid var(--line);align-items:start}
.community-room section{min-width:0}#headlines{list-style:none;margin:0;padding:0}
#headlines li{padding:.9rem 0;border-top:1px solid var(--line)}#headlines small{display:block;color:var(--red-dark);font-weight:700;margin-bottom:.25rem}#headlines a{font:bold 1.22rem/1.23 "Barlow Condensed",Arial,sans-serif}#news-status{font-size:.85rem;color:#625750}
.chat-welcome{border-top:3px solid var(--red);background:var(--cream);padding:1.3rem}.chat-welcome button{margin-top:.8rem}.chat-box[hidden],.chat-welcome[hidden]{display:none}
.chat-box{--white:#fff;--off-white:var(--ivory);--dark:var(--ink);--gray:#635959;--light-gray:#f0e8e0;--font-body:inherit;--font-head:inherit;--radius:6px}.chat-input-wrap input{min-width:0}.chat-box button{cursor:pointer}.chat-status:empty{display:none}
@media(max-width:740px){.community-room{grid-template-columns:1fr;gap:2rem}.mast{height:auto;min-height:62px;flex-wrap:wrap;gap:.35rem 1rem;padding-block:.55rem}.mast nav{flex-wrap:wrap;gap:.35rem 1rem}}
