/* Steemeet chat page (/steemeet): three-column dashboard under the site header. Uses the page theme variables
   (--bg, --card, --text, --muted, --gold, --teal, --border), so every WorldBites colour theme applies. */
html, body { height: 100%; }
body { display: flex; flex-direction: column; overflow: hidden; }
body > header { flex: 0 0 auto; }

.sm-app {
  --sm-radius: 16px;
  --sm-teal-soft: rgba(26,155,142,0.09);
  --sm-teal-line: rgba(26,155,142,0.22);
  --sm-shadow: 0 10px 30px rgba(28,45,43,0.06);
  position: relative; flex: 1 1 auto; min-height: 0;
  display: grid; grid-template-columns: 264px minmax(0, 1fr) 256px; gap: 16px;
  width: 100%; max-width: 1280px; margin: 0 auto; padding: 16px 24px 20px; box-sizing: border-box;
}
.sm-visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sm-app svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- shared panels ---------- */
.sm-rooms, .sm-chat, .sm-members {
  min-height: 0; background: var(--card); border: 1px solid var(--border); border-radius: var(--sm-radius); box-shadow: var(--sm-shadow);
}
.sm-btn { font: inherit; font-size: .88rem; font-weight: 700; border-radius: 10px; padding: 9px 14px; cursor: pointer; border: 1.5px solid var(--teal); transition: background .2s, color .2s, opacity .2s; }
.sm-btn:disabled { opacity: .55; cursor: default; }
.sm-btn-primary { background: var(--teal); color: #fff; }
.sm-btn-primary:hover:not(:disabled) { background: #158275; border-color: #158275; }
.sm-btn-ghost { background: transparent; color: var(--teal); }
.sm-btn-ghost:hover:not(:disabled) { background: var(--sm-teal-soft); }
.sm-btn-wide { width: 100%; }
.sm-icon-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; min-width: 38px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--card); color: var(--text); cursor: pointer; font: inherit; font-size: .85rem; font-weight: 700; }
.sm-icon-btn svg { width: 18px; height: 18px; }
.sm-icon-btn:hover { border-color: var(--teal); color: var(--teal); }
.sm-only-mobile { display: none; }

/* ---------- left: rooms ---------- */
.sm-rooms { display: flex; flex-direction: column; padding: 18px 14px 14px; overflow: hidden; }
.sm-brand { display: flex; align-items: center; gap: 12px; padding: 0 6px 16px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.sm-brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, var(--teal), #0f6f66); color: #fff; box-shadow: 0 4px 12px rgba(26,155,142,0.3); }
.sm-brand-mark svg { width: 20px; height: 20px; fill: rgba(255,255,255,0.18); }
.sm-brand-name { font-family: Georgia, 'Times New Roman', serif; font-size: 1.3rem; font-weight: 700; letter-spacing: .2px; color: var(--text); }
.sm-brand-sub { font-size: .76rem; color: var(--muted); margin-top: 2px; }
.sm-section-label { font-size: .7rem; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); padding: 0 8px 8px; }
.sm-room-list { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1 1 auto; min-height: 0; margin: 0 -4px; padding: 0 4px; }
.sm-room { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 10px; text-decoration: none; color: var(--text); font-size: .94rem; font-weight: 500; transition: background .15s, color .15s; }
.sm-room:hover { background: var(--sm-teal-soft); }
.sm-room.is-active { background: var(--teal); color: #fff; font-weight: 700; box-shadow: 0 4px 12px rgba(26,155,142,0.25); }
.sm-room-hash { color: var(--teal); font-weight: 700; opacity: .8; }
.sm-room.is-active .sm-room-hash { color: rgba(255,255,255,0.8); }
.sm-room-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sm-room-lock { width: 14px; height: 14px; opacity: .6; flex-shrink: 0; }
.sm-room-tag { font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--gold); border: 1px solid currentColor; border-radius: 999px; padding: 1px 6px; opacity: .85; }
.sm-room.is-active .sm-room-tag { color: #fff; }

.sm-new-topic { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 12px; padding: 11px 12px; border-radius: 12px; border: 1.5px dashed var(--teal); background: transparent; color: var(--teal); font: inherit; font-size: .9rem; font-weight: 700; cursor: pointer; transition: background .2s; }
.sm-new-topic svg { width: 16px; height: 16px; stroke-width: 2.6; }
.sm-new-topic:hover { background: var(--sm-teal-soft); border-style: solid; }
.sm-new-topic[hidden] { display: none; }
.sm-topic-form { margin-top: 12px; padding: 12px; border-radius: 12px; background: var(--sm-teal-soft); border: 1px solid var(--sm-teal-line); }
.sm-topic-input { display: flex; align-items: center; gap: 4px; background: var(--card); border: 1.5px solid var(--border); border-radius: 10px; padding: 0 10px; }
.sm-topic-input:focus-within { border-color: var(--teal); }
.sm-topic-input span { color: var(--teal); font-weight: 700; }
.sm-topic-input input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; padding: 9px 0; font: inherit; font-size: .9rem; color: var(--text); }
.sm-topic-actions { display: flex; gap: 8px; margin-top: 10px; }
.sm-topic-actions .sm-btn { flex: 1; padding: 7px 10px; }
.sm-topic-msg { margin: 8px 0 0; font-size: .78rem; color: #c0392b; min-height: 0; }
.sm-topic-msg:empty { display: none; }

.sm-me { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 12px 8px 0; border-top: 1px solid var(--border); }
.sm-me[hidden] { display: none; }
.sm-me-text { display: flex; flex-direction: column; min-width: 0; }
.sm-me-name { font-weight: 700; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; }
.sm-me-status { font-size: .74rem; color: var(--teal); font-weight: 600; }

/* ---------- avatars & badges ---------- */
.sm-avatar { position: relative; display: inline-grid; place-items: center; flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, var(--teal), var(--gold)); color: #fff; font-weight: 800; font-size: 1rem; }
.sm-avatar::before { content: attr(data-initial); }
.sm-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: var(--card); }
.sm-avatar-sm { width: 32px; height: 32px; font-size: .82rem; }
.sm-avatar.is-online::after { content: ''; position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; background: #22c55e; border: 2px solid var(--card); z-index: 1; }

.sm-badge { display: inline-flex; align-items: center; font-size: .66rem; font-weight: 800; letter-spacing: .3px; line-height: 1; padding: 3px 7px; border-radius: 999px; white-space: nowrap; border: 1px solid transparent; }
.sm-badge-loading { color: var(--muted); background: var(--sm-teal-soft); }
.sm-badge-l0 { color: var(--muted); background: transparent; border-color: var(--border); }
.sm-badge-l1 { color: #0f766e; background: rgba(20,184,166,0.12); border-color: rgba(20,184,166,0.3); }
.sm-badge-l2 { color: #1d4ed8; background: rgba(59,130,246,0.1); border-color: rgba(59,130,246,0.28); }
.sm-badge-l3 { color: #8a6d0b; background: linear-gradient(135deg, rgba(212,175,55,0.2), rgba(184,150,15,0.1)); border-color: rgba(184,150,15,0.45); }
.sm-badge-team { color: #fff; background: var(--teal); }

/* ---------- main: chat ---------- */
.sm-chat { position: relative; display: flex; flex-direction: column; overflow: hidden; }
.sm-chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.sm-chat-title { flex: 1 1 auto; min-width: 0; }
.sm-chat-title h1 { margin: 0; font-family: Georgia, 'Times New Roman', serif; font-size: 1.3rem; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm-hash { color: var(--teal); margin-right: 2px; }
.sm-chat-title p { margin: 2px 0 0; font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm-chat-title p:empty { display: none; }
.sm-live { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 700; color: var(--muted); padding: 5px 10px; border-radius: 999px; background: var(--sm-teal-soft); white-space: nowrap; }
.sm-live-dot { width: 8px; height: 8px; border-radius: 50%; background: #f59e0b; }
.sm-live[data-status="live"] { color: var(--teal); }
.sm-live[data-status="live"] .sm-live-dot { background: #22c55e; box-shadow: 0 0 0 0 rgba(34,197,94,0.6); animation: sm-pulse 2s infinite; }
.sm-live[data-status="offline"] .sm-live-dot { background: #94a3b8; }
@keyframes sm-pulse { 0% { box-shadow: 0 0 0 0 rgba(34,197,94,0.55); } 70% { box-shadow: 0 0 0 7px rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }
.sm-online-toggle { display: none; }

.sm-feed { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 12px 6px 12px 0; scroll-behavior: auto; outline: none; }
.sm-day { display: flex; align-items: center; gap: 12px; margin: 14px 18px 8px; font-size: .72rem; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); }
.sm-day::before, .sm-day::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.sm-msg { display: grid; grid-template-columns: 56px minmax(0, 1fr); padding: 6px 18px 4px 6px; margin-top: 8px; border-radius: 0 12px 12px 0; transition: background .15s; }
.sm-msg.is-cont { margin-top: 0; padding-top: 1px; padding-bottom: 2px; }
.sm-msg:hover { background: var(--sm-teal-soft); }
.sm-msg-side { display: flex; justify-content: center; padding-top: 2px; text-decoration: none; }
.sm-msg.is-cont .sm-msg-side { font-size: .66rem; color: var(--muted); padding-top: 4px; opacity: 0; }
.sm-msg.is-cont:hover .sm-msg-side { opacity: 1; }
.sm-msg-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; margin-bottom: 2px; }
.sm-msg-author { font-weight: 800; font-size: .94rem; color: var(--text); text-decoration: none; }
.sm-msg-author:hover { color: var(--teal); }
.sm-msg.is-mine .sm-msg-author { color: var(--teal); }
.sm-msg-head time { font-size: .74rem; color: var(--muted); }
.sm-msg-body { font-size: .95rem; line-height: 1.5; color: var(--text); overflow-wrap: anywhere; }
.sm-msg-body a { color: var(--teal); }
.sm-mention { font-weight: 700; text-decoration: none; background: var(--sm-teal-soft); padding: 0 3px; border-radius: 4px; }
.sm-mention.is-me { background: rgba(212,175,55,0.22); color: #8a6d0b !important; }

.sm-empty { display: flex; flex-direction: column; align-items: flex-start; padding: 40px 28px; color: var(--muted); }
.sm-empty-hash { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--sm-teal-soft); color: var(--teal); font-family: Georgia, serif; font-size: 1.8rem; font-weight: 700; margin-bottom: 14px; }
.sm-empty h3 { margin: 0 0 6px; font-family: Georgia, 'Times New Roman', serif; font-size: 1.4rem; color: var(--text); }
.sm-empty p { margin: 0; }
.sm-loading { display: flex; justify-content: center; gap: 6px; padding: 40px 0; }
.sm-loading span { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); opacity: .35; animation: sm-dot 1s infinite ease-in-out; }
.sm-loading span:nth-child(2) { animation-delay: .15s; }
.sm-loading span:nth-child(3) { animation-delay: .3s; }
@keyframes sm-dot { 0%, 100% { opacity: .25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-4px); } }

.sm-jump { position: absolute; left: 50%; bottom: 92px; transform: translateX(-50%); padding: 7px 14px; border-radius: 999px; border: 0; background: var(--teal); color: #fff; font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer; box-shadow: 0 6px 16px rgba(26,155,142,0.35); z-index: 2; }

.sm-composer { display: flex; align-items: flex-end; gap: 10px; margin: 0 16px; padding: 8px 8px 8px 16px; border: 1.5px solid var(--border); border-radius: 14px; background: var(--bg); transition: border-color .2s, box-shadow .2s; }
.sm-composer:focus-within { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(26,155,142,0.12); background: var(--card); }
.sm-composer textarea { flex: 1; min-width: 0; resize: none; border: 0; outline: 0; background: transparent; font: inherit; font-size: .95rem; line-height: 1.45; color: var(--text); padding: 7px 0; max-height: 160px; }
.sm-composer textarea:disabled { cursor: not-allowed; }
.sm-send { display: grid; place-items: center; flex-shrink: 0; width: 38px; height: 38px; border-radius: 10px; border: 0; background: var(--teal); color: #fff; cursor: pointer; transition: opacity .2s, transform .15s; }
.sm-send svg { width: 18px; height: 18px; fill: rgba(255,255,255,0.25); }
.sm-send:disabled { opacity: .4; cursor: default; }
.sm-composer-note { margin: 6px 18px 12px; min-height: 1em; font-size: .76rem; color: #c0392b; }
.sm-composer-note:empty::before { content: 'Enter to send · Shift + Enter for a new line'; color: var(--muted); }

/* ---------- right: members ---------- */
.sm-members { display: flex; flex-direction: column; padding: 18px 14px; overflow: hidden; }
.sm-members-head { display: flex; align-items: center; justify-content: space-between; padding: 0 6px; }
.sm-members-head h2 { margin: 0; font-size: .74rem; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); }
.sm-count { min-width: 22px; padding: 2px 8px; border-radius: 999px; background: var(--teal); color: #fff; font-size: .74rem; font-weight: 800; text-align: center; }
.sm-members-room { margin: 6px 6px 12px; font-size: .8rem; color: var(--muted); }
.sm-members-room strong { color: var(--teal); }
.sm-member-list { list-style: none; margin: 0 -4px; padding: 0 4px; overflow-y: auto; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 2px; }
.sm-member-link { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; text-decoration: none; color: var(--text); }
.sm-member-link:hover { background: var(--sm-teal-soft); }
.sm-member-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sm-member-name { font-size: .88rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sm-member-rank { display: flex; gap: 4px; }
.sm-you { font-size: .66rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.sm-member-empty { padding: 8px; font-size: .84rem; color: var(--muted); }

/* ---------- guest guard ---------- */
.sm-guard { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; padding: 24px; background: color-mix(in srgb, var(--bg) 55%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.sm-guard[hidden] { display: none; }
.sm-guard-card { width: 100%; max-width: 420px; max-height: 100%; overflow-y: auto; box-sizing: border-box; padding: 30px 28px 24px; border-radius: 20px; background: var(--card); border: 1px solid var(--border); box-shadow: 0 24px 60px rgba(28,45,43,0.18); text-align: center; }
.sm-guard-icon { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--sm-teal-soft); color: var(--teal); margin-bottom: 14px; }
.sm-guard-icon svg { width: 26px; height: 26px; }
.sm-guard-card h2 { margin: 0 0 8px; font-family: Georgia, 'Times New Roman', serif; font-size: 1.45rem; color: var(--text); }
.sm-guard-lead { margin: 0 0 20px; font-size: .9rem; line-height: 1.5; color: var(--muted); }
.sm-guard-login { display: flex; flex-direction: column; gap: 10px; }
.sm-guard-login[hidden], .sm-guard-verify[hidden] { display: none; }
.sm-guard-login input { font: inherit; font-size: .95rem; padding: 11px 14px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--bg); color: var(--text); outline: none; }
.sm-guard-login input:focus { border-color: var(--teal); background: var(--card); }
.sm-guard-login .sm-btn, .sm-guard-verify .sm-btn { padding: 11px 14px; font-size: .95rem; }
.sm-guard-fine { margin: 2px 0 0; font-size: .74rem; color: var(--muted); line-height: 1.4; }
.sm-guard-msg { margin: 12px 0 0; font-size: .84rem; color: var(--teal); }
.sm-guard-msg:empty { display: none; }
.sm-guard-msg.is-error { color: #c0392b; }
.sm-guard-links { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); font-size: .84rem; color: var(--muted); display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.sm-guard-links a { color: var(--teal); font-weight: 700; text-decoration: none; }
.sm-guard-links a:hover { text-decoration: underline; }
.sm-app[data-state="guest"] .sm-rooms, .sm-app[data-state="guest"] .sm-chat, .sm-app[data-state="guest"] .sm-members { filter: blur(1.5px); pointer-events: none; user-select: none; }

/* placeholder conversation shown behind the guard */
.sm-ghost { display: flex; gap: 14px; padding: 12px 18px; }
.sm-ghost-av { width: 40px; height: 40px; border-radius: 50%; background: var(--sm-teal-line); flex-shrink: 0; }
.sm-ghost > div { flex: 1; display: flex; flex-direction: column; gap: 7px; padding-top: 3px; }
.sm-ghost-line { display: block; height: 10px; border-radius: 6px; background: var(--border); }
.sm-ghost-line.w-20 { width: 20%; background: var(--sm-teal-line); }
.sm-ghost-line.w-30 { width: 30%; } .sm-ghost-line.w-40 { width: 40%; } .sm-ghost-line.w-45 { width: 45%; }
.sm-ghost-line.w-50 { width: 50%; } .sm-ghost-line.w-60 { width: 60%; } .sm-ghost-line.w-65 { width: 65%; }
.sm-ghost-line.w-70 { width: 70%; } .sm-ghost-line.w-80 { width: 80%; }

.sm-scrim { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .sm-app { grid-template-columns: 240px minmax(0, 1fr); }
  .sm-online-toggle { display: inline-flex; }
  .sm-members { position: absolute; top: 16px; right: 24px; bottom: 20px; width: 280px; z-index: 15; transform: translateX(calc(100% + 32px)); transition: transform .25s ease; visibility: hidden; }
  .sm-app.show-members .sm-members { transform: none; visibility: visible; }
  .sm-scrim { position: absolute; inset: 0; z-index: 14; background: rgba(15,23,22,0.25); border-radius: 0; }
  .sm-scrim:not([hidden]) { display: block; }
}
@media (max-width: 760px) {
  .sm-app { grid-template-columns: minmax(0, 1fr); padding: 10px 10px 12px; gap: 0; }
  .sm-only-mobile { display: inline-flex; }
  .sm-rooms { position: absolute; top: 10px; left: 10px; bottom: 12px; width: min(290px, calc(100% - 40px)); z-index: 15; transform: translateX(calc(-100% - 24px)); transition: transform .25s ease; visibility: hidden; }
  .sm-app.show-rooms .sm-rooms { transform: none; visibility: visible; }
  .sm-members { top: 10px; right: 10px; bottom: 12px; width: min(280px, calc(100% - 40px)); }
  .sm-chat-head { padding: 10px 12px; gap: 8px; }
  .sm-chat-title h1 { font-size: 1.1rem; }
  .sm-live { padding: 5px 8px; }
  .sm-live #smLiveText { display: none; }
  .sm-msg { grid-template-columns: 48px minmax(0, 1fr); padding-right: 12px; }
  .sm-avatar { width: 34px; height: 34px; }
  .sm-avatar-sm { width: 30px; height: 30px; }
  .sm-composer { margin: 0 10px; }
  .sm-composer-note { margin: 6px 12px 8px; }
  .sm-guard { padding: 14px; align-items: start; }
  .sm-guard-card { padding: 24px 20px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .sm-live-dot, .sm-loading span { animation: none !important; }
  .sm-rooms, .sm-members { transition: none !important; }
}
