:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --ink: #182033;
  --muted: #69758a;
  --line: #dfe5ef;
  --primary: #176b87;
  --primary-2: #0f4f67;
  --danger: #c24141;
  --soft: #e8f4f6;
  --shadow: 0 18px 60px rgba(28, 39, 62, .12);
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-card: 0 4px 16px rgba(28, 39, 62, .07);
  --transition: .18s ease;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --chat-header-height: clamp(58px, 11vw, 68px);
  --chat-composer-height: clamp(50px, 10vw, 58px);
  --chat-bubble-font: clamp(14px, 3.9vw, 17px);
  --chat-meta-font: clamp(11px, 2.9vw, 13px);
  --chat-gap: clamp(8px, 2.8vw, 14px);
  --chat-avatar-size: clamp(34px, 8.5vw, 42px);
  --attachment-card-min-width: min(180px, 100%);
  --attachment-card-max-width: min(100%, 300px);
  --attachment-card-padding: 8px 12px;
  --attachment-card-gap: 8px;
  --media-card-width: clamp(18rem, 30vw, 22.75rem);
  --media-audio-width: clamp(17.5rem, 30vw, 27.5rem);
  --media-video-width: clamp(15rem, 26vw, 21rem);
  --media-video-max-height: min(24rem, 54vh);
  --video-player-min-height: 240px;
  --app-vh: 100vh;
}
* { box-sizing: border-box; }
[v-cloak] { display: none; }
html {
  min-height: 100%;
  height: -webkit-fill-available;
  background: #f3f6fb;
  overflow-x: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
}
body {
  margin: 0;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(23,107,135,.10), transparent 30rem),
    linear-gradient(180deg, #f7f9fc 0%, #f3f6fb 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  overflow-x: hidden;
}
body.chat-ios-keyboard-open {
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}
html.ios-keyboard-lock {
  overflow: hidden !important;
  overscroll-behavior: none;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 13px;
  background: #fff;
  color: var(--ink);
  outline: none;
}
textarea { resize: vertical; min-height: 104px; line-height: 1.55; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(23,107,135,.14); }
label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; }
.home-shell {
  min-height: 100vh;
  color: #d9e3f3;
  background:
    radial-gradient(circle at 14% 10%, rgba(59, 130, 246, .18), transparent 30rem),
    radial-gradient(circle at 88% 24%, rgba(16, 185, 129, .15), transparent 26rem),
    linear-gradient(180deg, #091221 0%, #0d182a 41%, #f3f6fb 41%, #f5f7fb 100%);
}
.home-container {
  width: min(1240px, calc(100% - 44px));
  margin: 0 auto;
}
.home-topbar {
  position: sticky;
  top: 0;
  z-index: 12;
  border-bottom: 1px solid rgba(255,255,255,.07);
  background: rgba(8, 15, 27, .88);
  backdrop-filter: blur(14px);
}
.home-topbar-inner {
  width: min(1240px, calc(100% - 44px));
  margin: 0 auto;
  min-height: 74px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 28px;
  align-items: center;
}
.home-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -.02em;
}
.home-brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(135deg, #1e88e5, #0f6bb8);
  color: #fff;
  box-shadow: 0 10px 24px rgba(18, 88, 145, .26);
  font-size: 15px;
}
.home-nav {
  display: flex;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
}
.home-nav a {
  color: #93a4bc;
  font-size: 14px;
  font-weight: 500;
  transition: color .18s ease;
}
.home-nav a:hover { color: #ffffff; }
.home-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.home-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid rgba(53, 142, 193, .28);
  background: linear-gradient(180deg, #1d95d4, #1378b2);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  box-shadow: none;
  transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}
.home-action-btn.ghost,
.ghost.home-action-btn {
  border-color: rgba(255,255,255,.08);
  background: rgba(255,255,255,.05);
  color: #f4f8ff;
}
.home-main {
  display: grid;
  gap: 0;
}
.home-hero {
  position: relative;
  padding: 92px 0 148px;
  overflow: hidden;
}
.home-hero::after {
  content: "";
  position: absolute;
  inset: auto auto 18px 50%;
  width: min(1040px, 90vw);
  height: 240px;
  border-radius: 999px;
  background: rgba(59, 130, 246, .10);
  filter: blur(76px);
  transform: translateX(-50%);
  pointer-events: none;
}
.home-hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(390px, .78fr);
  gap: 56px;
  align-items: center;
}
.home-kicker {
  margin: 0 0 18px;
  color: #60a5fa;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.home-hero-copy h1 {
  margin: 0;
  max-width: 700px;
  color: #f8fafc;
  font-size: clamp(60px, 6.6vw, 65px);
  font-weight: 800;
  line-height: 72.92px;
  letter-spacing: -.06em;
}
.home-hero-title {
  display: grid;
  gap: 0;
}
.home-hero-title span {
  display: block;
}
.home-hero-title span:last-child {
  max-width: 4.7em;
}
.home-hero-text {
  margin: 28px 0 0;
  max-width: 820px;
  color: #aebcd0;
  font-size: 18px;
  line-height: 1.8;
}
.home-chip-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 28px;
}
.home-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 999px;
  background: rgba(255,255,255,.04);
  color: #d3def0;
  font-size: 12px;
  font-weight: 700;
}
.home-cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 26px;
}
.home-primary-cta,
.home-secondary-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease, color .18s ease;
}
.home-primary-cta {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 14px 30px rgba(6, 14, 22, .18);
}
.home-secondary-cta {
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  color: #f8fbff;
}
.home-primary-cta:hover,
.home-secondary-cta:hover,
.home-action-btn:hover {
  transform: translateY(-2px);
}
.home-primary-cta:hover {
  background: #f8fbff;
}
.home-secondary-cta:hover,
.ghost.home-action-btn:hover {
  border-color: rgba(255,255,255,.20);
  background: rgba(255,255,255,.08);
}
.home-action-btn:hover {
  border-color: rgba(68, 167, 221, .40);
  background: linear-gradient(180deg, #20a0e2, #1787c4);
}
.home-hero-panel {
  display: flex;
  justify-content: flex-end;
  align-self: center;
}
.home-hero-card {
  width: min(470px, 100%);
  display: grid;
  gap: 16px;
  padding: 18px;
  margin-top: 22px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.03));
  box-shadow: 0 20px 44px rgba(2, 9, 18, .18);
}
.home-mini-label {
  margin: 0;
  color: #c4d0e0;
  font-size: 14px;
  font-weight: 700;
}
.home-quick-card {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 18px;
  background: rgba(12, 26, 43, .62);
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.home-quick-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(30, 136, 229, .16);
  color: #71c8ff;
  font-size: 18px;
}
.home-quick-card strong {
  display: block;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
}
.home-quick-card p {
  margin: 4px 0 0;
  color: #8ea2bb;
  font-size: 13px;
  line-height: 1.62;
}
.home-quick-link {
  color: #dff4ff;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}
.home-quick-card:hover {
  transform: translateY(-2px);
  border-color: rgba(84, 169, 220, .24);
  background: rgba(14, 30, 49, .78);
}
.home-feature-strip {
  margin-top: -76px;
  position: relative;
  z-index: 2;
}
.home-feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}
.home-feature-card,
.home-story-card,
.home-scenario-card,
.home-tech-card {
  border: 1px solid rgba(226, 232, 240, .92);
  background: #ffffff;
  box-shadow: 0 24px 54px rgba(15, 23, 42, .08);
}
.home-feature-card {
  padding: 32px 28px 28px;
  border-radius: 20px;
  color: var(--ink);
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}
.home-feature-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(180deg, #edf5ff, #e8f1fb);
  color: #1c7eb0;
  font-size: 22px;
}
.home-feature-card h3,
.home-story-copy h3,
.home-scenario-card h3,
.home-tech-card h3 {
  margin: 20px 0 12px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.34;
}
.home-feature-card p,
.home-story-copy p,
.home-scenario-card p,
.home-tech-card p,
.home-admin-banner p,
.home-footer-copy {
  margin: 0;
  color: #5f7087;
  line-height: 1.82;
  font-size: 14px;
}
.home-feature-card:hover {
  transform: translateY(-8px);
  border-color: rgba(59, 130, 246, .28);
  box-shadow: 0 28px 56px rgba(13, 25, 44, .12);
}
.home-section {
  padding: 65px 0;
}
.home-section-dark .home-section-head {
  margin-bottom: 42px;
}
.home-section-dark .home-section-head h2 {
  color: #eef4ff;
}
@media (max-width: 767px) {
  .home-section-dark .home-section-head h2 {
   color: #182033;  
  }
}
.home-section-dark .home-story-copy h3 {
  color: #182033;
}
.home-section-light {
  position: relative;
}
.home-section-light .home-kicker {
  color: #60a5fa;
}
.home-section-soft {
  background:
    linear-gradient(180deg, #eff4fa 0%, #f5f7fb 44%, #f6f8fb 100%),
    radial-gradient(circle at top center, rgba(96, 165, 250, .08), transparent 22rem);
}
.home-section-head {
  display: grid;
  gap: 12px;
  margin-bottom: 42px;
}
.home-section-head h2,
.home-admin-banner h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(42px, 4.2vw, 60px);
  line-height: 1.04;
  letter-spacing: -.04em;
  font-weight: 800;
}
.home-story-grid {
  display: grid;
  gap: 18px;
}
.home-story-card {
  display: grid;
  grid-template-columns: minmax(380px, .96fr) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 14px;
  border-radius: 18px;
  box-shadow: 0 16px 34px rgba(15, 23, 42, .08);
}
.home-story-card-reverse {
  grid-template-columns: minmax(0, 1fr) minmax(380px, .96fr);
}
.home-story-media {
  min-height: 290px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  font-size: 82px;
}
.home-story-media-branch {
  background: linear-gradient(180deg, #e9f2ff, #dbeafe);
  color: #1c7398;
}
.home-story-media-security {
  background: linear-gradient(180deg, #e6f7f2, #d9f5ea);
  color: #117f5c;
}
.home-story-copy {
  padding: 10px 14px 10px 12px;
}
.home-list {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}
.home-list li {
  position: relative;
  padding-left: 24px;
  color: #5f7087;
  line-height: 1.72;
  font-size: 15px;
}
.home-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 11px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #13b5c8, #14b88a);
}
.home-scenario-grid,
.home-tech-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.home-scenario-card,
.home-tech-card {
  padding: 34px 28px;
  border-radius: 16px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.home-scenario-card {
  min-height: 184px;
}
.home-tech-card {
  min-height: 184px;
}
.home-scenario-card:hover,
.home-tech-card:hover {
  transform: translateY(-5px);
  border-color: rgba(59, 130, 246, .22);
  box-shadow: 0 18px 36px rgba(15, 23, 42, .08);
}
.home-admin-banner {
  margin-top: 40px;
  padding: 46px 44px;
  border: 1px solid rgba(36, 54, 80, .80);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(19, 30, 51, .98), rgba(24, 36, 58, .96)),
    radial-gradient(circle at 90% 10%, rgba(96, 165, 250, .10), transparent 18rem);
  box-shadow: 0 24px 54px rgba(11, 18, 31, .24);
}
.home-admin-banner h2,
.home-admin-banner p {
  color: #f2f7ff;
}
.home-admin-banner p {
  margin-top: 18px;
  max-width: 720px;
  color: rgba(220, 230, 245, .80);
}
.home-footer {
  padding: 26px 0 34px;
  border-top: 1px solid rgba(205, 216, 231, .92);
  background:
    linear-gradient(180deg, rgba(241, 245, 250, .96), rgba(244, 247, 251, .98));
}
.home-footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
}
.home-footer-brand {
  color: var(--ink);
}
.home-footer-copy {
  margin-top: 16px;
  max-width: 700px;
  font-size: 14px;
}
.home-footer-links {
  display: flex;
  gap: 12px 16px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.home-footer-links a {
  color: #0f6ea6;
  font-weight: 700;
}
.topbar {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(223,229,239,.7);
  background: rgba(255,255,255,.78);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 5;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .2px; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px; background: var(--primary); color: #fff; }
nav { display: flex; gap: 14px; align-items: center; color: var(--muted); }
.auth-shell, .loading-shell { min-height: calc(100vh - 68px); display: grid; place-items: center; padding: 28px; }
.auth-shell {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(23,107,135,.12), transparent),
    radial-gradient(ellipse 60% 50% at 80% 100%, rgba(23,107,135,.08), transparent),
    linear-gradient(160deg, #f0f4f8 0%, #e8edf5 50%, #f5f7fb 100%);
}
.auth-shell::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(90deg, transparent, transparent 60px, rgba(23,107,135,.02) 60px, rgba(23,107,135,.02) 61px),
    repeating-linear-gradient(0deg, transparent, transparent 60px, rgba(23,107,135,.02) 60px, rgba(23,107,135,.02) 61px);
  pointer-events: none;
}
.auth-shell::after {
  content: '';
  position: absolute;
  top: -30%;
  right: -20%;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(23,107,135,.06) 0%, transparent 70%);
  pointer-events: none;
  animation: auth-float 12s ease-in-out infinite;
}
@keyframes auth-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-30px, 20px) scale(1.05); }
}
@keyframes auth-panel-in {
  from { opacity: 0; transform: translateY(16px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.loading-dot { width: 38px; height: 38px; border: 4px solid rgba(23,107,135,.16); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.auth-panel, .panel, .chat-panel {
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(223,229,239,.9);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.auth-panel {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  padding: 38px 36px;
  display: grid;
  gap: 22px;
  background: rgba(255,255,255,.85);
  border: 1px solid rgba(255,255,255,.6);
  border-radius: 20px;
  box-shadow:
    0 24px 80px rgba(23,107,135,.10),
    0 8px 24px rgba(28,39,62,.06),
    inset 0 1px 0 rgba(255,255,255,.8);
  backdrop-filter: blur(16px) saturate(1.4);
  animation: auth-panel-in .5s cubic-bezier(.22,1,.36,1) both;
}
.auth-panel .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: rgba(23,107,135,.08);
  border-radius: 20px;
  font-size: 11px;
  letter-spacing: .08em;
  width: fit-content;
}
.auth-panel .eyebrow::before {
  content: '\f3ed';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 10px;
}
.auth-panel h1 {
  font-size: clamp(26px, 5vw, 34px);
  font-weight: 800;
  letter-spacing: -.02em;
  background: linear-gradient(135deg, #182033 30%, #176b87 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.auth-panel .muted {
  font-size: 14px;
  margin: -8px 0 0;
}
.auth-panel .stack {
  gap: 12px;
}
.auth-panel input {
  padding: 14px 16px;
  border: 1.5px solid rgba(223,229,239,.8);
  border-radius: 12px;
  background: rgba(248,250,253,.9);
  font-size: 15px;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.auth-panel input:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(23,107,135,.08);
}
.auth-panel input::placeholder {
  color: #9ca8b8;
}
.auth-panel .primary {
  margin-top: 4px;
  padding: 15px 20px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  background: linear-gradient(135deg, #176b87 0%, #0f4f67 100%);
  color: #fff;
  border: none;
  box-shadow: 0 4px 16px rgba(23,107,135,.25), inset 0 1px 0 rgba(255,255,255,.15);
  transition: transform .15s, box-shadow .15s;
  cursor: pointer;
}
.auth-panel .primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(23,107,135,.3), inset 0 1px 0 rgba(255,255,255,.15);
}
.auth-panel .primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(23,107,135,.2);
}
.auth-panel .ghost.wide {
  padding: 12px;
  border-radius: 12px;
  font-size: 14px;
  color: var(--muted);
  background: rgba(248,250,253,.6);
  border: 1.5px solid rgba(223,229,239,.6);
  transition: background .2s, border-color .2s;
}
.auth-panel .ghost.wide:hover:not(:disabled) {
  background: rgba(23,107,135,.04);
  border-color: rgba(23,107,135,.2);
  color: var(--primary);
}
.install-panel { width: min(720px, 100%); }
.eyebrow { margin: 0 0 6px; color: var(--primary); text-transform: uppercase; font-size: 12px; font-weight: 800; letter-spacing: .12em; }
h1, h2 { margin: 0; line-height: 1.12; }
h1 { font-size: clamp(30px, 5vw, 46px); }
h2 { font-size: 22px; }
.muted { color: var(--muted); line-height: 1.7; }
.stack { display: grid; gap: 14px; }
.code-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.code-row button { white-space: nowrap; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.dialog-type-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.dialog-type-option {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 94px;
  padding: 14px 16px;
  border: 1px solid #dbe5f2;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  color: var(--ink);
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition), transform var(--transition);
}
.dialog-type-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.dialog-type-option:hover {
  border-color: rgba(23, 107, 135, .35);
  box-shadow: 0 10px 24px rgba(28, 39, 62, .08);
}
.dialog-type-option.active {
  border-color: rgba(47, 116, 232, .72);
  background: linear-gradient(180deg, #f3f7ff 0%, #ecf4ff 100%);
  box-shadow: inset 0 0 0 1px rgba(47, 116, 232, .22), 0 10px 24px rgba(47, 116, 232, .11);
}
.dialog-type-option.disabled {
  cursor: not-allowed;
  opacity: .56;
}
.dialog-type-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: #edf4fb;
  color: #2673a8;
  font-size: 17px;
}
.dialog-type-option.active .dialog-type-mark {
  background: #2f74e8;
  color: #fff;
}
.dialog-type-copy {
  min-width: 0;
  display: grid;
  gap: 5px;
}
.dialog-type-copy strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
}
.dialog-type-copy small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}
.create-panel .create-field-label {
  color: var(--theme-ink, var(--ink));
  font-size: 14px;
  font-weight: 800;
}
.create-panel .create-field-label input {
  font-weight: 400;
}
.install-checks {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fbfdff;
}
.install-check-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.install-check-head strong { display: block; }
.install-check-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.install-check-head button { flex: 0 0 auto; }
.check-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.check-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  padding: 9px;
  border: 1px solid #c9eadb;
  border-radius: var(--radius-sm);
  background: #f3fbf7;
}
.check-item.bad {
  border-color: #f0c5c5;
  background: #fff7f7;
}
.check-item span {
  display: grid;
  place-items: center;
  min-height: 24px;
  border-radius: 8px;
  background: #dff5ea;
  color: #0f6b4f;
  font-size: 12px;
  font-weight: 800;
}
.check-item.bad span {
  background: #ffe4e4;
  color: var(--danger);
}
.check-item strong { display: block; font-size: 13px; }
.check-item p { margin: 3px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; word-break: break-word; }
.db-test-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}
.db-test-row button { min-height: 44px; }
.db-test-row p { line-height: 1.5; }
.wide { grid-column: 1 / -1; width: 100%; }
.check { display: flex; align-items: center; flex-direction: row; gap: 10px; }
.check input { width: auto; }
.avatar-profile { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fbfdff; }
.avatar-profile img { width: 54px; height: 54px; border-radius: 50%; object-fit: cover; border: 2px solid #fff; box-shadow: 0 4px 14px rgba(24,32,51,.12); }
.avatar-profile p { margin: 3px 0 0; color: var(--muted); }
.avatar-picker { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--muted); }
.avatar-picker > span { flex: 0 0 100%; font-size: 13px; color: var(--muted); }
.avatar-choice { width: 44px; height: 44px; padding: 4px; border: 2px solid transparent; border-radius: 50%; background: #fff; display: grid; place-items: center; }
.avatar-choice img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.avatar-choice.active { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(23,107,135,.14); }
button {
  border: 0;
  border-radius: var(--radius-sm);
  padding: 11px 15px;
  cursor: pointer;
  transition: var(--transition);
}
button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
button:focus-visible { outline: 2px solid rgba(23,107,135,.5); outline-offset: 2px; }
.primary { background: var(--primary); color: #fff; font-weight: 800; }
.primary:hover { background: var(--primary-2); transform: translateY(-1px); }
.ghost { background: #eef3f7; color: var(--ink); }
.ghost:hover { background: #e4eaf0; }
.ghost:active { background: #dae2ea; }
.ghost.warn { background: #fff7e8; color: #8a5a00; }
.danger { background: #fff0f0; color: var(--danger); }
.danger:hover { background: #ffe0e0; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; background: var(--soft); color: var(--primary); }
.icon-btn:hover { background: #d8edf0; color: var(--primary-2); }
.error { color: var(--danger); margin: 0; }
.page-grid, .admin-grid {
  width: min(1180px, calc(100% - 32px));
  margin: 26px auto;
  display: grid;
  grid-template-columns: minmax(0, 420px) 1fr;
  gap: 20px;
}
.admin-shell {
  width: min(1680px, calc(100% - 28px));
  margin: 12px auto 24px;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.user-shell {
  width: min(1420px, calc(100% - 28px));
  margin: 12px auto 24px;
  padding-bottom: var(--safe-bottom);
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.admin-sidebar {
  position: sticky;
  top: 84px;
  padding: 18px 14px;
}
.user-sidebar {
  position: sticky;
  top: calc(84px + var(--safe-top));
  padding: 18px 14px;
}
.admin-sidebar-head {
  padding: 4px 6px 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}
.user-sidebar-head {
  padding: 4px 6px 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}
.admin-sidebar-head h2 {
  margin: 6px 0 6px;
}
.user-sidebar-head h2 {
  margin: 6px 0 6px;
}
.admin-sidebar-head p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}
.user-sidebar-head p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}
.admin-main {
  min-width: 0;
  display: grid;
  gap: 12px;
}
.user-main {
  min-width: 0;
  display: grid;
  gap: 12px;
}
.admin-tabs {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}
.user-tabs {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}
.admin-tabs a {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #43536b;
  background: #f7fafc;
  font-weight: 700;
  transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}
.user-tabs a {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #43536b;
  background: #f7fafc;
  font-weight: 700;
  transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}
.admin-tabs a:hover, .admin-tabs a.active {
  border-color: #d8e2ef;
  background: rgba(255,255,255,.98);
  color: var(--primary);
  transform: translateX(2px);
}
.user-tabs a:hover, .user-tabs a.active {
  border-color: #d8e2ef;
  background: rgba(255,255,255,.98);
  color: var(--primary);
  transform: translateX(2px);
}
.admin-tabs a.active {
  border-color: rgba(23,107,135,.25);
  background: #eef7f8;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.65), 0 8px 22px rgba(23,107,135,.08);
}
.user-tabs a.active {
  border-color: rgba(23,107,135,.25);
  background: #eef7f8;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.65), 0 8px 22px rgba(23,107,135,.08);
}
.admin-content-panel,
.admin-links-shell {
  min-width: 0;
}
.admin-links-head {
  margin-bottom: 12px;
}
.admin-links-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
}
.admin-links-table {
  width: 100%;
  min-width: 1100px;
  border-collapse: collapse;
  font-size: 14px;
}
.admin-links-table th,
.admin-links-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  white-space: nowrap;
}
.admin-links-table th {
  color: #2673a8;
  background: #fbfcfe;
  font-weight: 700;
}
.admin-links-table tbody tr:nth-child(odd) {
  background: #f7f7f7;
}
.admin-links-table tbody tr:hover {
  background: #eef7fa;
}
.admin-links-empty {
  text-align: center;
  color: var(--muted);
  padding: 26px !important;
}
.admin-links-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.admin-links-actions button {
  padding: 4px 8px;
  font-size: 12px;
  min-width: auto;
}
.admin-link-token {
  font-size: 12px;
  background: #f0f4f8;
  padding: 2px 6px;
  border-radius: 3px;
  color: #4a6785;
}
.modal-panel.admin-live-modal {
  --sc-chat-blue: #0a84ff;
  --sc-chat-blue-deep: #175cd3;
  --sc-chat-green: #20c997;
  --sc-chat-line: rgba(15, 23, 42, .09);
  width: min(92vw, 1400px);
  height: min(88vh, 900px);
  height: min(88dvh, 900px);
  height: min(calc(var(--app-vh, 100vh) - 24px), 900px);
  max-height: 88vh;
  max-height: calc(var(--app-vh, 100vh) - 24px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0;
}
.admin-live-modal > .modal-close {
  position: absolute;
  top: 16px;
  right: 12px;
  z-index: 10;
}
.admin-live-main-head .toolbar-actions{margin-right: 45px;}
.admin-live-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.admin-live-sidebar {
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  scrollbar-width: thin;
}
.admin-live-sidebar-head {
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--line);
}
.admin-live-sidebar-head .eyebrow {
  margin-bottom: 2px;
}
.admin-live-sidebar-head h3 {
  margin: 0;
  font-size: 16px;
}
.admin-live-branch-list {
  flex: 0 1 auto;
  overflow: auto;
  padding: 8px;
  scrollbar-width: thin;
}
.admin-live-branch-list .branch-row {
  margin-bottom: 6px;
}
.admin-live-notice {
  border-top: 1px solid var(--line);
  padding: 10px 12px;
}
.admin-live-notice .eyebrow {
  margin-bottom: 4px;
}
.admin-live-notice .group-notice-text {
  font-size: 13px;
  color: #475569;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.admin-live-members {
  border-top: 1px solid var(--line);
  padding: 10px 12px;
}
.admin-live-members-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.admin-live-members-head .eyebrow {
  margin: 0;
}
.admin-live-member-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.admin-live-main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #eceff3;
}
.admin-live-main .messages {
  flex: 1;
  min-height: 0;
}
.admin-live-main-head {
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.admin-live-main-head .section-title {
  margin: 0;
}
.admin-live-main .admin-group-chat-meta,
.admin-live-main .admin-group-chat-summary {
  padding: 10px 16px;
  background: #fff;
}
.admin-live-main .admin-live-chat-meta {
  flex: 0 0 auto;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(226, 233, 243, .9);
}
.admin-live-main .monitor-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.admin-live-main .metric-card strong {
  white-space: nowrap;
}
.user-content-panel {
  min-width: 0;
}
.admin-content-panel {
  padding: 15px 16px;
  max-height: calc(100vh - 156px);
  overflow: auto;
  overscroll-behavior: contain;
  scroll-padding-top: 10px;
  scrollbar-width: thin;
  scrollbar-color: #cfdbe7 transparent;
}
.user-content-panel {
  padding: 18px;
  max-height: calc(100vh - 156px - var(--safe-bottom));
  overflow: auto;
  overscroll-behavior: contain;
  scroll-padding-top: 10px;
  scrollbar-width: thin;
  scrollbar-color: #cfdbe7 transparent;
}
.admin-content-panel::-webkit-scrollbar,
.user-content-panel::-webkit-scrollbar,
.admin-panel::-webkit-scrollbar {
  width: 10px;
}
.admin-content-panel::-webkit-scrollbar-track,
.user-content-panel::-webkit-scrollbar-track,
.admin-panel::-webkit-scrollbar-track {
  background: transparent;
}
.admin-content-panel::-webkit-scrollbar-thumb,
.user-content-panel::-webkit-scrollbar-thumb,
.admin-panel::-webkit-scrollbar-thumb {
  background: #d7e2ec;
  border: 2px solid transparent;
  border-radius: 999px;
  background-clip: content-box;
}
.admin-content-panel::-webkit-scrollbar-thumb:hover,
.user-content-panel::-webkit-scrollbar-thumb:hover,
.admin-panel::-webkit-scrollbar-thumb:hover {
  background: #c0d0df;
  border: 2px solid transparent;
  background-clip: content-box;
}
.user-avatar-picker {
  align-items: flex-start;
}
.admin-stats-panel {
  display: grid;
  gap: 16px;
}
.segmented-control {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f5f8fb;
}
.segmented-control button {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  background: transparent;
  color: #5f6b7a;
}
.segmented-control button.active {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 3px 10px rgba(23,107,135,.10);
}
.stats-headline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}
.stats-headline span {
  color: var(--ink);
  font-weight: 800;
}
.stats-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}
.stats-kpi-card {
  min-height: 118px;
  display: grid;
  gap: 8px;
  align-content: center;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-card);
}
.stats-kpi-card span {
  color: var(--muted);
  font-size: 13px;
}
.stats-kpi-card strong {
  color: #182033;
  font-size: 25px;
  line-height: 1.1;
}
.stats-kpi-card small {
  color: var(--muted);
  line-height: 1.45;
}
.stats-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.stats-chart-box,
.stats-ranking-list {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-card);
}
.stats-chart-box.wide {
  grid-column: 1 / -1;
}
.stats-chart-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 10px;
}
.stats-chart-title strong {
  color: var(--ink);
  font-size: 15px;
}
.stats-chart-title span {
  color: var(--muted);
  font-size: 12px;
}
.stats-chart {
  width: 100%;
  height: 310px;
  min-height: 260px;
}
.stats-chart-box.wide .stats-chart {
  height: 350px;
}
.stats-ranking-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}
.stats-ranking-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid #edf1f5;
}
.stats-ranking-row:first-of-type {
  border-top: 0;
}
.stats-ranking-row span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #eef7f8;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}
.stats-ranking-row b {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stats-ranking-row small {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.security-event-card .card-actions {
  margin-top: 10px;
}
.admin-subpanel {
  margin-top: 12px;
  padding: 14px;
  background: linear-gradient(180deg, #fbfdff 0%, #f6f9fc 100%);
  border: 1px solid rgba(219, 227, 239, .95);
  box-shadow: none;
}
.admin-workspace {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(0, .75fr) minmax(0, 1.5fr);
  gap: 12px;
  align-items: start;
}
.admin-panel, .admin-chat-panel { min-width: 0; }
.panel {
  padding: 18px;
  min-width: 0;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(219, 227, 239, .95);
  background: rgba(255,255,255,.96);
  box-shadow: 0 12px 30px rgba(28, 39, 62, .07);
}
.admin-panel, .admin-chat-panel { padding: 14px; }
.admin-panel {
  max-height: calc(100vh - 156px);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #cfdbe7 transparent;
}
.admin-panel-primary {
  min-width: 0;
}
.admin-panel-frame {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
}
.admin-panel-body {
  min-width: 0;
  display: grid;
  gap: 12px;
  align-items: start;
}
.diagnostic-panel {
  padding: 14px;
  margin-bottom: 0;
  border: 1px solid #d8e6f2;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #f6fbff 0%, #ffffff 100%);
}
.diagnostic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
}
.diagnostic-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  background: #fff;
  align-self: start;
}
.diagnostic-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}
.diagnostic-card strong {
  display: block;
  font-size: 15px;
  line-height: 1.3;
  word-break: break-word;
}
.diagnostic-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  word-break: break-word;
}
.diagnostic-card p.bad { color: var(--danger); }
.diagnostic-card.wide { grid-column: 1 / -1; }
.worker-diagnostic {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #e4ebf4;
  border-radius: 12px;
  background: linear-gradient(180deg, #fbfdff 0%, #f7faff 100%);
  display: grid;
  gap: 12px;
}
.worker-diagnostic-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.worker-diagnostic-head strong {
  display: block;
  margin: 0;
  font-size: 16px;
}
.worker-diagnostic-head span {
  display: block;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.worker-diagnostic-badge {
  flex: 0 0 auto;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}
.worker-diagnostic-badge.ok {
  color: #176b87;
  background: #e8f4f6;
}
.worker-diagnostic-badge.warn {
  color: #b45309;
  background: #fff3dd;
}
.worker-diagnostic-alert {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #f1c6c6;
  border-radius: 10px;
  background: #fff7f7;
  font-size: 13px;
  line-height: 1.55;
}
.worker-diagnostic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
}
.worker-diagnostic-grid.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.worker-kv {
  min-width: 0;
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid #e7edf5;
  border-radius: 10px;
  background: #ffffff;
}
.worker-kv.wide {
  grid-column: 1 / -1;
}
.worker-kv label {
  display: block;
  width: auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.worker-kv code {
  display: block;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.worker-launch-box {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px dashed #c9d9e8;
  border-radius: 12px;
  background: #f7fbff;
}
.worker-media-test {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #dbe7f1;
  border-radius: 12px;
  background: #ffffff;
}
.worker-media-test-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.worker-media-test-head strong {
  display: block;
  margin: 0;
  font-size: 15px;
}
.worker-media-test-head p,
.worker-media-test-time,
.worker-media-test-skip {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}
.worker-launch-title {
  display: grid;
  gap: 4px;
}
.worker-launch-title strong {
  display: block;
  margin: 0;
  font-size: 15px;
}
.worker-launch-title span {
  display: block;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.worker-launch-steps {
  display: grid;
  gap: 6px;
}
.worker-launch-steps strong {
  display: block;
  margin: 0;
  font-size: 14px;
}
.worker-launch-steps p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}
.media-test-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
  align-items: start;
}
.media-test-item {
  padding: 8px 10px;
  border: 1px solid #e7edf5;
  border-radius: 10px;
  background: #fbfdff;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.45;
}
.media-test-item.bad {
  border-color: #f1c6c6;
  background: #fff7f7;
  color: var(--danger);
}
.media-test-failures {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}
.media-test-failures strong {
  display: block;
  margin: 0;
  font-size: 13px;
}
.media-test-failures p {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
}
.diagnostic-panel .toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.table-mini-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: start;
}
.table-mini-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #edf1f6;
  border-radius: var(--radius-sm);
  background: #fbfdff;
}
.table-mini-row b {
  min-width: 0;
  word-break: break-word;
  font-size: 13px;
}
.table-mini-row small {
  color: var(--muted);
  white-space: nowrap;
}
.diagnostics-error { margin-top: 10px; }
.swoole-sse-status {
  display: grid;
  gap: 7px;
  padding: 10px 12px;
  border: 1px solid #dfe8f3;
  border-radius: var(--radius-md);
  background: #fbfdff;
}
.swoole-sse-status.ok {
  border-color: #b9e7ce;
  background: #f3fbf7;
}
.swoole-sse-status.bad {
  border-color: #ffd0d0;
  background: #fff8f8;
}
.swoole-sse-status-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.swoole-sse-status-head strong { color: var(--ink); }
.swoole-sse-status-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.swoole-sse-status p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}
.swoole-sse-status p.bad { color: var(--danger); }
.settings-form { display: grid; gap: 9px; padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.settings-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  column-gap: 14px;
  row-gap: 16px;
}
.settings-grid .wide { grid-column: 1 / -1; }
.performance-profile-panel {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid #dce6f2;
  border-radius: var(--radius-md);
  background: #f8fbff;
}
.performance-profile-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.performance-profile-head .settings-note {
  margin-top: 6px;
}
.performance-profile-current {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 999px;
  background: #163b65;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}
.performance-profile-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.performance-profile-card {
  min-width: 0;
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 12px;
  border: 1px solid #dce6f2;
  border-radius: var(--radius-sm);
  background: #fff;
}
.performance-profile-card.active {
  border-color: #2b6fad;
  box-shadow: 0 0 0 2px rgba(43, 111, 173, .12);
}
.performance-profile-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.performance-profile-card-head strong {
  color: var(--ink);
  font-size: 15px;
}
.performance-profile-card-head span {
  color: #53677f;
  font-size: 12px;
  font-weight: 700;
}
.performance-profile-card p,
.performance-profile-card dd,
.performance-profile-notes span {
  margin: 0;
  color: #65758a;
  font-size: 12px;
  line-height: 1.5;
}
.performance-profile-card dl {
  display: grid;
  gap: 7px;
  margin: 0;
}
.performance-profile-card dl div {
  display: grid;
  gap: 2px;
}
.performance-profile-card dt,
.performance-profile-notes b {
  color: #24364a;
  font-size: 12px;
  font-weight: 800;
}
.performance-profile-notes {
  display: grid;
  gap: 7px;
  padding-top: 2px;
}
.performance-profile-notes .risk {
  padding-left: 8px;
  border-left: 2px solid #e7a33b;
}
.performance-profile-card .ghost {
  width: 100%;
  justify-content: center;
}
.performance-profile-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.performance-profile-summary span {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid #dce6f2;
  border-radius: var(--radius-sm);
  background: #fff;
  color: #42546b;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}
.setting-field {
  min-width: 0;
  display: grid;
  gap: 7px;
  align-content: start;
}
.setting-field label {
  min-width: 0;
}
.setting-field .settings-note {
  margin: 0;
  min-height: 36px;
  padding-left: 10px;
  border-left: 2px solid #dbe7f3;
  color: #738298;
  line-height: 1.55;
}
.permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 10px;
  align-items: start;
}
.user-permission-card {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid #dfe8f3;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #fbfdff 0%, #f6f9fc 100%);
}
.user-permission-card .meta-line {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}
.user-permission-card .check {
  min-height: 36px;
  gap: 8px;
  padding: 0;
  color: #62748d;
  font-size: 14px;
  line-height: 1.45;
}
.user-permission-card .check.wide {
  grid-column: auto;
  width: auto;
}
.user-permission-card .check input {
  flex: 0 0 auto;
}
.settings-note {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  margin-top: 14px;
}
.install-check-group {
  display: grid;
  gap: 10px;
}
.install-check-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.mail-settings-form { align-items: end; }
.admin-list-title { margin-top: 2px; }
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  scroll-margin-top: 92px;
}
.admin-panel .section-title h2, .admin-chat-panel .section-title h2 { font-size: 18px; }
.admin-panel .eyebrow, .admin-chat-panel .eyebrow { margin-bottom: 4px; }
.admin-chat-panel .section-title { margin-bottom: 12px; }
.admin-chat-panel .toolbar-actions .ghost { padding: 9px 12px; }
.section-title.compact { margin-top: 16px; margin-bottom: 8px; }
.toolbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.admin-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  margin-bottom: 12px;
}
.admin-search input {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 14px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.admin-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(23,107,135,.1);
  outline: none;
}
.admin-search button { white-space: nowrap; }
.admin-links-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 14px;
  padding: 10px 14px;
  background: linear-gradient(135deg, #f8fafb 0%, #f0f4f8 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.admin-links-filters .filter-group {
  display: flex;
  align-items: center;
  gap: 7px;
}
.admin-links-filters label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  letter-spacing: .3px;
  text-transform: uppercase;
}
.admin-links-filters select,
.admin-links-filters .filter-input {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
  color: var(--ink);
  min-width: 90px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.admin-links-filters select:hover,
.admin-links-filters .filter-input:hover {
  border-color: var(--primary);
}
.admin-links-filters select:focus,
.admin-links-filters .filter-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(23,107,135,.1);
  outline: none;
}
.admin-links-filters .filter-input {
  width: 130px;
}
.user-link-tabs {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
  margin: 0 0 14px;
  border: 1px solid var(--theme-border, var(--line));
  border-radius: 999px;
  background: #f8fbff;
}
.user-link-tabs button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--theme-muted, var(--muted));
  font-weight: 800;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}
.user-link-tabs button.active {
  background: linear-gradient(135deg, var(--theme-primary, #3b82f6), var(--theme-primary-deep, #2563eb));
  color: #fff;
  box-shadow: 0 8px 18px rgba(37, 99, 235, .18);
}
.user-link-tabs button small {
  min-width: 22px;
  min-height: 22px;
  display: inline-grid;
  place-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(100, 116, 139, .12);
  color: inherit;
  font-size: 12px;
  line-height: 1;
}
.user-link-tabs button.active small {
  background: rgba(255,255,255,.22);
}
.link-list { display: grid; gap: 12px; }
.link-card, .branch-row, .audit-msg {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 10px 11px;
  background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.link-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px 16px;
  align-items: center;
}
.user-card {
  display: grid;
  grid-template-columns: auto 46px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 10px;
  background: #fff;
  margin-bottom: 10px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.user-card.active { border-color: rgba(23,107,135,.45); box-shadow: 0 10px 26px rgba(23,107,135,.08); }
.user-select { align-self: start; padding-top: 12px; }
.user-card img {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: 0 4px 12px rgba(24,32,51,.12);
}
.user-meta { min-width: 0; }
.user-card p { margin: 4px 0; color: var(--muted); word-break: break-all; }
.user-card small { color: var(--muted); line-height: 1.55; }
.admin-users-panel { background: #fff; }
.admin-users-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
  scroll-margin-top: 92px;
}
.admin-users-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.admin-users-title h2 { margin: 0; font-size: 26px; letter-spacing: 0; }
.admin-users-search {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto;
  gap: 8px;
  min-width: min(420px, 100%);
}
.admin-users-tabs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 2px 0 18px;
  color: var(--primary);
}
.admin-users-tabs button {
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--primary);
  padding: 6px 8px;
  font-weight: 700;
}
.admin-users-tabs button.active {
  background: #0f9fb3;
  color: #fff;
}
.admin-users-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.admin-users-page { display: flex; align-items: center; justify-content: flex-end; gap: 6px; color: var(--muted); }
.admin-users-page .ghost { min-width: 36px; padding: 8px 10px; }
.admin-users-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
}
.admin-users-table {
  width: 100%;
  min-width: 1540px;
  border-collapse: collapse;
  font-size: 14px;
}
.admin-users-table th,
.admin-users-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  white-space: nowrap;
}
.admin-users-table th {
  color: #2673a8;
  background: #fbfcfe;
  font-weight: 700;
}
.admin-users-table th button {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  font: inherit;
}
.admin-users-table tbody tr:nth-child(odd) { background: #f7f7f7; }
.admin-users-table tbody tr:hover { background: #eef7fa; }
.admin-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: 0 3px 10px rgba(24,32,51,.12);
}
.table-link { color: #2176b7; }
.admin-users-empty { text-align: center; color: var(--muted); padding: 26px !important; }
.admin-users-actions { display: flex; align-items: center; gap: 6px; }
.admin-users-actions .ghost { padding: 7px 10px; }
.admin-user-editor-panel { width: min(860px, 100%); max-height: min(88vh, 840px); overflow: auto; }
.admin-user-editor-form .avatar-picker { padding: 8px 0 2px; }
.security-event-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 11px;
  background: #fff;
  margin-bottom: 10px;
}
.security-event-card p { color: var(--muted); margin: 6px 0; word-break: break-all; }
.security-event-card small { color: var(--muted); line-height: 1.55; }
.queue-chart-bar {
  display: flex;
  width: 100%;
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef3f7;
  margin: 10px 0 12px;
}
.queue-chart-segment {
  min-width: 0;
  height: 100%;
  transition: width .2s ease;
}
.queue-chart-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 8px;
}
.queue-chart-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.queue-chart-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex: 0 0 auto;
}
.queue-chart-legend-item strong {
  color: var(--ink);
  font-size: 13px;
}
.queue-chart-legend-item small {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 8px 0 10px;
  color: var(--muted);
  font-size: 13px;
}
.pager span { text-align: center; }
.admin-link-card.active, .admin-branch-row.active { border-color: rgba(23,107,135,.55); box-shadow: 0 10px 26px rgba(23,107,135,.08); }
.admin-link-card {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 14px 16px;
  padding: 16px 18px;
}
.admin-link-card .select-check {
  grid-row: 1 / span 2;
  align-self: center;
}
.admin-link-card .link-meta {
  grid-column: 2;
  align-self: start;
}
.admin-link-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.admin-link-card .link-meta strong {
  display: block;
  font-size: 17px;
  line-height: 1.3;
  letter-spacing: .01em;
  color: #1f2b3d;
}
.admin-link-status {
  flex: 0 0 auto;
  min-height: 24px;
  padding: 4px 10px;
  font-size: 12px;
}
.admin-link-card p {
  margin: 7px 0;
  font-size: 14px;
  line-height: 1.55;
  word-break: break-word;
}
.admin-link-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: #56667d;
}
.admin-link-summary span:not(.type-badge) {
  position: relative;
}
.admin-link-summary span:not(.type-badge):not(:last-child)::after {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  margin-left: 10px;
  border-radius: 999px;
  background: #c7d3e0;
  vertical-align: middle;
}
.admin-link-details {
  margin-top: 8px;
  color: #70819a;
  font-size: 12px;
  line-height: 1.6;
}
.admin-link-details span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.admin-link-time {
  display: block;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #e5ecf4;
  color: #7d8ca2;
  font-size: 12px;
  letter-spacing: .01em;
}
.admin-link-card small {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.65;
  word-break: break-word;
}
.admin-link-card .card-actions {
  grid-column: 1 / -1;
  justify-content: flex-start;
  padding-top: 10px;
  margin-top: 2px;
  border-top: 1px solid #edf2f7;
}
.admin-link-card .card-actions button {
  min-width: 76px;
  padding: 8px 12px;
  font-size: 14px;
}
.link-meta {
  min-width: 0;
  align-self: center;
}
.select-check { display: grid; place-items: center; flex: 0 0 auto; cursor: pointer; }
.select-check input { width: 18px; height: 18px; accent-color: var(--primary); }
.link-card p { color: var(--muted); margin: 6px 0; word-break: break-all; }
.link-card small, .branch-row small, .audit-msg small, time { color: var(--muted); }
.meta-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.status-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}
.status-active { color: #0f6b4f; background: #e5f7ef; border: 1px solid #b8e6d0; }
.status-closed { color: #855b00; background: #fff4d6; border: 1px solid #f1d58d; }
.status-destroyed { color: #b42318; background: #fff0f0; border: 1px solid #f2b8b5; }
.status-deleted { color: #6b21a8; background: #f5f3ff; border: 1px solid #ddd6fe; }
.status-unknown { color: var(--muted); background: #eef3f7; border: 1px solid var(--line); }
.type-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 23px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
  vertical-align: middle;
}
.type-group { color: #7a2e0e; background: #fff1e6; border: 1px solid #f2c7a5; }
.type-direct { color: #155e75; background: #e7f6fb; border: 1px solid #b8e1ec; }
.password-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  min-height: 23px;
  padding: 3px 9px;
  border-radius: 999px;
  color: #9f1239;
  background: #fff1f2;
  border: 1px solid #fda4af;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
}
.password-badge i {
  color: #e11d48;
  font-size: 11px;
}
.type-main { color: #0f6b4f; background: #e5f7ef; border: 1px solid #b8e6d0; }
.type-branch { color: #31518c; background: #eef4ff; border: 1px solid #c7d8fa; }
.type-pending { color: #6b5b14; background: #fff8db; border: 1px solid #eadc97; }
.type-owner { color: #7a2e0e; background: #fff1e6; border: 1px solid #f2c7a5; }
.type-user { color: #155e75; background: #e7f6fb; border: 1px solid #b8e1ec; }
.type-guest { color: #31518c; background: #eef4ff; border: 1px solid #c7d8fa; }
.card-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.card-actions button,
.card-actions a.ghost {
  min-height: 38px;
  padding: 8px 12px;
  white-space: nowrap;
}
.card-actions a.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.chat-shell {
  min-height: 100vh;
  min-height: 100dvh;
  min-height: var(--app-vh, 100vh);
  display: grid;
  width: 100%;
  max-width: 100%;
  padding: 0;
  overflow: hidden;
  background: linear-gradient(180deg, #eff4fa 0%, #ebf1f8 100%);
  touch-action: manipulation;
  overscroll-behavior: none;
}
.chat-shell-enter,
.chat-shell-direct {
  place-items: center;
  padding: clamp(18px, 4vw, 56px);
}
.chat-shell-group {
  place-items: stretch;
  padding: 0;
}
.enter-panel-shell {
  width: min(100%, 560px);
  margin: 0;
  padding: 0;
  display: grid;
  place-items: center;
}
.enter-panel {
  width: min(520px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 22px;
  padding: 38px;
  border: 1px solid rgba(223,229,239,.92);
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(23,107,135,.08), transparent 15rem),
    linear-gradient(180deg, rgba(255,255,255,.98) 0%, rgba(248,251,255,.98) 100%);
  box-shadow: 0 22px 60px rgba(28,39,62,.12);
}
.enter-panel-hero {
  display: grid;
  gap: 12px;
}
.enter-panel-hero h1 {
  max-width: 10em;
  color: #172033;
  font-size: 42px;
  line-height: 1.12;
  letter-spacing: 0;
}
.enter-panel-hero .muted {
  max-width: 30em;
  font-size: 15px;
  line-height: 1.75;
}
.enter-form {
  gap: 16px;
}
.enter-field {
  display: grid;
  gap: 10px;
}
.enter-field > span {
  color: #587086;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .02em;
}
.enter-field input {
  min-height: 52px;
  border-radius: 14px;
  font-size: 15px;
}
.enter-submit {
  min-height: 56px;
  border-radius: 16px;
  font-size: 17px;
  letter-spacing: .01em;
}
.enter-error {
  margin-top: 2px;
}
.direct-chat-panel {
  width: min(900px, 100%);
  height: min(760px, calc(100vh - 110px));
  height: min(760px, calc(100dvh - 110px));
  height: min(760px, calc(var(--app-vh, 100vh) - 110px));
}
.chat-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: hidden;
  background: #eceff3;
}
.chat-panel.group-workspace {
  width: 100%;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  height: var(--app-vh, 100vh);
  place-self: stretch;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: #f5f7fb;
  grid-template-columns: minmax(280px, 22vw) minmax(0, 1fr) minmax(300px, 23vw);
  grid-template-rows: auto minmax(0, 1fr) auto;
  backdrop-filter: none;
}
.group-workspace .group-left-pane {
  grid-column: 1;
  grid-row: 1 / 4;
  display: flex;
  flex-direction: column;
  align-self: stretch;
  height: var(--app-vh, 100vh);
  max-height: var(--app-vh, 100vh);
  border-right: 1px solid rgba(224, 231, 242, .95);
  background: linear-gradient(180deg, #f1f3f6 0%, #eceff4 100%);
  min-height: 0;
  overflow: hidden;
  -webkit-overflow-scrolling: touch;
}
.group-workspace .chat-head,
.group-workspace .group-call-cloud-slot,
.group-workspace .message-stage,
.group-workspace .composer {
  grid-column: 2;
}
.group-workspace .chat-head { grid-row: 1; }
.group-workspace .message-stage { grid-row: 2; }
.group-workspace .composer { grid-row: 3; }
.group-workspace .group-call-cloud-slot { grid-row: 2; }
.group-workspace.has-active-group-call {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}
.group-workspace.has-active-group-call .group-left-pane,
.group-workspace.has-active-group-call .group-right-pane {
  grid-row: 1 / 5;
}
.group-workspace.has-active-group-call .message-stage { grid-row: 3; }
.group-workspace.has-active-group-call .composer { grid-row: 4; }
.group-workspace .group-right-pane {
  grid-column: 3;
  grid-row: 1 / 4;
  display: flex;
  flex-direction: column;
  align-self: stretch;
  height: var(--app-vh, 100vh);
  max-height: var(--app-vh, 100vh);
  padding: 18px 18px 20px;
  border-left: 1px solid rgba(224, 231, 242, .95);
  background: linear-gradient(180deg, #f8f8f9 0%, #f4f5f7 100%);
  overflow: hidden;
  -webkit-overflow-scrolling: touch;
  transition: transform .2s ease, opacity .2s ease;
}
.desktop-session-pane {
  flex: 1 1 auto;
  min-height: 0;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background: rgba(255,255,255,.48);
  overflow: hidden;
}
.desktop-session-head {
  padding: 18px 16px 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  align-items: center;
  border-bottom: 1px solid rgba(225, 232, 241, .92);
}
.desktop-session-search {
  min-height: 46px;
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border-radius: 14px;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(222, 230, 239, .95);
  color: #a0a8b6;
}
.desktop-session-search input {
  border: 0;
  padding: 0;
  background: transparent;
  min-width: 0;
  box-shadow: none;
  color: #4b5563;
}
.desktop-session-search input:focus {
  border: 0;
  box-shadow: none;
}
.desktop-session-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 0;
  padding: 0;
  -webkit-overflow-scrolling: touch;
  background: rgba(255,255,255,.58);
}
.desktop-session-empty {
  min-height: 100%;
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 10px;
  padding: 120px 24px 24px;
  color: #7f8da4;
  text-align: center;
}
.desktop-session-empty i {
  font-size: 28px;
  color: #99a7bc;
}
.desktop-session-empty strong {
  font-size: 18px;
  font-weight: 700;
  color: #7f8da4;
}
.desktop-session-empty p {
  margin: 0;
  max-width: 220px;
  line-height: 1.7;
  color: #97a4b8;
}
.desktop-session-list .empty-line {
  padding: 24px 18px;
}
.private-session-row,
.group-member-row,
.group-member-card {
  width: 100%;
  display: grid;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.private-session-row,
.group-member-row {
  grid-template-columns: 46px minmax(0, 1fr) auto;
  padding: 16px 16px 16px 18px;
}
.private-session-row img,
.group-member-row img {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  object-fit: cover;
}
.group-member-row span {
  min-width: 0;
  display: grid;
  gap: 4px;
  font-size: 16px;
  font-weight: 400;
}
.group-member-row small {
  color: #9ba6b5;
  font-size: 13px;
  font-weight: 500;
}
.private-session-row .member-ip-line {
  display: block;
  margin-top: -1px;
  color: #7c8aa0;
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.group-member-row.active,
.group-member-row:hover,
.private-session-row.active,
.private-session-row:hover,
.group-member-card.active,
.group-member-card:hover {
  background: rgba(255,255,255,.74);
  border-color: rgba(205, 216, 229, .94);
  box-shadow: none;
}
.private-session-row {
  border-radius: 0;
  border-left: 3px solid transparent;
  border-right: 0;
  border-top: 0;
  border-bottom: 1px solid rgba(229, 234, 241, .88);
}
.private-session-row:hover,
.private-session-row:focus-visible {
  transform: none;
  outline: none;
}
.private-session-row.active {
  border-left-color: #1aad63;
  background: rgba(255,255,255,.9);
  box-shadow: inset 0 0 0 1px rgba(219, 231, 244, .8);
}
.private-session-meta {
  align-self: start;
  color: #a3acb9;
  font-size: 12px;
  font-weight: 500;
}
.private-session-row.muted,
.group-member-row.muted,
.group-member-card.muted { opacity: .78; }
.group-notice-card,
.group-member-panel {
  border: 1px solid rgba(228, 233, 241, .94);
  border-radius: 22px;
  background: rgba(255,255,255,.9);
  padding: 18px;
  box-shadow: none;
}
.desktop-member-panel {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.group-right-pane { gap: 0; }
.group-right-pane h3 { margin: 0; }
.desktop-info-pane {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-height: 100%;
  gap: 14px;
  overflow: hidden;
}
.desktop-member-overview {
  padding: 4px 2px 8px;
}
.desktop-member-search {
  min-height: 40px;
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 0 14px;
  border-radius: 13px;
  background: rgba(232, 232, 234, .92);
  color: #9b9fa8;
}
.desktop-member-search input {
  border: 0;
  padding: 0;
  min-width: 0;
  background: transparent;
  box-shadow: none;
  color: #4b5563;
}
.desktop-member-search input:focus {
  border: 0;
  box-shadow: none;
}
.desktop-member-avatars {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px 12px;
  padding: 18px 10px 6px;
}
.desktop-member-avatar-item {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
  color: #8b95a5;
  font-size: 12px;
}
.desktop-member-avatar-item img,
.desktop-member-avatar-plus {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  object-fit: cover;
  background: rgba(255,255,255,.96);
  border: 1px solid rgba(220, 227, 236, .95);
}
.desktop-member-avatar-plus {
  display: grid;
  place-items: center;
  color: #a7b0bc;
  font-size: 20px;
}
.desktop-info-card {
  padding: 18px 18px 16px;
}
.desktop-info-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.desktop-info-count {
  min-width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(230, 236, 245, .9);
  color: #7f8ca0;
  font-size: 14px;
  font-weight: 700;
}
.desktop-info-value {
  margin: 0;
  color: #9ba6b5;
  font-size: 17px;
  line-height: 1.5;
}
.group-member-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.group-member-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.desktop-member-actions {
  margin-bottom: 14px;
}
.desktop-member-actions .ghost,
.desktop-member-actions .danger {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 14px;
  box-shadow: none;
}
.subtle-danger {
  background: rgba(255, 240, 240, .84);
  color: #d97874;
  border: 1px solid rgba(249, 214, 214, .92);
}
.group-member-grid {
  display: grid;
  gap: 10px;
}
.desktop-member-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  align-content: start;
  gap: 12px;
  padding-right: 2px;
  -webkit-overflow-scrolling: touch;
}
.desktop-member-panel .desktop-member-list {
  padding-bottom: 12px;
}
.group-member-card {
  position: relative;
  grid-template-columns: 42px minmax(0, 1fr);
  padding: 10px 12px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}
.group-member-card img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(24,32,51,.12);
}
.group-member-card-body { min-width: 0; display: grid; gap: 4px; }
.group-member-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.group-member-card-top strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.member-remark-chip {
  display: inline-block;
  max-width: min(150px, 100%);
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 6px;
  background: #eef7f3;
  color: #0f766e;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.35;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.private-session-row .member-remark-chip {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 3px 0 0;
}
.member-role-pill {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e7f6fb;
  color: #155e75;
  font-size: 11px;
  font-weight: 800;
}
.member-role-pill.muted { background: #fff1d6; color: #8a5a00; }
.group-member-card small { color: var(--muted); line-height: 1.45; }
.group-member-card .member-ip-line {
  display: block;
  margin-top: 1px;
  color: #6b7b93;
  font-size: 11px;
  line-height: 1.45;
  word-break: break-all;
}
.group-notice-text {
  margin: 0;
  color: #44546a;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}
.member-select-check {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
}
.member-select-check input {
  width: 16px;
  height: 16px;
}
.member-kick-btn {
  position: absolute;
  top: 8px;
  right: 10px;
  z-index: 1;
  padding: 6px 10px;
  font-size: 12px;
}
.member-remark-btn {
  position: absolute;
  top: 42px;
  right: 10px;
  z-index: 1;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1;
}
.group-member-card .member-kick-btn,
.group-member-card .member-remark-btn,
.group-member-card .member-select-check {
  opacity: .98;
}
.mobile-group-notice { display: none; }
.mobile-back-chat { margin-top: 8px; }
.mobile-group-strip { display: none; }
.chat-head-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.chat-head-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.chat-title-row {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.chat-head-copy h2 {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.direct-participant-count {
  flex: 0 0 auto;
  color: #8e98a8;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}
.chat-head-subline {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.chat-nav-btn,
.chat-menu-btn,
.chat-info-close {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  color: #111827;
}
.chat-nav-btn:hover,
.chat-menu-btn:hover,
.chat-info-close:hover,
.chat-nav-btn:focus-visible,
.chat-menu-btn:focus-visible,
.chat-info-close:focus-visible {
  background: rgba(15, 23, 42, .06);
  outline: none;
}
.chat-menu-btn i,
.chat-info-close i {
  font-size: 18px;
}
.chat-nav-btn i {
  font-size: 22px;
}
.mobile-chat-info-page {
  display: none;
}
.mobile-chat-info-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 14px;
  border-bottom: 1px solid rgba(224, 231, 240, .82);
  background:
    linear-gradient(180deg, rgba(255,255,255,.98) 0%, rgba(246,249,252,.95) 100%);
  box-shadow: 0 12px 28px rgba(15, 23, 42, .045);
}
.mobile-chat-info-title {
  min-width: 0;
  display: grid;
  gap: 5px;
  flex: 1 1 auto;
  padding-top: 2px;
  text-align: center;
}
.mobile-chat-info-title strong {
  color: #0f172a;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -.02em;
}
.mobile-chat-info-title span {
  color: #728196;
  font-size: 12px;
  line-height: 1.35;
  max-width: 18rem;
  justify-self: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mobile-chat-info-head .chat-nav-btn,
.mobile-chat-info-head .chat-info-close {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(247,250,253,.98) 0%, rgba(240,245,249,.96) 100%);
  color: #223042;
  box-shadow: inset 0 0 0 1px rgba(224, 231, 240, .92), 0 4px 10px rgba(15, 23, 42, .035);
}
.mobile-chat-info-head .chat-nav-btn i {
  font-size: 20px;
}
.mobile-chat-info-head .chat-info-close i {
  font-size: 16px;
}
.mobile-chat-info-body {
  min-height: 0;
  overflow: auto;
  display: grid;
  gap: 16px;
  padding: 16px 14px calc(22px + var(--safe-bottom));
  background: #f3f4f6;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}
.mobile-chat-info-card {
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.96) 0%, rgba(249,251,253,.94) 100%);
  border: 1px solid rgba(224, 231, 240, .92);
  box-shadow: 0 12px 30px rgba(15, 23, 42, .055);
}
.mobile-chat-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.mobile-chat-card-head h3 {
  margin: 0;
  font-size: 19px;
  line-height: 1.15;
}
.mobile-chat-info-copy {
  margin: 0 0 14px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.7;
}
.mobile-chat-member-actions {
  margin-bottom: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}
.mobile-chat-member-actions .ghost,
.mobile-chat-member-actions .danger {
  min-width: 0;
  min-height: 46px;
  padding: 0 10px;
  border-radius: 16px;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  box-shadow: none;
}
.mobile-chat-member-actions .ghost:disabled,
.mobile-chat-member-actions .danger:disabled {
  opacity: .72;
}
.mobile-chat-member-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px 12px;
}
.mobile-chat-member-card {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 8px;
  align-content: start;
  min-height: 168px;
  padding: 42px 8px 10px;
  border: 1px solid rgba(225, 232, 241, .96);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,.99) 0%, rgba(248,250,252,.98) 100%);
  text-align: center;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .045);
}
.mobile-chat-member-card:hover,
.mobile-chat-member-card:focus-visible {
  border-color: rgba(169, 205, 214, .96);
  background: linear-gradient(180deg, rgba(247,251,253,.99) 0%, rgba(241,247,249,.98) 100%);
  outline: none;
}
.mobile-chat-member-card img,
.mobile-chat-member-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: 0 6px 16px rgba(15, 23, 42, .10);
}
.mobile-chat-member-icon {
  display: grid;
  place-items: center;
  background: #edf7f8;
  color: var(--primary);
  font-size: 20px;
}
.mobile-chat-member-card strong,
.mobile-chat-member-card small {
  display: block;
  width: 100%;
}
.mobile-chat-member-card strong {
  color: #1f2937;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.3;
  min-height: calc(1.3em * 2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.mobile-chat-member-card strong .member-remark-chip {
  display: block;
  max-width: 100%;
  width: fit-content;
  margin: 4px auto 0;
}
.mobile-chat-member-card small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  min-height: calc(1.35em * 2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mobile-chat-member-card .member-ip-line {
  min-height: auto;
  color: #6b7b93;
  font-size: 10px;
  line-height: 1.3;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mobile-chat-member-card.active {
  border-color: rgba(137, 189, 202, .96);
  background: linear-gradient(180deg, rgba(244,250,252,.99) 0%, rgba(237,246,248,.98) 100%);
  box-shadow: 0 12px 24px rgba(23,107,135,.10);
}
.mobile-chat-member-card.muted {
  background: linear-gradient(180deg, rgba(255,250,240,.98) 0%, rgba(255,247,233,.98) 100%);
  border-color: rgba(239, 225, 196, .9);
}
.mobile-chat-member-card .member-select-check {
  top: 8px;
  left: 8px;
  z-index: 2;
  padding: 0;
  background: rgba(255,255,255,.96);
  border-radius: 8px;
}
.mobile-chat-member-card .member-kick-btn {
  top: 8px;
  right: 8px;
  z-index: 2;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1;
  box-shadow: 0 6px 16px rgba(239, 68, 68, .12);
}
.mobile-chat-member-card .member-remark-btn {
  top: 40px;
  right: 8px;
  z-index: 2;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 10px;
  font-size: 11px;
  line-height: 1;
  background: rgba(255,255,255,.96);
}
.mobile-chat-card-head .meta-chip {
  flex: 0 0 auto;
  margin-top: 3px;
  padding: 8px 13px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(241,246,250,.98) 0%, rgba(235,241,247,.96) 100%);
  color: #5b6c80;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .01em;
  box-shadow: inset 0 0 0 1px rgba(228, 235, 243, .9), 0 4px 10px rgba(15, 23, 42, .028);
}
.mobile-chat-info-actions {
  padding: 4px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(249,251,253,.98) 0%, rgba(241,245,249,.96) 100%);
  border: 1px solid rgba(226, 233, 241, .92);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.82), 0 8px 18px rgba(15, 23, 42, .04);
}
.mobile-chat-return-btn {
  width: 100%;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 18px;
  background: linear-gradient(180deg, #178fc6 0%, #136f9a 56%, #125f85 100%);
  color: #ffffff;
  box-shadow: 0 14px 28px rgba(19, 111, 154, .24);
}
.mobile-chat-return-btn i {
  font-size: 16px;
}
.mobile-chat-info-card .group-notice-text {
  position: relative;
  padding: 16px 16px 16px 18px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(248,250,253,.99) 0%, rgba(242,246,250,.98) 100%);
  border: 1px solid rgba(227, 234, 242, .92);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.86), 0 6px 16px rgba(15, 23, 42, .028);
  color: #49586d;
  font-size: 14px;
  line-height: 1.78;
}
.mobile-chat-info-card .group-notice-text::before {
  content: "";
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 0;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(23,107,135,.88), rgba(25,150,180,.46));
}
.private-chat-layer { position: fixed; inset: 0; z-index: 40; pointer-events: none; }
.private-chat-window {
  position: fixed;
  width: min(400px, calc(100vw - 24px));
  height: min(520px, calc(100vh - 96px));
  min-width: 360px;
  min-height: 360px;
  --private-bubble-max-width: calc(100% - var(--chat-avatar-size) - var(--chat-gap) - 18px);
  --media-card-width: min(100%, 22rem);
  --media-audio-width: min(100%, 20rem);
  --media-video-width: min(100%, 22rem);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 20px 70px rgba(28,39,62,.2);
  overflow: hidden;
  pointer-events: auto;
}
.private-chat-window.active { border-color: rgba(23,107,135,.55); box-shadow: 0 24px 80px rgba(23,107,135,.22); }
.private-chat-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #f7fafc;
  cursor: move;
}
.private-chat-title span { display: inline-flex; align-items: center; gap: 8px; min-width: 0; font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.private-message-stage { min-height: 0; }
.private-chat-messages { min-height: 0; overflow-x: hidden; overflow-y: auto; padding: 12px; background: #EDEDED; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
.private-chat-messages .msg-row:last-child { margin-bottom: 0; }
.private-chat-messages .group-chat-row {
  gap: var(--chat-gap);
}
.private-chat-messages .group-chat-body {
  width: var(--private-bubble-max-width);
  max-width: var(--private-bubble-max-width);
}
.private-chat-messages .group-chat-body .message-stack {
  width: 100%;
  max-width: 100%;
}
.private-chat-messages .group-chat-bubble {
  max-width: 100%;
}
.private-chat-messages .group-chat-bubble:has(.media-audio) {
  width: min(var(--private-bubble-max-width), 24rem);
  max-width: min(100%, var(--private-bubble-max-width));
}
.private-chat-messages .group-chat-bubble:has(.media-video) {
  width: min(var(--private-bubble-max-width), calc(var(--media-video-width) + 18px));
  max-width: min(100%, var(--private-bubble-max-width));
}

/* Modern blue/cyan theme for user/admin centers. */
:root {
  --theme-primary: #3b82f6;
  --theme-primary-deep: #2563eb;
  --theme-primary-soft: #eff6ff;
  --theme-accent: #06b6d4;
  --theme-accent-soft: #ecfeff;
  --theme-pink: #ec4899;
  --theme-purple: #8b5cf6;
  --theme-orange: #f97316;
  --theme-bg: #f5f7fa;
  --theme-ink: #1e293b;
  --theme-muted: #64748b;
  --theme-panel: #ffffff;
  --theme-border: rgba(226, 232, 240, .8);
  --theme-shadow: 0 1px 3px rgba(0,0,0,.04), 0 4px 12px rgba(0,0,0,.03);
  --theme-card-shadow: 0 1px 2px rgba(0,0,0,.03), 0 2px 8px rgba(0,0,0,.02);
}

body:has(.user-shell),
body:has(.admin-shell) {
  background: var(--theme-bg);
  color: var(--theme-ink);
}

body:has(.user-shell)::before,
body:has(.admin-shell)::before {
  content: "";
  position: fixed;
  inset: 68px 0 auto;
  height: 260px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(59,130,246,.03), transparent);
  z-index: -1;
}

body:has(.user-shell) .topbar,
body:has(.admin-shell) .topbar {
  border-bottom-color: var(--theme-border);
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(12px) saturate(1.1);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

body:has(.user-shell) .brand,
body:has(.admin-shell) .brand {
  color: var(--theme-ink);
}

body:has(.user-shell) .brand-mark,
body:has(.admin-shell) .brand-mark {
  background: linear-gradient(145deg, var(--theme-primary), var(--theme-primary-deep));
  box-shadow: 0 8px 20px rgba(59,130,246,.22), inset 0 1px 0 rgba(255,255,255,.28);
}

body:has(.user-shell) nav a:hover,
body:has(.admin-shell) nav a:hover {
  color: var(--theme-primary);
}

body:has(.user-shell) .admin-shell,
body:has(.admin-shell) .admin-shell,
body:has(.user-shell) .user-shell,
body:has(.admin-shell) .user-shell {
  gap: clamp(14px, 1.6vw, 20px);
}

body:has(.user-shell) .panel,
body:has(.admin-shell) .panel,
body:has(.user-shell) .admin-sidebar,
body:has(.admin-shell) .admin-sidebar,
body:has(.user-shell) .user-sidebar,
body:has(.admin-shell) .user-sidebar,
body:has(.user-shell) .admin-content-panel,
body:has(.admin-shell) .admin-content-panel,
body:has(.user-shell) .user-content-panel,
body:has(.admin-shell) .user-content-panel,
body:has(.user-shell) .modal-panel,
body:has(.admin-shell) .modal-panel {
  border-color: var(--theme-border);
  background: var(--theme-panel);
  box-shadow: var(--theme-shadow);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

body:has(.user-shell) .admin-sidebar,
body:has(.admin-shell) .admin-sidebar,
body:has(.user-shell) .user-sidebar,
body:has(.admin-shell) .user-sidebar {
  overflow: hidden;
}

body:has(.user-shell) .admin-sidebar::before,
body:has(.admin-shell) .admin-sidebar::before,
body:has(.user-shell) .user-sidebar::before,
body:has(.admin-shell) .user-sidebar::before {
  content: "";
  display: block;
  height: 3px;
  margin: -18px -14px 14px;
  background: linear-gradient(90deg, var(--theme-primary), var(--theme-accent));
  border-radius: 0 0 2px 2px;
}

body:has(.user-shell) .eyebrow,
body:has(.admin-shell) .eyebrow,
body:has(.user-shell) .home-kicker,
body:has(.admin-shell) .home-kicker {
  color: var(--theme-primary);
}

body:has(.user-shell) h1,
body:has(.admin-shell) h1,
body:has(.user-shell) h2,
body:has(.admin-shell) h2,
body:has(.user-shell) .section-title h2,
body:has(.admin-shell) .section-title h2 {
  color: var(--theme-ink);
  letter-spacing: -.01em;
}

body:has(.user-shell) .admin-sidebar-head,
body:has(.admin-shell) .admin-sidebar-head,
body:has(.user-shell) .user-sidebar-head,
body:has(.admin-shell) .user-sidebar-head {
  border-bottom-color: var(--theme-border);
}

body:has(.user-shell) .admin-tabs a,
body:has(.admin-shell) .admin-tabs a,
body:has(.user-shell) .user-tabs a,
body:has(.admin-shell) .user-tabs a {
  min-height: 46px;
  border-color: transparent;
  background: #f8fafc;
  color: var(--theme-muted);
  box-shadow: none;
}

body:has(.user-shell) .admin-tabs a:hover,
body:has(.admin-shell) .admin-tabs a:hover,
body:has(.user-shell) .admin-tabs a.active,
body:has(.admin-shell) .admin-tabs a.active,
body:has(.user-shell) .user-tabs a:hover,
body:has(.admin-shell) .user-tabs a:hover,
body:has(.user-shell) .user-tabs a.active,
body:has(.admin-shell) .user-tabs a.active {
  border-color: rgba(59,130,246,.2);
  background: var(--theme-primary-soft);
  color: var(--theme-primary-deep);
  box-shadow: 0 2px 8px rgba(59,130,246,.06);
}

body:has(.user-shell) .admin-tabs a.active,
body:has(.admin-shell) .admin-tabs a.active,
body:has(.user-shell) .user-tabs a.active,
body:has(.admin-shell) .user-tabs a.active {
  position: relative;
}

body:has(.user-shell) .admin-tabs a.active::before,
body:has(.admin-shell) .admin-tabs a.active::before,
body:has(.user-shell) .user-tabs a.active::before,
body:has(.admin-shell) .user-tabs a.active::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-right: 9px;
  border-radius: 999px;
  background: var(--theme-accent);
  box-shadow: 0 0 0 3px rgba(6,182,212,.14);
}

body:has(.user-shell) input,
body:has(.admin-shell) input,
body:has(.user-shell) select,
body:has(.admin-shell) select,
body:has(.user-shell) textarea,
body:has(.admin-shell) textarea {
  min-height: 44px;
  border-color: #e2e8f0;
  background: #fff;
  color: var(--theme-ink);
  font-size: max(16px, 1em);
  box-shadow: 0 1px 2px rgba(0,0,0,.03);
  -webkit-appearance: none;
  appearance: none;
}

body:has(.user-shell) input:focus,
body:has(.admin-shell) input:focus,
body:has(.user-shell) select:focus,
body:has(.admin-shell) select:focus,
body:has(.user-shell) textarea:focus,
body:has(.admin-shell) textarea:focus {
  border-color: var(--theme-primary);
  box-shadow: 0 0 0 3px rgba(59,130,246,.12), 0 1px 2px rgba(0,0,0,.03);
}

body:has(.user-shell) button:focus-visible,
body:has(.admin-shell) button:focus-visible,
body:has(.user-shell) a:focus-visible,
body:has(.admin-shell) a:focus-visible {
  outline: 2px solid rgba(59,130,246,.5);
  outline-offset: 3px;
}

body:has(.user-shell) .primary,
body:has(.admin-shell) .primary {
  background: linear-gradient(135deg, var(--theme-primary), var(--theme-primary-deep));
  color: #fff;
  box-shadow: 0 4px 14px rgba(59,130,246,.22);
}

body:has(.user-shell) .primary:hover,
body:has(.admin-shell) .primary:hover {
  background: linear-gradient(135deg, #4f8ff7, #1d5fd9);
}

body:has(.user-shell) .ghost,
body:has(.admin-shell) .ghost {
  background: #f8fafc;
  color: var(--theme-ink);
  box-shadow: inset 0 0 0 1px #e2e8f0;
}

body:has(.user-shell) .ghost:hover,
body:has(.admin-shell) .ghost:hover {
  background: #f1f5f9;
  color: var(--theme-primary-deep);
}

body:has(.user-shell) .ghost.warn,
body:has(.admin-shell) .ghost.warn,
body:has(.user-shell) .danger,
body:has(.admin-shell) .danger {
  background: #fef2f2;
  color: #dc2626;
  box-shadow: inset 0 0 0 1px rgba(239,68,68,.15);
}

body:has(.user-shell) .icon-btn,
body:has(.admin-shell) .icon-btn {
  background: var(--theme-primary-soft);
  color: var(--theme-primary);
}

body:has(.user-shell) .avatar-profile,
body:has(.admin-shell) .avatar-profile,
body:has(.user-shell) .admin-subpanel,
body:has(.admin-shell) .admin-subpanel,
body:has(.user-shell) .diagnostic-panel,
body:has(.admin-shell) .diagnostic-panel,
body:has(.user-shell) .user-permission-card,
body:has(.admin-shell) .user-permission-card,
body:has(.user-shell) .swoole-sse-status,
body:has(.admin-shell) .swoole-sse-status {
  border-color: var(--theme-border);
  background: #fff;
}

body:has(.user-shell) .avatar-profile img,
body:has(.admin-shell) .avatar-profile img,
body:has(.user-shell) .user-card img,
body:has(.admin-shell) .user-card img,
body:has(.user-shell) .admin-user-avatar,
body:has(.admin-shell) .admin-user-avatar {
  border-color: #fff;
  box-shadow: 0 4px 12px rgba(59,130,246,.10);
}

body:has(.user-shell) .avatar-choice,
body:has(.admin-shell) .avatar-choice {
  background: #f8fafc;
  box-shadow: inset 0 0 0 1px #e2e8f0;
}

body:has(.user-shell) .avatar-choice.active,
body:has(.admin-shell) .avatar-choice.active {
  border-color: var(--theme-primary);
  box-shadow: 0 0 0 3px rgba(59,130,246,.14), 0 4px 12px rgba(59,130,246,.10);
}

body:has(.user-shell) .stats-kpi-card,
body:has(.admin-shell) .stats-kpi-card,
body:has(.user-shell) .stats-chart-box,
body:has(.admin-shell) .stats-chart-box,
body:has(.user-shell) .stats-ranking-list,
body:has(.admin-shell) .stats-ranking-list,
body:has(.user-shell) .diagnostic-card,
body:has(.admin-shell) .diagnostic-card,
body:has(.user-shell) .link-card,
body:has(.admin-shell) .link-card,
body:has(.user-shell) .branch-row,
body:has(.admin-shell) .branch-row,
body:has(.user-shell) .audit-msg,
body:has(.admin-shell) .audit-msg,
body:has(.user-shell) .user-card,
body:has(.admin-shell) .user-card,
body:has(.user-shell) .security-event-card,
body:has(.admin-shell) .security-event-card,
body:has(.user-shell) .admin-link-card,
body:has(.admin-shell) .admin-link-card {
  border-color: var(--theme-border);
  background: #fff;
  box-shadow: var(--theme-card-shadow);
}

body:has(.user-shell) .stats-kpi-card,
body:has(.admin-shell) .stats-kpi-card {
  position: relative;
  overflow: hidden;
}

body:has(.user-shell) .stats-kpi-card::before,
body:has(.admin-shell) .stats-kpi-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--theme-primary), var(--theme-accent));
}

body:has(.user-shell) .stats-kpi-card strong,
body:has(.admin-shell) .stats-kpi-card strong {
  color: var(--theme-ink);
}

body:has(.user-shell) .stats-ranking-row span,
body:has(.admin-shell) .stats-ranking-row span {
  background: var(--theme-primary-soft);
  color: var(--theme-primary);
}

body:has(.user-shell) .segmented-control,
body:has(.admin-shell) .segmented-control {
  border-color: var(--theme-border);
  background: #f1f5f9;
}

body:has(.user-shell) .segmented-control button.active,
body:has(.admin-shell) .segmented-control button.active,
body:has(.user-shell) .admin-users-tabs button.active,
body:has(.admin-shell) .admin-users-tabs button.active {
  background: #fff;
  color: var(--theme-primary);
  box-shadow: 0 2px 8px rgba(59,130,246,.08);
}

body:has(.user-shell) .admin-users-tabs,
body:has(.admin-shell) .admin-users-tabs,
body:has(.user-shell) .table-link,
body:has(.admin-shell) .table-link {
  color: var(--theme-primary);
}

body:has(.user-shell) .admin-users-tabs button,
body:has(.admin-shell) .admin-users-tabs button {
  border-radius: 999px;
  color: var(--theme-muted);
}

body:has(.user-shell) .admin-users-panel,
body:has(.admin-shell) .admin-users-panel,
body:has(.user-shell) .admin-users-table-wrap,
body:has(.admin-shell) .admin-users-table-wrap {
  background: #fff;
}

body:has(.user-shell) .admin-users-table-wrap,
body:has(.admin-shell) .admin-users-table-wrap {
  border-color: var(--theme-border);
  border-radius: 10px;
  -webkit-overflow-scrolling: touch;
}

body:has(.user-shell) .admin-users-table th,
body:has(.admin-shell) .admin-users-table th {
  color: var(--theme-muted);
  background: #f8fafc;
}

body:has(.user-shell) .admin-users-table td,
body:has(.admin-shell) .admin-users-table td,
body:has(.user-shell) .admin-users-table th,
body:has(.admin-shell) .admin-users-table th {
  border-bottom-color: #f1f5f9;
}

body:has(.user-shell) .admin-users-table tbody tr:nth-child(odd),
body:has(.admin-shell) .admin-users-table tbody tr:nth-child(odd) {
  background: #fafbfc;
}

body:has(.user-shell) .admin-users-table tbody tr:hover,
body:has(.admin-shell) .admin-users-table tbody tr:hover {
  background: var(--theme-primary-soft);
}

body:has(.admin-shell) .admin-links-table-wrap {
  border-color: var(--theme-border);
  background: #fff;
}
body:has(.admin-shell) .admin-links-table th {
  color: var(--theme-muted);
  background: #f8fafc;
}
body:has(.admin-shell) .admin-links-table td,
body:has(.admin-shell) .admin-links-table th {
  border-bottom-color: #f1f5f9;
}
body:has(.admin-shell) .admin-links-table tbody tr:nth-child(odd) {
  background: #fafbfc;
}
body:has(.admin-shell) .admin-links-table tbody tr:hover {
  background: var(--theme-primary-soft);
}

body:has(.user-shell) .user-card.active,
body:has(.admin-shell) .user-card.active,
body:has(.user-shell) .admin-link-card.active,
body:has(.admin-shell) .admin-link-card.active,
body:has(.user-shell) .admin-branch-row.active,
body:has(.admin-shell) .admin-branch-row.active {
  border-color: rgba(59,130,246,.45);
  box-shadow: 0 4px 16px rgba(59,130,246,.10);
}

body:has(.user-shell) .status-active,
body:has(.admin-shell) .status-active,
body:has(.user-shell) .type-main,
body:has(.admin-shell) .type-main {
  color: var(--theme-primary-deep);
  background: var(--theme-primary-soft);
  border-color: rgba(59,130,246,.2);
}
body:has(.user-shell) .status-deleted,
body:has(.admin-shell) .status-deleted {
  color: #7c3aed;
  background: rgba(139,92,246,.08);
  border-color: rgba(139,92,246,.2);
}

body:has(.user-shell) .type-group,
body:has(.admin-shell) .type-group,
body:has(.user-shell) .type-owner,
body:has(.admin-shell) .type-owner {
  color: #7c3aed;
  background: #f5f3ff;
  border-color: rgba(139,92,246,.2);
}

body:has(.user-shell) .queue-chart-bar,
body:has(.admin-shell) .queue-chart-bar {
  background: var(--theme-primary-soft);
}

body:has(.user-shell) .modal-backdrop,
body:has(.admin-shell) .modal-backdrop {
  background: rgba(15, 23, 42, .3);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

body:has(.user-shell) .site-footer,
body:has(.admin-shell) .site-footer {
  background: linear-gradient(135deg, rgba(241,245,249,.75) 0%, rgba(255,255,255,.85) 100%);
  box-shadow: 0 1px 3px rgba(15,23,42,.03), 0 0 0 1px var(--theme-border, rgba(148,163,184,.1));
}

@supports not selector(body:has(.user-shell)) {
  body {
    --primary: #3b82f6;
    --primary-2: #2563eb;
    --soft: #eff6ff;
  }
}

@media (max-width: 920px) {
  body:has(.user-shell),
  body:has(.admin-shell) {
    background: var(--theme-bg);
  }

  body:has(.user-shell)::before,
  body:has(.admin-shell)::before {
    display: none;
  }

  body:has(.user-shell) .topbar,
  body:has(.admin-shell) .topbar {
    padding-top: calc(14px + var(--safe-top));
    padding-left: calc(18px + var(--safe-left));
    padding-right: calc(18px + var(--safe-right));
  }

  body:has(.user-shell) .admin-shell,
  body:has(.admin-shell) .admin-shell,
  body:has(.user-shell) .user-shell,
  body:has(.admin-shell) .user-shell {
    width: min(100% - 20px, 100%);
    margin-top: 10px;
    margin-bottom: calc(18px + var(--safe-bottom));
  }

  body:has(.user-shell) .admin-sidebar,
  body:has(.admin-shell) .admin-sidebar,
  body:has(.user-shell) .user-sidebar,
  body:has(.admin-shell) .user-sidebar {
    padding: 16px calc(16px + var(--safe-right)) 16px calc(16px + var(--safe-left));
  }

  body:has(.user-shell) .admin-sidebar::before,
  body:has(.admin-shell) .admin-sidebar::before,
  body:has(.user-shell) .user-sidebar::before,
  body:has(.admin-shell) .user-sidebar::before {
    margin: -16px calc(-16px - var(--safe-right)) 14px calc(-16px - var(--safe-left));
  }

  body:has(.user-shell) .admin-tabs,
  body:has(.admin-shell) .admin-tabs,
  body:has(.user-shell) .user-tabs,
  body:has(.admin-shell) .user-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  }

  body:has(.user-shell) .admin-tabs a,
  body:has(.admin-shell) .admin-tabs a,
  body:has(.user-shell) .user-tabs a,
  body:has(.admin-shell) .user-tabs a {
    justify-content: center;
    text-align: center;
    transform: none;
  }

  body:has(.user-shell) .admin-content-panel,
  body:has(.admin-shell) .admin-content-panel,
  body:has(.user-shell) .user-content-panel,
  body:has(.admin-shell) .user-content-panel {
    padding: clamp(14px, 4vw, 18px);
    overflow: visible;
    -webkit-overflow-scrolling: touch;
  }

  body:has(.user-shell) .section-title,
  body:has(.admin-shell) .section-title,
  body:has(.user-shell) .stats-headline,
  body:has(.admin-shell) .stats-headline {
    gap: 10px;
  }
}

@media (max-width: 560px) {
  body:has(.user-shell) .admin-shell,
  body:has(.admin-shell) .admin-shell,
  body:has(.user-shell) .user-shell,
  body:has(.admin-shell) .user-shell {
    width: min(100% - 14px, 100%);
  }

  body:has(.user-shell) .admin-tabs,
  body:has(.admin-shell) .admin-tabs,
  body:has(.user-shell) .user-tabs,
  body:has(.admin-shell) .user-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body:has(.user-shell) .admin-tabs a,
  body:has(.admin-shell) .admin-tabs a,
  body:has(.user-shell) .user-tabs a,
  body:has(.admin-shell) .user-tabs a {
    min-height: 52px;
    padding: 0 10px;
    overflow-wrap: anywhere;
    white-space: normal;
  }

  body:has(.user-shell) .avatar-picker,
  body:has(.admin-shell) .avatar-picker {
    gap: 10px;
  }

  body:has(.user-shell) .avatar-choice,
  body:has(.admin-shell) .avatar-choice {
    width: 46px;
    height: 46px;
  }

  body:has(.user-shell) .card-actions,
  body:has(.admin-shell) .card-actions,
  body:has(.user-shell) .toolbar-actions,
  body:has(.admin-shell) .toolbar-actions {
    justify-content: stretch;
  }

  body:has(.user-shell) .card-actions button,
  body:has(.admin-shell) .card-actions button,
  body:has(.user-shell) .card-actions a.ghost,
  body:has(.admin-shell) .card-actions a.ghost,
  body:has(.user-shell) .toolbar-actions button,
  body:has(.admin-shell) .toolbar-actions button {
    flex: 1 1 128px;
  }
}
.private-chat-messages .group-chat-bubble .preview-trigger,
.private-chat-messages .group-chat-bubble .media-card,
.private-chat-messages .group-chat-bubble .attachment {
  max-width: 100%;
}
.private-chat-messages .group-chat-bubble .media-card {
  max-width: 100%;
}
.private-chat-messages .group-chat-bubble .media-link-image {
  width: 100%;
}
.private-chat-messages .group-chat-bubble .media-audio {
  min-width: min(17.5rem, var(--private-bubble-max-width));
}
.private-chat-messages .group-chat-bubble .inline-audio {
  width: 100%;
  min-width: 0;
}
.private-chat-messages .group-chat-bubble .video-player-shell {
  width: 100%;
}
.private-chat-messages .attachment-external {
  max-width: min(100%, var(--private-bubble-max-width));
}
.private-chat-messages .quote-block {
  max-width: min(100%, 22rem);
}
.private-chat-compose {
  display: grid;
  grid-template-columns: 34px 34px minmax(0, 1fr) 48px;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.private-chat-compose .file-btn,
.private-chat-compose .primary {
  width: 100%;
  height: 44px;
  min-height: 44px;
  padding: 0;
}
.private-chat-compose input:not([type="file"]) {
  width: 100%;
  min-width: 0;
  height: 44px;
}
.private-composer-quote { grid-column: 1 / -1; margin: 0; }
.private-chat-compose .preview-img { max-height: 180px; }
.private-chat-compose .video-player-mount { min-height: 180px; }
.private-chat-resize-handle {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 0 0 8px 0;
  background: linear-gradient(135deg, transparent 0 42%, rgba(23,107,135,.18) 42% 58%, rgba(23,107,135,.36) 58% 72%, rgba(23,107,135,.55) 72% 100%);
  color: transparent;
  cursor: nwse-resize;
  z-index: 2;
  box-shadow: none;
}
.private-chat-resize-handle:hover,
.private-chat-resize-handle:focus-visible {
  background: linear-gradient(135deg, transparent 0 38%, rgba(23,107,135,.22) 38% 54%, rgba(23,107,135,.42) 54% 70%, rgba(23,107,135,.68) 70% 100%);
  outline: none;
}
.private-chat-resize-handle i {
  display: none;
}
.private-emoji-picker {
  max-height: min(320px, calc(100vh - 180px));
  overflow: hidden;
}
.private-emoji-picker .emoji-grid {
  max-height: min(220px, calc(100vh - 280px));
}
.admin-chat-panel { height: calc(100vh - 156px); display: grid; grid-template-rows: auto auto auto 1fr auto; overflow: hidden; }
.admin-chat-panel.admin-group-chat-panel {
  background: #f5f7fb;
  border: 1px solid rgba(228, 233, 241, .94);
  border-radius: 24px;
}
.drop-zone { position: relative; }
.drop-zone.drop-active::after {
  content: "释放以上传附件";
  position: absolute;
  inset: 10px;
  z-index: 8;
  display: grid;
  place-items: center;
  border: 2px dashed rgba(23,107,135,.55);
  border-radius: 8px;
  background: rgba(232,244,246,.86);
  color: var(--primary);
  font-weight: 900;
  pointer-events: none;
}
.chat-head {
  padding: 22px 28px 18px;
  border-bottom: 1px solid rgba(226, 233, 243, .9);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255,255,255,.96);
}
.chat-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.desktop-chat-status {
  color: #8e98a8;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  min-height: 42px;
}
.desktop-chat-tool {
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(223, 229, 239, .95);
  background: rgba(248, 250, 252, .96);
  color: #4b5563;
  box-shadow: none;
  padding: 0;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}
.desktop-chat-tool i {
  font-size: 18px;
  line-height: 1;
}
.desktop-chat-tool:hover,
.desktop-chat-tool:focus-visible {
  background: #ffffff;
  border-color: rgba(198, 210, 223, .96);
  transform: translateY(-1px);
}
.desktop-chat-leave {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 12px;
  background: rgba(243, 246, 250, .95);
  border: 1px solid rgba(226, 233, 243, .95);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.status-dot { color: var(--primary); background: var(--soft); padding: 7px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.admin-chat-panel .status-dot { padding: 6px 9px; }
.chat-panel .group-members { grid-row: 2; margin: 10px 12px 0; }
.chat-panel .message-stage { grid-row: 3; }
.chat-panel .composer { grid-row: 4; }
.message-stage,
.private-message-stage {
  position: relative;
  min-height: 0;
  overflow: hidden;
}
.message-stage {
  display: block;
}
.private-message-stage {
  display: block;
}
.message-stage .messages,
.private-message-stage .private-chat-messages {
  width: 100%;
  height: 100%;
}
.messages {
  min-height: 0;
  padding: 18px 28px 18px;
  overflow-x: hidden;
  overflow-y: auto;
  background: #EDEDED;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  overscroll-behavior-y: contain;
  overflow-anchor: none;
  scroll-padding-bottom: calc(var(--chat-composer-height) + var(--safe-bottom) + 18px);
}
.new-message-bubble {
  position: absolute;
  left: 50%;
  bottom: 16px;
  z-index: 12;
  min-height: 38px;
  max-width: min(76%, 260px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 15px;
  border: 1px solid rgba(203, 213, 225, .88);
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  color: #176b87;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 12px 34px rgba(15, 23, 42, .14);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transform: translateX(-50%) translateZ(0);
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.new-message-bubble i {
  font-size: 12px;
  line-height: 1;
}
.new-message-bubble:hover,
.new-message-bubble:focus-visible {
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 16px 42px rgba(15, 23, 42, .18);
  transform: translateX(-50%) translateY(-1px) translateZ(0);
}
.private-new-message-bubble {
  bottom: 12px;
  min-height: 34px;
  max-width: calc(100% - 44px);
  padding: 0 13px;
  font-size: 12px;
}
.admin-live-message-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #eceff3;
}
.admin-live-messages { border-top: 0; border-bottom: 0; }
.admin-group-chat-messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 18px 24px calc(20px + var(--safe-bottom));
  background:
    radial-gradient(circle at top right, rgba(23,107,135,.05), transparent 18rem),
    linear-gradient(180deg, #eeeff2 0%, #e8eaee 100%);
  border-top: 0;
  border-bottom: 0;
}
.admin-live-modal .admin-live-message-stage {
  background:
    radial-gradient(circle at 92% 0%, rgba(32, 201, 151, .08), transparent 22rem),
    linear-gradient(180deg, rgba(246, 249, 253, .82), rgba(238, 243, 248, .78));
}
.admin-live-modal .admin-live-messages {
  background:
    radial-gradient(circle at 8% 8%, rgba(10, 132, 255, .08), transparent 22rem),
    radial-gradient(circle at 92% 12%, rgba(32, 201, 151, .08), transparent 22rem),
    linear-gradient(180deg, rgba(247, 250, 255, .74), rgba(239, 244, 250, .72));
}
.admin-live-modal .message-avatar {
  border-radius: 16px;
  border-color: rgba(255, 255, 255, .92);
}
.admin-live-modal .msg,
.admin-live-modal .group-chat-bubble {
  border: 1px solid rgba(15, 23, 42, .06);
  border-radius: 20px;
  background: rgba(255, 255, 255, .92);
  color: #263241;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .62);
}
.admin-live-modal .msg.mine,
.admin-live-modal .group-chat-bubble.mine {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(180deg, #0a84ff, #0066e6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22);
}
.admin-live-modal .group-chat-bubble::before {
  background: rgba(255, 255, 255, .92);
}
.admin-live-modal .group-chat-bubble.mine::before {
  background: #187de2;
}
.admin-live-modal .group-chat-bubble.revoked-message,
.admin-live-modal .group-chat-bubble.revoked-message.mine {
  color: #7a4b00;
  border: 1px solid #f4b740;
  background: linear-gradient(180deg, #fff8db 0%, #ffe8a3 100%);
  box-shadow: 0 10px 24px rgba(244, 183, 64, .2), inset 0 1px 0 rgba(255, 255, 255, .58);
}
.admin-live-modal .group-chat-bubble.revoked-message::before,
.admin-live-modal .group-chat-bubble.revoked-message.mine::before {
  background: #ffefba;
}
.admin-live-modal .msg.media-only,
.admin-live-modal .msg.media-only.mine,
.admin-live-modal .group-chat-bubble.media-only,
.admin-live-modal .group-chat-bubble.media-only.mine {
  border: 0;
  background: transparent;
  box-shadow: none;
}
.admin-live-modal .group-chat-sender,
.admin-live-modal .sender,
.admin-live-modal .msg time {
  color: #7b8798;
}
.admin-live-modal .msg.mine time,
.admin-live-modal .msg.mine .message-link,
.admin-live-modal .group-chat-bubble.mine .message-link {
  color: rgba(255, 255, 255, .92);
  text-decoration-color: rgba(255, 255, 255, .44);
}
.admin-live-modal .quote-block,
.admin-live-modal .composer-quote {
  border: 1px solid rgba(15, 23, 42, .06);
  border-radius: 14px;
  background: rgba(255, 255, 255, .72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);
}
.admin-live-modal .attachment {
  border-color: rgba(15, 23, 42, .08);
  border-radius: 16px;
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
}
.admin-live-modal .preview-img,
.admin-live-modal .media-card {
  border-radius: 18px;
  box-shadow: 0 14px 32px rgba(15, 23, 42, .12);
}
.admin-live-modal .media-video,
.admin-live-modal .group-chat-bubble .media-video,
.admin-live-modal .message-stack > .media-video {
  width: var(--media-video-width);
  max-width: 100%;
}
.admin-live-modal .video-player-shell {
  width: 100%;
  max-width: 100%;
}
.admin-live-modal .voice-message-bubble {
  border-radius: 20px;
  background: rgba(255, 255, 255, .94);
  color: #203047;
  box-shadow: inset 0 0 0 1px rgba(188, 205, 225, .72);
}
.admin-live-modal .msg.mine .voice-message-bubble,
.admin-live-modal .group-chat-bubble.mine .voice-message-bubble,
.admin-live-modal .msg.media-only.mine .voice-message-bubble,
.admin-live-modal .group-chat-bubble.media-only.mine .voice-message-bubble,
.admin-live-modal .message-stack.mine > .voice-message-bubble {
  color: #ffffff;
  background: linear-gradient(180deg, #0a84ff, #0066e6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22);
}
.admin-live-modal .msg.mine .voice-play-icon,
.admin-live-modal .group-chat-bubble.mine .voice-play-icon,
.admin-live-modal .msg.media-only.mine .voice-play-icon,
.admin-live-modal .group-chat-bubble.media-only.mine .voice-play-icon,
.admin-live-modal .message-stack.mine > .voice-message-bubble .voice-play-icon {
  color: #0a66d8;
  background: rgba(255, 255, 255, .86);
}
.admin-live-modal .msg.mine .voice-waveform span,
.admin-live-modal .group-chat-bubble.mine .voice-waveform span,
.admin-live-modal .msg.media-only.mine .voice-waveform span,
.admin-live-modal .group-chat-bubble.media-only.mine .voice-waveform span,
.admin-live-modal .message-stack.mine > .voice-message-bubble .voice-waveform span {
  opacity: .86;
}
.admin-live-modal .voice-message-bubble.pending,
.admin-live-modal .voice-message-bubble:disabled {
  opacity: 1;
}
.admin-live-modal .voice-message-bubble.pending .voice-waveform span,
.admin-live-modal .voice-message-bubble:disabled .voice-waveform span {
  opacity: .45;
}
.msg-row {
  display: flex;
  align-items: flex-start;
  gap: var(--chat-gap);
  margin-bottom: 12px;
  min-width: 0;
  content-visibility: auto;
  contain-intrinsic-size: auto 1px auto 128px;
}
.msg-row.cv-offscreen,
.group-chat-row.cv-offscreen {
  contain: strict;
  height: 128px;
  overflow: hidden;
}
.msg-row.cv-offscreen > *,
.group-chat-row.cv-offscreen > * {
  visibility: hidden;
}
.msg-row.mine { flex-direction: row-reverse; }
.msg-row.message-highlight .msg,
.msg-row.message-highlight .group-chat-bubble,
.msg-row.message-highlight .message-stack .quote-block {
  border-color: rgba(23,107,135,.7);
  box-shadow: 0 0 0 3px rgba(23,107,135,.14), 0 10px 26px rgba(23,107,135,.12);
}
.message-avatar {
  width: var(--chat-avatar-size);
  height: var(--chat-avatar-size);
  border-radius: 14px;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,.96);
  flex: 0 0 auto;
}
.msg {
  width: auto;
  max-width: min(78%, 640px);
  margin: 0;
  background: #fff;
  border: 0;
  border-radius: 6px 16px 16px 16px;
  padding: 11px 13px;
  line-height: 1.7;
  box-shadow: 0 1px 1px rgba(15, 23, 42, .05);
  touch-action: pan-y;
}
.msg,
.group-chat-bubble,
.timeline-system-divider span {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: pan-y;
}
.msg .message-rich,
.msg .message-rich-inline,
.group-chat-bubble .message-rich,
.group-chat-bubble .message-rich-inline,
.timeline-system-divider span {
  cursor: text;
  -webkit-touch-callout: default;
  -webkit-user-select: text;
  user-select: text;
  touch-action: pan-y;
}
.msg.mine {
  background: linear-gradient(180deg, #9ff163 0%, #97eb5e 100%);
  border-radius: 16px 6px 16px 16px;
  border-color: transparent;
}
.msg.media-only,
.msg.media-only.mine {
  min-width: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}
.msg.media-only:has(.media-video),
.group-chat-bubble.media-only:has(.media-video) {
  width: min(var(--media-video-width), 100%);
  max-width: min(var(--media-video-width), 100%);
}
.msg.media-only:has(.media-audio),
.group-chat-bubble.media-only:has(.media-audio) {
  width: min(var(--media-audio-width), 100%);
  max-width: min(var(--media-audio-width), 100%);
}
.msg-row.mine .msg { margin-left: auto; }
.message-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: auto;
  min-width: 0;
  max-width: min(78%, 640px);
}
.message-stack.mine {
  align-items: flex-end;
}
.group-chat-body .message-stack {
  width: min(100%, min(62vw, 22rem));
  max-width: 100%;
}
.msg time {
  display: block;
  margin-top: 2px;
  color: #7b8698;
  font-size: var(--chat-meta-font);
  line-height: 1.2;
  text-align: left;
}
.msg.mine time {
  text-align: right;
}
.admin-msg.mine { background: #e7f5f4; border-color: #c3e5e3; }
.admin-msg.mine .sender { text-align: right; }
.admin-msg.mine time { display: block; text-align: right; }
.admin-group-chat-row { margin-bottom: 12px; }
.admin-group-chat-row .message-avatar { width: var(--chat-avatar-size); height: var(--chat-avatar-size); border-radius: 14px; }
.admin-group-chat-body { gap: 5px; }
.admin-group-chat-body .message-stack { width: min(100%, min(62vw, 22rem)); max-width: 100%; }
.admin-group-chat-body .group-chat-sender { padding: 0 2px; }
.admin-group-chat-row.mine .group-chat-sender { display: none; }
.admin-group-chat-row .attachment-external {
  margin-top: 4px;
}
.admin-group-chat-row .quote-block {
  margin-top: 4px;
}
.admin-timeline-time-divider,
.admin-timeline-system-divider {
  margin: 12px 0 14px;
}
.admin-timeline-time-divider span,
.admin-timeline-system-divider span {
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(225, 231, 240, .82);
  box-shadow: 0 6px 14px rgba(15, 23, 42, .04);
}
.timeline-time-divider,
.timeline-system-divider {
  display: flex;
  justify-content: center;
  margin: 12px 0 14px;
}
.timeline-time-divider span,
.timeline-system-divider span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.55);
  color: #a0a7b2;
  font-size: 12px;
  line-height: 1.2;
}
.timeline-system-divider span {
  color: #7f8ea6;
}
.group-chat-row {
  min-width: 0;
  align-items: flex-start;
  gap: 12px;
  content-visibility: auto;
  contain-intrinsic-size: auto 1px auto 128px;
}
.group-chat-row.mine {
  flex-direction: row-reverse;
}
.group-chat-body {
  flex: 1 1 auto;
  min-width: 0;
  max-width: calc(100% - var(--chat-avatar-size) - 12px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
}
.group-chat-row.mine .group-chat-body {
  align-items: flex-end;
}
.group-chat-sender {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 2px;
  color: #a7adb8;
  font-size: 13px;
  line-height: 1.15;
}
.group-chat-sender .chat-sender-remark {
  margin-left: 0;
  vertical-align: middle;
}
.group-chat-row.mine .group-chat-sender {
  display: none;
}
.group-chat-bubble {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: auto;
  min-width: 0;
  max-width: 100%;
  border-radius: 10px;
  padding: 10px 14px;
  background: #ffffff;
  box-shadow: 0 1px 0 rgba(15, 23, 42, .02);
  line-height: 1.55;
}
.group-chat-bubble.mine {
  background: #95ec69;
}
.group-chat-bubble.media-only,
.group-chat-bubble:has(.voice-message-bubble) {
  min-width: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}
.group-chat-bubble.media-only > .media-card,
.msg.media-only > .media-card {
  margin: 0;
}
.group-chat-bubble.media-only > .media-audio,
.msg.media-only > .media-audio {
  border: 0;
  box-shadow: none;
  background: rgba(255,255,255,.92);
}
.group-chat-bubble::before {
  content: "";
  position: absolute;
  top: 12px;
  left: -7px;
  width: 12px;
  height: 12px;
  background: #ffffff;
  clip-path: polygon(100% 0, 0 50%, 100% 100%);
}
.group-chat-bubble.mine::before {
  left: auto;
  right: -7px;
  background: #95ec69;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.group-chat-bubble.media-only::before,
.group-chat-bubble:has(.voice-message-bubble)::before {
  display: none;
}
.group-chat-bubble time,
.group-chat-row .sender {
  display: none;
}
.group-chat-bubble .message-rich {
  font-size: clamp(15px, 2.4vw, 17px);
  line-height: 1.52;
  width: auto;
  max-width: 100%;
  white-space: pre-wrap;
  word-break: break-all;
  overflow-wrap: anywhere;
}
.group-chat-bubble p,
.group-chat-bubble .attachment,
.group-chat-bubble .preview-trigger,
.group-chat-bubble .media-card,
.group-chat-bubble .message-rich-inline {
  max-width: 100%;
  word-break: break-all;
  overflow-wrap: anywhere;
}
.group-chat-bubble .message-rich:last-child,
.group-chat-bubble .attachment:last-child,
.group-chat-bubble .preview-trigger:last-child,
.group-chat-bubble .media-card:last-child {
  margin-bottom: 0;
}
.group-chat-bubble:has(.media-video) {
  max-width: min(100%, calc(var(--media-video-width) + 20px));
  width: auto;
}
.group-chat-bubble:has(.media-audio) {
  max-width: min(70vw, 22rem, 100%);
  width: auto;
}
.sender {
  display: block;
  font-size: var(--chat-meta-font);
  color: #6b7280;
  font-weight: 700;
  margin-bottom: 4px;
}
.quote-block {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  max-width: min(100%, 26rem);
  min-width: 0;
  margin: 2px 0 0;
  padding: 3px 10px;
  border: 0;
  border-radius: 6px;
  background: rgba(241, 241, 241, .99);
  color: #9a9ea6;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(255,255,255,.85);
}
.quote-block strong,
.quote-block span {
  display: inline;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.quote-block strong {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 400;
  color: #858993;
  margin: 0;
}
.quote-block strong::after {
  content: ":";
  margin-left: 1px;
}
.quote-block span {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 10px;
  color: #a1a5ad;
}
.quote-block.unavailable { opacity: .72; cursor: not-allowed; }
.quote-block:hover,
.quote-block:focus-visible {
  background: rgba(232, 232, 232, .98);
  outline: none;
}
.quote-block:focus-visible {
  box-shadow: 0 0 0 2px rgba(23,107,135,.18), 0 1px 0 rgba(255,255,255,.85);
}
.message-stack .quote-block {
  align-self: flex-start;
}
.message-stack.mine .quote-block {
  align-self: flex-end;
  margin-right: clamp(14px, 3vw, 34px);
}
.msg-row:not(.mine) .message-stack .quote-block {
  margin-left: clamp(9px, 2.2vw, 20px);
}
.group-chat-row.mine .message-stack .quote-block {
  margin-right: clamp(3px, 3.2vw, 3px);
}
.group-chat-row:not(.mine) .message-stack .quote-block {
  margin-left: clamp(10px, 2.4vw, 22px);
}
.msg p { margin: 0 0 6px; white-space: pre-wrap; word-break: break-word; }
.message-rich {
  font-size: var(--chat-bubble-font);
  line-height: 1.64;
  word-break: normal;
  overflow-wrap: anywhere;
}
.message-rich-inline {
  white-space: pre-wrap;
}
.message-link {
  display: inline;
  max-width: 100%;
  color: #2f5fae;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: rgba(47, 95, 174, .38);
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-break: anywhere;
  -webkit-line-break: anywhere;
  line-height: inherit;
  border-radius: 4px;
  transition: color .16s ease, text-decoration-color .16s ease, background-color .16s ease;
}
.group-chat-bubble.mine .message-link,
.msg.mine .message-link {
  color: #1f5ea8;
  text-decoration-color: rgba(31, 94, 168, .34);
}
.message-link:hover,
.message-link:focus-visible {
  color: #214f9a;
  background: rgba(47, 95, 174, .08);
  text-decoration-color: currentColor;
  outline: none;
}
.group-chat-bubble.mine .message-link:hover,
.group-chat-bubble.mine .message-link:focus-visible,
.msg.mine .message-link:hover,
.msg.mine .message-link:focus-visible {
  background: rgba(255,255,255,.18);
}
.inline-emoji {
  display: inline-block;
  width: 28px;
  height: 28px;
  margin: 0 2px;
  vertical-align: text-bottom;
  object-fit: contain;
}
.inline-emoji-sm {
  width: 20px;
  height: 20px;
  margin: 0 1px;
  vertical-align: text-bottom;
}
.attachment {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: stretch;
  gap: var(--attachment-card-gap);
  width: fit-content;
  min-width: var(--attachment-card-min-width);
  max-width: var(--attachment-card-max-width);
  padding: var(--attachment-card-padding);
  border-radius: 10px;
  background: rgba(255,255,255,.84);
  border: 1px solid rgba(219, 227, 239, .95);
  margin: 6px 0;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.2;
  box-shadow: 0 1px 0 rgba(255,255,255,.5), 0 4px 10px rgba(15, 23, 42, .035);
}
.attachment i {
  grid-row: 1 / span 2;
  align-self: start;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  color: var(--primary);
  font-size: 16px;
  margin-top: 2px;
}
.attachment-copy {
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto;
  align-items: start;
  gap: 8px;
}
.attachment-name {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 800;
  color: #334155;
  line-height: 1.35;
}
.attachment-size {
  display: block;
  justify-self: end;
  align-self: end;
  text-align: right;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.preview-trigger .attachment-name {
  margin-top: 8px;
  padding: 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.group-chat-bubble.mine .attachment,
.msg.mine .attachment {
  background: rgba(244, 251, 240, .92);
  border-color: rgba(168, 215, 146, .85);
}
.group-chat-bubble.mine .attachment-name,
.msg.mine .attachment-name {
  color: #355541;
}
.group-chat-bubble.mine .attachment-size,
.msg.mine .attachment-size {
  color: #55736d;
}
.attachment-external {
  align-self: flex-start;
  margin-top: 3px;
}
.message-stack.mine .attachment-external,
.group-chat-row.mine .message-stack .attachment-external {
  align-self: flex-end;
  margin-right: clamp(1px, 3vw, 0px);
}
.msg-row:not(.mine) .message-stack .attachment-external {
  margin-left: clamp(9px, 2.2vw, 20px);
}
.group-chat-row:not(.mine) .message-stack .attachment-external {
  margin-left: clamp(1px, 2.4vw, 0px);
}
.preview-trigger {
  display: inline-grid;
  justify-items: start;
  width: auto;
  max-width: min(100%, 12rem);
  margin: 8px 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  text-align: left;
}
.message-stack.mine .preview-trigger,
.group-chat-row.mine .preview-trigger {
  justify-items: end;
  margin-left: auto;
}
.preview-img {
  display: block;
  width: auto;
  max-width: min(100%, 12rem);
  max-height: 18rem;
  height: auto;
  object-fit: initial;
  border-radius: var(--radius-sm);
  border: 0;
  background: transparent;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .12);
  transition: box-shadow .16s ease, transform .16s ease;
}
.preview-trigger:hover .preview-img,
.preview-trigger:focus-visible .preview-img {
  box-shadow: 0 14px 28px rgba(24,32,51,.18);
  transform: translateY(-1px);
}
.preview-trigger:focus-visible { outline: 2px solid rgba(23,107,135,.35); outline-offset: 3px; border-radius: 10px; }
.preview-trigger .attachment-name {
  display: block;
  width: auto;
  max-width: 100%;
  margin-top: 8px;
  color: #415470;
  font-size: 12px;
  line-height: 1.45;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.media-card {
  width: var(--media-card-width);
  max-width: 100%;
  margin: 8px 0;
  padding: 12px;
  border: 1px solid rgba(223,229,239,.95);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.96) 0%, rgba(244,248,252,.94) 100%);
}
.media-audio {
  width: var(--media-audio-width);
  min-width: min(17.5rem, 100%);
  max-width: 100%;
  background: linear-gradient(180deg, #f9fcff 0%, #edf5fb 100%);
}
.media-video {
  width: var(--media-video-width);
  max-width: 100%;
  padding: 10px;
  background: #0f1724;
  border-color: rgba(255,255,255,.08);
}
.media-link-card {
  display: block;
  max-width: 100%;
}
.media-link-image {
  width: var(--media-video-width);
  padding: 0;
  overflow: hidden;
  background: #0f1724;
  border-color: rgba(15, 23, 42, .08);
}
.media-link-img {
  display: block;
  width: 100%;
  max-height: min(360px, 58vh);
  object-fit: cover;
  background: #0a0f17;
}
.media-link-unsupported {
  max-width: var(--attachment-card-max-width);
}
.inline-audio {
  display: block;
  width: 100%;
  min-width: 0;
  height: 42px;
  border-radius: 999px;
}
.voice-message-bubble {
  width: min(70vw, 220px);
  min-width: 138px;
  min-height: 42px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  margin: 4px 0;
  border: 0;
  border-radius: 18px;
  background: rgba(255,255,255,.9);
  color: #203047;
  box-shadow: inset 0 0 0 1px rgba(219, 227, 239, .86), 0 4px 12px rgba(15, 23, 42, .05);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.msg.mine .voice-message-bubble,
.group-chat-bubble.mine .voice-message-bubble {
  background: #95ec69;
  color: #17351d;
  box-shadow: inset 0 0 0 1px rgba(95, 202, 70, .35), 0 4px 12px rgba(35, 120, 52, .08);
}
.voice-message-bubble:disabled,
.voice-message-bubble.pending {
  cursor: default;
  opacity: .78;
}
.voice-play-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(15, 23, 42, .08);
  font-size: 12px;
}
.msg.mine .voice-play-icon,
.group-chat-bubble.mine .voice-play-icon {
  background: rgba(29, 91, 38, .12);
}
.voice-waveform {
  min-width: 0;
  height: 24px;
  display: flex;
  align-items: center;
  gap: 2px;
}
.voice-waveform span {
  width: 3px;
  min-height: 6px;
  max-height: 24px;
  border-radius: 999px;
  background: currentColor;
  opacity: .62;
}
.voice-message-bubble.playing .voice-waveform span {
  opacity: .95;
}
.voice-message-bubble strong {
  min-width: 28px;
  font-size: 12px;
  line-height: 1;
  text-align: right;
  white-space: nowrap;
}
.video-player-shell {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  border-radius: 18px;
  background:
    radial-gradient(circle at 18% 12%, rgba(95, 167, 255, .22), transparent 34%),
    linear-gradient(135deg, #07111c 0%, #0d1724 52%, #05070b 100%);
  aspect-ratio: 16 / 10;
  max-height: var(--media-video-max-height);
  isolation: isolate;
}
.video-player-mount {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  background: transparent;
}
.video-player-mount[hidden] {
  display: none !important;
}
.video-player-mount.zwp-wrap,
.video-player-mount .zwp-wrap {
  width: 100% !important;
  height: 100% !important;
  max-height: none;
  border-radius: 18px;
  overflow: hidden;
  background: transparent !important;
  touch-action: manipulation;
}
.video-player-mount.zwp-wrap:not(.zwp-fluid),
.video-player-mount .zwp-wrap:not(.zwp-fluid) {
  height: 100% !important;
}
.video-player-mount.zwp-wrap.zwp-fluid,
.video-player-mount .zwp-wrap.zwp-fluid {
  height: 100% !important;
  padding-top: 0 !important;
}
.video-player-mount.zwp-wrap .zwp-container,
.video-player-mount .zwp-wrap .zwp-container {
  height: 100% !important;
  overflow: hidden;
  border-radius: inherit;
  background: #05070b;
}
.video-player-mount.zwp-wrap .zwp-videoWrapper,
.video-player-mount .zwp-wrap .zwp-videoWrapper,
.video-player-mount.zwp-wrap .zwp__layers,
.video-player-mount .zwp-wrap .zwp__layers {
  border-radius: inherit;
}
.video-player-mount.zwp-wrap .zwp-controlbar,
.video-player-mount .zwp-wrap .zwp-controlbar {
  height: 56px;
  min-height: 42px;
  padding: 16px 8px 6px;
  background: linear-gradient(to top, rgba(3, 7, 12, .92), rgba(3, 7, 12, .42), transparent) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.video-player-mount.zwp-wrap .zwp-controlbar.zwp-vodplayer,
.video-player-mount .zwp-wrap .zwp-controlbar.zwp-vodplayer {
 height: 42px;
 padding-top: 7px;
}
.video-player-mount.zwp-wrap .zwp__time-rail,
.video-player-mount .zwp-wrap .zwp__time-rail {
  left: 10px;
  right: 10px;
  bottom: 34px;
  height: 14px;
}
.video-player-mount.zwp-wrap .zwp__time-total,
.video-player-mount .zwp-wrap .zwp__time-total {
  bottom: 5px;
}
.video-player-mount.zwp-wrap .zwp__overlay-button,
.video-player-mount .zwp-wrap .zwp__overlay-button {
  width: clamp(52px, 18vw, 78px) !important;
  height: clamp(52px, 18vw, 78px) !important;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  box-shadow: 0 12px 36px rgba(0, 0, 0, .28), inset 0 0 0 1px rgba(255, 255, 255, .2);
}
.video-player-mount.zwp-wrap .zwp__overlay-button svg path,
.video-player-mount .zwp-wrap .zwp__overlay-button svg path {
  fill: #f5f7fb !important;
}
.video-player-mount.zwp-wrap .zwp-speedButton,
.video-player-mount.zwp-wrap .zwp-optionButton,
.video-player-mount.zwp-wrap .zwp-subtitleButton,
.video-player-mount.zwp-wrap .zwp-qualityButton,
.video-player-mount .zwp-wrap .zwp-speedButton,
.video-player-mount .zwp-wrap .zwp-optionButton,
.video-player-mount .zwp-wrap .zwp-subtitleButton,
.video-player-mount .zwp-wrap .zwp-qualityButton {
  display: none !important;
}
.video-player-unavailable {
  display: grid;
  min-height: min(var(--video-player-min-height), var(--media-video-max-height));
  place-items: center;
  gap: 8px;
  color: rgba(245, 247, 251, .76);
  font-size: 13px;
  font-weight: 800;
}
.video-player-unavailable i {
  font-size: 24px;
  opacity: .82;
}
.video-player-mount.zwp-wrap video,
.video-player-mount.zwp-wrap iframe,
.video-player-mount.zwp-wrap .zwp-player,
.video-player-mount.zwp-wrap .dplayer-video-wrap,
.video-player-mount.zwp-wrap .art-video-player,
.video-player-mount .zwp-wrap video,
.video-player-mount .zwp-wrap iframe,
.video-player-mount .zwp-wrap .zwp-player,
.video-player-mount .zwp-wrap .dplayer-video-wrap,
.video-player-mount .zwp-wrap .art-video-player {
  width: 100% !important;
  height: 100% !important;
  max-height: none;
  object-fit: contain;
}
.composer {
  display: grid;
  grid-template-columns: 42px 42px minmax(0, 1fr) 48px;
  align-items: center;
  gap: 10px;
  padding: 14px 22px 16px;
  border-top: 1px solid rgba(226, 233, 243, .92);
  background: rgba(255,255,255,.96);
  position: relative;
  z-index: 2;
}
body.chat-ios-keyboard-open .composer {
  padding-bottom: max(12px, var(--safe-bottom));
}
.group-workspace .composer {
  grid-template-columns: 1fr;
  grid-template-rows: auto;
  gap: 0;
  align-items: stretch;
  padding: 14px 18px 16px;
  background: #f7f7f7;
}
.desktop-composer-shell {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px 16px 8px;
  border: 1px solid rgba(217, 226, 236, .95);
  border-radius: 16px;
  background: #ffffff;
}
.desktop-composer-editor {
  width: 100%;
  min-height: 88px;
  flex: 0 0 auto;
  padding: 6px 4px 0;
}
.desktop-composer-editor textarea {
  width: 100%;
  min-height: 72px;
  height: 80px;
  display: block;
  border: 0;
  padding: 0 4px;
  resize: none;
  background: transparent;
  box-shadow: none;
  font-size: 16px;
  line-height: 1.55;
  color: #111827;
}
.desktop-composer-editor textarea:focus {
  border: 0;
  box-shadow: none;
}
.desktop-composer-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 0 2px;
  width: 100%;
  flex: 0 0 auto;
}
.desktop-composer-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.desktop-composer-tools .file-btn {
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  color: #4b5563;
}
.desktop-composer-tools .file-btn i {
  font-size: 17px;
  line-height: 1;
}
.desktop-composer-submit {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-self: end;
}
.desktop-send-btn {
  min-width: 98px;
  min-height: 32px;
  padding: 0 16px;
  border-radius: 10px;
  background: rgba(238, 241, 245, .92);
  color: #9aa3b1;
  border: 1px solid rgba(230, 235, 242, .96);
  box-shadow: none;
}
.desktop-send-btn:not(:disabled) {
  background: linear-gradient(180deg, #1490c8, #127cae);
  color: #ffffff;
  border-color: transparent;
}
.desktop-upload-hint {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 2px;
  color: #1280b3;
  justify-self: start;
  font-size: 12px;
  width: fit-content;
  flex: 0 0 auto;
}
.desktop-upload-hint i {
  font-size: 14px;
}
.desktop-member-empty {
  margin: 0;
  padding: 18px 12px 6px;
  color: #8f98a5;
  text-align: center;
}
.composer-quote {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 3px 10px;
  border: 0;
  border-radius: 7px;
  background: rgba(241, 241, 241, .99);
}
.composer-quote > div {
  flex: 1 1 auto;
  min-width: 0;
}
.composer-quote strong,
.composer-quote span {
  display: inline;
}
.composer-quote strong {
  margin-right: 6px;
  font-size: 10px;
  font-weight: 400;
  color: #858993;
  white-space: nowrap;
}
.composer-quote strong::after { content: ":"; margin-left: 1px; }
.composer-quote span {
  min-width: 0;
  color: #a1a5ad;
  font-size: 10px;
  line-height: 1.35;
  overflow: hidden;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.composer-quote .message-rich-inline {
  display: inline;
  white-space: normal;
}
.composer-quote .message-link {
  white-space: normal;
  overflow-wrap: anywhere;
}
.quote-cancel {
  flex: 0 0 auto;
  padding: 0 3px;
  min-height: auto;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: #a8acb3;
  font-size: 10px;
  box-shadow: none;
}
.quote-cancel:hover,
.quote-cancel:focus-visible {
  background: rgba(255,255,255,.38);
  color: #80858d;
  outline: none;
}
.file-btn {
  width: 100%;
  height: 42px;
  min-height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  color: #4b5563;
  cursor: pointer;
}
.file-btn input { display: none; }
.emoji-trigger {
  padding: 0;
  border: 0;
  transition: background .16s ease, color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.emoji-trigger.active {
  background: #dff1f4;
  color: var(--primary-2);
  box-shadow: inset 0 0 0 1px rgba(23,107,135,.24), 0 0 0 3px rgba(23,107,135,.10);
}
.emoji-trigger:hover,
.emoji-trigger:focus-visible {
  background: #e3f0f4;
  color: var(--primary-2);
  outline: none;
}
.composer input:not([type="file"]) {
  width: 100%;
  min-width: 0;
  height: 42px;
  border: 0;
  border-radius: 22px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(223,229,239,.95);
}
.composer .primary {
  width: 100%;
  min-width: 50px;
  height: 33px;
  padding: 0;
}
.emoji-picker {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fbfdff;
  box-shadow: 0 10px 28px rgba(24,32,51,.08);
  animation: emojiPickerReveal .18s ease;
  transform-origin: bottom center;
}
@keyframes emojiPickerReveal {
  from {
    opacity: 0;
    transform: translateY(6px) scale(.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.emoji-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.emoji-tab {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  min-height: 36px;
}
.emoji-tab.active {
  border-color: rgba(23,107,135,.35);
  background: #eef7f8;
  color: var(--primary);
}
.emoji-tab.recent {
  font-weight: 900;
}
.emoji-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
  gap: 8px;
  max-height: 220px;
  overflow: auto;
}
.emoji-item {
  width: 42px;
  height: 42px;
  padding: 4px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: #fff;
  display: grid;
  place-items: center;
}
.emoji-item:hover,
.emoji-item:focus-visible {
  border-color: rgba(23,107,135,.35);
  background: #eef7f8;
  outline: none;
}
.emoji-item img {
  display: block;
  width: 32px;
  height: 32px;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.upload-hint { grid-column: 3 / -1; margin: -4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.35; }
.upload-hint-button {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--primary);
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}
.upload-hint-button:hover,
.upload-hint-button:focus-visible {
  color: var(--primary-2);
  text-decoration: underline;
  outline: none;
}
.upload-hint-button.compact {
  grid-column: auto;
  justify-self: center;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  color: #6b7280;
}
.upload-hint-button.compact span {
  display: none;
}
.upload-format-backdrop { z-index: 80; }
.upload-format-panel { width: min(460px, 100%); }
.upload-format-list { display: grid; gap: 10px; }
.upload-format-group {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}
.upload-format-group strong { color: var(--primary); }
.upload-format-group span { color: var(--muted); line-height: 1.55; word-break: break-word; }
.upload-format-limit { margin: 0; color: var(--muted); font-weight: 800; }
.link-editor-panel {
  width: min(1080px, calc(100vw - 32px));
  max-width: 1080px;
  height: min(88vh, 980px);
  max-height: min(88vh, 980px);
  padding: 0;
  overflow: hidden;
}
.link-editor-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  min-height: 0;
}
.link-editor-header {
  padding: 28px 32px 18px;
  border-bottom: 1px solid rgba(223, 229, 239, .85);
  background: linear-gradient(180deg, rgba(250, 252, 255, .98), rgba(255, 255, 255, .96));
}
.link-editor-header .eyebrow,
.link-editor-header h2 {
  margin-left: 0;
  margin-right: 0;
}
.link-editor-scroll {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 32px 28px;
  overscroll-behavior: contain;
}
.link-editor-grid {
  margin-top: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 20px;
}
.link-editor-grid .wide {
  grid-column: 1 / -1;
}
.link-editor-grid .settings-note.wide {
  margin-top: -6px;
}
.link-editor-actions {
  position: sticky;
  bottom: 0;
  margin-top: 6px;
  padding-top: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0), rgba(255,255,255,.92) 22%, rgba(255,255,255,1) 100%);
  z-index: 2;
}
.link-editor-disabled-group {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border: 1px dashed #c9d9df;
  border-radius: 10px;
  background: #f8fbfc;
}
.link-editor-disabled-group strong {
  color: #5d7280;
}
.link-editor-disabled-group p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.link-editor-disabled-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.link-editor-disabled-grid label {
  color: #8aa0ad;
}
.link-editor-disabled-grid input[disabled] {
  background: #edf3f5;
  color: #9aaeb8;
  cursor: not-allowed;
}
.branch-row { display: grid; grid-template-columns: auto 1fr; gap: 7px 12px; margin-bottom: 10px; cursor: pointer; align-items: start; }
.admin-branch-row.active {
  background:
    linear-gradient(180deg, rgba(244, 251, 255, .98), rgba(252, 254, 255, .98)),
    radial-gradient(circle at top right, rgba(39, 118, 154, .09), transparent 54%);
  border-color: rgba(39, 118, 154, .32);
  box-shadow: 0 14px 30px rgba(26, 76, 104, .08);
}
.admin-branch-row.group-overview-anchor {
  position: relative;
  margin-bottom: 0;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom-color: transparent;
}
.branch-row > :not(.select-check) { grid-column: 2; }
.branch-row .select-check { grid-row: 1 / span 3; grid-column: 1; padding-top: 2px; }
.branch-row:hover, .link-card:hover { border-color: rgba(23,107,135,.45); }
.branch-row:active { background: rgba(23,107,135,.04); }
.admin-chat-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: #fbfdff;
}
.admin-group-chat-meta {
  padding: 18px 22px 10px;
  border-bottom: 1px solid rgba(226, 233, 243, .9);
  background: rgba(255,255,255,.96);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}
.admin-group-chat-meta-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}
.admin-group-chat-meta strong {
  display: block;
  color: #1f2b3d;
  font-size: 19px;
  line-height: 1.28;
  letter-spacing: .01em;
}
.admin-group-chat-meta p {
  margin: 0;
  color: #7b8798;
  font-size: 13px;
  line-height: 1.5;
}
.admin-group-chat-meta-row {
  gap: 10px;
  justify-content: flex-start;
}
.admin-chat-meta p { margin: 2px 0 0; color: var(--muted); font-size: 12px; line-height: 1.35; }
.meta-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.meta-chip { display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 999px; background: #eef3f7; color: var(--muted); font-size: 12px; font-weight: 700; }
.monitor-hint {
  margin: -6px 0 10px;
  padding: 8px 10px;
  border: 1px solid #d8ebf1;
  border-radius: 8px;
  background: #f5fbfd;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.chat-context-menu {
  position: fixed;
  z-index: 10020;
  min-width: 138px;
  padding: 6px;
  border: 1px solid rgba(24,32,51,.12);
  border-radius: 10px;
  background: rgba(255,255,255,.98);
  box-shadow: 0 14px 34px rgba(24,32,51,.18);
  backdrop-filter: blur(10px);
}
.chat-context-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  font-size: 14px;
}
.chat-context-menu button:hover,
.chat-context-menu button:focus-visible {
  background: #eef6f8;
  color: var(--primary);
  outline: none;
}
.chat-context-menu .danger-menu-item {
  color: #b3261e;
}
.chat-context-menu .danger-menu-item:hover,
.chat-context-menu .danger-menu-item:focus-visible {
  background: #fff0ee;
  color: #9d1d17;
}
.revoked-message {
  color: #7a4b00;
  background: linear-gradient(180deg, #fff8db 0%, #ffe8a3 100%);
  border: 1px solid #f4b740;
  box-shadow: 0 8px 20px rgba(244, 183, 64, .18);
}
.revoked-message.mine {
  color: #7a4b00;
  background: linear-gradient(180deg, #fff8db 0%, #ffe8a3 100%);
  border-color: #f4b740;
}
.revoked-message-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 20px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}
.revoked-message-icon {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(184, 98, 0, .14);
  color: #b86200;
  font-size: 11px;
}
.revoked-message .sender,
.revoked-message time {
  color: #9a6a12;
}
.revoked-message.group-chat-bubble::before {
  background: #ffefba;
}
.revoked-message.mine::before {
  background: #ffefba;
}
.admin-revoked-message {
  border-color: rgba(179,38,30,.35);
}
.admin-revoked-external-attachment {
  border-color: rgba(179,38,30,.35);
  background: #fff8f7;
}
.admin-revoked-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  margin-bottom: 8px;
  padding: 3px 8px;
  border: 1px solid rgba(179,38,30,.22);
  border-radius: 999px;
  background: #fff0ee;
  color: #9d1d17;
  font-size: 12px;
  line-height: 1.3;
}
.admin-revoked-system-divider span {
  border-color: rgba(179,38,30,.22);
  background: #fff0ee;
  color: #9d1d17;
}
.admin-revoked-system-divider i {
  margin-right: 6px;
}
.admin-revoked-system-divider small {
  margin-left: 8px;
  font-size: 12px;
  opacity: .8;
}
.admin-clear-marker span {
  border-color: rgba(234,88,12,.3);
  background: #fff7ed;
  color: #9a3412;
}
.admin-clear-marker i {
  margin-right: 6px;
}
.admin-revoked-inline {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  margin-bottom: 3px;
  color: #9d1d17;
  font-size: 12px;
  line-height: 1.2;
}
.pswp {
  --pswp-bg: rgba(5, 10, 18, .96);
  --pswp-root-z-index: 1000000;
}
.pswp__top-bar {
  top: max(12px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  left: auto;
  width: auto;
  height: 44px;
  gap: 8px;
}
.pswp__button {
  position: relative;
  display: block;
  width: 42px;
  height: 42px;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 50%;
  background-color: rgba(7, 12, 20, .68);
  color: #fff;
  line-height: 1;
  opacity: .94;
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
  transform: none;
  appearance: none;
}
.pswp__button:not(.pswp__button--arrow) .pswp__icn {
  top: 50%;
  left: 50%;
  width: 30px;
  height: 30px;
  transform: translate(-50%, -50%);
  transform-origin: center;
}
.pswp__button:hover,
.pswp__button:focus-visible,
.pswp-gallery-download:hover,
.pswp-gallery-download:focus-visible {
  background-color: rgba(23,107,135,.92);
  opacity: 1;
  outline: none;
  transform: none;
}
.pswp__counter,
.pswp__button--zoom { display: none; }
.pswp__button--arrow {
  width: 52px;
  height: 52px;
  margin-top: -26px;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.pswp__button--arrow .pswp__icn {
  top: 0;
  left: 0;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 50%;
  background: rgba(7, 12, 20, .68);
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
}
.pswp-gallery-title {
  position: fixed;
  z-index: 2;
  top: max(16px, env(safe-area-inset-top));
  left: max(18px, env(safe-area-inset-left));
  right: 150px;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 8px rgba(0,0,0,.58);
  pointer-events: none;
}
.pswp-gallery-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 76px;
  height: 42px;
  padding: 0 13px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 999px;
  background: rgba(7, 12, 20, .68);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  opacity: .94;
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
  transform: none;
}
.pswp-gallery-download i { font-size: 14px; }
.pswp-gallery-rail {
  position: fixed;
  z-index: 2;
  top: 70px;
  bottom: 14px;
  left: max(6px, env(safe-area-inset-left));
  width: 144px;
  padding: 10px;
  overflow-y: auto;
  border-right: 1px solid rgba(255,255,255,.08);
  background: rgba(8, 15, 27, .72);
  backdrop-filter: blur(10px);
}
.pswp-gallery-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  margin: 0 0 10px;
  padding: 0;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,.16);
  border-radius: 8px;
  background: rgba(255,255,255,.08);
  cursor: pointer;
  opacity: .72;
}
.pswp-gallery-thumb.active,
.pswp-gallery-thumb:hover,
.pswp-gallery-thumb:focus-visible {
  border-color: rgba(78, 197, 216, .98);
  opacity: 1;
  outline: none;
}
.pswp-gallery-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.monitor-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 8px 10px;
  background: #fff;
}
.admin-group-chat-summary {
  padding: 0 22px 16px;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid rgba(226, 233, 243, .9);
  gap: 10px;
}
.admin-group-chat-summary .metric-card {
  border-radius: 20px;
  padding: 14px 16px;
  border-color: rgba(220, 228, 239, .94);
  background: linear-gradient(180deg, rgba(255,255,255,.98) 0%, rgba(250,252,255,.98) 100%);
  box-shadow: 0 6px 18px rgba(24, 32, 51, .04);
}
.admin-group-chat-summary .metric-card span {
  font-size: 12px;
  margin-bottom: 5px;
}
.admin-group-chat-summary .metric-card strong {
  font-size: 16px;
  line-height: 1.3;
}
.admin-live-monitor-summary {
  flex: 0 0 auto;
  padding: 8px 18px 10px;
  background: rgba(255,255,255,.96);
}
.admin-live-monitor-summary .metric-card {
  min-height: 58px;
  border-radius: 8px;
  padding: 9px 12px;
  box-shadow: none;
}
.admin-live-monitor-summary .metric-card strong {
  font-size: 15px;
}
.summary-block, .metric-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 9px;
  background: #fbfdff;
}
.summary-block span, .metric-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 3px;
}
.summary-block strong, .metric-card strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.25;
  word-break: break-word;
}
.wide-metric { grid-column: span 2; }
.monitor-empty {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  min-height: 88px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
  background: #fbfdff;
}
.monitor-empty i { color: var(--primary); font-size: 24px; }
.monitor-empty strong { color: var(--ink); }
.monitor-empty p { margin: 0; max-width: 360px; line-height: 1.5; }
.empty-line {
  margin: 0;
  padding: 10px 12px;
  color: var(--muted);
  text-align: center;
  line-height: 1.55;
  border: 1px dashed #dbe5ef;
  border-radius: 12px;
  background: #fbfdff;
}
.admin-composer { border-top: 1px solid var(--line); }
.admin-group-chat-panel .admin-composer {
  border-top: 1px solid rgba(226, 233, 243, .9);
  background: rgba(255,255,255,.96);
}
.audit-msg { margin-bottom: 10px; }
.audit-msg p { white-space: pre-wrap; }
.badge { display: inline-flex; align-items: center; width: fit-content; padding: 5px 8px; border-radius: 999px; background: #fff0d8; color: #8a5a00; font-size: 12px; font-weight: 800; margin-bottom: 6px; }
.site-footer {
  width: min(1180px, calc(100% - 32px));
  margin: -4px auto 28px;
  padding: 22px 24px;
  border-top: none;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(241,245,249,.85) 0%, rgba(248,250,252,.95) 100%);
  box-shadow: 0 1px 3px rgba(15,23,42,.04), 0 0 0 1px rgba(148,163,184,.1);
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.site-footer p { margin: 0; max-width: 720px; line-height: 1.7; font-size: 13.5px; letter-spacing: .01em; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px 18px; }
.footer-links a { color: var(--primary); font-weight: 600; font-size: 13.5px; padding: 5px 12px; border-radius: 8px; transition: background .2s, color .2s; text-decoration: none; }
.footer-links a:hover { background: rgba(59,130,246,.08); color: var(--primary-2, #2563eb); }
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(24, 32, 51, .48);
  backdrop-filter: blur(4px);
}
.modal-panel {
  position: relative;
  width: min(520px, 100%);
  display: grid;
  gap: 14px;
  padding: 26px;
  border: 1px solid rgba(223,229,239,.95);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow);
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  background: #eef3f7;
  color: var(--muted);
}
.modal-link {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  color: var(--muted);
  word-break: break-all;
  line-height: 1.5;
}
.success-line { margin: 0; color: #0f6b4f; font-weight: 800; }
.modal-actions { display: grid; grid-template-columns: 1fr 1.35fr; gap: 10px; }
.modal-actions button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; }
.member-remark-modal {
  width: min(440px, 100%);
  max-height: min(86vh, 680px);
  overflow: auto;
}
.member-remark-field {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-weight: 800;
}
.member-remark-field input {
  width: 100%;
  min-height: 44px;
  font-size: 16px;
}
.member-remark-actions {
  grid-template-columns: 1fr 1.2fr;
}
.qr-modal-panel {
  width: min(460px, 100%);
}
.qr-code-box {
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}
.qr-code-canvas {
  width: 240px;
  height: 240px;
  max-width: 100%;
  image-rendering: pixelated;
  border-radius: 6px;
  background: #fff;
}
.muted-members-panel {
  width: min(860px, 100%);
  max-height: min(760px, calc(100vh - 44px));
  overflow: hidden;
}
.muted-members-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-right: 34px;
}
.muted-members-head h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}
.muted-members-list {
  display: grid;
  gap: 10px;
  max-height: min(560px, calc(100vh - 190px));
  overflow: auto;
  padding-right: 4px;
}
.muted-member-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}
.muted-member-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.muted-member-main strong {
  min-width: 0;
  overflow-wrap: anywhere;
}
.muted-member-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.muted-member-grid span {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid #e5ecf4;
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.muted-member-grid b {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
  font-size: 12px;
}
.muted-member-reason {
  grid-column: 1;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.muted-member-actions {
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: center;
}
.muted-member-actions button {
  min-width: 76px;
}
.group-members {
  display: grid;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  overflow: auto;
}
.chat-panel .group-members { max-height: 136px; }
.admin-group-members { max-height: 180px; }
.admin-sidebar-members {
  margin-top: 0;
  padding: 12px;
  gap: 12px;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-top: 0;
  background:
    linear-gradient(180deg, rgba(245, 251, 255, .96), rgba(255, 255, 255, .98)),
    radial-gradient(circle at top left, rgba(39, 118, 154, .08), transparent 58%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.75),
    0 14px 30px rgba(26, 76, 104, .08);
}
.admin-sidebar-overview-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(188, 210, 223, .7);
}
.admin-sidebar-overview-title .eyebrow {
  margin-bottom: 4px;
}
.admin-sidebar-overview-title h3 {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.15;
}
.admin-sidebar-members-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 2px;
}
.admin-sidebar-members-head small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.admin-sidebar-member-list {
  display: grid;
  gap: 10px;
  max-height: 420px;
  overflow: auto;
  padding-right: 2px;
}
.admin-sidebar-member-card {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(188, 210, 223, .9);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,.92);
  box-shadow: var(--shadow-card);
}
.admin-sidebar-member-card img {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid rgba(188, 210, 223, .9);
  background: #fff;
}
.admin-sidebar-member-card strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.25;
  word-break: break-word;
}
.admin-sidebar-member-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.admin-sidebar-member-card .member-ip-line {
  color: #6b7b93;
  word-break: break-all;
}
.admin-sidebar-member-card .member-remark-chip {
  max-width: 100%;
  margin-top: 4px;
}
.admin-sidebar-member-card.muted {
  border-color: rgba(227, 183, 115, .9);
  background: linear-gradient(180deg, rgba(255, 249, 238, .98), rgba(255,255,255,.96));
}
.admin-member-actions {
  margin-top: -2px;
  margin-bottom: 2px;
}
.member-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}
.member-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 5px 10px 5px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}
.member-chip img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
}
.member-chip i {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--soft);
  color: var(--primary);
}
.member-chip-text {
  min-width: 0;
  display: grid;
  gap: 1px;
  line-height: 1.08;
}
.member-chip-text strong {
  max-width: 104px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
}
.member-chip small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  transform-origin: left center;
}
.member-chip.muted {
  border-color: rgba(176, 74, 74, .3);
  background: #fff7f7;
}
@media (max-width: 1180px) {
  .admin-shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }
  .user-shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }
  .admin-workspace { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); }
  .admin-chat-panel { grid-column: 1 / -1; height: min(720px, calc(100vh - 156px)); }
  .performance-profile-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .performance-profile-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1040px) {
  .diagnostic-grid, .table-mini-list { grid-template-columns: 1fr; }
  .worker-diagnostic-grid,
  .worker-diagnostic-grid.compact { grid-template-columns: 1fr; }
}
@media (max-width: 920px) {
  :root {
    --attachment-card-min-width: 0;
    --media-card-width: clamp(18rem, 62vw, 32rem);
    --media-audio-width: clamp(17.5rem, 62vw, 26rem);
    --media-video-width: clamp(18rem, 62vw, 32rem);
    --video-player-min-height: 240px;
    --mobile-chat-shell-padding: clamp(10px, 2.6vw, 16px);
    --mobile-chat-line: rgba(214, 223, 235, .92);
    --mobile-chat-shadow: 0 12px 28px rgba(15, 23, 42, .08);
  }
  .home-topbar-inner,
  .home-footer-inner,
  .home-hero-grid,
  .home-story-card,
  .home-story-card-reverse {
    grid-template-columns: 1fr;
  }
  .home-topbar-inner {
    min-height: auto;
    padding: 14px 0;
  }
  .home-nav,
  .home-actions {
    justify-content: flex-start;
  }
  .performance-profile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-hero {
    padding-top: 58px;
    padding-bottom: 104px;
  }
  .home-feature-grid,
  .home-scenario-grid,
  .home-tech-grid {
    grid-template-columns: 1fr 1fr;
  }
  .home-story-media {
    min-height: 220px;
    font-size: 60px;
  }
  .home-hero-card {
    margin-top: 16px;
  }
  .home-footer-inner {
    display: grid;
  }
  .page-grid, .admin-workspace { grid-template-columns: 1fr; }
  .admin-shell { grid-template-columns: 1fr; }
  .dialog-type-picker { grid-template-columns: 1fr; }
  .user-shell {
    width: min(100% - 20px, 100%);
    margin: 10px auto calc(18px + var(--safe-bottom));
    grid-template-columns: 1fr;
  }
  .admin-sidebar {
    position: static;
    top: auto;
    padding: 14px;
  }
  .user-sidebar {
    position: static;
    top: auto;
    padding: 14px calc(14px + var(--safe-right)) 14px calc(14px + var(--safe-left));
  }
  .admin-sidebar-head {
    margin-bottom: 12px;
    padding-bottom: 12px;
  }
  .user-sidebar-head {
    margin-bottom: 12px;
    padding-bottom: 12px;
  }
  .admin-tabs {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }
  .user-tabs {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }
  .admin-tabs a {
    min-height: 40px;
    padding: 0 13px;
    transform: none;
  }
  .user-tabs a {
    min-height: 40px;
    padding: 0 13px;
    transform: none;
  }
  .user-tabs a:hover,
  .user-tabs a.active {
    transform: none;
  }
  .admin-content-panel {
    max-height: none;
    overflow: visible;
  }
  .user-content-panel {
    max-height: none;
    overflow: visible;
    padding: 16px;
  }
  .stats-chart-grid {
    grid-template-columns: 1fr;
  }
  .stats-chart {
    height: 280px;
  }
  .stats-chart-box.wide .stats-chart {
    height: 310px;
  }
  .admin-chat-panel { grid-column: auto; height: calc(100vh - 156px); }
  .admin-panel { max-height: none; overflow: auto; }
  .diagnostic-grid, .table-mini-list { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .link-editor-panel {
    width: min(100vw - 16px, 100%);
    height: 92vh;
    max-height: 92vh;
  }
  .link-editor-header {
    padding: 22px 18px 14px;
  }
  .link-editor-scroll {
    padding: 16px 18px 22px;
  }
  .link-editor-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .link-editor-disabled-grid {
    grid-template-columns: 1fr;
  }
  .admin-live-backdrop {
    place-items: stretch;
    padding: 0;
  }
  .modal-panel.admin-live-modal {
    width: 100%;
    height: var(--app-vh, 100dvh);
    max-height: var(--app-vh, 100dvh);
    border-radius: 0;
    border: 0;
  }
  .admin-live-modal > .modal-close {
    top: calc(10px + var(--safe-top));
    right: calc(10px + var(--safe-right));
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    border-radius: 14px;
  }
  .admin-live-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }
  .admin-live-sidebar {
    border-right: 0;
    border-bottom: 1px solid rgba(224, 231, 242, .95);
    max-height: 34vh;
    max-height: 34dvh;
  }
  .admin-live-sidebar-head {
    padding: calc(12px + var(--safe-top)) calc(58px + var(--safe-right)) 10px calc(14px + var(--safe-left));
  }
  .admin-live-branch-list {
    display: flex;
    gap: 8px;
    padding: 8px calc(10px + var(--safe-right)) 10px calc(10px + var(--safe-left));
    overflow-x: auto;
    overflow-y: hidden;
  }
  .admin-live-branch-list .branch-row {
    flex: 0 0 min(78vw, 280px);
    margin-bottom: 0;
  }
  .admin-live-members {
    display: block;
    max-height: 18vh;
    max-height: 18dvh;
    padding: 8px calc(10px + var(--safe-right)) 10px calc(10px + var(--safe-left));
  }
  .admin-live-members-head {
    margin-bottom: 6px;
  }
  .admin-live-member-list {
    display: flex;
    flex-direction: row;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
  }
  .admin-live-member-list .admin-sidebar-member-card {
    flex: 0 0 min(76vw, 260px);
  }
  .admin-live-main-head {
    padding: 10px calc(12px + var(--safe-right)) 10px calc(12px + var(--safe-left));
  }
  .admin-live-main-head .section-title {
    padding-right: 44px;
    gap: 10px;
  }
  .admin-live-main-head .section-title h2 {
    max-width: 11em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .admin-live-main .admin-live-chat-meta {
    padding: 10px calc(12px + var(--safe-right)) 10px calc(12px + var(--safe-left));
  }
  .admin-live-chat-meta .admin-group-chat-meta-row {
    gap: 6px;
  }
  .admin-live-chat-meta .meta-chip {
    max-width: 100%;
  }
  .admin-live-monitor-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 8px calc(12px + var(--safe-right)) 8px calc(12px + var(--safe-left));
    gap: 6px;
  }
  .admin-live-monitor-summary .metric-card {
    min-height: 48px;
    padding: 7px 8px;
  }
  .admin-live-monitor-summary .metric-card span {
    font-size: 11px;
  }
  .admin-live-monitor-summary .metric-card strong {
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .admin-group-chat-messages {
    padding: 14px calc(10px + var(--safe-right)) calc(16px + var(--safe-bottom)) calc(10px + var(--safe-left));
  }
  .admin-group-chat-row {
    gap: 10px;
    margin-bottom: 14px;
  }
  .admin-group-chat-row .message-avatar {
    width: clamp(30px, 8vw, 40px);
    height: clamp(30px, 8vw, 40px);
    border-radius: 12px;
  }
  .admin-group-chat-body {
    max-width: calc(100% - var(--chat-avatar-size) - 10px);
  }
  .admin-group-chat-body .message-stack {
    width: min(100%, min(calc(100vw - 92px), 78vw));
  }
  .admin-composer {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    width: 100%;
    z-index: 2;
    grid-template-columns: 40px 40px minmax(0, 1fr) 48px;
    align-items: center;
    gap: 8px;
    padding-left: calc(10px + var(--safe-left));
    padding-right: calc(10px + var(--safe-right));
    padding-bottom: calc(10px + var(--safe-bottom));
  }
  .admin-composer .composer-quote,
  .admin-composer .emoji-picker {
    grid-column: 1 / -1;
  }
  .admin-composer .file-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    border-radius: 14px;
    background: rgba(255,255,255,.74);
    box-shadow: inset 0 0 0 1px rgba(225, 231, 240, .95);
  }
  .admin-composer input:not([type="file"]) {
    height: 44px;
    border-radius: 22px;
    font-size: 16px;
  }
  .admin-composer .primary {
    width: 48px;
    min-width: 48px;
    height: 40px;
    min-height: 40px;
    border-radius: 14px;
  }
  .admin-composer .upload-hint-button {
    display: none;
  }
  .install-check-head { align-items: stretch; flex-direction: column; }
  .check-list { grid-template-columns: 1fr; }
  .db-test-row { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .performance-profile-head { flex-direction: column; }
  .performance-profile-grid,
  .performance-profile-summary { grid-template-columns: 1fr; }
  .permission-grid { grid-template-columns: 1fr; }
  .code-row { grid-template-columns: 1fr; }
  .code-row button { width: auto; justify-self: start; }
  .topbar { align-items: flex-start; height: auto; padding-top: 14px; padding-bottom: 14px; gap: 12px; flex-direction: column; }
  nav { flex-wrap: wrap; }
  nav a, nav button { min-height: 44px; display: inline-flex; align-items: center; }
  .chat-shell {
    width: 100%;
    min-height: 100dvh;
    min-height: var(--app-vh, 100dvh);
    background:
      radial-gradient(circle at top left, rgba(37, 117, 157, .12), transparent 20rem),
      linear-gradient(180deg, #edf2f7 0%, #eef3f8 100%);
  }
  .chat-shell-enter {
    place-items: center;
    padding: 0;
  }
  .chat-shell-direct,
  .chat-shell-group {
    place-items: stretch;
    padding: 0;
  }
  .enter-panel-shell {
    width: 100%;
    min-height: var(--app-vh, 100dvh);
    display: grid;
    place-items: center;
    padding: calc(14px + var(--safe-top)) 14px calc(18px + var(--safe-bottom));
  }
  .enter-panel {
    width: min(100%, 520px);
    min-height: auto;
    gap: 20px;
    padding: clamp(22px, 6vw, 30px);
    border: 1px solid rgba(223, 229, 239, .96);
    border-radius: 24px;
    box-shadow: 0 18px 44px rgba(18, 32, 52, .10);
    background:
      radial-gradient(circle at top right, rgba(23,107,135,.10), transparent 13rem),
      linear-gradient(180deg, rgba(255,255,255,.99) 0%, rgba(246,249,253,.99) 100%);
  }
  .enter-panel-mobile .enter-panel-hero {
    gap: 12px;
    padding-top: 0;
  }
  .enter-panel-mobile .enter-panel-hero h1 {
    max-width: 9em;
    font-size: clamp(30px, 8vw, 42px);
    line-height: 1.12;
  }
  .enter-panel-mobile .enter-panel-hero .muted {
    font-size: 14px;
    line-height: 1.72;
  }
  .enter-panel-mobile .enter-form {
    gap: 12px;
  }
  .enter-panel-mobile .enter-field {
    gap: 8px;
  }
  .enter-panel-mobile .enter-field input {
    min-height: 52px;
    border-radius: 14px;
    padding: 0 14px;
    font-size: 16px;
    background: rgba(255,255,255,.96);
    border-color: rgba(220, 228, 239, .96);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.72);
  }
  .enter-panel-mobile .enter-submit {
    min-height: 54px;
    border-radius: 15px;
    font-size: 17px;
    box-shadow: 0 14px 30px rgba(23,107,135,.20);
  }
  .direct-chat-panel,
  .chat-panel.group-workspace {
    width: 100%;
    max-width: none;
    height: 100dvh;
    min-height: 100dvh;
    height: var(--app-vh, 100dvh);
    min-height: var(--app-vh, 100dvh);
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    display: block;
    position: relative;
  }
  .chat-panel {
    display: block;
    position: relative;
  }
  .chat-panel.group-workspace {
    display: block;
  }
  .group-workspace .group-left-pane,
  .group-workspace .group-right-pane,
  .private-chat-layer {
    display: none;
  }
  .private-chat-resize-handle {
    display: none;
  }
  .mobile-chat-head {
    min-height: auto;
    padding: calc(8px + var(--safe-top)) calc(var(--mobile-chat-shell-padding) + var(--safe-right)) 10px calc(var(--mobile-chat-shell-padding) + var(--safe-left));
    background: linear-gradient(180deg, rgba(255,255,255,.98) 0%, rgba(249,251,255,.96) 100%);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 30;
    border-bottom: 1px solid var(--mobile-chat-line);
    box-shadow: 0 6px 16px rgba(15, 23, 42, .045);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
  .chat-head {
    align-items: center;
    flex-direction: row;
    gap: 10px;
    min-height: 58px;
  }
  .chat-head-main {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1 1 auto;
  }
  .chat-head-copy {
    min-width: 0;
    display: grid;
    gap: 3px;
  }
  .chat-title-row {
    gap: 8px;
  }
  .chat-tools {
    flex: 0 0 auto;
    justify-content: flex-end;
    margin-left: 0;
  }
  .chat-head-copy .eyebrow {
    margin-bottom: 0;
    font-size: 10px;
    letter-spacing: .06em;
    line-height: 1.1;
  }
  .chat-head-copy h2 {
    font-size: clamp(17px, 4.8vw, 20px);
    line-height: 1.1;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .direct-participant-count {
    font-size: 13px;
  }
  .chat-head-subline {
    margin: 0;
    color: #778396;
    font-size: 11px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .message-stage {
    position: fixed;
    top: max(var(--safe-top), var(--mobile-chat-head-offset, calc(66px + var(--safe-top))));
    right: var(--safe-right);
    bottom: max(var(--safe-bottom), var(--mobile-composer-offset, calc(78px + var(--safe-bottom))));
    left: var(--safe-left);
    z-index: 10;
    overflow: hidden;
  }
  .messages {
    position: static;
    padding: 16px var(--mobile-chat-shell-padding) calc(20px + var(--safe-bottom));
    overscroll-behavior-y: contain;
    overflow-anchor: none;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scroll-padding-bottom: calc(24px + var(--safe-bottom));
    background:#EDEDED;
  }
  .new-message-bubble {
    bottom: max(14px, calc(var(--safe-bottom) * .35 + 12px));
    min-height: 38px;
    max-width: min(calc(100% - 88px), 260px);
    padding: 0 14px;
    font-size: 13px;
  }
  .msg {
    max-width: min(80%, 640px);
  }
  .message-stack {
    max-width: calc(100% - 76px);
  }
  .group-chat-body .message-stack,
  .admin-live-messages .message-stack {
    width: min(100%, min(calc(100% - 92px), 78vw));
    max-width: 100%;
  }
  .group-chat-bubble:has(.media-audio) {
    max-width: 100%;
  }
  .mobile-chat-info-page {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    background:
      radial-gradient(circle at top left, rgba(23,107,135,.08), transparent 18rem),
      linear-gradient(180deg, #edf2f7 0%, #eef3f8 100%);
  }
  .mobile-chat-info-head {
    padding: calc(10px + var(--safe-top)) calc(var(--mobile-chat-shell-padding) + var(--safe-right)) 12px calc(var(--mobile-chat-shell-padding) + var(--safe-left));
    background: rgba(255,255,255,.97);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
  .mobile-chat-info-body {
    padding: 14px var(--mobile-chat-shell-padding) calc(24px + var(--safe-bottom));
    gap: 14px;
  }
  .mobile-chat-info-card {
    border-radius: 20px;
    background: rgba(255,255,255,.95);
    border: 1px solid rgba(219, 227, 238, .96);
    box-shadow: 0 8px 18px rgba(15, 23, 42, .055);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .mobile-chat-member-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .mobile-chat-member-card {
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255,255,255,.98) 0%, rgba(246,249,253,.98) 100%);
    box-shadow: 0 8px 18px rgba(15, 23, 42, .05);
  }
  .mobile-chat-member-card.active {
    border-color: rgba(129, 181, 194, .95);
    box-shadow: 0 10px 24px rgba(23,107,135,.12);
  }
  .preview-trigger { width: auto; }
  .preview-trigger,
  .preview-trigger .attachment-name,
  .preview-img {
    max-width: min(100%, 10rem);
  }
  .preview-img {
    max-height: 14.5rem;
  }
  .media-link-image {
    width: min(100%, 18rem);
  }
  .media-link-img {
    max-height: 15rem;
  }
  .preview-img { width: 100%; max-height: 150px; }
  .admin-chat-meta { flex-direction: column; align-items: flex-start; }
  .meta-row { justify-content: flex-start; }
  .monitor-summary { grid-template-columns: 1fr 1fr; }
  .summary-block, .wide-metric { grid-column: 1 / -1; }
  .site-footer { flex-direction: column; }
  .footer-links { justify-content: flex-start; }
  .modal-actions { grid-template-columns: 1fr; }
  .composer {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    align-items: end;
    transform: translateZ(0);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 35;
    border-top: 1px solid rgba(220, 227, 237, .9);
    box-shadow: 0 -6px 16px rgba(15, 23, 42, .045);
    background: linear-gradient(180deg, rgba(249,251,253,.98) 0%, rgba(243,246,250,.98) 100%);
    padding: 8px calc(10px + var(--safe-right)) calc(12px + var(--safe-bottom)) calc(10px + var(--safe-left));
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
  .upload-hint {
    display: none;
  }
  .mobile-compose-shell {
    display: grid;
    width: 100%;
    grid-template-columns: 40px minmax(0, 1fr) 40px 40px;
    align-items: center;
    gap: 8px;
  }
  .mobile-compose-shell.is-active {
    grid-template-columns: 32px minmax(0, 1fr) 40px auto;
    align-items: center;
    gap: 8px;
  }
  .mobile-compose-circle,
  .mobile-compose-corner {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border-radius: 14px;
    background: rgba(255,255,255,.74);
    color: #2c3745;
    box-shadow: inset 0 0 0 1px rgba(225, 231, 240, .95);
    border: 0;
  }
  .mobile-compose-corner {
    width: 32px;
    min-width: 32px;
    height: 32px;
    min-height: 32px;
    margin-top: 0;
    align-self: center;
    border-radius: 10px;
    background: transparent;
    box-shadow: none;
    color: #667281;
  }
  .mobile-compose-circle i,
  .mobile-compose-corner i {
    font-size: 18px;
    line-height: 1;
  }
  .mobile-compose-corner i {
    font-size: 14px;
  }
  .mobile-compose-editor {
    min-width: 0;
    padding: 9px 14px;
    border-radius: 20px;
    background: rgba(255,255,255,.98);
    border: 1px solid rgba(229, 235, 242, .98);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.82), 0 4px 14px rgba(15, 23, 42, .04);
  }
  .mobile-compose-editor-inline {
    min-height: 44px;
    padding-top: 6px;
    padding-bottom: 6px;
  }
  .mobile-compose-editor-inline.is-active {
    min-height: 44px;
    padding-top: 6px;
    padding-bottom: 6px;
  }
  .mobile-compose-editor textarea {
    width: 100%;
    display: block;
    border: 0;
    padding: 2px;
    resize: none;
    background: transparent;
    box-shadow: none;
    font-size: 16px;
    line-height: 1.5;
    -webkit-appearance: none;
    appearance: none;
    color: #22252a;
  }
  .mobile-compose-editor-inline textarea {
    min-height: 30px;
    height: auto;
    max-height: 120px;
    line-height: 1.55;
    overflow: hidden;
  }
  .mobile-compose-editor textarea:focus {
    border: 0;
    box-shadow: none;
  }
  .mobile-compose-send {
    width: auto;
    min-width: 64px;
    max-width: none;
    height: 40px;
    min-height: 40px;
    padding: 0 16px;
    border-radius: 20px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    justify-self: end;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    background: linear-gradient(180deg, #1fcd61 0%, #17bf58 100%);
    box-shadow: 0 6px 12px rgba(24, 196, 94, .20);
  }
  .mobile-compose-send:disabled {
    background: rgba(238, 241, 245, .95);
    color: #a3acb6;
    box-shadow: none;
    transform: none;
  }
}
@media (max-width: 560px) {
  :root {
    --attachment-card-min-width: min(180px, 100%);
    --attachment-card-max-width: min(100%, 300px);
    --attachment-card-padding: 7px 10px;
    --attachment-card-gap: 7px;
    --media-card-width: clamp(15.5rem, 72vw, 22.5rem);
    --media-audio-width: clamp(17.5rem, 82vw, 22rem);
    --media-video-width: clamp(13.5rem, 68vw, 19.25rem);
    --media-video-max-height: min(21rem, 46vh);
    --video-player-min-height: 190px;
  }
  .user-shell {
    width: min(100% - 14px, 100%);
    margin-top: 8px;
  }
  .user-sidebar,
  .user-content-panel {
    border-radius: 12px;
  }
  .user-tabs a {
    flex: 1 1 calc(50% - 4px);
    justify-content: center;
    min-width: 0;
    text-align: center;
    white-space: nowrap;
  }
  .user-content-panel > .section-title {
    align-items: flex-start;
    flex-direction: column;
  }
  .user-content-panel .toolbar-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .user-content-panel .toolbar-actions .ghost,
  .user-content-panel .toolbar-actions .danger {
    flex: 1 1 126px;
  }
  .stats-headline,
  .stats-chart-title {
    align-items: flex-start;
    flex-direction: column;
  }
  .stats-kpi-grid,
  .stats-ranking-grid {
    grid-template-columns: 1fr;
  }
  .stats-chart-box,
  .stats-ranking-list {
    padding: 12px;
  }
  .stats-chart,
  .stats-chart-box.wide .stats-chart {
    height: 260px;
    min-height: 240px;
  }
  .segmented-control {
    width: 100%;
  }
  .segmented-control button {
    flex: 1;
  }
  .home-shell {
    background:
      radial-gradient(circle at top left, rgba(38, 110, 167, .18), transparent 22rem),
      linear-gradient(180deg, #08111f 0%, #0d1729 36%, #f4f7fc 36%, #f5f7fb 100%);
  }
  .home-topbar-inner,
  .home-container {
    width: min(1200px, calc(100% - 24px));
  }
  .home-nav {
    gap: 12px;
  }
  .home-nav a {
    font-size: 13px;
  }
  .home-actions {
    width: 100%;
  }
  .home-action-btn {
    flex: 1 1 calc(50% - 8px);
  }
  .home-hero-copy h1 {
    font-size: 50px;
  }
  .home-hero-title {
    gap: 0;
  }
  .home-hero-text {
    font-size: 17px;
  }
  .home-feature-strip {
    margin-top: -44px;
  }
  .home-feature-grid,
  .home-scenario-grid,
  .home-tech-grid {
    grid-template-columns: 1fr;
  }
  .home-story-card,
  .home-admin-banner,
  .home-feature-card,
  .home-scenario-card,
  .home-tech-card {
    padding: 20px;
  }
  .home-quick-card {
    grid-template-columns: 42px minmax(0, 1fr);
  }
  .home-quick-link {
    grid-column: 2;
    margin-top: 6px;
  }
  .home-story-media {
    min-height: 182px;
    font-size: 52px;
  }
  .home-cta-row {
    display: grid;
    grid-template-columns: 1fr;
  }
  .admin-users-head,
  .admin-users-toolbar {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .admin-users-title,
  .admin-users-search,
  .admin-users-page {
    width: 100%;
  }
  .admin-users-title {
    display: grid;
    grid-template-columns: auto 1fr 1fr;
    gap: 8px;
    align-items: center;
  }
  .admin-users-title h2 {
    grid-column: 1 / -1;
  }
  .admin-users-title .ghost {
    width: 100%;
    justify-content: center;
    min-height: 40px;
  }
  .admin-users-search {
    grid-template-columns: 1fr;
    min-width: 0;
  }
  .admin-users-page {
    justify-content: flex-start;
    overflow-x: auto;
  }
  .admin-users-table {
    min-width: 1120px;
    font-size: 13px;
  }
  .admin-users-table th,
  .admin-users-table td {
    padding: 10px;
  }
  .admin-user-editor-panel {
    width: 100%;
    padding: 22px 18px;
  }
  .chat-shell {
    min-height: 100dvh;
    min-height: var(--app-vh, 100dvh);
  }
  .direct-chat-panel,
  .chat-panel.group-workspace {
    height: 100dvh;
    min-height: 100dvh;
    height: var(--app-vh, 100dvh);
    min-height: var(--app-vh, 100dvh);
  }
  .mobile-chat-head {
    padding: calc(8px + var(--safe-top)) calc(10px + var(--safe-right)) 9px calc(10px + var(--safe-left));
  }
  .chat-nav-btn,
  .chat-menu-btn,
  .chat-info-close {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    background: rgba(244, 247, 251, .88);
    color: #223042;
    box-shadow: inset 0 0 0 1px rgba(220, 227, 237, .92);
  }
  .chat-head-copy h2 {
    font-size: clamp(16px, 5vw, 18px);
  }
  .chat-head-subline {
    font-size: 10px;
  }
  .mobile-chat-info-head {
    padding: calc(12px + var(--safe-top)) calc(10px + var(--safe-right)) 12px calc(10px + var(--safe-left));
  }
  .mobile-chat-info-body {
    gap: 14px;
    padding: 14px 10px calc(20px + var(--safe-bottom));
  }
  .mobile-chat-member-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px 8px;
  }
  .mobile-chat-member-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .mobile-chat-member-actions .danger {
    grid-column: 1 / -1;
  }
  .mobile-chat-member-card {
    min-height: 160px;
    padding: 44px 6px 10px;
  }
  .mobile-chat-member-card img,
  .mobile-chat-member-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
  }
  .mobile-chat-member-card strong {
    font-size: 13px;
    min-height: calc(1.3em * 2);
  }
  .mobile-chat-member-card small {
    font-size: 10px;
    min-height: calc(1.35em * 2);
  }
  .mobile-chat-member-card .member-ip-line {
    min-height: auto;
    font-size: 9px;
  }
  .mobile-chat-member-card .member-select-check {
    top: 7px;
    left: 7px;
    transform: scale(.94);
    transform-origin: top left;
  }
  .mobile-chat-member-card .member-kick-btn {
    top: 7px;
    right: 7px;
    min-height: 26px;
    padding: 4px 8px;
    font-size: 11px;
  }
  .mobile-chat-member-card .member-remark-btn {
    top: 37px;
    right: 7px;
    min-height: 24px;
    padding: 3px 7px;
    font-size: 10px;
  }
  .mobile-chat-member-actions .ghost,
  .mobile-chat-member-actions .danger {
    min-height: 42px;
    padding: 0 8px;
    border-radius: 14px;
    font-size: 13px;
  }
  .mobile-chat-info-card .group-notice-text {
    padding: 14px 14px 14px 16px;
    border-radius: 16px;
    font-size: 13px;
    line-height: 1.72;
  }
  .mobile-chat-info-card .group-notice-text::before {
    top: 12px;
    bottom: 12px;
  }
  .mobile-chat-info-title strong {
    font-size: 18px;
  }
  .mobile-chat-info-title span {
    max-width: 14rem;
    font-size: 11px;
  }
  .mobile-chat-info-head .chat-nav-btn,
  .mobile-chat-info-head .chat-info-close {
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    border-radius: 13px;
  }
  .mobile-chat-info-card {
    padding: 14px;
    border-radius: 16px;
  }
  .mobile-chat-card-head {
    gap: 10px;
    margin-bottom: 10px;
  }
  .mobile-chat-card-head h3 {
    font-size: 18px;
  }
  .mobile-chat-card-head .meta-chip {
    margin-top: 1px;
    padding: 6px 11px;
    font-size: 12px;
  }
  .mobile-chat-info-actions {
    padding: 4px;
    border-radius: 18px;
  }
  .mobile-chat-return-btn {
    min-height: 48px;
    border-radius: 16px;
    gap: 8px;
    font-size: 14px;
  }
  .chat-tools { gap: 6px; }
  .admin-sidebar-member-list { max-height: 300px; }
  .member-chip {
    flex: 0 0 auto;
    max-width: 132px;
    min-height: 42px;
    padding: 5px 9px 5px 6px;
    font-size: 12px;
  }
  .member-chip img,
  .member-chip i {
    width: 28px;
    height: 28px;
  }
  .member-chip-text strong { max-width: 78px; }
  .member-chip small { font-size: 9px; }
  .messages {
    padding: 14px 10px calc(16px + var(--safe-bottom));
    scroll-padding-bottom: calc(22px + var(--safe-bottom));
  }
  .timeline-time-divider,
  .timeline-system-divider {
    margin: 12px 0 14px;
  }
  .timeline-time-divider span,
  .timeline-system-divider span {
    min-height: 26px;
    padding: 0 12px;
    font-size: 11px;
    background: rgba(255,255,255,.72);
    border: 1px solid rgba(225, 231, 240, .82);
    box-shadow: 0 6px 14px rgba(15, 23, 42, .04);
  }
  .msg-row {
    gap: clamp(6px, 2.5vw, 10px);
    margin-bottom: 14px;
  }
  .message-avatar {
    width: clamp(30px, 8vw, 40px);
    height: clamp(30px, 8vw, 40px);
    border-radius: 12px;
  }
  .msg {
    max-width: calc(100% - 76px);
    padding: 10px 12px;
    border-radius: 8px 16px 16px 16px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .06);
  }
  .message-stack {
    max-width: calc(100% - 76px);
  }
  .message-stack:has(.media-audio) {
    max-width: calc(100% - 5px);
  }
  .msg.media-only:has(.media-audio),
  .group-chat-bubble.media-only:has(.media-audio) {
    max-width: min(calc(100% - 22px), var(--media-audio-width));
  }
  .group-chat-row {
    gap: 10px;
    margin-bottom: 14px;
  }
  .group-chat-body {
    max-width: calc(100% - var(--chat-avatar-size) - 10px);
    gap: 5px;
  }
  .group-chat-sender {
    font-size: 12px;
    padding-left: 2px;
  }
  .group-chat-bubble {
    width: auto;
    min-width: 0;
    max-width: 100%;
    padding: 11px 13px;
    border-radius: 8px 18px 18px 18px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .05);
  }
  .group-chat-bubble:has(.media-video) {
    max-width: min(calc(100% - 22px), calc(var(--media-video-width) + 18px));
  }
  .group-chat-bubble:has(.media-audio) {
    max-width: min(calc(100% - 22px), calc(var(--media-audio-width) + 18px));
  }
  .group-chat-bubble::before {
    top: 11px;
    left: -5px;
    width: 10px;
    height: 10px;
  }
  .group-chat-bubble.mine::before {
    left: auto;
    right: -5px;
  }
  .group-chat-body .message-stack,
  .admin-live-messages .message-stack {
    width: min(100%, min(calc(100% - 5px), 78vw));
    max-width: 100%;
  }
  .group-chat-body .message-stack:has(.media-audio),
  .admin-live-messages .message-stack:has(.media-audio) {
    width: min(100%, calc(100% - 5px));
  }
  .quote-block {
    max-width: min(100%, calc(100% - 120px));
    padding: 6px 10px;
    border-radius: 12px;
    background: rgba(241, 245, 249, .92);
  }
  .private-chat-messages .message-stack .quote-block {
    max-width: calc(100% - 6px);
  }
  .msg-row:not(.mine) .message-stack .quote-block,
  .group-chat-row:not(.mine) .message-stack .quote-block {
    margin-left: 5px;
  }
  .message-stack.mine .quote-block,
  .group-chat-row.mine .message-stack .quote-block {
    margin-right: 5px;
  }
  .sender,
  .chat-head-subline,
  .attachment-size,
  .quote-block strong,
  .quote-block span,
  .composer-quote strong,
  .composer-quote span {
    font-size: clamp(10px, 2.8vw, 12px);
  }
  .attachment {
    grid-template-columns: auto minmax(0, 1fr);
    font-size: 13px;
  }
  .attachment-copy {
    gap: 6px;
  }
  .attachment-size { font-size: 12px; }
  .media-card {
    padding: 10px;
    border-radius: 16px;
  }
  .media-video {
    padding: 8px;
  }
  .inline-audio {
    height: 38px;
  }
  .user-card { grid-template-columns: auto minmax(0, 1fr) auto; }
  .user-card img { width: 38px; height: 38px; }
  .user-meta { grid-column: 2 / -1; }
  .user-link-tabs {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-radius: 16px;
  }
  .user-link-tabs button {
    justify-content: center;
    padding: 9px 10px;
  }
  .link-card {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
  }
  .link-card .select-check {
    grid-row: 1 / span 2;
    padding-top: 10px;
  }
  .link-card .link-meta {
    grid-column: 2;
  }
  .card-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .admin-link-card {
    padding: 14px;
    gap: 12px;
  }
  .admin-link-card .link-meta strong {
    font-size: 15px;
  }
  .admin-link-head {
    gap: 10px;
  }
  .admin-link-status {
    padding: 4px 9px;
    font-size: 11px;
  }
  .admin-link-card p {
    font-size: 13px;
    line-height: 1.5;
  }
  .admin-link-summary {
    gap: 8px;
  }
  .admin-link-summary span:not(.type-badge):not(:last-child)::after {
    margin-left: 8px;
  }
  .admin-link-card small {
    font-size: 12px;
    line-height: 1.55;
  }
  .admin-link-time {
    margin-top: 8px;
    padding-top: 8px;
    font-size: 11px;
  }
  .admin-link-card .card-actions {
    gap: 10px;
    padding-top: 10px;
  }
  .admin-link-card .card-actions button {
    min-width: 0;
    flex: 1 1 120px;
    font-size: 14px;
  }
  .muted-members-panel {
    padding: 20px;
  }
  .muted-members-head h2 {
    font-size: 19px;
  }
  .muted-member-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .muted-member-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .muted-member-reason,
  .muted-member-actions {
    grid-column: 1;
  }
  .muted-member-actions {
    grid-row: auto;
    align-self: stretch;
  }
  .muted-member-actions button {
    width: 100%;
  }
  .pswp-gallery-title {
    top: calc(max(12px, env(safe-area-inset-top)) + 48px);
    right: max(12px, env(safe-area-inset-right));
    left: max(12px, env(safe-area-inset-left));
    font-size: 13px;
    text-align: center;
  }
  .pswp__top-bar {
    top: max(10px, env(safe-area-inset-top));
    right: max(10px, env(safe-area-inset-right));
    height: 38px;
  }
  .pswp__button {
    width: 38px;
    height: 38px;
  }
  .pswp__button:not(.pswp__button--arrow) .pswp__icn {
    width: 18px;
    height: 18px;
  }
  .pswp__button--arrow,
  .pswp__button--arrow .pswp__icn {
    width: 42px;
    height: 42px;
  }
  .pswp-gallery-download {
    min-width: 42px;
    width: 42px;
    height: 38px;
    padding: 0;
    border-radius: 50%;
  }
  .pswp-gallery-download span { display: none; }
  .pswp-gallery-rail {
    top: auto;
    right: 0;
    bottom: max(8px, env(safe-area-inset-bottom));
    left: 0;
    width: auto;
    height: 84px;
    display: flex;
    gap: 8px;
    padding: 9px 10px;
    overflow-x: auto;
    overflow-y: hidden;
    border-top: 1px solid rgba(255,255,255,.08);
    border-right: 0;
  }
  .pswp-gallery-thumb {
    flex: 0 0 72px;
    height: 58px;
    margin: 0;
  }
  .composer {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding: 8px calc(10px + var(--safe-right)) calc(12px + var(--safe-bottom)) calc(10px + var(--safe-left));
    align-items: end;
    transform: translateZ(0);
    background: linear-gradient(180deg, rgba(249,251,253,.98) 0%, rgba(243,246,250,.98) 100%);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 35;
    border-top: 1px solid rgba(220, 227, 237, .9);
    box-shadow: 0 -6px 16px rgba(15, 23, 42, .045);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
  body.chat-ios-keyboard-open .composer {
    padding: 8px calc(10px + var(--safe-right)) calc(12px + var(--safe-bottom)) calc(10px + var(--safe-left));
  }
  .upload-hint {
    display: none;
  }
  .mobile-compose-shell {
    display: grid;
    width: 100%;
    grid-template-columns: 40px minmax(0, 1fr) 40px 40px;
    align-items: center;
    gap: 8px;
  }
  .mobile-compose-shell.is-active {
    grid-template-columns: 32px minmax(0, 1fr) 40px auto;
    align-items: center;
    gap: 8px;
  }
  .mobile-compose-circle,
  .mobile-compose-corner {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border-radius: 14px;
    background: rgba(255,255,255,.74);
    color: #2c3745;
    box-shadow: inset 0 0 0 1px rgba(225, 231, 240, .95);
    border: 0;
  }
  .mobile-compose-corner {
    width: 32px;
    min-width: 32px;
    height: 32px;
    min-height: 32px;
    margin-top: 0;
    align-self: center;
    border-radius: 10px;
    background: transparent;
    box-shadow: none;
    color: #667281;
  }
  .mobile-compose-circle i,
  .mobile-compose-corner i {
    font-size: 18px;
    line-height: 1;
  }
  .mobile-compose-corner i {
    font-size: 14px;
  }
  .mobile-compose-editor {
    min-width: 0;
    padding: 9px 14px;
    border-radius: 20px;
    background: rgba(255,255,255,.98);
    border: 1px solid rgba(229, 235, 242, .98);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.82), 0 4px 14px rgba(15, 23, 42, .04);
  }
  .mobile-compose-editor-inline {
    min-height: 44px;
    padding-top: 6px;
    padding-bottom: 6px;
  }
  .mobile-compose-editor-inline.is-active {
    min-height: 44px;
    padding-top: 6px;
    padding-bottom: 6px;
  }
  .mobile-compose-editor textarea {
    width: 100%;
    display: block;
    border: 0;
    padding: 2px;
    resize: none;
    background: transparent;
    box-shadow: none;
    font-size: 16px;
    line-height: 1.5;
    -webkit-appearance: none;
    appearance: none;
    color: #22252a;
  }
  .mobile-compose-editor-inline textarea {
    min-height: 30px;
    height: auto;
    max-height: 120px;
    line-height: 1.55;
    overflow: hidden;
  }
  .mobile-compose-editor textarea:focus {
    border: 0;
    box-shadow: none;
  }
  .mobile-voice-editor {
    min-width: 0;
    min-height: 44px;
    display: grid;
  }
  .mobile-voice-hold {
    width: 100%;
    min-width: 0;
    height: 44px;
    border: 0;
    border-radius: 4px;
    background: rgba(255,255,255,.98);
    color: #252a31;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0;
    box-shadow: inset 0 0 0 1px rgba(229, 235, 242, .98), 0 4px 14px rgba(15, 23, 42, .04);
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-voice-hold:active,
  .mobile-voice-editor.recording .mobile-voice-hold {
    background: #f7fafc;
    color: #111827;
  }
  .mobile-compose-send {
    width: auto;
    min-width: 64px;
    max-width: none;
    height: 40px;
    min-height: 40px;
    padding: 0 16px;
    border-radius: 20px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    justify-self: end;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    background: linear-gradient(180deg, #1fcd61 0%, #17bf58 100%);
    box-shadow: 0 6px 12px rgba(24, 196, 94, .20);
  }
  .mobile-compose-send:disabled {
    background: rgba(238, 241, 245, .95);
    color: #a3acb6;
    box-shadow: none;
    transform: none;
  }
  .mobile-compose-shell .emoji-trigger.active {
    background: rgba(232, 244, 246, .96);
    color: var(--primary);
    box-shadow: inset 0 0 0 1px rgba(188, 217, 224, .96);
  }
  .mobile-compose-shell .emoji-trigger:hover,
  .mobile-compose-shell .emoji-trigger:focus-visible,
  .mobile-compose-circle:hover,
  .mobile-compose-circle:focus-visible,
  .mobile-compose-corner:hover,
  .mobile-compose-corner:focus-visible {
    background: rgba(255,255,255,.96);
    color: #243040;
    outline: none;
  }
  .voice-record-overlay {
    position: fixed;
    inset: 0;
    z-index: 10060;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto auto;
    align-items: end;
    padding: calc(16px + var(--safe-top)) calc(16px + var(--safe-right)) 0 calc(16px + var(--safe-left));
    background: rgba(0, 0, 0, .58);
    color: #fff;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
  }
  .voice-record-preview {
    justify-self: center;
    align-self: center;
    width: min(60vw, 200px);
    min-height: 56px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: 28px;
    background: #95ec69;
    color: #22672a;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .18);
  }
  .voice-record-dot {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(34, 103, 42, .12);
  }
  .voice-record-wave {
    height: 28px;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
  }
  .voice-record-wave span {
    width: 2.5px;
    min-height: 6px;
    max-height: 28px;
    border-radius: 999px;
    background: currentColor;
  }
  .voice-record-preview strong {
    font-size: 14px;
    line-height: 1;
    color: #1e5125;
    white-space: nowrap;
  }
  .voice-record-actions {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    width: auto;
    min-height: clamp(138px, 27vh, 210px);
    margin: 0 calc(-16px - var(--safe-right)) -58px calc(-16px - var(--safe-left));
    padding: 0;
    position: relative;
    z-index: 2;
    overflow: hidden;
  }
  .voice-record-zone {
    position: relative;
    flex: 0 0 50%;
    min-width: 0;
    min-height: 100%;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    justify-content: center;
    align-items: center;
    place-items: center;
    align-content: center;
    gap: 8px;
    padding: 18px 59px 54px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: rgba(255, 255, 255, .88);
    font-size: 18px;
    font-weight: 800;
    line-height: 1.05;
    transform: translateZ(0);
    isolation: isolate;
  }
  .voice-record-zone::before {
    content: "";
    position: absolute;
    z-index: -1;
    bottom: 12px;
    width: min(58vw, 360px);
    height: clamp(108px, 16vh, 138px);
    border-radius: 50%;
    background: linear-gradient(180deg, rgba(255,255,255,.28), rgba(255,255,255,.16));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.13);
    margin-left: -7px;
  }
  .voice-record-zone > * {
    position: relative;
    z-index: 1;
  }
  .voice-record-cancel-zone {
    padding-left: max(22px, calc(var(--safe-left) + 16px));
    transform: rotate(-10deg) translateY(2px);
    transform-origin: 38% 64%;
    margin-bottom: 34px;
    padding-left: 0px;
    margin-top: 56px;
  }
  .voice-record-cancel-zone > * {
    transform: rotate(10deg);
  }
  .voice-record-cancel-zone::before {
    left: max(-112px, -18vw);
    transform: rotate(4deg);
  }
  .voice-record-send-zone {
    padding-right: max(22px, calc(var(--safe-right) + 16px));
    transform: rotate(10deg) translateY(2px);
    transform-origin: 62% 64%;
    margin-bottom: 34px;
    margin-top: 50px;
  }
  .voice-record-send-zone > * {
    transform: rotate(-10deg);
  }
  .voice-record-send-zone::before {
    right: max(-112px, -18vw);
    transform: rotate(-4deg);
  }
  .voice-record-zone i {
    font-size: 22px;
  }
  .voice-record-zone i.fa-solid.fa-xmark {
    margin-top: -11px;
  }
  .voice-record-zone i.fa-solid.fa-paper-plane {
    margin-top: 14px;
  }
  .voice-record-zone.active {
    color: #fff;
  }
  .voice-record-zone.active::before {
    background: linear-gradient(180deg, rgba(255,255,255,.36), rgba(255,255,255,.2));
  }
  .voice-record-cancel-zone.active {
    color: #fff;
  }
  .voice-record-cancel-zone.active::before {
    background: linear-gradient(180deg, rgba(248, 113, 113, .46), rgba(255,255,255,.18));
  }
  .voice-record-send-zone.active {
    color: #fff;
  }
  .voice-record-send-zone.active::before {
    background: linear-gradient(180deg, rgba(34, 197, 94, .48), rgba(255,255,255,.18));
  }
  .voice-record-release {
    min-height: calc(104px + var(--safe-bottom));
    display: grid;
    place-items: start center;
    margin: 0 calc(-16px - var(--safe-right)) 0 calc(-16px - var(--safe-left));
    padding: 28px 16px calc(22px + var(--safe-bottom));
    border-top-left-radius: 50% 74px;
    border-top-right-radius: 50% 74px;
    background: linear-gradient(180deg, rgba(255,255,255,.74), rgba(255,255,255,.9));
    color: #29313c;
    font-size: 17px;
    font-weight: 800;
    position: relative;
    z-index: 3;
    box-shadow: 0 -12px 26px rgba(255,255,255,.22), inset 0 1px 0 rgba(255,255,255,.6);
  }
  .mobile-compose-zoom-panel {
    position: fixed;
    inset: 0;
    z-index: 10040;
    display: grid;
    grid-template-rows: minmax(0, 1fr);
    padding: calc(14px + var(--safe-top)) 0 0;
    background: rgba(128, 128, 128, .58);
  }
  .mobile-compose-zoom-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,.03), rgba(0,0,0,.03));
  }
  .mobile-compose-zoom-panel > * {
    position: relative;
    z-index: 1;
  }
  .mobile-compose-zoom-panel {
    align-items: stretch;
  }
  .mobile-compose-zoom-sheet {
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    padding: 0;
    margin: 0;
    border-top-left-radius: 26px;
    border-top-right-radius: 26px;
    background: #ffffff;
    box-shadow: 0 -2px 16px rgba(15, 23, 42, .06);
    overflow: hidden;
  }
  .mobile-compose-zoom-close {
    width: 44px;
    height: 44px;
    margin: 18px 0 0 18px;
    display: inline-grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: rgba(248, 248, 248, .98);
    color: #1f2329;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .08);
  }
  .mobile-compose-zoom-close i {
    font-size: 18px;
    line-height: 1;
  }
  .mobile-compose-zoom-sheet textarea {
    width: 100%;
    min-height: 0;
    height: auto;
    max-height: none;
    border: 0;
    padding: 18px 24px 0;
    resize: none;
    background: transparent;
    color: #20232a;
    font-size: 18px;
    line-height: 1.7;
    box-shadow: none;
    -webkit-appearance: none;
    appearance: none;
  }
  .mobile-compose-zoom-sheet textarea:focus {
    border: 0;
    box-shadow: none;
  }
  .mobile-compose-zoom-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 18px;
    padding: 14px 24px calc(18px + var(--safe-bottom));
    background: #ffffff;
  }
  .mobile-compose-zoom-emoji {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }
  .mobile-compose-zoom-emoji i {
    font-size: 26px;
  }
  .mobile-compose-zoom-send {
    min-width: 68px;
    height: 40px;
    min-height: 40px;
    border-radius: 12px;
    font-size: 15px;
  }
  .upload-format-group {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .emoji-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 2px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }
  .emoji-tabs::-webkit-scrollbar {
    height: 6px;
  }
  .emoji-tabs::-webkit-scrollbar-thumb {
    background: rgba(23,107,135,.18);
    border-radius: 999px;
  }
  .emoji-tab {
    flex: 0 0 auto;
    white-space: nowrap;
  }
  .emoji-grid {
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    max-height: 180px;
  }
  .inline-emoji {
    width: 24px;
    height: 24px;
  }
  .inline-emoji-sm {
    width: 18px;
    height: 18px;
  }
}

@media (max-width: 1180px) and (pointer: coarse), (max-width: 1180px) and (max-height: 720px) {
  :root {
    --mobile-chat-shell-padding: clamp(10px, 2.2vw, 18px);
    --mobile-chat-line: rgba(214, 223, 235, .92);
    --mobile-chat-shadow: 0 12px 28px rgba(15, 23, 42, .08);
  }
  .chat-shell-direct,
  .chat-shell-group {
    place-items: stretch;
    padding: 0;
  }
  .direct-chat-panel,
  .chat-panel.group-workspace {
    width: 100%;
    max-width: none;
    height: 100dvh;
    min-height: 100dvh;
    height: var(--app-vh, 100dvh);
    min-height: var(--app-vh, 100dvh);
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    display: block;
    position: relative;
  }
  .chat-panel {
    display: block;
    position: relative;
  }
  .chat-panel.group-workspace {
    display: block;
  }
  .group-workspace .group-left-pane,
  .group-workspace .group-right-pane,
  .private-chat-layer {
    display: none;
  }
  .private-chat-resize-handle {
    display: none;
  }
  .mobile-chat-head {
    min-height: auto;
    padding: calc(8px + var(--safe-top)) calc(var(--mobile-chat-shell-padding) + var(--safe-right)) 10px calc(var(--mobile-chat-shell-padding) + var(--safe-left));
    background: linear-gradient(180deg, rgba(255,255,255,.98) 0%, rgba(249,251,255,.96) 100%);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 30;
    border-bottom: 1px solid var(--mobile-chat-line);
    box-shadow: 0 6px 16px rgba(15, 23, 42, .045);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
  .message-stage {
    position: fixed;
    top: max(var(--safe-top), var(--mobile-chat-head-offset, calc(66px + var(--safe-top))));
    right: var(--safe-right);
    bottom: max(var(--safe-bottom), var(--mobile-composer-offset, calc(78px + var(--safe-bottom))));
    left: var(--safe-left);
    z-index: 10;
    overflow: hidden;
  }
  .messages {
    position: static;
    padding: 16px var(--mobile-chat-shell-padding) calc(20px + var(--safe-bottom));
    overscroll-behavior-y: contain;
    overflow-anchor: none;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scroll-padding-bottom: calc(24px + var(--safe-bottom));
    background: #EDEDED;
  }
  .composer {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding: 8px calc(10px + var(--safe-right)) calc(12px + var(--safe-bottom)) calc(10px + var(--safe-left));
    align-items: end;
    transform: translateZ(0);
    background: linear-gradient(180deg, rgba(249,251,253,.98) 0%, rgba(243,246,250,.98) 100%);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 35;
    border-top: 1px solid rgba(220, 227, 237, .9);
    box-shadow: 0 -6px 16px rgba(15, 23, 42, .045);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
  body.chat-ios-keyboard-open .composer {
    padding: 8px calc(10px + var(--safe-right)) calc(12px + var(--safe-bottom)) calc(10px + var(--safe-left));
  }
  .mobile-compose-shell {
    display: grid;
    width: 100%;
    grid-template-columns: 40px minmax(0, 1fr) 40px 40px;
    align-items: center;
    gap: 8px;
  }
  .mobile-compose-shell.is-active {
    grid-template-columns: 32px minmax(0, 1fr) 40px auto;
    align-items: center;
    gap: 8px;
  }
  .mobile-compose-circle,
  .mobile-compose-corner {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border-radius: 14px;
    background: rgba(255,255,255,.74);
    color: #2c3745;
    box-shadow: inset 0 0 0 1px rgba(225, 231, 240, .95);
    border: 0;
  }
  .mobile-compose-corner {
    width: 32px;
    min-width: 32px;
    height: 32px;
    min-height: 32px;
    border-radius: 10px;
    background: transparent;
    box-shadow: none;
    color: #667281;
  }
  .mobile-compose-editor {
    min-width: 0;
    padding: 9px 14px;
    border-radius: 20px;
    background: rgba(255,255,255,.98);
    border: 1px solid rgba(229, 235, 242, .98);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.82), 0 4px 14px rgba(15, 23, 42, .04);
  }
  .mobile-compose-editor-inline,
  .mobile-compose-editor-inline.is-active {
    min-height: 44px;
    padding-top: 6px;
    padding-bottom: 6px;
  }
  .mobile-compose-editor textarea {
    width: 100%;
    display: block;
    border: 0;
    padding: 2px;
    resize: none;
    background: transparent;
    box-shadow: none;
    font-size: 16px;
    line-height: 1.5;
    -webkit-appearance: none;
    appearance: none;
    color: #22252a;
  }
  .mobile-compose-editor-inline textarea {
    min-height: 30px;
    height: auto;
    max-height: 120px;
    line-height: 1.55;
    overflow: hidden;
  }
  .mobile-compose-editor textarea:focus {
    border: 0;
    box-shadow: none;
  }
  .mobile-voice-editor {
    min-width: 0;
    min-height: 44px;
    display: grid;
  }
  .mobile-voice-hold {
    width: 100%;
    min-width: 0;
    height: 44px;
    border: 0;
    border-radius: 4px;
    background: rgba(255,255,255,.98);
    color: #252a31;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0;
    box-shadow: inset 0 0 0 1px rgba(229, 235, 242, .98), 0 4px 14px rgba(15, 23, 42, .04);
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-compose-send {
    width: auto;
    min-width: 64px;
    max-width: none;
    height: 40px;
    min-height: 40px;
    padding: 0 16px;
    border-radius: 20px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    justify-self: end;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    background: linear-gradient(180deg, #1fcd61 0%, #17bf58 100%);
    box-shadow: 0 6px 12px rgba(24, 196, 94, .20);
  }
  .upload-hint {
    display: none;
  }
}

@media (max-width: 920px) and (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
  }
  .home-feature-card:hover,
  .home-story-card:hover,
  .home-tech-card:hover,
  .desktop-chat-tool:hover,
  .mobile-compose-send,
  .new-message-bubble {
    transform: none !important;
  }
}

/* Shouye-inspired foreground chat refresh. Scoped to /c/{token} chat route. */
.chat-shell {
  --sc-chat-ink: #101828;
  --sc-chat-muted: #667085;
  --sc-chat-line: rgba(15, 23, 42, .09);
  --sc-chat-panel: rgba(255, 255, 255, .78);
  --sc-chat-panel-strong: rgba(255, 255, 255, .94);
  --sc-chat-soft: #f6f8fb;
  --sc-chat-blue: #0a84ff;
  --sc-chat-blue-deep: #175cd3;
  --sc-chat-green: #20c997;
  --sc-chat-shadow-soft: 0 24px 80px rgba(28, 45, 86, .13);
  --sc-chat-shadow-card: 0 18px 44px rgba(15, 23, 42, .07);
  --sc-chat-radius-lg: 34px;
  --sc-chat-radius-md: 24px;
  position: relative;
  isolation: isolate;
  color: var(--sc-chat-ink);
  background:
    radial-gradient(circle at 18% 0%, rgba(10, 132, 255, .16), transparent 28rem),
    radial-gradient(circle at 82% 12%, rgba(32, 201, 151, .13), transparent 26rem),
    linear-gradient(180deg, #ffffff 0%, #f4f7fb 52%, #eef3f8 100%);
}

.chat-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(17, 24, 39, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 24, 39, .035) 1px, transparent 1px);
  background-size: 72px 72px;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .34), transparent 68%);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .34), transparent 68%);
}

.chat-shell-enter,
.chat-shell-direct {
  background: transparent;
}

.chat-shell .enter-panel {
  border-color: rgba(255, 255, 255, .76);
  border-radius: var(--sc-chat-radius-lg);
  background:
    radial-gradient(circle at 84% 4%, rgba(10, 132, 255, .12), transparent 15rem),
    linear-gradient(145deg, rgba(255, 255, 255, .96), rgba(238, 244, 252, .86));
  box-shadow: var(--sc-chat-shadow-soft), inset 0 1px 0 rgba(255, 255, 255, .92);
  backdrop-filter: blur(22px) saturate(1.35);
  -webkit-backdrop-filter: blur(22px) saturate(1.35);
}

.chat-shell .enter-panel .eyebrow,
.chat-shell .chat-head-copy .eyebrow,
.chat-shell .desktop-info-head .eyebrow,
.chat-shell .group-member-panel-head .eyebrow,
.chat-shell .mobile-chat-card-head .eyebrow {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--sc-chat-blue-deep);
  letter-spacing: 0;
  text-transform: none;
}

.chat-shell .enter-panel .eyebrow::before,
.chat-shell .chat-head-copy .eyebrow::before,
.chat-shell .desktop-info-head .eyebrow::before,
.chat-shell .group-member-panel-head .eyebrow::before,
.chat-shell .mobile-chat-card-head .eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--sc-chat-green);
  box-shadow: 0 0 0 6px rgba(32, 201, 151, .13);
}

.chat-shell .enter-panel-hero h1 {
  color: var(--sc-chat-ink);
  font-weight: 820;
}

.chat-shell .enter-panel-hero .muted {
  color: #526173;
}

.chat-shell .enter-field input,
.chat-shell .composer input:not([type="file"]),
.chat-shell textarea {
  border-color: rgba(214, 224, 236, .9);
  border-radius: 18px;
  background: rgba(255, 255, 255, .9);
  color: var(--sc-chat-ink);
  -webkit-appearance: none;
  appearance: none;
}

.chat-shell .enter-field input:focus,
.chat-shell .composer input:not([type="file"]):focus,
.chat-shell textarea:focus {
  border-color: rgba(10, 132, 255, .48);
  box-shadow: 0 0 0 4px rgba(10, 132, 255, .12);
}

.chat-shell .enter-submit,
.chat-shell .composer .primary,
.chat-shell .mobile-compose-send,
.chat-shell .desktop-send-btn:not(:disabled) {
  color: #fff;
  background: linear-gradient(180deg, #0a84ff, #0066e6);
  box-shadow: 0 14px 30px rgba(0, 102, 255, .24), inset 0 1px 0 rgba(255, 255, 255, .28);
}

.chat-shell .direct-chat-panel {
  width: min(980px, calc(100% - 40px));
  height: min(800px, calc(var(--app-vh, 100vh) - 96px));
  border: 1px solid rgba(255, 255, 255, .78);
  border-radius: 36px;
  background: linear-gradient(145deg, rgba(255, 255, 255, .96), rgba(232, 238, 247, .86));
  box-shadow: var(--sc-chat-shadow-soft), inset 0 1px 0 rgba(255, 255, 255, .92);
  backdrop-filter: blur(22px) saturate(1.3);
  -webkit-backdrop-filter: blur(22px) saturate(1.3);
}

.chat-shell .chat-panel {
  border-color: rgba(255, 255, 255, .78);
  background: rgba(255, 255, 255, .46);
}

.chat-shell .chat-panel.group-workspace {
  background: transparent;
  grid-template-columns: minmax(280px, 21vw) minmax(0, 1fr) minmax(300px, 22vw);
}

.chat-shell .group-workspace .group-left-pane,
.chat-shell .group-workspace .group-right-pane {
  border-color: var(--sc-chat-line);
  background: rgba(255, 255, 255, .62);
  backdrop-filter: blur(22px) saturate(1.35);
  -webkit-backdrop-filter: blur(22px) saturate(1.35);
}

.chat-shell .desktop-session-pane,
.chat-shell .desktop-session-list {
  background: transparent;
}

.chat-shell .desktop-session-head {
  border-bottom-color: var(--sc-chat-line);
}

.chat-shell .desktop-session-search,
.chat-shell .desktop-member-search {
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 18px;
  background: rgba(255, 255, 255, .78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .82);
}

.chat-shell .private-session-row {
  border-bottom-color: rgba(15, 23, 42, .07);
}

.chat-shell .private-session-row:hover,
.chat-shell .private-session-row.active,
.chat-shell .group-member-card:hover,
.chat-shell .group-member-card.active {
  border-color: rgba(10, 132, 255, .2);
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 14px 30px rgba(15, 23, 42, .06);
}

.chat-shell .private-session-row.active {
  border-left-color: var(--sc-chat-green);
}

.chat-shell .chat-head {
  border-bottom-color: var(--sc-chat-line);
  background: rgba(255, 255, 255, .78);
  box-shadow: 0 12px 30px rgba(15, 23, 42, .05);
  backdrop-filter: blur(20px) saturate(1.35);
  -webkit-backdrop-filter: blur(20px) saturate(1.35);
}

.chat-shell .chat-head-copy h2 {
  color: var(--sc-chat-ink);
  font-weight: 810;
}

.chat-shell .desktop-chat-status,
.chat-shell .direct-participant-count,
.chat-shell .chat-head-subline {
  color: var(--sc-chat-muted);
}

.chat-shell .desktop-chat-tool,
.chat-shell .desktop-chat-leave,
.chat-shell .file-btn,
.chat-shell .mobile-compose-circle,
.chat-shell .mobile-compose-corner,
.chat-shell .chat-nav-btn,
.chat-shell .chat-menu-btn,
.chat-shell .chat-info-close {
  border-color: rgba(15, 23, 42, .08);
  background: rgba(255, 255, 255, .72);
  color: #344054;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .06), inset 0 1px 0 rgba(255, 255, 255, .76);
}

.chat-shell .desktop-chat-tool:hover,
.chat-shell .desktop-chat-leave:hover,
.chat-shell .file-btn:hover,
.chat-shell .chat-nav-btn:hover,
.chat-shell .chat-menu-btn:hover,
.chat-shell .chat-info-close:hover {
  border-color: rgba(10, 132, 255, .18);
  background: rgba(255, 255, 255, .94);
  color: var(--sc-chat-blue-deep);
}

.chat-shell .message-stage {
  background:
    radial-gradient(circle at 92% 0%, rgba(32, 201, 151, .08), transparent 22rem),
    linear-gradient(180deg, rgba(246, 249, 253, .82), rgba(238, 243, 248, .78));
}

.chat-shell .messages,
.chat-shell .private-chat-messages {
  background:
    radial-gradient(circle at 8% 8%, rgba(10, 132, 255, .08), transparent 22rem),
    radial-gradient(circle at 92% 12%, rgba(32, 201, 151, .08), transparent 22rem),
    linear-gradient(180deg, rgba(247, 250, 255, .74), rgba(239, 244, 250, .72));
}

.chat-shell .message-avatar {
  border-radius: 16px;
  border-color: rgba(255, 255, 255, .92);
}

.chat-shell .msg,
.chat-shell .group-chat-bubble {
  border: 1px solid rgba(15, 23, 42, .06);
  border-radius: 20px;
  background: rgba(255, 255, 255, .92);
  color: #263241;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .62);
}

.chat-shell .msg.mine,
.chat-shell .group-chat-bubble.mine {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(180deg, #0a84ff, #0066e6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22);
}
.chat-shell .group-chat-bubble.mine:has(.voice-message-bubble),
.chat-shell .msg.mine:has(.voice-message-bubble) {
  background: transparent;
  box-shadow: none;
  border-color: transparent;
}

.chat-shell .revoked-message,
.chat-shell .revoked-message.mine,
.chat-shell .group-chat-bubble.revoked-message,
.chat-shell .group-chat-bubble.revoked-message.mine {
  color: #7a4b00;
  border: 1px solid #f4b740;
  background: linear-gradient(180deg, #fff8db 0%, #ffe8a3 100%);
  box-shadow: 0 10px 24px rgba(244, 183, 64, .2), inset 0 1px 0 rgba(255, 255, 255, .58);
}

.chat-shell .group-chat-bubble::before {
  background: rgba(255, 255, 255, .92);
}

.chat-shell .group-chat-bubble.mine::before {
  background: #187de2;
}

.chat-shell .group-chat-bubble.revoked-message::before,
.chat-shell .group-chat-bubble.revoked-message.mine::before {
  background: #ffefba;
}

.chat-shell .msg.media-only,
.chat-shell .msg.media-only.mine,
.chat-shell .group-chat-bubble.media-only,
.chat-shell .group-chat-bubble.media-only.mine {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.chat-shell .group-chat-sender,
.chat-shell .sender,
.chat-shell .msg time {
  color: #7b8798;
}

.chat-shell .msg.mine time,
.chat-shell .msg.mine .message-link,
.chat-shell .group-chat-bubble.mine .message-link {
  color: rgba(255, 255, 255, .92);
  text-decoration-color: rgba(255, 255, 255, .44);
}

.chat-shell .quote-block,
.chat-shell .composer-quote {
  border: 1px solid rgba(15, 23, 42, .06);
  border-radius: 14px;
  background: rgba(255, 255, 255, .72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);
}

.chat-shell .attachment {
  border-color: rgba(15, 23, 42, .08);
  border-radius: 16px;
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
}

.chat-shell .preview-img,
.chat-shell .media-card {
  border-radius: 18px;
}

.chat-shell .media-video,
.chat-shell .group-chat-bubble .media-video,
.chat-shell .message-stack > .media-video,
.chat-shell .private-chat-messages .group-chat-bubble .media-video {
  width: var(--media-video-width);
  max-width: 100%;
}

.chat-shell .video-player-shell {
  width: 100%;
  max-width: 100%;
}

.chat-shell .voice-message-bubble {
  border-radius: 20px;
  background: rgba(255, 255, 255, .94);
  color: #203047;
  box-shadow: inset 0 0 0 1px rgba(188, 205, 225, .72);
}

.chat-shell .msg.mine .voice-message-bubble,
.chat-shell .group-chat-bubble.mine .voice-message-bubble {
  color: #ffffff;
  background: linear-gradient(180deg, #0a84ff, #0066e6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22);
}

.chat-shell .msg.media-only.mine .voice-message-bubble,
.chat-shell .group-chat-bubble.media-only.mine .voice-message-bubble,
.chat-shell .message-stack.mine > .voice-message-bubble {
  color: #ffffff;
  background: linear-gradient(180deg, #0a84ff, #0066e6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22);
}

.chat-shell .msg.mine .voice-play-icon,
.chat-shell .group-chat-bubble.mine .voice-play-icon,
.chat-shell .msg.media-only.mine .voice-play-icon,
.chat-shell .group-chat-bubble.media-only.mine .voice-play-icon,
.chat-shell .message-stack.mine > .voice-message-bubble .voice-play-icon {
  color: #0a66d8;
  background: rgba(255, 255, 255, .86);
}

.chat-shell .msg.mine .voice-waveform span,
.chat-shell .group-chat-bubble.mine .voice-waveform span,
.chat-shell .msg.media-only.mine .voice-waveform span,
.chat-shell .group-chat-bubble.media-only.mine .voice-waveform span,
.chat-shell .message-stack.mine > .voice-message-bubble .voice-waveform span {
  opacity: .86;
}

.chat-shell .voice-message-bubble.pending,
.chat-shell .voice-message-bubble:disabled {
  opacity: 1;
}

.chat-shell .voice-message-bubble.pending .voice-waveform span,
.chat-shell .voice-message-bubble:disabled .voice-waveform span {
  opacity: .45;
}

.chat-shell .composer,
.chat-shell .group-workspace .composer {
  border-top-color: var(--sc-chat-line);
  background: rgba(255, 255, 255, .78);
  box-shadow: 0 -16px 34px rgba(15, 23, 42, .06);
  backdrop-filter: blur(20px) saturate(1.35);
  -webkit-backdrop-filter: blur(20px) saturate(1.35);
}

.chat-shell .desktop-composer-shell {
  border-color: rgba(15, 23, 42, .08);
  border-radius: 24px;
  background: rgba(255, 255, 255, .88);
  box-shadow: var(--sc-chat-shadow-card), inset 0 1px 0 rgba(255, 255, 255, .82);
}

.chat-shell .desktop-composer-editor textarea {
  color: var(--sc-chat-ink);
}

.chat-shell .desktop-composer-editor textarea,
.chat-shell .mobile-compose-editor textarea {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.chat-shell .desktop-composer-editor textarea:focus,
.chat-shell .mobile-compose-editor textarea:focus {
  border: 0;
  box-shadow: none;
}

.chat-shell .composer .primary:disabled,
.chat-shell .mobile-compose-send:disabled,
.chat-shell .desktop-send-btn:disabled {
  color: #98a2b3;
  background: rgba(238, 241, 245, .95);
  box-shadow: none;
  cursor: not-allowed;
}

.chat-shell .desktop-upload-hint,
.chat-shell .upload-hint-button {
  color: var(--sc-chat-blue-deep);
}

.chat-shell .emoji-picker {
  border-color: rgba(15, 23, 42, .08);
  border-radius: 22px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 24px 54px rgba(15, 23, 42, .14);
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
}

.chat-shell .emoji-tab.active,
.chat-shell .emoji-item:hover,
.chat-shell .emoji-item:focus-visible,
.chat-shell .emoji-trigger.active {
  border-color: rgba(10, 132, 255, .24);
  background: #eaf2ff;
  color: var(--sc-chat-blue-deep);
}

.chat-shell .new-message-bubble {
  border-color: rgba(10, 132, 255, .18);
  color: var(--sc-chat-blue-deep);
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 18px 38px rgba(15, 23, 42, .16);
}

.chat-shell .group-notice-card,
.chat-shell .group-member-panel,
.chat-shell .mobile-chat-info-card,
.chat-shell .desktop-member-avatar-item img,
.chat-shell .desktop-member-avatar-plus,
.chat-shell .group-member-card {
  border-color: rgba(15, 23, 42, .08);
  background: rgba(255, 255, 255, .78);
  box-shadow: 0 14px 32px rgba(15, 23, 42, .06), inset 0 1px 0 rgba(255, 255, 255, .72);
}

.chat-shell .group-notice-text {
  color: #44546a;
}

.chat-shell .member-role-pill,
.chat-shell .meta-chip {
  color: var(--sc-chat-blue-deep);
  background: #eaf2ff;
}

.chat-shell .member-role-pill.muted {
  color: #8a5a00;
  background: #fff4d6;
}

.chat-shell .private-chat-window {
  position: relative;
  border-color: rgba(255, 255, 255, .88);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .95), rgba(247, 251, 255, .88)),
    radial-gradient(circle at top right, rgba(10, 132, 255, .12), transparent 42%);
  box-shadow:
    0 30px 90px rgba(15, 23, 42, .18),
    0 10px 30px rgba(10, 132, 255, .08),
    inset 0 1px 0 rgba(255, 255, 255, .92);
  backdrop-filter: blur(20px) saturate(1.28);
  -webkit-backdrop-filter: blur(20px) saturate(1.28);
}

.chat-shell .private-chat-window::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(circle at 16% 12%, rgba(255, 255, 255, .62), transparent 24%),
    linear-gradient(135deg, rgba(10, 132, 255, .06), transparent 36%, rgba(32, 201, 151, .05));
  pointer-events: none;
}

.chat-shell .private-chat-window.active {
  border-color: rgba(10, 132, 255, .34);
  box-shadow:
    0 34px 100px rgba(15, 23, 42, .22),
    0 0 0 1px rgba(10, 132, 255, .12),
    0 0 0 6px rgba(10, 132, 255, .08),
    inset 0 1px 0 rgba(255, 255, 255, .92);
}

.chat-shell .private-chat-title {
  position: relative;
  z-index: 1;
  padding: 14px 16px 13px;
  border-bottom: 1px solid rgba(201, 215, 232, .62);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .86), rgba(244, 249, 255, .72));
  color: var(--sc-chat-ink);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.chat-shell .private-chat-title span {
  gap: 10px;
  color: #203047;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .72);
}

.chat-shell .private-chat-title span i {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(10, 132, 255, .16), rgba(10, 132, 255, .08));
  color: #0b6cdc;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9);
}

.chat-shell .private-chat-title .icon-btn {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(198, 212, 228, .82);
  border-radius: 14px;
  background: rgba(255, 255, 255, .82);
  color: #55708a;
  box-shadow: 0 10px 18px rgba(15, 23, 42, .08), inset 0 1px 0 rgba(255, 255, 255, .92);
  transition: transform .16s ease, background .16s ease, color .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.chat-shell .private-chat-title .icon-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(10, 132, 255, .24);
  background: rgba(234, 242, 255, .96);
  color: #0a66d8;
  box-shadow: 0 14px 26px rgba(10, 132, 255, .16), inset 0 1px 0 rgba(255, 255, 255, .96);
}

.chat-shell .private-chat-title .icon-btn i.fa-solid.fa-xmark {
  margin-top: -3px;
  margin-left: -4px;
}

.chat-shell .private-message-stage {
  position: relative;
  z-index: 1;
}

.chat-shell .private-chat-compose {
  position: relative;
  z-index: 1;
  grid-template-columns: 42px 42px minmax(0, 1fr) 52px;
  gap: 10px;
  padding: 12px 14px 14px;
  border-top: 1px solid rgba(201, 215, 232, .66);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .74), rgba(250, 252, 255, .88));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.chat-shell .private-chat-messages {
  padding: 16px 14px 18px;
  background:
    radial-gradient(circle at 12% 8%, rgba(10, 132, 255, .07), transparent 16rem),
    radial-gradient(circle at 88% 12%, rgba(32, 201, 151, .06), transparent 15rem),
    linear-gradient(180deg, rgba(245, 250, 255, .82), rgba(238, 244, 250, .76));
}

.chat-shell .private-chat-compose input:not([type="file"]) {
  height: 48px;
  padding: 0 18px;
  border: 1px solid rgba(201, 215, 232, .88);
  border-radius: 18px;
  background: rgba(255, 255, 255, .88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .92);
  color: #223246;
  font-size: 16px;
}

.chat-shell .private-chat-compose input:not([type="file"]):focus {
  border-color: rgba(10, 132, 255, .28);
  box-shadow: 0 0 0 4px rgba(10, 132, 255, .08), inset 0 1px 0 rgba(255, 255, 255, .92);
}

.chat-shell .private-chat-compose .file-btn {
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(201, 215, 232, .84);
  background: rgba(255, 255, 255, .82);
  box-shadow: 0 10px 18px rgba(15, 23, 42, .06), inset 0 1px 0 rgba(255, 255, 255, .92);
  color: #55708a;
  transition: transform .16s ease, border-color .16s ease, background .16s ease, color .16s ease, box-shadow .16s ease;
}

.chat-shell .private-chat-compose .file-btn i {
  font-size: 17px;
  line-height: 1;
}

.chat-shell .private-chat-compose .file-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(10, 132, 255, .24);
  background: rgba(234, 242, 255, .92);
  color: #0a66d8;
  box-shadow: 0 14px 24px rgba(10, 132, 255, .12), inset 0 1px 0 rgba(255, 255, 255, .94);
}

.chat-shell .private-chat-compose .emoji-trigger.active {
  border-color: rgba(10, 132, 255, .24);
  background: linear-gradient(180deg, rgba(234, 242, 255, .98), rgba(223, 237, 255, .92));
  color: #0a66d8;
  box-shadow: 0 12px 22px rgba(10, 132, 255, .14), inset 0 1px 0 rgba(255, 255, 255, .96);
}

.chat-shell .private-chat-compose .primary {
  width: 52px;
  min-width: 52px;
  height: 52px;
  min-height: 52px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  align-self: center;
  border: 1px solid rgba(6, 102, 230, .18);
  border-radius: 20px;
  color: #fff;
  background: linear-gradient(180deg, #118cff, #0066e6);
  box-shadow:
    0 16px 32px rgba(10, 132, 255, .26),
    inset 0 1px 0 rgba(255, 255, 255, .26);
  overflow: hidden;
  justify-self: end;
}

.chat-shell .private-chat-compose .primary i {
  font-size: 19px;
  line-height: 1;
  transform: translate(1px, 0);
}

.chat-shell .private-chat-compose .primary:hover {
  transform: translateY(-1px);
  background: linear-gradient(180deg, #1992ff, #0a6fe8);
  box-shadow:
    0 20px 36px rgba(10, 132, 255, .3),
    inset 0 1px 0 rgba(255, 255, 255, .28);
}

.chat-shell .private-chat-compose .primary:disabled {
  border-color: rgba(201, 215, 232, .78);
  background: linear-gradient(180deg, rgba(229, 236, 244, .96), rgba(213, 222, 233, .94));
  color: #8b98aa;
  box-shadow: none;
  transform: none;
}

.chat-shell .private-chat-window .private-chat-resize-handle {
  right: 6px;
  bottom: 6px;
  width: 20px;
  height: 20px;
  border-radius: 0 0 16px 0;
  background: linear-gradient(135deg, transparent 0 42%, rgba(10, 132, 255, .18) 42% 58%, rgba(10, 132, 255, .34) 58% 74%, rgba(32, 201, 151, .52) 74% 100%);
}

.chat-shell .drop-zone.drop-active::after {
  border-color: rgba(10, 132, 255, .55);
  border-radius: 28px;
  background: rgba(234, 242, 255, .82);
  color: var(--sc-chat-blue-deep);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

@media (max-width: 920px), (max-width: 1180px) and (pointer: coarse), (max-width: 1180px) and (max-height: 720px) {
  .chat-shell {
    min-height: var(--app-vh, 100dvh);
    background:
      radial-gradient(circle at 14% 0%, rgba(10, 132, 255, .12), transparent 19rem),
      radial-gradient(circle at 88% 8%, rgba(32, 201, 151, .1), transparent 18rem),
      linear-gradient(180deg, #ffffff 0%, #f3f7fb 56%, #eef3f8 100%);
  }

  .chat-shell .enter-panel {
    border-radius: 28px;
    padding: 30px 24px;
  }

  .chat-shell .direct-chat-panel,
  .chat-shell .chat-panel.group-workspace {
    width: 100%;
    height: var(--app-vh, 100dvh);
    min-height: var(--app-vh, 100dvh);
    border-radius: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .chat-shell .mobile-chat-head {
    border-bottom-color: rgba(15, 23, 42, .08);
    background: rgba(255, 255, 255, .84);
    box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
    backdrop-filter: blur(18px) saturate(1.3);
    -webkit-backdrop-filter: blur(18px) saturate(1.3);
  }

  .chat-shell .message-stage {
    background: transparent;
  }

  .chat-shell .messages {
    background:
      radial-gradient(circle at 10% 8%, rgba(10, 132, 255, .08), transparent 18rem),
      linear-gradient(180deg, rgba(247, 250, 255, .72), rgba(239, 244, 250, .74));
  }

  .chat-shell .composer {
    padding-bottom: max(12px, calc(12px + var(--safe-bottom)));
    background: rgba(255, 255, 255, .86);
    box-shadow: 0 -12px 28px rgba(15, 23, 42, .08);
    backdrop-filter: blur(18px) saturate(1.3);
    -webkit-backdrop-filter: blur(18px) saturate(1.3);
  }

  body.chat-ios-keyboard-open .chat-shell .composer {
    padding-bottom: max(12px, var(--safe-bottom));
  }

  .chat-shell .mobile-compose-editor {
    border-radius: 22px;
    background: rgba(255, 255, 255, .96);
  }

  .chat-shell .mobile-voice-hold {
    border-radius: 22px;
    background: rgba(255, 255, 255, .96);
  }

  .chat-shell .msg,
  .chat-shell .group-chat-bubble {
    border-radius: 18px;
  }

  .chat-shell .mobile-chat-info-head,
  .chat-shell .mobile-chat-info-body {
    background: rgba(246, 249, 253, .96);
  }

  .chat-shell .mobile-chat-info-card {
    border-radius: 22px;
  }

  .chat-shell .mobile-chat-info-body {
    gap: 12px;
    padding: 12px var(--mobile-chat-shell-padding) calc(16px + var(--safe-bottom));
  }

  .chat-shell .mobile-chat-info-card {
    padding: 16px;
    box-shadow: 0 10px 26px rgba(15, 23, 42, .055), inset 0 1px 0 rgba(255, 255, 255, .74);
  }

  .chat-shell .mobile-chat-info-copy {
    margin-bottom: 12px;
    font-size: 13px;
    line-height: 1.65;
  }

  .chat-shell .mobile-chat-member-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .chat-shell .mobile-chat-member-actions .danger {
    grid-column: auto;
  }

  .chat-shell .mobile-chat-member-actions .ghost,
  .chat-shell .mobile-chat-member-actions .danger {
    min-height: 42px;
    border-radius: 16px;
    background: rgba(241, 246, 250, .92);
    color: #40516a;
  }

  .chat-shell .mobile-chat-member-actions .danger {
    color: #c85f62;
    background: rgba(255, 241, 243, .92);
  }

  .chat-shell .mobile-chat-member-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .chat-shell .mobile-chat-member-card {
    min-height: 126px;
    grid-template-columns: 52px minmax(0, 1fr);
    justify-items: start;
    align-items: center;
    align-content: center;
    gap: 6px 12px;
    padding: 14px;
    text-align: left;
    border-radius: 20px;
  }

  .chat-shell .mobile-chat-member-card img,
  .chat-shell .mobile-chat-member-icon {
    grid-row: 1 / span 3;
    width: 52px;
    height: 52px;
    border-radius: 16px;
  }

  .chat-shell .mobile-chat-member-card strong,
  .chat-shell .mobile-chat-member-card small {
    width: 100%;
    min-height: auto;
    text-align: left;
    -webkit-line-clamp: 1;
  }

  .chat-shell .mobile-chat-member-card strong {
    font-size: 15px;
  }

  .chat-shell .mobile-chat-member-card small {
    font-size: 12px;
  }

  .chat-shell .mobile-chat-member-card .member-ip-line {
    font-size: 11px;
  }

  .chat-shell .mobile-chat-member-card strong .member-remark-chip {
    display: inline-block;
    margin: 0 0 0 5px;
    vertical-align: middle;
  }

  .chat-shell .mobile-chat-member-card .member-select-check {
    top: 10px;
    left: 10px;
  }

  .chat-shell .mobile-chat-member-card .member-kick-btn,
  .chat-shell .mobile-chat-member-card .member-remark-btn {
    position: static;
    justify-self: end;
    min-height: 26px;
    padding: 4px 9px;
    font-size: 11px;
  }

  .chat-shell .mobile-chat-member-card .member-kick-btn {
    grid-column: 2;
    grid-row: 1;
  }

  .chat-shell .mobile-chat-member-card .member-remark-btn {
    grid-column: 2;
    grid-row: 2;
  }

  .chat-shell .mobile-chat-info-actions {
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  .chat-shell .mobile-chat-return-btn {
    min-height: 52px;
    border-radius: 18px;
    background: linear-gradient(180deg, #0a84ff, #0066e6);
    box-shadow: 0 16px 34px rgba(0, 102, 255, .22);
  }
}

/* Final order guard for the user center and admin theme. */
body:has(.user-shell),
body:has(.admin-shell) {
  background: var(--theme-bg);
  color: var(--theme-ink);
}

body:has(.user-shell) .topbar,
body:has(.admin-shell) .topbar {
  border-bottom-color: var(--theme-border);
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(12px) saturate(1.1);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

body:has(.user-shell) .brand-mark,
body:has(.admin-shell) .brand-mark,
body:has(.user-shell) .primary,
body:has(.admin-shell) .primary {
  background: linear-gradient(135deg, var(--theme-primary), var(--theme-primary-deep));
  color: #fff;
}

body:has(.user-shell) .admin-sidebar,
body:has(.admin-shell) .admin-sidebar,
body:has(.user-shell) .user-sidebar,
body:has(.admin-shell) .user-sidebar,
body:has(.user-shell) .admin-content-panel,
body:has(.admin-shell) .admin-content-panel,
body:has(.user-shell) .user-content-panel,
body:has(.admin-shell) .user-content-panel,
body:has(.user-shell) .panel,
body:has(.admin-shell) .panel,
body:has(.user-shell) .modal-panel,
body:has(.admin-shell) .modal-panel {
  border-color: var(--theme-border);
  background: var(--theme-panel);
  box-shadow: var(--theme-shadow);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

body:has(.user-shell) .admin-tabs a,
body:has(.admin-shell) .admin-tabs a,
body:has(.user-shell) .user-tabs a,
body:has(.admin-shell) .user-tabs a {
  border-color: transparent;
  background: #f8fafc;
  color: var(--theme-muted);
}

body:has(.user-shell) .admin-tabs a:hover,
body:has(.admin-shell) .admin-tabs a:hover,
body:has(.user-shell) .admin-tabs a.active,
body:has(.admin-shell) .admin-tabs a.active,
body:has(.user-shell) .user-tabs a:hover,
body:has(.admin-shell) .user-tabs a:hover,
body:has(.user-shell) .user-tabs a.active,
body:has(.admin-shell) .user-tabs a.active {
  border-color: rgba(59,130,246,.2);
  background: var(--theme-primary-soft);
  color: var(--theme-primary-deep);
  box-shadow: 0 2px 8px rgba(59,130,246,.06);
  transform: none;
}

body:has(.user-shell) input,
body:has(.admin-shell) input,
body:has(.user-shell) select,
body:has(.admin-shell) select,
body:has(.user-shell) textarea,
body:has(.admin-shell) textarea {
  min-height: 44px;
  border-color: #e2e8f0;
  background: #fff;
  color: var(--theme-ink);
  font-size: max(16px, 1em);
  -webkit-appearance: none;
  appearance: none;
}

body:has(.user-shell) .stats-kpi-card,
body:has(.admin-shell) .stats-kpi-card,
body:has(.user-shell) .stats-chart-box,
body:has(.admin-shell) .stats-chart-box,
body:has(.user-shell) .stats-ranking-list,
body:has(.admin-shell) .stats-ranking-list,
body:has(.user-shell) .link-card,
body:has(.admin-shell) .link-card,
body:has(.user-shell) .branch-row,
body:has(.admin-shell) .branch-row,
body:has(.user-shell) .user-card,
body:has(.admin-shell) .user-card,
body:has(.user-shell) .security-event-card,
body:has(.admin-shell) .security-event-card,
body:has(.user-shell) .admin-link-card,
body:has(.admin-shell) .admin-link-card,
body:has(.user-shell) .diagnostic-card,
body:has(.admin-shell) .diagnostic-card {
  border-color: var(--theme-border);
  background: #fff;
  box-shadow: var(--theme-card-shadow);
}

body:has(.user-shell) .admin-users-table th,
body:has(.admin-shell) .admin-users-table th {
  color: var(--theme-muted);
  background: #f8fafc;
}

body:has(.user-shell) .admin-users-table tbody tr:nth-child(odd),
body:has(.admin-shell) .admin-users-table tbody tr:nth-child(odd) {
  background: #fafbfc;
}

body:has(.user-shell) .admin-users-table tbody tr:hover,
body:has(.admin-shell) .admin-users-table tbody tr:hover {
  background: var(--theme-primary-soft);
}

body:has(.user-shell) .avatar-choice.active,
body:has(.admin-shell) .avatar-choice.active,
body:has(.user-shell) .user-card.active,
body:has(.admin-shell) .user-card.active,
body:has(.user-shell) .admin-link-card.active,
body:has(.admin-shell) .admin-link-card.active,
body:has(.user-shell) .admin-branch-row.active,
body:has(.admin-shell) .admin-branch-row.active {
  border-color: rgba(59,130,246,.45);
  box-shadow: 0 0 0 3px rgba(59,130,246,.1), 0 4px 16px rgba(59,130,246,.10);
}

body:has(.user-shell) input[type="checkbox"],
body:has(.admin-shell) input[type="checkbox"],
body:has(.user-shell) input[type="radio"],
body:has(.admin-shell) input[type="radio"] {
  display: inline-grid;
  place-content: center;
  flex: 0 0 auto;
  width: 24px;
  min-width: 24px;
  height: 24px;
  min-height: 24px;
  margin: 0;
  padding: 0;
  border: 1.5px solid #cbd5e1;
  border-radius: 7px;
  background-color: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
  cursor: pointer;
  vertical-align: middle;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color var(--transition), background-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

body:has(.user-shell) input[type="checkbox"]:hover,
body:has(.admin-shell) input[type="checkbox"]:hover,
body:has(.user-shell) input[type="radio"]:hover,
body:has(.admin-shell) input[type="radio"]:hover {
  border-color: var(--theme-primary);
  box-shadow: 0 2px 6px rgba(59,130,246,.10);
}

body:has(.user-shell) input[type="checkbox"]:checked,
body:has(.admin-shell) input[type="checkbox"]:checked {
  border-color: var(--theme-primary);
  background-color: var(--theme-primary);
  background-image: url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 9.2 7.4 12.5 14 5.7' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 16px 16px;
  box-shadow: 0 0 0 3px rgba(59,130,246,.12), 0 2px 8px rgba(59,130,246,.14);
}

body:has(.user-shell) input[type="radio"],
body:has(.admin-shell) input[type="radio"] {
  border-radius: 50%;
}

body:has(.user-shell) input[type="radio"]:checked,
body:has(.admin-shell) input[type="radio"]:checked {
  border-color: var(--theme-primary);
  background: radial-gradient(circle at center, #fff 0 28%, var(--theme-primary) 31% 100%);
  box-shadow: 0 0 0 3px rgba(59,130,246,.12), 0 2px 8px rgba(59,130,246,.14);
}

body:has(.user-shell) input[type="checkbox"]:focus-visible,
body:has(.admin-shell) input[type="checkbox"]:focus-visible,
body:has(.user-shell) input[type="radio"]:focus-visible,
body:has(.admin-shell) input[type="radio"]:focus-visible {
  outline: 2px solid rgba(59,130,246,.4);
  outline-offset: 3px;
}

body:has(.user-shell) input[type="checkbox"]:disabled,
body:has(.admin-shell) input[type="checkbox"]:disabled,
body:has(.user-shell) input[type="radio"]:disabled,
body:has(.admin-shell) input[type="radio"]:disabled {
  cursor: not-allowed;
  opacity: .55;
}

@media (max-width: 920px) {
  body:has(.user-shell) .admin-tabs,
  body:has(.admin-shell) .admin-tabs,
  body:has(.user-shell) .user-tabs,
  body:has(.admin-shell) .user-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  }

  body:has(.user-shell) .admin-content-panel,
  body:has(.admin-shell) .admin-content-panel,
  body:has(.user-shell) .user-content-panel,
  body:has(.admin-shell) .user-content-panel {
    max-height: none;
    overflow: visible;
    padding: clamp(14px, 4vw, 18px);
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 560px) {
  body:has(.user-shell) .admin-tabs,
  body:has(.admin-shell) .admin-tabs,
  body:has(.user-shell) .user-tabs,
  body:has(.admin-shell) .user-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body:has(.user-shell) .admin-tabs a,
  body:has(.admin-shell) .admin-tabs a,
  body:has(.user-shell) .user-tabs a,
  body:has(.admin-shell) .user-tabs a {
    min-height: 52px;
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 920px) {
  .admin-live-modal .admin-live-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .admin-live-modal .admin-live-sidebar {
    flex: 0 0 auto;
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid rgba(224, 231, 242, .95);
    background: rgba(255, 255, 255, .9);
    overflow: hidden;
  }

  .admin-live-modal .admin-live-sidebar-head {
    display: none;
  }

  .admin-live-modal .admin-live-branch-list {
    min-height: 52px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: calc(8px + var(--safe-top)) calc(58px + var(--safe-right)) 8px calc(10px + var(--safe-left));
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  .admin-live-modal .admin-live-branch-list::-webkit-scrollbar {
    display: none;
  }

  .admin-live-modal .admin-live-branch-list .branch-row {
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    padding: 0 12px;
    border-radius: 999px;
    white-space: nowrap;
    box-shadow: none;
  }

  .admin-live-modal .admin-live-branch-list .branch-row b {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    font-size: 14px;
    line-height: 1;
  }

  .admin-live-modal .admin-live-branch-list .branch-row > span,
  .admin-live-modal .admin-live-branch-list .branch-row > small {
    display: none;
  }

  .admin-live-modal .admin-live-members {
    display: none;
  }

  .admin-live-modal .admin-live-main-head {
    flex: 0 0 auto;
    padding: 8px calc(12px + var(--safe-right)) 8px calc(12px + var(--safe-left));
    border-bottom: 1px solid rgba(224, 231, 242, .95);
    background: rgba(255, 255, 255, .9);
  }

  .admin-live-modal .admin-live-main-head .section-title {
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin: 0;
    padding: 0;
  }

  .admin-live-modal .admin-live-main-head .section-title > div:not(.toolbar-actions) {
    display: none;
  }

  .admin-live-modal .admin-live-main-head .toolbar-actions {
    width: auto;
    max-width: calc(100% - 52px);
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    margin: 0;
  }

  .admin-live-modal .admin-live-main-head .status-dot {
    flex: 0 0 auto;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(224, 243, 247, .96);
    color: #176b87;
    box-shadow: inset 0 0 0 1px rgba(188, 222, 230, .72);
  }

  .admin-live-modal .admin-live-main-head .toolbar-actions .ghost {
    flex: 0 0 auto;
    width: auto;
    min-width: 108px;
    min-height: 38px;
    padding: 0 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .84);
    border: 1px solid rgba(214, 224, 236, .9);
    color: #263241;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .05);
  }

  .admin-live-modal .admin-live-chat-meta,
  .admin-live-modal .admin-live-monitor-summary {
    display: none;
  }

  .admin-live-modal .admin-live-message-stage {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    z-index: auto;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    overflow: hidden;
  }

  .admin-live-modal .admin-live-messages {
    position: static;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 14px calc(10px + var(--safe-right)) calc(16px + var(--safe-bottom)) calc(10px + var(--safe-left));
  }

  .admin-live-modal .admin-composer {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    width: 100%;
    z-index: 2;
    display: grid;
    grid-template-columns: 40px 40px minmax(0, 1fr) 48px;
    align-items: center;
    gap: 8px;
    padding: 8px calc(10px + var(--safe-right)) calc(10px + var(--safe-bottom)) calc(10px + var(--safe-left));
    border-top: 1px solid rgba(220, 227, 237, .9);
    background: rgba(255, 255, 255, .86);
    box-shadow: 0 -12px 28px rgba(15, 23, 42, .08);
    backdrop-filter: blur(18px) saturate(1.3);
    -webkit-backdrop-filter: blur(18px) saturate(1.3);
    transform: none;
  }

  body.chat-ios-keyboard-open .admin-live-modal .admin-composer {
    padding: 8px calc(10px + var(--safe-right)) max(10px, var(--safe-bottom)) calc(10px + var(--safe-left));
  }

  .admin-live-modal .admin-composer .composer-quote,
  .admin-live-modal .admin-composer .emoji-picker {
    grid-column: 1 / -1;
  }

  .admin-live-modal .admin-composer .file-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .74);
    color: #2c3745;
    box-shadow: inset 0 0 0 1px rgba(225, 231, 240, .95);
  }

  .admin-live-modal .admin-composer input:not([type="file"]) {
    height: 44px;
    min-height: 44px;
    border-radius: 22px;
    padding: 0 16px;
    font-size: 16px;
    background: rgba(255, 255, 255, .96);
  }

  .admin-live-modal .admin-composer .primary {
    width: 48px;
    min-width: 48px;
    height: 40px;
    min-height: 40px;
    border-radius: 14px;
  }

  .admin-live-modal .admin-composer .upload-hint-button {
    display: none;
  }
}

@media (max-width: 560px) {
  .auth-shell {
    padding: 20px 16px;
    align-content: center;
  }
  .auth-shell::after {
    width: 300px;
    height: 300px;
    top: -20%;
    right: -30%;
  }
  .auth-panel {
    padding: 28px 22px;
    border-radius: 16px;
    gap: 18px;
  }
  .auth-panel h1 {
    font-size: 26px;
  }
  .auth-panel input {
    padding: 13px 14px;
    font-size: 16px;
  }
  .auth-panel .primary {
    padding: 14px 18px;
  }
}

/* ===== 新消息通知 ===== */
.user-tab-notifications { position: relative; }
.user-tab-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  line-height: 1;
}
.notification-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  background: var(--panel);
  cursor: pointer;
  transition: background var(--transition);
  position: relative;
}
.notification-item:hover { background: #f8fbfd; }
.notification-item.unread { background: #f0f9fb; }
.notification-item.unread::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--primary);
  border-radius: 0 2px 2px 0;
}
.notif-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--soft);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--primary);
  font-size: 16px;
}
.notif-icon.notif-group { background: #e8f0e8; color: #3a7a3a; }
.notif-icon.notif-private { background: var(--soft); color: var(--primary); }
.notif-icon.notif-group-private { background: #fff3e0; color: #e65100; }
.notif-body { flex: 1; min-width: 0; }
.notif-title-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.notif-chat-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notif-type-badge {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 500;
  flex-shrink: 0;
}
.notif-type-badge.badge-group { background: #e8f0e8; color: #3a7a3a; }
.notif-type-badge.badge-private { background: var(--soft); color: var(--primary); }
.notif-type-badge.badge-group-private { background: #fff3e0; color: #e65100; }
.notif-sender { font-size: 13px; color: var(--muted); }
.notif-sender strong { color: var(--ink); font-weight: 500; }
.notif-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}
.notif-time { font-size: 12px; color: var(--muted); white-space: nowrap; }
.notif-badge {
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}
@media (max-width: 600px) {
  .notification-item { padding: 12px 14px; gap: 10px; }
  .notif-icon { width: 34px; height: 34px; font-size: 14px; }
  .notif-chat-title { font-size: 13px; }
  .notif-sender { font-size: 12px; }
  .notif-time { font-size: 11px; }
  .notif-badge { min-width: 18px; height: 18px; font-size: 10px; }
}

/* ==================== LiveKit 通话功能样式 ==================== */

/* 移动端+号图标旋转动画 */
.mobile-compose-more i { transition: transform .2s ease; }
.mobile-compose-more i.fa-rotate-45 { transform: rotate(45deg); }

/* 功能面板遮罩 */
.action-panel-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(15, 23, 42, .4);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  display: flex;
  align-items: flex-end;
}

/* 功能面板主体 */
.action-panel {
  width: 100%;
  background: var(--panel);
  border-radius: 20px 20px 0 0;
  padding: 8px 20px calc(20px + var(--safe-bottom));
  animation: action-panel-up .22s cubic-bezier(.32,1,.6,1);
}
@keyframes action-panel-up {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.action-panel-handle {
  width: 36px; height: 4px;
  border-radius: 2px;
  background: var(--line);
  margin: 6px auto 18px;
}

/* 功能按钮网格 */
.action-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px 8px;
  padding-bottom: 8px;
}
.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.action-btn input { display: none; }
.action-icon {
  width: 64px; height: 64px;
  border-radius: 16px;
  background: #f2f4f8;
  display: grid;
  place-items: center;
  font-size: 26px;
  color: #3a4560;
  transition: background .15s;
}
.action-btn:active .action-icon { background: #e2e6ef; }
.action-label {
  font-size: 12px;
  color: var(--muted);
  line-height: 1;
}

/* 通话界面全屏覆盖 */
.call-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  min-height: var(--app-vh);
  min-height: 100dvh;
  background:
    radial-gradient(circle at 50% 8%, rgba(218, 184, 52, .22), transparent 30%),
    linear-gradient(180deg, #24220f 0%, #161407 54%, #1d1a0d 100%);
  overflow: hidden;
  color: #fff;
}
.call-topbar {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  z-index: 46;
  min-height: calc(52px + var(--safe-top));
  padding: calc(6px + var(--safe-top)) max(14px, var(--safe-right)) 6px max(14px, var(--safe-left));
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  background: linear-gradient(180deg, rgba(26, 25, 9, .78), rgba(26, 25, 9, .52) 76%, rgba(26, 25, 9, .08));
}
.call-topbar > strong {
  font-size: clamp(20px, 1.5rem, 28px);
  line-height: 1;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}
.call-topbar-actions {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: clamp(14px, 5vw, 28px);
}
.call-topbar-btn {
  width: 34px;
  height: 34px;
  justify-self: start;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: #fff;
  box-shadow: none;
  font-size: 23px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.call-topbar-btn:active {
  transform: scale(.96);
}
.call-topbar-danger {
  color: #ffb4ba;
}
.call-topbar-danger i {
  font-size: 20px;
}
.group-call-cloud-slot {
  position: relative;
  z-index: 18;
  padding: 12px clamp(20px, 2.6vw, 32px) 14px;
  border-bottom: 1px solid rgba(226, 233, 243, .72);
  background:
    linear-gradient(180deg, rgba(255,255,255,.84), rgba(246,250,253,.72));
  overflow: hidden;
}
.group-call-cloud-slot::before {
  content: "";
  position: absolute;
  inset: -40px 10% auto auto;
  width: min(320px, 58vw);
  height: 110px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 22% 54%, rgba(60, 201, 150, .22), transparent 38%),
    radial-gradient(circle at 66% 48%, rgba(86, 166, 255, .22), transparent 42%);
  filter: blur(18px);
  opacity: .78;
  pointer-events: none;
}
.group-call-entry {
  position: relative;
  z-index: 1;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 14px 10px 16px;
  border: 1px solid rgba(16, 185, 129, .2);
  border-radius: 12px;
  background:
    linear-gradient(90deg, rgba(236,255,247,.94), rgba(246,251,255,.9) 58%, rgba(255,255,255,.95));
  box-shadow: 0 12px 30px rgba(15, 93, 78, .08), inset 0 1px 0 rgba(255,255,255,.78);
  backdrop-filter: blur(14px) saturate(1.16);
  -webkit-backdrop-filter: blur(14px) saturate(1.16);
  overflow: hidden;
}
.group-call-entry::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  height: auto;
  border-radius: 999px;
  background: #14b981;
  pointer-events: none;
}
.group-call-entry.video {
  border-color: rgba(37, 99, 235, .2);
  background:
    linear-gradient(90deg, rgba(236,248,255,.96), rgba(246,249,255,.92) 58%, rgba(255,255,255,.95));
  box-shadow: 0 12px 30px rgba(37, 99, 235, .08), inset 0 1px 0 rgba(255,255,255,.82);
}
.group-call-entry.video::after {
  background: #3b82f6;
}
.group-call-entry-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1 1 auto;
}
.group-call-live-dot {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #18b981, #0f8e68);
  color: #fff;
  font-size: 16px;
  box-shadow: 0 10px 22px rgba(16, 185, 129, .2), 0 0 0 6px rgba(16, 185, 129, .08);
}
.group-call-entry.video .group-call-live-dot {
  background: linear-gradient(135deg, #3b82f6, #1769c7);
  box-shadow: 0 10px 22px rgba(59, 130, 246, .2), 0 0 0 6px rgba(59, 130, 246, .08);
}
.group-call-entry-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.group-call-entry-copy strong {
  color: #0f2e25;
  font-size: 15px;
  line-height: 20px;
  font-weight: 820;
}
.group-call-entry.video .group-call-entry-copy strong {
  color: #162f52;
}
.group-call-entry-copy small {
  max-width: 100%;
  color: #607080;
  font-size: 13px;
  line-height: 18px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.group-call-entry-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}
.group-call-entry-btn,
.group-call-entry-end {
  min-width: 92px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 820;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: none;
}
.group-call-entry-btn {
  background: #0f2e25;
  color: #fff;
}
.group-call-entry.video .group-call-entry-btn {
  background: #162f52;
}
.group-call-entry-end {
  border: 1px solid rgba(220, 38, 38, .18);
  background: rgba(255, 255, 255, .78);
  color: #c93434;
}
.group-call-entry-btn:hover,
.group-call-entry-btn:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(15, 46, 37, .18);
}
.group-call-entry-end:hover,
.group-call-entry-end:focus-visible {
  background: rgba(255, 241, 241, .86);
}
.group-call-entry-btn:active,
.group-call-entry-end:active {
  transform: translateY(1px);
}
@media (max-width: 600px) {
  .group-call-cloud-slot {
    position: fixed;
    top: max(calc(58px + var(--safe-top)), var(--mobile-chat-head-offset, calc(66px + var(--safe-top))));
    left: var(--safe-left);
    right: var(--safe-right);
    z-index: 29;
    padding: 8px calc(var(--mobile-chat-shell-padding) + var(--safe-right)) 9px calc(var(--mobile-chat-shell-padding) + var(--safe-left));
    border-bottom: 1px solid rgba(220, 228, 238, .72);
    background: linear-gradient(180deg, rgba(250,252,255,.88), rgba(241,247,252,.76));
    backdrop-filter: blur(14px) saturate(1.2);
    -webkit-backdrop-filter: blur(14px) saturate(1.2);
  }
  .chat-panel.has-active-group-call .message-stage {
    top: max(calc(128px + var(--safe-top)), calc(var(--mobile-chat-head-offset, calc(66px + var(--safe-top))) + 68px));
  }
  .group-call-entry {
    align-items: stretch;
    gap: 9px;
    min-height: 52px;
    padding: 7px 8px;
    border-radius: 25px 18px 25px 20px;
  }
  .group-call-entry::after {
    display: none;
  }
  .group-call-live-dot {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
    border-radius: 16px 18px 15px 19px;
  }
  .group-call-entry-copy strong {
    font-size: 13px;
    line-height: 17px;
  }
  .group-call-entry-copy small {
    max-width: 46vw;
    font-size: 11px;
  }
  .group-call-entry-actions {
    gap: 6px;
  }
  .group-call-entry-btn,
  .group-call-entry-end {
    min-width: 0;
    width: 38px;
    height: 34px;
    padding: 0;
  }
  .group-call-entry-btn span,
  .group-call-entry-end span {
    display: none;
  }
}
.call-float {
  position: fixed;
  z-index: 39;
  width: 112px;
  height: 112px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid rgba(255,255,255,.78);
  border-radius: 30px;
  background: rgba(255,255,255,.9);
  -webkit-backdrop-filter: blur(22px) saturate(1.35);
  backdrop-filter: blur(22px) saturate(1.35);
  color: #16b85f;
  box-shadow: 0 18px 44px rgba(15, 23, 42, .18), inset 0 1px 0 rgba(255,255,255,.72);
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.call-float.dragging {
  cursor: grabbing;
  transform: scale(1.02);
}
.call-float-phone {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #34c759;
  color: #fff;
  font-size: 23px;
  line-height: 1;
  box-shadow: 0 10px 22px rgba(52, 199, 89, .32);
}
.call-float strong {
  font-size: 18px;
  line-height: 1;
  font-weight: 850;
  letter-spacing: 0;
  color: #102018;
  font-variant-numeric: tabular-nums;
}
.call-float.video {
  width: 122px;
  height: 142px;
  overflow: hidden;
  display: block;
  border-radius: 22px;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(255,255,255,.9);
  color: #14b85b;
  box-shadow: 0 16px 34px rgba(15,23,42,.18), inset 0 1px 0 rgba(255,255,255,.82);
}
.call-float-video {
  width: 100%;
  height: calc(100% - 34px);
  display: block;
  object-fit: cover;
  background: #111;
}
.call-float-video.inset {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 34px;
  height: 46px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.34);
  box-shadow: 0 8px 18px rgba(0,0,0,.28);
}
.call-float-video.inset.off {
  opacity: .2;
}
.call-float-time {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 66px;
  min-height: 34px;
  padding: 8px 10px;
  border-radius: 0 0 22px 22px;
  color: #1a2a20;
  font-size: 12px;
  font-weight: 800;
  line-height: 18px;
  text-align: right;
}
.call-float-status {
  position: absolute;
  left: 9px;
  bottom: 8px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 18px;
  color: #14b85b;
  font-size: 13px;
  line-height: 1;
}
.call-float-status i {
  color: #14b85b;
}
.call-float-status i.off {
  color: #8a929e;
}
.call-float-status.voice {
  position: static;
  min-height: 0;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.72);
  box-shadow: inset 0 0 0 1px rgba(52,199,89,.14);
}
.call-float-off {
  position: absolute;
  inset: 0 0 34px 0;
  display: grid;
  place-items: center;
  background: rgba(10,15,28,.78);
  color: rgba(255,255,255,.88);
  font-size: 30px;
}
.call-float-local-off {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 34px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(10,15,28,.74);
  color: rgba(255,255,255,.9);
  font-size: 13px;
  pointer-events: none;
}
.call-stage {
  position: absolute;
  inset: calc(52px + var(--safe-top)) 0 calc(78px + var(--safe-bottom)) 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: rgba(0,0,0,.18);
}
.call-stage.voice {
  background:
    radial-gradient(circle at 50% 28%, rgba(255,255,255,.08), transparent 18rem),
    linear-gradient(180deg, #202124 0%, #101113 100%);
}
.call-stage.video.grid {
  align-items: start;
}
.call-focus,
.call-grid {
  width: 100%;
  height: 100%;
}
.call-focus {
  display: grid;
  place-items: stretch;
}
.call-video-tile {
  position: relative;
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background: #191919;
  color: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.call-focus-tile {
  width: 100%;
  height: 100%;
}
.call-tile-video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  background: #161616;
}
.call-focus-tile .call-tile-video {
  object-fit: cover;
}
.call-video-tile.off .call-tile-video {
  opacity: .12;
}
.call-video-tile.empty {
  cursor: default;
}
.call-video-tile.empty:disabled {
  opacity: 1;
}
.call-tile-avatar {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #202020;
  color: rgba(255,255,255,.5);
  font-size: clamp(34px, 12vw, 76px);
}
.call-tile-avatar img {
  width: clamp(86px, 22vw, 148px);
  height: clamp(86px, 22vw, 148px);
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 16px 38px rgba(0,0,0,.34);
}
.call-video-tile.empty .call-tile-avatar {
  background:
    radial-gradient(circle at 50% 46%, rgba(255,255,255,.045), transparent 42%),
    #1f1f1f;
  color: rgba(255,255,255,.34);
  font-size: clamp(30px, 10vw, 58px);
}
.call-focus-name,
.call-member-label {
  position: absolute;
  left: 10px;
  bottom: 10px;
  max-width: calc(100% - 76px);
  color: rgba(255,255,255,.95);
  font-size: 14px;
  line-height: 1.2;
  font-weight: 760;
  text-shadow: 0 2px 10px rgba(0,0,0,.65);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.call-member-label {
  left: 8px;
  bottom: 7px;
  max-width: calc(100% - 48px);
  font-size: 12px;
}
.call-focus-name {
  top: calc(14px + var(--safe-top));
  bottom: auto;
  max-width: calc(100% - 96px);
  z-index: 5;
}
.call-mic-badge {
  position: absolute;
  right: 9px;
  bottom: 9px;
  z-index: 2;
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 3px solid #fff;
  background: #fff;
  color: #ef3f47;
  font-size: 15px;
  box-shadow: 0 8px 18px rgba(0,0,0,.3);
}
.call-speaking-badge {
  position: absolute;
  right: 10px;
  top: 10px;
  left: auto;
  bottom: auto;
  z-index: 3;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.92);
  background: #fff;
  color: #24c657;
  font-size: 16px;
  box-shadow: 0 8px 20px rgba(0,0,0,.26);
}
.call-focus-tile .call-speaking-badge {
  right: 14px;
  top: 14px;
  left: auto;
  bottom: auto;
}
.call-focus-tile .call-speaking-badge:has(~ .call-listen-toggle.focus) {
  right: 64px;
  top: 18px;
}
.call-listen-toggle {
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 5;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.54);
  background: rgba(14,15,18,.58);
  color: rgba(255,255,255,.92);
  font-size: 15px;
  box-shadow: 0 10px 24px rgba(0,0,0,.3);
  cursor: pointer;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: transform .16s ease, background .16s ease, color .16s ease, border-color .16s ease;
}
.call-listen-toggle:hover,
.call-listen-toggle:focus-visible {
  transform: translateY(-1px);
  background: rgba(255,255,255,.92);
  color: #1f2228;
  outline: none;
}
.call-listen-toggle.muted {
  border-color: rgba(239,63,71,.76);
  background: rgba(239,63,71,.95);
  color: #fff;
}
.call-focus-tile .call-listen-toggle.focus {
  right: 14px;
  top: 14px;
  width: 42px;
  height: 42px;
  font-size: 18px;
}
.call-grid .call-mic-badge,
.call-thumb .call-mic-badge,
.call-grid .call-speaking-badge,
.call-thumb .call-speaking-badge {
  right: 8px;
  bottom: 8px;
  width: 28px;
  height: 28px;
  border-width: 2px;
  font-size: 14px;
}
.call-grid .call-speaking-badge,
.call-thumb .call-speaking-badge {
  right: 8px;
  left: auto;
  top: 8px;
  bottom: auto;
  color: #25c85a;
}
.call-grid .call-listen-toggle {
  right: 8px;
  top: 44px;
  width: 30px;
  height: 30px;
  font-size: 13px;
}
.call-grid .call-mic-badge {
  right: auto;
  left: 8px;
  bottom: 28px;
}
.call-grid .call-member-label {
  max-width: calc(100% - 16px);
}
.call-grid .call-video-tile.empty .call-member-label {
  left: 50%;
  bottom: clamp(24px, 8vh, 58px);
  transform: translateX(-50%);
  max-width: calc(100% - 28px);
  color: rgba(255,255,255,.46);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}
.call-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  align-content: stretch;
  overflow-y: auto;
  scrollbar-width: none;
  background: #202020;
  padding-bottom: 14px;
}
.call-grid::-webkit-scrollbar { display: none; }
.call-grid-tile {
  min-height: 0;
  aspect-ratio: auto;
  border-right: 1px solid rgba(0,0,0,.28);
  border-bottom: 1px solid rgba(0,0,0,.28);
}
.call-grid.count-1 {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
}
.call-grid.count-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr);
}
.call-grid.count-3 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
}
.call-grid.count-3 .tile-1 {
  grid-row: auto;
}
.call-grid.count-4 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
}
.call-grid.count-5,
.call-grid.count-6 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
}
.call-grid.count-5 .tile-1 {
  grid-column: 1 / 3;
}
.call-grid.count-5 .tile-1 .call-tile-video {
  object-position: center 38%;
}
.call-grid.count-7,
.call-grid.count-8,
.call-grid.count-9,
.call-grid.count-10,
.call-grid.count-11,
.call-grid.count-12 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(156px, 1fr);
  align-content: start;
}
.call-voice-grid {
  background:
    radial-gradient(circle at 50% 26%, rgba(255,255,255,.055), transparent 20rem),
    #202020;
}
.call-voice-tile {
  cursor: default;
  background:
    radial-gradient(circle at 50% 42%, rgba(255,255,255,.055), transparent 42%),
    linear-gradient(180deg, #252629 0%, #151619 100%);
}
.call-voice-tile.speaking {
  box-shadow: inset 0 0 0 3px rgba(52, 199, 89, .88), inset 0 0 48px rgba(52, 199, 89, .12);
}
.call-voice-tile.empty {
  opacity: .7;
}
.call-voice-empty-state {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: 28px;
  color: rgba(255,255,255,.82);
  text-align: center;
  pointer-events: none;
}
.call-voice-empty-icon {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 28px;
  background: rgba(255,255,255,.1);
  color: rgba(255,255,255,.9);
  font-size: 28px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08), 0 20px 44px rgba(0,0,0,.22);
}
.call-voice-empty-state strong {
  font-size: 18px;
  line-height: 1.25;
  font-weight: 820;
}
.call-voice-empty-state span {
  max-width: 260px;
  color: rgba(255,255,255,.56);
  font-size: 13px;
  line-height: 1.45;
}
.call-voice-tile .call-tile-avatar {
  background: transparent;
}
.call-voice-tile .call-tile-avatar img {
  width: clamp(78px, 18vw, 132px);
  height: clamp(78px, 18vw, 132px);
}
.call-voice-tile .call-member-label {
  bottom: 14px;
  left: 14px;
  max-width: calc(100% - 28px);
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(0,0,0,.32);
  font-size: 13px;
}
.call-voice-tile .call-speaking-badge {
  top: 12px;
  right: 12px;
  left: auto;
  bottom: auto;
}
.call-voice-tile .call-listen-toggle {
  top: 50px;
  right: 12px;
}
.call-voice-tile .call-mic-badge {
  left: 12px;
  right: auto;
  bottom: 50px;
}
@media (orientation: landscape) and (max-height: 520px) {
  .call-grid.count-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .call-grid.count-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: minmax(0, 1fr);
  }
  .call-grid.count-3 .tile-1 {
    grid-row: auto;
  }
  .call-grid.count-5,
  .call-grid.count-6 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
  }
  .call-grid.count-5 .tile-1 {
    grid-column: auto;
  }
}
.call-waiting {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: rgba(255,255,255,.7);
  font-size: 20px;
  font-weight: 650;
  text-align: center;
  z-index: 1;
}
.call-waiting-avatar {
  width: clamp(86px, 18vw, 120px);
  height: clamp(86px, 18vw, 120px);
  border-radius: 50%;
  background: rgba(255,255,255,.13);
  display: grid;
  place-items: center;
  font-size: clamp(36px, 7vw, 52px);
  color: rgba(255,255,255,.5);
}
.call-device-tip {
  position: absolute;
  left: 50%;
  bottom: calc(84px + var(--safe-bottom));
  transform: translateX(-50%);
  z-index: 45;
  width: max-content;
  max-width: min(78vw, 360px);
  padding: 7px 11px;
  border-radius: 14px;
  background: rgba(17, 24, 39, .66);
  border: 1px solid rgba(255,255,255,.18);
  color: rgba(255,255,255,.9);
  font-size: 11px;
  line-height: 1.35;
  text-align: center;
  box-shadow: 0 10px 26px rgba(0,0,0,.22);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  pointer-events: none;
}

.call-audio-unlock-tip {
  position: absolute;
  left: 50%;
  bottom: calc(124px + var(--safe-bottom));
  transform: translateX(-50%);
  z-index: 46;
  width: max-content;
  max-width: min(78vw, 360px);
}
.call-audio-unlock-tip button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 5px 16px 5px 7px;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 999px;
  background: rgba(22, 27, 32, .82);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  box-shadow: 0 16px 36px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.16);
  -webkit-backdrop-filter: blur(18px) saturate(1.22);
  backdrop-filter: blur(18px) saturate(1.22);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .12s ease, background .16s ease, border-color .16s ease;
}
.call-audio-unlock-tip button:hover {
  background: rgba(28, 34, 40, .9);
  border-color: rgba(255,255,255,.34);
}
.call-audio-unlock-tip button:active {
  transform: scale(.95);
}
.call-audio-unlock-icon {
  position: relative;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  border-radius: 50%;
  background: #176b87;
  color: #fff;
  box-shadow: 0 0 0 4px rgba(23,107,135,.22);
}
.call-audio-unlock-icon::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: inherit;
  border: 1px solid rgba(255,255,255,.32);
  animation: call-audio-unlock-pulse 1.5s ease-out infinite;
}
.call-audio-unlock-icon i {
  position: relative;
  z-index: 1;
  font-size: 14px;
}
@keyframes call-audio-unlock-pulse {
  0% {
    opacity: .7;
    transform: scale(.82);
  }
  100% {
    opacity: 0;
    transform: scale(1.25);
  }
}
@media (prefers-reduced-motion: reduce) {
  .call-audio-unlock-icon::after {
    animation: none;
  }
}

.call-filmstrip {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(76px + var(--safe-bottom));
  z-index: 44;
  height: clamp(70px, 11vh, 96px);
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  background: #202020;
  box-shadow: 0 -1px 0 rgba(255,255,255,.03);
  isolation: isolate;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: transform;
}
.call-filmstrip::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: #202020;
  box-shadow: 0 -1px 0 rgba(255,255,255,.03);
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.call-filmstrip.repainting::before {
  transform: translate3d(0,0,0) scale(1.0001);
  -webkit-transform: translate3d(0,0,0) scale(1.0001);
}
.call-filmstrip::-webkit-scrollbar { display: none; }
.call-thumb {
  position: relative;
  z-index: 1;
  flex: 0 0 clamp(96px, 28vw, 164px);
  height: 100%;
  padding: 0;
  border: 0;
  border-right: 1px solid rgba(0,0,0,.42);
  border-radius: 0;
  overflow: hidden;
  cursor: pointer;
  background: #171717;
  color: #fff;
  -webkit-tap-highlight-color: transparent;
  box-shadow: inset 0 0 0 0 rgba(52,199,89,0);
  transition: box-shadow .18s ease, opacity .18s ease;
}
.call-thumb:active { opacity: .86; }
.call-thumb.active {
  box-shadow: inset 0 -4px 0 #34c759, inset 0 0 0 2px rgba(52,199,89,.72);
}
.call-thumb-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #111;
}
.call-thumb.off .call-thumb-video {
  opacity: .16;
}
.call-thumb-off {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255,255,255,.86);
  font-size: 28px;
  background: rgba(10,10,10,.7);
  z-index: 4;
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: transform, opacity;
}
.call-thumb-off img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 8px 18px rgba(0,0,0,.32);
}
.call-thumb small {
  position: absolute;
  left: 3px;
  bottom: 2px;
  max-width: calc(100% - 52px);
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(0,0,0,.46);
  color: rgba(255,255,255,.92);
  font-size: 11px;
  line-height: 14px;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.call-thumb-status-stack {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 6;
  display: grid;
  gap: 4px;
  justify-items: end;
}
.call-thumb-status-stack .call-speaking-badge,
.call-thumb-status-stack .call-mic-badge,
.call-thumb-status-stack .call-listen-toggle {
  position: static;
  width: 26px;
  height: 26px;
  min-width: 26px;
  min-height: 26px;
  border-width: 1px;
  font-size: 12px;
  box-shadow: 0 7px 16px rgba(0,0,0,.26);
  transform: none;
}
.call-thumb-status-stack .call-listen-toggle {
  pointer-events: auto;
}
.call-thumb-status-stack .call-speaking-badge,
.call-thumb-status-stack .call-mic-badge {
  pointer-events: none;
}
.call-thumb .call-listen-toggle {
  width: 26px;
  height: 26px;
  font-size: 12px;
}

/* 通话控制栏 */
.call-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: calc(78px + var(--safe-bottom));
  padding: 12px max(10px, var(--safe-left)) calc(10px + var(--safe-bottom)) max(10px, var(--safe-right));
  display: grid;
  align-items: center;
  justify-content: center;
  background: rgba(70, 70, 48, .76);
  border-radius: 14px 14px 0 0;
  box-shadow: 0 -8px 18px rgba(0,0,0,.13), inset 0 1px 0 rgba(255,255,255,.08);
  z-index: 45;
  -webkit-backdrop-filter: blur(22px) saturate(1.15);
  backdrop-filter: blur(22px) saturate(1.15);
}
.call-controls:not(.video) {
  min-height: calc(78px + var(--safe-bottom));
}
.call-controls.video {
  background: rgba(70, 70, 48, .76);
}
.call-controls.video .call-ctrl-btn span {
  text-shadow: none;
}
.call-controls.video .call-ctrl-btn i {
  box-shadow: none;
}
.call-control-row {
  width: min(100%, 560px);
  display: grid;
  align-items: start;
  justify-content: center;
  column-gap: clamp(9px, 3vw, 24px);
  grid-auto-rows: 46px;
}
.call-control-row-primary {
  width: auto;
  grid-template-columns: repeat(4, 46px);
}
.call-controls.video.switchable .call-control-row-primary {
  grid-template-columns: repeat(6, 46px);
}
.call-controls:not(.video) .call-control-row-primary {
  grid-template-columns: repeat(4, 46px);
}
.call-ctrl-btn {
  width: 46px;
  height: 48px;
  min-height: 48px;
  border-radius: 16px;
  border: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 0;
  padding: 0;
  font-size: 18px;
  cursor: pointer;
  background: transparent;
  color: #fff;
  transition: opacity .15s, transform .1s;
  -webkit-tap-highlight-color: transparent;
}
.call-ctrl-btn:active { transform: scale(.92); }
.call-ctrl-btn:disabled { opacity: .48; cursor: not-allowed; }
.call-ctrl-btn i {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: 0 0 46px;
  background: rgba(28,29,33,.86);
  color: #fff;
  box-shadow: none;
}
.call-ctrl-btn.call-speaker-refresh-btn.active i {
  background: #e74343;
  color: #fff;
}
.call-refresh-btn i {
  background: rgba(34, 36, 42, .92);
}
.call-ctrl-btn > span {
  display: none;
  width: 90px;
  min-height: 16px;
  color: rgba(255,255,255,.86);
  font-size: 13px;
  line-height: 16px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.call-ctrl-btn.active i,
.call-aux-btn i {
  background: rgba(28,29,33,.94);
  color: #fff;
}
.call-collapse-btn i {
  background: rgba(255,255,255,.1);
  color: #fff;
}
.call-end-btn i {
  background: #e74343;
  color: #fff;
  font-size: 20px;
  transform: rotate(135deg);
}
.call-end-btn:active i { background: #d92b3a; }
.call-accept-btn { background: #27ae60; }
.call-accept-btn:active { background: #1e9050; }

@media (max-width: 380px) {
  .call-topbar {
    gap: 8px;
    padding-left: max(10px, var(--safe-left));
    padding-right: max(10px, var(--safe-right));
  }
  .call-topbar-actions {
    gap: 10px;
  }
  .call-topbar-btn {
    width: 32px;
    height: 32px;
    border-radius: 12px;
    font-size: 20px;
  }
  .call-control-row {
    column-gap: 5px;
  }
  .call-control-row-primary,
  .call-controls:not(.video) .call-control-row-primary {
    grid-template-columns: repeat(4, 40px);
  }
  .call-controls.video.switchable .call-control-row-primary {
    grid-template-columns: repeat(6, 40px);
  }
  .call-ctrl-btn {
    width: 40px;
    height: 44px;
    min-height: 44px;
  }
  .call-ctrl-btn i {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }
}

@media (max-width: 480px) {
  .call-modal {
    min-height: 100dvh;
  }
  .call-topbar {
    grid-template-columns: minmax(36px, .7fr) auto minmax(72px, .7fr);
  }
  .call-topbar-actions {
    gap: 8px;
  }
  .call-stage {
    inset: calc(52px + var(--safe-top)) 0 calc(76px + var(--safe-bottom)) 0;
  }
  .call-controls {
    min-height: calc(76px + var(--safe-bottom));
    padding-left: max(8px, var(--safe-left));
    padding-right: max(8px, var(--safe-right));
  }
  .call-control-row {
    width: 100%;
    column-gap: clamp(4px, 2vw, 10px);
  }
  .call-controls.video.switchable .call-control-row-primary {
    grid-template-columns: repeat(6, minmax(36px, 42px));
  }
  .call-control-row-primary,
  .call-controls:not(.video) .call-control-row-primary {
    grid-template-columns: repeat(4, minmax(42px, 46px));
  }
  .call-ctrl-btn {
    width: 100%;
    min-width: 0;
  }
  .call-listen-toggle {
    width: 32px;
    height: 32px;
  }
  .call-grid.count-7,
  .call-grid.count-8,
  .call-grid.count-9,
  .call-grid.count-10,
  .call-grid.count-11,
  .call-grid.count-12 {
    grid-auto-rows: minmax(132px, 1fr);
  }
}

@media (max-height: 560px) {
  .call-stage {
    bottom: calc(68px + var(--safe-bottom));
  }
  .call-filmstrip {
    bottom: calc(68px + var(--safe-bottom));
    height: clamp(58px, 13vh, 78px);
  }
  .call-controls,
  .call-controls:not(.video) {
    min-height: calc(68px + var(--safe-bottom));
    padding-top: 8px;
    padding-bottom: calc(8px + var(--safe-bottom));
  }
  .call-device-tip {
    bottom: calc(74px + var(--safe-bottom));
  }
  .call-waiting {
    gap: 10px;
    font-size: 17px;
  }
  .call-waiting-avatar {
    width: 76px;
    height: 76px;
    font-size: 32px;
  }
  .call-thumb small {
    max-width: calc(100% - 44px);
    padding: 2px 6px;
    font-size: 10px;
    line-height: 13px;
  }
  .call-thumb-status-stack {
    top: 5px;
    right: 5px;
    gap: 3px;
  }
  .call-thumb-status-stack .call-speaking-badge,
  .call-thumb-status-stack .call-mic-badge,
  .call-thumb-status-stack .call-listen-toggle {
    width: 23px;
    height: 23px;
    min-width: 23px;
    min-height: 23px;
    font-size: 11px;
  }
}

@media (orientation: landscape) and (max-height: 480px) {
  .call-topbar {
    min-height: calc(44px + var(--safe-top));
    padding-top: calc(4px + var(--safe-top));
    padding-bottom: 4px;
  }
  .call-stage {
    inset: calc(44px + var(--safe-top)) 0 calc(62px + var(--safe-bottom)) 0;
  }
  .call-filmstrip {
    bottom: calc(62px + var(--safe-bottom));
    height: 58px;
  }
  .call-controls,
  .call-controls:not(.video) {
    min-height: calc(62px + var(--safe-bottom));
    padding-top: 6px;
    padding-bottom: calc(6px + var(--safe-bottom));
  }
  .call-control-row {
    grid-auto-rows: 42px;
  }
  .call-ctrl-btn {
    height: 42px;
    min-height: 42px;
  }
  .call-ctrl-btn i {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }
}

/* 来电弹框 */
.incoming-call-modal {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: grid;
  place-items: center;
  background: rgba(10,15,30,.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.incoming-call-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 36px 40px;
  border-radius: 24px;
  background: rgba(22,30,50,.96);
  color: #fff;
  min-width: 240px;
  animation: call-bounce .3s cubic-bezier(.34,1.56,.64,1);
}
@keyframes call-bounce {
  from { opacity: 0; transform: scale(.85); }
  to   { opacity: 1; transform: scale(1); }
}
.incoming-call-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  display: grid;
  place-items: center;
  font-size: 32px;
  color: rgba(255,255,255,.6);
  animation: ring-pulse 1.2s ease-in-out infinite;
}
@keyframes ring-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(39,174,96,.4); }
  50%       { box-shadow: 0 0 0 16px rgba(39,174,96,0); }
}
.incoming-call-name { font-size: 18px; font-weight: 600; margin: 0; }
.incoming-call-type { font-size: 13px; color: rgba(255,255,255,.5); margin: 0; }
.incoming-call-actions {
  display: flex;
  gap: 40px;
  margin-top: 8px;
}
.incoming-call-actions .call-ctrl-btn {
  width: 54px;
  height: 54px;
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: rgba(255,255,255,.14);
  border-radius: 50%;
  line-height: 1;
}
.incoming-call-actions .call-ctrl-btn i {
  width: auto;
  height: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #fff;
  box-shadow: none;
  font-size: 25px;
  line-height: 1;
  transform: none;
}
.incoming-call-actions .call-end-btn { background: #d92b3a; }
.incoming-call-actions .call-accept-btn { background: #27ae60; }

/* 桌面端通话按钮激活色 */
.desktop-composer-tools .file-btn:has(.fa-phone),
.desktop-composer-tools .file-btn:has(.fa-video) {
  color: var(--primary);
}
.desktop-composer-tools .file-btn:has(.fa-phone):hover,
.desktop-composer-tools .file-btn:has(.fa-video):hover {
  background: var(--soft);
}
