html, body{
  max-width:100%;
  overflow-x:hidden;
}

/*
  realtime_spa.css
  Minimal CSS additions needed for the SPA wiring in web/app.js.
  It intentionally avoids resetting global styles so it can coexist with
  the phase-1 theme CSS.
*/

/* ------------------------------
   Discord-like 4-column layout
   ------------------------------ */

/*
  IMPORTANT:
  The SPA toggles between the 4-column shell and standalone pages
  using the HTML `hidden` attribute in web/app.js.
  Our layout classes set `display:flex`, which can override `hidden`
  in some UA stylesheets unless we force it.
*/
[hidden]{
  display: none !important;
}

.rt-app{
  height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  padding: 14px;
  gap: 12px;
  box-sizing: border-box;
}

/* Standalone layout for pages that must not use the shell (welcome/error) */
.rt-standalone{
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  box-sizing: border-box;
}

/* ------------------------------
   Standalone Welcome (ported from old welcome.html behavior)
   ------------------------------ */
.rt-welcome{
  min-height: 100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 24px;
  box-sizing: border-box;
}

.center{
  position: relative;
  width: min(920px, 92vw);
  min-height: 220px;
  display:flex;
  align-items:center;
  justify-content:center;
}

.center .scrim{
  position:absolute;
  inset: 0;
  border-radius: 18px;
  background: rgba(0,0,0,0.40);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: 0 18px 60px rgba(0,0,0,0.55);
}

.welcome-text{
  position: relative;
  z-index: 1;
  text-align:center;
  font-size: clamp(34px, 5vw, 62px);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.1;
  text-shadow: 0 0 18px rgba(255,255,255,0.16), 0 0 42px rgba(255,255,255,0.10);
  opacity: 0;
  transform: translateY(10px);
  animation: welcomeFadeIn 800ms ease-out forwards;
}

@keyframes welcomeFadeIn{
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.rt-standalone > #standalone-view{
  width: min(720px, 100%);
}

.rt-shell{
  position:relative;
  display:grid;
  grid-template-columns: 72px 224px 1fr 224px;
  flex: 1;
  min-height: 0; /* allow children to scroll */
  gap: 12px;
  padding: 0;
  box-sizing: border-box;
}

.rt-iconbar,
.rt-left,
.rt-main,
.rt-right{
  border-radius: 16px;
  background: rgba(10,14,22,0.62);
  border: 1px solid rgba(255,255,255,0.10);
  backdrop-filter: blur(14px);
}

.rt-iconbar{
  display:flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 10px;
  gap: 10px;
}

.rt-icon{
  width: 48px;
  height: 48px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius: 14px;
  text-decoration:none;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
  font-size: 22px;
}
.rt-icon:hover{ transform: translateY(-1px); background: rgba(255,255,255,0.10); }
.rt-icon.active{ background: rgba(255,255,255,0.14); border-color: rgba(255,255,255,0.18); }

.rt-left,
.rt-right{
  overflow-y: auto;
  overflow-x: hidden;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.rt-left::-webkit-scrollbar,
.rt-right::-webkit-scrollbar{
  width: 0;
  height: 0;
}

.rt-pane{
  padding: 14px;
  height: 100%;
  box-sizing: border-box;
}

.rt-pane__title{
  font-weight: 800;
  letter-spacing: 0.2px;
}

.rt-side-list{
  display:flex;
  flex-direction: column;
  gap: 6px;
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

.rt-side-item{
  appearance: none;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.05);
  color: inherit;
  border-radius: 12px;
  padding: 10px 10px;
  text-align:left;
  cursor:pointer;
}
.rt-side-item:hover{ background: rgba(255,255,255,0.09); }
.rt-side-item.active{ background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.16); }

.rt-main{
  display:flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.rt-main::-webkit-scrollbar{
  width: 0;
  height: 0;
}

/* Main bar (3rd column only) */
.rt-mainbar{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  min-height: 56px;
  height: 56px;
  box-sizing: border-box;
  border: 1px solid rgba(230,238,245,.14);
  border-bottom: 1px solid rgba(230,238,245,.14);
  border-radius: 16px;
  background: var(--grad-primary);
  box-shadow: 0 6px 20px rgba(0,0,0,.35);
  backdrop-filter: blur(14px);
  overflow: hidden;
}
.rt-mainbar__left{
  font-weight: 900;
  letter-spacing: .2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rt-mainbar__right{
  display:flex;
  align-items:center;
  gap: 10px;
  flex-shrink: 0;
  white-space: nowrap;
}

.rt-topbar{
  position: relative;
  /* Ensure titlebar overlays (user menu) sit above the 4-column shell */
  z-index: 6000;
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  margin: 0;
  border-radius: 16px;

  /* Project titlebar styling (match Phase-1 titlebar look) */
  background: var(--grad-primary);
  border: 1px solid rgba(230,238,245,.14);
  box-shadow: 0 6px 20px rgba(0,0,0,.35);
  backdrop-filter: blur(14px);
}

/* Footnote bar */
.rt-footbar{
  display:flex;
  align-items:center;
  justify-content: space-between;
  padding: 6px 10px;
  min-height: 28px;
  border-radius: 14px;
  background: rgba(10,14,22,0.40);
  border: 1px solid rgba(255,255,255,0.10);
  backdrop-filter: blur(12px);
}
.rt-footbar__left,
.rt-footbar__right{
  display:flex;
  align-items:center;
  gap: 10px;
}

.rt-topbar__left{ display:flex; align-items:center; min-width: 0; gap: 12px; }
.rt-topbar__title{
  /* Use bundled project font */
  font-family: 'Allura', cursive;
  font-weight: 400;
  font-size: 35px;
  letter-spacing: 1px;
  line-height: 1.1;
  color: var(--title-color);
  text-shadow: 0 10px 30px rgba(0,0,0,.35);
}

 .rt-topbar__title:hover{ opacity: .94; }
.rt-topbar__title:focus-visible{ outline: 2px solid rgba(230,238,245,.45); outline-offset: 4px; border-radius: 10px; }

/* Ensure topbar icons are clearly visible on the gradient background */
.rt-topbar .titlebar__actions{ color: var(--title-color); }
.rt-topbar .titlebar__actions .btn{
  color: var(--title-color);
}
.rt-topbar .titlebar__actions .btn.btn-ghost{
  background: rgba(0,0,0,.10);
  border: 1px solid rgba(230,238,245,.14);
}
.rt-topbar .titlebar__actions .btn.btn-ghost:hover{
  background: rgba(255,255,255,.06);
  box-shadow: 0 0 0 1px rgba(230,238,245,.10), 0 4px 12px rgba(0,0,0,.18);
}

/* Keep icon buttons geometry stable regardless of badge updates */
.rt-topbar .titlebar__actions .icon-button{
  position: relative;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  line-height: 1;
  overflow: visible;
  flex: 0 0 40px;
}

/* Topbar icon sizing: keep button size, enlarge SVG glyphs reliably */
.rt-topbar .titlebar__actions .icon-button .topbar-icon{
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  display: block;
}

/* Notification count badge: brighter + easier to read */
.rt-topbar .badge{
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255,107,107,.55);
  background: rgba(255,107,107,.22);
  color: #ffdddd;
  font-weight: 900;
  font-size: 12px;
  line-height: 1;
  box-shadow: var(--glow-red);
}
.rt-topbar .badge--corner{
  top: 0;
  left: 0;
  right: auto;
  transform: translate(-38%, -38%);
  z-index: 2;
  pointer-events: none;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

/* Left-side topbar actions (e.g., Create post) */
.rt-topbar__leftActions{ display:flex; align-items:center; gap: 10px; }

.rt-view{
  flex: 1;
  min-height: 0;
  overflow:auto;
  padding: 14px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.rt-view::-webkit-scrollbar{ width:0; height:0; }

/* Make legacy sections breathe inside rt-view */
.rt-view .card{ width: 100%; }

/* tighten posts grid padding since rt-view already has padding */
.posts-grid{ margin-top: 0 !important; }





/* -- sidebar: contacts (presence list) -- */
.muted {
  color: var(--muted);
  opacity: 0.9;
}

.contacts-search {
  width: 100%;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  outline: none;
}

.contacts-search::placeholder {
  color: rgba(255,255,255,0.55);
}

.contacts-search:focus {
  border-color: rgba(100,108,255,0.55);
  box-shadow: 0 0 0 3px rgba(100,108,255,0.18);
}

.contact-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-section + .contact-section {
  margin-top: 14px;
}

.contact-section-title {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: rgba(255,255,255,0.72);
  margin: 2px 2px 4px;
  padding: 6px 6px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  cursor: pointer;
}

.contact-section-title:hover {
  background: rgba(255,255,255,0.05);
}

.contact-section-title__left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.contact-section-chevron {
  opacity: 0.9;
  width: 14px;
  display: inline-flex;
  justify-content: center;
}

.contact-section-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contact-section-count {
  font-size: 12px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.86);
}

.contact-sort-toggle {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.02);
  color: rgba(255,255,255,0.78);
  user-select: none;
}

.contact-sort-toggle:hover {
  background: rgba(255,255,255,0.05);
}

.contact-sort-toggle:focus-visible {
  outline: 2px solid rgba(100,108,255,0.35);
  outline-offset: 2px;
}

.contacts {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  cursor: pointer;
}

.contact:hover {
  background: rgba(255,255,255,0.06);
}

.contact.active {
  outline: 2px solid rgba(100, 108, 255, 0.35);
}

.contact .dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.25);
  flex: 0 0 auto;
}

.contact .dot.on {
  background: #3ad29f;
}

.contact .dot.off {
  background: rgba(255,255,255,0.25);
}

.contact-main {
  flex: 1 1 auto;
  min-width: 0;
}

.contact-name {
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contact-sub {
  font-size: 12px;
  opacity: 0.8;
  margin-top: 2px;
}

.badge-unread {
  margin-left: auto;
  background: rgba(255, 80, 80, 0.18);
  border: 1px solid rgba(255, 80, 80, 0.35);
  color: rgba(255, 235, 235, 0.95);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.badge-unread--sm {
  padding: 2px 7px;
  font-size: 11px;
}

/* -- chat view -- */
.chat-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.chat-title {
  margin: 0;
  font-size: 18px;
}

.typing-indicator {
  font-size: 12px;
  opacity: 0.85;
  min-height: 18px;
}

/* Typing indicator: pill styling (used in chat underbar) */
.chat-underbar .typing-indicator{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.92);
  font-weight: 650;
  letter-spacing: 0.2px;
}

.chat-underbar .typing-indicator:empty{
  display: none;
}

.chat-underbar .typing-indicator{
  font-size: 12px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.typing-dots {
  display: inline-flex;
  gap: 4px;
  margin-left: 8px;
  vertical-align: middle;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.25;
  animation: rt-blink 1.2s infinite;
}
.typing-dots span:nth-child(2){animation-delay:0.2s}
.typing-dots span:nth-child(3){animation-delay:0.4s}
@keyframes rt-blink{0%,100%{opacity:0.25} 50%{opacity:0.9}}

.chat-messages {
  flex: 1;
  min-height: 240px;
  overflow: auto;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 14px;
  padding: 10px;
  background: rgba(0,0,0,0.12);
}

.chat-bubble {
  max-width: 78%;
  overflow-wrap: anywhere;  white-space: normal;
word-break: break-word;
  width: fit-content;
  min-width: 0;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 14px;
  padding: 10px 12px;
  margin: 8px 0;
  background: rgba(255,255,255,0.05);
}

.chat-bubble.me {
  margin-left: auto;
  background: rgba(100, 108, 255, 0.15);
  border-color: rgba(100, 108, 255, 0.25);
}

.chat-bubble-head {
  font-size: 12px;
  opacity: 0.85;
  margin-bottom: 4px;
}


.chat-bubble-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.chat-input {
  display: flex;
  gap: 10px;
}

.chat-input input {
  flex: 1 1 auto;
}


.chat-input textarea,
.chat-input .chat-input__textarea {
  flex: 1 1 auto;
  resize: none;
  min-height: 38px;
  max-height: 140px;
  overflow-y: hidden;
  line-height: 1.35;
  white-space: pre-wrap;
}
/* -- toast -- */
.rt-toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.75);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  padding: 10px 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
  z-index: 9999;
}

.rt-toast.show { opacity: 1; }

.rt-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  font-size: 12px;
}

.rt-pill.ok { border-color: rgba(58,210,159,0.35); }

.rt-pill.bad { border-color: rgba(255,80,80,0.35); }

/* =========================================================
   SPA: Reports → New Report page
   Scoped to .report-new so it won't affect other pages.
   ========================================================= */

.settings-wrapper.report-new {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 18px;
}

.report-new .report-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
  justify-content: flex-start;
  margin-bottom: 12px;
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(56,189,148,.10), rgba(99,102,241,.12));
  border: 1px solid var(--border);
  box-shadow: 0 10px 24px rgba(0,0,0,.10);
}

.report-new .cardish {
  background: var(--surface-bg);
  border: 1px solid var(--surface-border);
  border-radius: 18px;
  padding: 14px;
  margin: 12px 0;
}

.report-new .target-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255,86,86,.10);
  border: 1px solid rgba(255,86,86,.28);
  font-weight: 700;
}

.report-new .tt { text-transform: capitalize; }

.report-new .prewrap {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.report-new .report-form {
  max-width: none;
  width: 100%;
}

.report-new .row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.report-new .actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: space-between;
  margin-top: 12px;
}




@media (max-width: 1024px){
  
/* Report form actions: stack buttons on mobile */
.report-new .actions { flex-direction: column; align-items: stretch; }
.report-new .actions > div:last-child { display: flex; justify-content: flex-end; }
/* Mobile: content-first shell (main column only by default) */
  .rt-app{
    padding: 10px;
    gap: 10px;
    height: 100dvh;
    min-height: 100dvh;
  }

  .rt-shell{
    grid-template-columns: minmax(0, 1fr) !important;
    grid-auto-rows: minmax(0, 1fr);
    gap: 0;
    min-height: 0;
    height: 100%;
    position: relative;
  }

  /* First toolbar is not needed on mobile */
  .rt-iconbar{
    display: none !important;
  }

  /* Mobile side panels are overlay drawers (hidden by default) */
  .rt-left,
  .rt-right{
    display: block !important;
    position: fixed;
    top: calc(var(--mobile-topbar-bottom, 64px) + 8px);
    bottom: max(10px, env(safe-area-inset-bottom));
    /* Mobile drawer width: reduced by ~30% */
    width: var(--mobile-panel-w);
    z-index: 230;
    /* Enable vertical scrolling inside drawers (hide scrollbar) */
    overflow-y: auto;
    overflow-x: hidden;
    -ms-overflow-style: none;
    scrollbar-width: none;
    box-shadow: 0 18px 40px rgba(0,0,0,.42);
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(10,14,22,0.92);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    touch-action: pan-y;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: transform .24s ease, opacity .2s ease, visibility 0s linear .24s;
    will-change: transform, opacity;
  }

  .rt-left::-webkit-scrollbar,
  .rt-right::-webkit-scrollbar{
    width: 0;
    height: 0;
  }
  .rt-left{
    left: max(10px, env(safe-area-inset-left));
    transform: translateX(calc(-100% - 18px));
  }
  .rt-right{
    right: max(10px, env(safe-area-inset-right));
    transform: translateX(calc(100% + 18px));
  }

  .rt-main{
    grid-column: 1 / -1;
    min-width: 0;
    width: 100%;
    min-height: 0;
    height: 100%;
    overflow: hidden;
    touch-action: pan-y;
  }

  .rt-view{
    min-width: 0;
    width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
    touch-action: pan-y;
  }
  .rt-view::-webkit-scrollbar{ width:0; height:0; }

  /* Open states for animated overlay drawers */
  body.mobile-nav-open .rt-left,
  body.mobile-aside-open .rt-right{
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transition: transform .24s ease, opacity .2s ease;
  }
  body.mobile-nav-open .rt-left{ transform: translateX(0); }
  body.mobile-aside-open .rt-right{ transform: translateX(0); }

  /* Optional shared mobile backdrop hook */
  .shell-backdrop{
    position: fixed;
    inset: 0;
    background: rgba(2,6,23,.56);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
    z-index: 220;
  }
  body.mobile-nav-open .shell-backdrop,
  body.mobile-aside-open .shell-backdrop{
    opacity: 1;
    pointer-events: auto;
  }
}


/* Mobile: subtle "pull handle" protrusions to hint side drawers exist */
@media (max-width: 1024px) {
  body.mobile-shell-ready:not(.mobile-nav-open)::before {
    content: "";
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 64px;
    border-radius: 0 10px 10px 0;
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.18);
    box-shadow: 0 0 10px rgba(255,255,255,0.12);
    pointer-events: none;
    z-index: 9998;
  }

  body.mobile-shell-ready:not(.mobile-aside-open)::after {
    content: "";
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 64px;
    border-radius: 10px 0 0 10px;
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.18);
    box-shadow: 0 0 10px rgba(255,255,255,0.12);
    pointer-events: none;
    z-index: 9998;
  }
}






/* Mobile drawer width override for extended mobile mode (large tablets included) */
.chat-input-note {
  font-size: 11px;
  opacity: 0.75;
  margin-top: 4px;
  line-height: 1.2;
}

/* Chat composer layout */
.chat-input {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.chat-input-main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.chat-input-main .chat-input__textarea {
  width: 100%;
}
.chat-input-note {
  align-self: flex-start;
}
.chat-input #chat-send {
  flex: 0 0 auto;
  height: 38px;
  line-height: 38px;
  padding-top: 0;
  padding-bottom: 0;
}

.chat-input-main #typing-ind {
  margin-top: 4px;
  font-size: 11px;
  opacity: 0.8;
}

.chat-input #chat-send {
  width: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.chat-input #chat-send svg {
  display: block;
  fill: currentColor;
}
/* Chat send icon button fixes */
.chat-input { align-items: flex-start; }
.chat-input #chat-send {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex: 0 0 auto;
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
  user-select: none;
  position: relative;
  z-index: 5;
  background: -glow;
  border: 1px solid rgba(255,255,255,0.18);
  color: #fff !important;
}
.chat-input #chat-send:active { transform: translateY(1px); }
.chat-input #chat-send .icon-btn,
.chat-input #chat-send svg {
  pointer-events: none;
}
.chat-input #chat-send svg,
.chat-input #chat-send svg path {
  fill: #fff !important;
}
/* NOTE: Do not force-hide #chat-send.
   The send button must remain visible + clickable so chat can work. */

/* Last-resort safety override: if any future rule accidentally disables/hides it,
   this keeps it clickable and visible within the composer. */
html body .chat-input #chat-send{
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}


/* ------------------------------
   Text box remaining counter
   ------------------------------ */
.textbox-remaining{
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.25;
  opacity: 0.86;
  text-align: right;
  white-space: nowrap;
  width: 100%;
  color: rgba(255, 255, 255, 0.78);
}
.textbox-remaining.is-warn{
  opacity: 1;
  color: rgba(255, 210, 120, 0.98);
}
.textbox-remaining.is-error{
  opacity: 1;
  color: rgba(255, 110, 110, 0.98);
  font-weight: 700;
}

/* Chat: single underbar line (tip + typing + remaining on right) */
.chat-underbar{margin-top:6px;display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:16px;}
.chat-underbar__left{display:flex;align-items:center;gap:10px;min-width:0;flex:1 1 auto;overflow:hidden;}
.chat-underbar__tip{font-size:12px;line-height:1.25;opacity:.75;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
/* typing-indicator styling is defined earlier as a pill within .chat-underbar */
.chat-underbar__remaining{margin-top:0;text-align:right;white-space:nowrap;flex:0 0 auto;width:auto;}
