/* ==========================================================================
   style.css —— 移动端优先的聊天室样式
   适配要点：
   1. 用 dvh + env(safe-area-inset-*) 处理手机浏览器地址栏伸缩和 iPhone 刘海/横条；
   2. 所有可点区域不小于 40px，方便手指点；
   3. 输入框字号 >= 16px，避免 iOS Safari 聚焦时自动放大页面；
   4. 自动跟随系统深浅色。
   ========================================================================== */

:root {
  --bg: #eef1f6;
  --panel: #ffffff;
  --text: #1b1f2a;
  --muted: #7b8394;
  --line: #e6e9f1;
  --brand: #4f7cff;
  --brand-2: #6a5cff;
  --own-bg: linear-gradient(135deg, #4f7cff, #6a5cff);
  --other-bg: #ffffff;
  --danger: #e5484d;
  --shadow: 0 6px 24px rgba(24, 33, 61, .10);
  --radius: 18px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1116;
    --panel: #171a21;
    --text: #e8ebf2;
    --muted: #8c93a5;
    --line: #262a34;
    --other-bg: #21252f;
    --shadow: 0 6px 24px rgba(0, 0, 0, .45);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC",
               "HarmonyOS Sans", "Noto Sans SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  overscroll-behavior-y: none;   /* 防止在聊天列表顶端下拉时触发整页橡皮筋 */
}

button, input, textarea { font-family: inherit; font-size: 16px; color: inherit; }
button { cursor: pointer; border: none; background: none; }
.hidden { display: none !important; }

/* 每个「页面」都是全屏的竖向 flex 容器。
   高度优先用 dvh（跟着手机浏览器地址栏伸缩）；JS 检测到 visualViewport 时
   会给 <html> 加 .has-vv，改用实时高度 —— 这样软键盘弹出时输入框不会被遮住。 */
.screen {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

@supports (height: 100dvh) {
  .screen { height: 100dvh; }
}

html.has-vv .screen {
  top: var(--app-top, 0px);
  height: var(--app-height, 100vh);
}

/* ==========================================================================
   一、登录页
   ========================================================================== */
.login {
  align-items: center;
  justify-content: center;
  padding: calc(20px + var(--safe-top)) 20px calc(20px + var(--safe-bottom));
  background:
    radial-gradient(1000px 480px at 15% -10%, rgba(79, 124, 255, .28), transparent 60%),
    radial-gradient(900px 460px at 110% 15%, rgba(106, 92, 255, .26), transparent 55%),
    var(--bg);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--panel);
  border-radius: 24px;
  padding: 28px 22px 24px;
  box-shadow: var(--shadow);
  text-align: center;
  animation: rise .35s ease-out;
}

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.login-card .logo {
  width: 68px; height: 68px; border-radius: 20px;
  box-shadow: 0 8px 20px rgba(79, 124, 255, .3);
}
.login-card h1 { font-size: 21px; margin: 14px 0 4px; }
.login-card .subtitle { color: var(--muted); font-size: 13px; margin: 0 0 22px; }

.step { text-align: left; }
.step label { display: block; font-size: 13px; color: var(--muted); margin: 0 0 6px 2px; }
.step input {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
  outline: none;
  transition: border-color .18s;
}
.step input:focus { border-color: var(--brand); }

.field { position: relative; }
.field input { padding-right: 62px; }
.ghost-btn {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  color: var(--brand); font-size: 14px; padding: 8px 10px; border-radius: 10px;
}

.primary-btn {
  width: 100%;
  margin-top: 16px;
  padding: 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(79, 124, 255, .32);
  transition: transform .12s, opacity .2s;
}
.primary-btn:active { transform: scale(.98); }
.primary-btn[disabled] { opacity: .55; box-shadow: none; }

.hint { color: var(--muted); font-size: 12px; margin: 12px 2px 0; text-align: center; }
.hint.error { color: var(--danger); }
.ok-tip { color: #17a34a; font-size: 13px; margin: 0 0 14px; text-align: center; }
.link-btn { display: block; margin: 14px auto 0; color: var(--muted); font-size: 13px; }
.warn {
  margin: 18px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(229, 72, 77, .1);
  color: var(--danger);
  font-size: 12px;
  line-height: 1.6;
  text-align: left;
}

/* ==========================================================================
   二、聊天页
   ========================================================================== */
.chat { background: var(--bg); }

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(10px + var(--safe-top)) 14px 10px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
  z-index: 5;
}
.header-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.room-avatar {
  width: 38px; height: 38px; border-radius: 12px; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 16px;
}
.header-titles { min-width: 0; }
.room-name { font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-status { font-size: 12px; color: var(--muted); }

.icon-btn {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center; color: var(--muted);
  transition: background .15s, color .15s;
}
.icon-btn:active { background: var(--bg); color: var(--brand); }
.icon-btn.round {
  border-radius: 50%; background: var(--bg); color: var(--text);
  width: 40px; height: 40px; flex: 0 0 auto;
}
.icon-btn.round:active { background: var(--line); }
.icon-btn.mic svg { color: var(--brand); }

/* 按住说话：禁止长按选中文字 / 弹出系统菜单，也禁止手指滑动带动页面滚动 */
#btn-mic {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.connection-bar {
  flex: 0 0 auto;
  padding: 7px 14px;
  font-size: 12.5px;
  text-align: center;
  background: #fff4e5;
  color: #a15c00;
}
@media (prefers-color-scheme: dark) {
  .connection-bar { background: #3a2a12; color: #ffcf8a; }
}

/* ---- 消息列表 ---- */
.messages {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;   /* iOS 惯性滚动 */
  overscroll-behavior: contain;
  padding: 14px 12px 8px;
}

.history-loading, .empty-tip {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 14px 0;
}

.day-divider {
  text-align: center;
  margin: 12px 0 16px;
}
.day-divider span {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(123, 131, 148, .14);
  color: var(--muted);
  font-size: 11.5px;
}

.msg {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 12px;
  animation: pop .18s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.msg.mine { flex-direction: row-reverse; }
.msg.grouped { margin-top: -6px; }
.msg.grouped .avatar { visibility: hidden; }
.msg.grouped .who { display: none; }

.avatar {
  width: 38px; height: 38px; flex: 0 0 auto;
  border-radius: 13px;
  display: grid; place-items: center;
  color: #fff; font-size: 15px; font-weight: 600;
  user-select: none;
}

.msg .col { display: flex; flex-direction: column; min-width: 0; max-width: 78%; }
.msg.mine .col { align-items: flex-end; }
.who { font-size: 12px; color: var(--muted); margin: 0 2px 4px; }

.bubble {
  position: relative;
  padding: 10px 13px;
  border-radius: var(--radius);
  background: var(--other-bg);
  box-shadow: 0 1px 2px rgba(24, 33, 61, .06);
  font-size: 15.5px;
  line-height: 1.52;
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: pre-wrap;      /* 保留换行 */
  max-width: 100%;
}
.bubble.own {
  background: var(--own-bg);
  color: #fff;
  box-shadow: 0 4px 14px rgba(79, 124, 255, .28);
}
.bubble.own a { color: #eaf0ff; }
.bubble a { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }

/* 媒体类气泡统一用浅底，避免图片被蓝色渐变染色 */
.bubble.media {
  padding: 4px;
  background: var(--other-bg);
  box-shadow: 0 1px 3px rgba(24, 33, 61, .10);
}
.bubble.media.image { line-height: 0; }

/* 图片 / 视频下面的文字说明 */
.bubble .caption {
  line-height: 1.5;
  font-size: 15.5px;
  white-space: pre-wrap;
  word-break: break-word;
}
.bubble.media .caption { padding: 6px 8px 4px; }

.bubble img.media-image {
  display: block;
  width: auto;
  max-width: min(64vw, 260px);
  max-height: 360px;
  border-radius: 14px;
  object-fit: cover;
  background: rgba(123, 131, 148, .12);
}

.bubble video.media-video {
  display: block;
  width: min(72vw, 300px);
  max-height: 380px;
  border-radius: 14px;
  background: #000;
}

/* ---- 视频封面：点一下打开全屏播放器 ---- */
.video-box { position: relative; display: block; border-radius: 14px; overflow: hidden; background: #000; }
.video-box video {
  display: block;
  width: min(72vw, 300px);
  max-height: 380px;
  border-radius: 14px;
  background: #000;
  object-fit: cover;
  pointer-events: none;   /* 点击交给下面那层按钮统一处理 */
}
.video-open {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  background: rgba(6, 10, 22, .22);
  color: #fff;
  font-size: 12.5px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .6);
}
.video-open .video-play-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(12, 16, 28, .55);
  display: grid;
  place-items: center;
  backdrop-filter: blur(2px);
}
.video-open .video-play-icon::before {
  content: "";
  width: 0;
  height: 0;
  border-left: 14px solid #fff;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  margin-left: 4px;
}

/* ---- 视频全屏播放浮层 ---- */
.video-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(4, 6, 12, .96);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: calc(16px + var(--safe-top)) 10px calc(16px + var(--safe-bottom));
}
.video-overlay video {
  max-width: 100%;
  max-height: 74vh;
  border-radius: 12px;
  background: #000;
}
.video-close {
  position: absolute;
  top: calc(10px + var(--safe-top));
  right: 12px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, .18);
  color: #fff;
  font-size: 22px;
  line-height: 1;
}
.video-actions { display: flex; gap: 10px; }
.video-fullscreen {
  padding: 10px 22px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, .18);
  color: #fff;
  font-size: 13.5px;
}

/* ---- 语音消息 ---- */
.bubble.audio {
  padding: 9px 12px 9px 9px;
  min-width: 132px;
  max-width: min(66vw, 260px);
}
/* 真正播放用的 <audio> 元素藏起来，界面上只显示自定义的播放条 */
.voice audio { display: none; }
.voice { display: flex; align-items: center; gap: 9px; }
.voice-play {
  width: 34px; height: 34px; flex: 0 0 auto;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; display: grid; place-items: center;
}
.voice-play:active { transform: scale(.94); }
.voice-main { flex: 1 1 auto; min-width: 0; }
.voice-bars {
  display: flex; align-items: flex-end; gap: 2px; height: 20px;
  color: var(--brand);
}
.voice-bars i {
  display: block; width: 2.5px; border-radius: 2px; background: currentColor;
  opacity: .38;
}
.voice-progress {
  height: 3px; border-radius: 3px; background: rgba(123, 131, 148, .25);
  margin-top: 6px; overflow: hidden;
}
.voice-progress span {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  transition: width .12s linear;
}
.voice-dur { font-size: 12px; color: var(--muted); flex: 0 0 auto; }

/* 消息下方的时间 / 发送状态（放在气泡外面） */
.msg .meta {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; color: var(--muted);
  margin: 4px 2px 0;
}
.msg.mine .meta { justify-content: flex-end; }
.status { font-size: 11px; }
.status.failed { color: var(--danger); }

/* 上传进度条 */
.upload-progress {
  height: 3px; border-radius: 3px; background: rgba(123, 131, 148, .25);
  margin-top: 6px; overflow: hidden;
}
.upload-progress span {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  transition: width .15s linear;
}
.bubble.own .upload-progress { background: rgba(255, 255, 255, .3); }
.bubble.own .upload-progress span { background: #fff; }

.system-line {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin: 10px 0 14px;
}

/* ---- 回到最新 ---- */
.jump-latest {
  position: absolute;
  right: 14px;
  bottom: calc(78px + var(--safe-bottom));
  z-index: 6;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--panel);
  color: var(--brand);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(24, 33, 61, .18);
  display: flex; align-items: center; gap: 6px;
}
.jump-latest .badge {
  background: var(--danger); color: #fff; font-size: 11px; font-weight: 500;
  min-width: 17px; height: 17px; padding: 0 5px; border-radius: 999px;
  display: grid; place-items: center;
}

/* ---- 底部输入栏 ---- */
.composer {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 10px calc(8px + var(--safe-bottom));
  background: var(--panel);
  border-top: 1px solid var(--line);
}
.input-wrap { flex: 1 1 auto; min-width: 0; }
.composer textarea {
  width: 100%;
  /* 最小高度兜底：即使脚本量错高度，也不会被压成一条缝 */
  min-height: 42px;
  max-height: 120px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--bg);
  resize: none;
  outline: none;
  line-height: 1.4;
  overflow-y: auto;
  transition: border-color .18s;
}
.composer textarea:focus { border-color: var(--brand); }
.composer textarea::placeholder { color: var(--muted); }

.send-btn {
  flex: 0 0 auto;
  height: 40px;
  padding: 0 18px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; font-weight: 600;
  box-shadow: 0 6px 16px rgba(79, 124, 255, .3);
}
.send-btn:active { transform: scale(.97); }

/* ==========================================================================
   三、浮层
   ========================================================================== */

/* 图片放大 */
.lightbox {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(0, 0, 0, .94);
  display: flex; align-items: center; justify-content: center;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}
.lightbox img {
  max-width: 100vw; max-height: 82vh;
  object-fit: contain;
  touch-action: pinch-zoom;     /* 允许双指缩放 */
}
.lightbox-close {
  position: absolute; top: calc(10px + var(--safe-top)); right: 12px;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255, 255, 255, .16); color: #fff; font-size: 24px; line-height: 1;
}
.lightbox-save {
  position: absolute; bottom: calc(20px + var(--safe-bottom)); left: 50%;
  transform: translateX(-50%);
  padding: 10px 22px; border-radius: 999px;
  background: rgba(255, 255, 255, .18); color: #fff;
  font-size: 14px; text-decoration: none;
}

/* 底部菜单 */
.sheet {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(12, 16, 28, .42);
  display: flex; align-items: flex-end;
}
.sheet-panel {
  width: 100%;
  background: var(--panel);
  border-radius: 20px 20px 0 0;
  padding: 8px 10px calc(10px + var(--safe-bottom));
  animation: slideUp .22s ease-out;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: none; } }
.sheet-title {
  text-align: center; color: var(--muted); font-size: 12.5px;
  padding: 10px 0 12px;
}
.sheet-items { display: grid; gap: 8px; }
.sheet-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--bg);
  font-size: 15.5px;
  text-align: left;
  width: 100%;
  color: var(--text);
}
.sheet-item:active { background: var(--line); }
.sheet-item .emoji { font-size: 20px; width: 24px; text-align: center; }
.sheet-item .sub { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.sheet-cancel {
  width: 100%; margin-top: 8px; padding: 14px;
  border-radius: 14px; background: var(--panel); color: var(--muted);
  font-size: 15.5px; border-top: 1px solid var(--line);
}

/* 录音浮层 */
.recording {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(12, 16, 28, .45);
  display: flex; align-items: center; justify-content: center;
}
.rec-card {
  background: rgba(24, 28, 40, .92);
  color: #fff;
  border-radius: 22px;
  padding: 26px 30px;
  text-align: center;
  min-width: 190px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .5);
}
.rec-card.cancel { background: rgba(160, 40, 46, .94); }
.rec-bars { display: flex; align-items: center; justify-content: center; gap: 4px; height: 34px; }
.rec-bars span {
  width: 4px; height: 10px; border-radius: 3px; background: #fff; opacity: .85;
  animation: wave 1s infinite ease-in-out;
}
.rec-bars span:nth-child(2) { animation-delay: .12s; }
.rec-bars span:nth-child(3) { animation-delay: .24s; }
.rec-bars span:nth-child(4) { animation-delay: .36s; }
.rec-bars span:nth-child(5) { animation-delay: .48s; }
@keyframes wave { 0%, 100% { height: 10px; } 50% { height: 30px; } }
.rec-time { font-size: 22px; font-weight: 600; margin-top: 12px; font-variant-numeric: tabular-nums; }
.rec-hint { font-size: 12.5px; opacity: .8; margin-top: 6px; }

/* 通用弹窗 */
.modal {
  position: fixed; inset: 0; z-index: 75;
  background: rgba(12, 16, 28, .45);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.modal-card {
  width: 100%; max-width: 400px;
  max-height: 78vh; overflow-y: auto;
  background: var(--panel);
  border-radius: 20px;
  padding: 20px 18px;
  animation: rise .2s ease-out;
}
.modal-card h3 { margin: 0 0 12px; font-size: 17px; }
.modal-body { font-size: 14px; color: var(--text); line-height: 1.7; }
.modal-body p { margin: 0 0 10px; }
.modal-body ol, .modal-body ul { margin: 0 0 10px; padding-left: 20px; }
.modal-body li { margin-bottom: 6px; }
.modal-body .tip { color: var(--muted); font-size: 12.5px; }
.modal-body .kv { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.modal-body .kv:last-child { border-bottom: none; }
.modal-body .kv b { font-weight: 600; }

/* 轻提示 */
.toast-wrap {
  position: fixed; top: calc(14px + var(--safe-top)); left: 0; right: 0;
  z-index: 90;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none;
}
.toast {
  max-width: 86vw;
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(24, 28, 40, .92);
  color: #fff;
  font-size: 13.5px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .28);
  animation: rise .2s ease-out;
}

/* 桌面端：把聊天区收窄成手机宽度，看起来更像聊天软件 */
@media (min-width: 720px) {
  .chat {
    max-width: 720px;
    margin: 0 auto;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    box-shadow: 0 0 40px rgba(24, 33, 61, .12);
  }
  .messages { padding: 16px 18px 8px; }
}

/* ==========================================================================
   管理员面板
   ========================================================================== */
#invite-field { margin-top: 12px; }

.admin-panel {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}
.admin-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(12px + var(--safe-top)) 16px 12px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.admin-title { font-size: 17px; font-weight: 600; }
.admin-close {
  width: 36px; height: 36px; border-radius: 50%;
  border: none; background: var(--bg); color: var(--muted); font-size: 20px; line-height: 1;
}
.admin-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 14px 14px calc(24px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.admin-tip { color: var(--muted); text-align: center; font-size: 13px; padding: 20px 0; }
.admin-card {
  background: var(--panel);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 2px 10px rgba(20, 28, 48, .06);
}
.admin-card h4 {
  margin: 0 0 8px;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.admin-card h4 .count { color: var(--muted); font-size: 12px; font-weight: 400; }
.admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.admin-row:last-child { border-bottom: none; }
.admin-row .info { min-width: 0; }
.admin-row .name { font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.admin-row .sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; word-break: break-all; }
.mini-btn {
  flex: 0 0 auto;
  padding: 6px 11px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font-size: 12.5px;
}
.mini-btn.danger { color: var(--danger); border-color: rgba(229, 72, 77, .3); background: rgba(229, 72, 77, .08); }
.mini-btn.primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; border: none; }
.mini-btn:active { opacity: .8; }
.admin-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  outline: none;
}
.admin-card .field-row { margin-bottom: 10px; }
.admin-card label.small { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.admin-card .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; background: rgba(79, 124, 255, .12); color: var(--brand); }
.pill.danger { background: rgba(229, 72, 77, .12); color: var(--danger); }
.pill.ok { background: rgba(23, 163, 74, .12); color: #17a34a; }
.invite-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 15px; letter-spacing: 2px; font-weight: 600; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; font-size: 14px; }
.switch-row input[type="checkbox"] { width: 20px; height: 20px; flex: 0 0 auto; }
.danger-zone { border: 1px solid rgba(229, 72, 77, .25); }
.danger-zone h4 { color: var(--danger); }
