:root {
  --defi-green: #18c784;
  --defi-dark: #081f2d;
  --defi-soft: #e9fff5;
  --defi-cyan: #18b7ff;
  --defi-gold: #f6c343;
  --surface: #ffffff;
  --line: #d9e8ee;
  --text: #11202a;
  --muted: #647681;
  --page: #f3f8fa;
  --shadow-soft: 0 10px 30px rgba(8, 31, 45, .10);
  --shadow-strong: 0 22px 55px rgba(8, 31, 45, .18);
}

[data-bs-theme="dark"] {
  --surface: #14211e;
  --line: #25433c;
  --text: #f3fffb;
  --defi-soft: #0f302b;
}

body {
  min-height: 100vh;
  background: var(--page);
  color: var(--text);
  overflow-x: hidden;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  font-size: 15px;
  letter-spacing: 0;
}

[data-bs-theme="dark"] body {
  background: #0c1412;
}

a { color: var(--defi-green); text-decoration: none; }

button,
input,
textarea,
select {
  font: inherit;
}

.btn {
  border-radius: 8px;
  font-weight: 750;
}

.btn-success {
  background: #19a963;
  border-color: #19a963;
}

.form-control,
.form-select {
  border-color: #dfe8e4;
  color: #111;
}

.form-control:focus,
.form-select:focus {
  border-color: #25d366;
  box-shadow: 0 0 0 .18rem rgba(37, 211, 102, .18);
}

.app-nav {
  background: linear-gradient(90deg, #061821, #0c3b47 48%, #0b6a5a);
  min-height: 60px;
  position: sticky;
  top: 0;
  z-index: 900;
  box-shadow: 0 10px 24px rgba(7, 94, 84, .16);
}

.app-nav .container-fluid {
  min-height: 60px;
}

.app-nav .navbar-brand,
.app-nav .nav-link {
  color: #fff;
}

.app-nav .navbar-brand {
  font-size: 1.25rem;
  letter-spacing: .01em;
}

.defi-brand span {
  color: var(--defi-gold);
}

.defi-brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  white-space: nowrap;
}

.defi-brand img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 12px;
  background: transparent;
  padding: 0;
  flex: 0 0 auto;
}

.auth-logo {
  display: block;
  width: min(340px, 92%);
  height: auto;
  max-height: 150px;
  object-fit: contain;
  margin: 0 auto 1.1rem;
}

.hero-logo {
  display: block;
  width: min(460px, 96%);
  height: auto;
  max-height: 220px;
  object-fit: contain;
  margin-bottom: 1rem;
  filter: drop-shadow(0 18px 38px rgba(8, 31, 45, .16));
}

.top-actions {
  display: flex;
  align-items: center;
  gap: .55rem;
}

.desktop-menu {
  display: flex;
  align-items: center;
  gap: .35rem;
  margin-left: 1rem;
  margin-right: auto;
}

.desktop-menu a {
  position: relative;
  color: rgba(255, 255, 255, .86);
  padding: .45rem .75rem;
  border-radius: 999px;
  font-weight: 700;
}

.desktop-menu a.active,
.desktop-menu a:hover {
  background: rgba(255, 255, 255, .16);
  color: #fff;
}

.desktop-menu b {
  position: absolute;
  top: -.25rem;
  right: -.25rem;
  min-width: 20px;
  height: 20px;
  padding: 0 .3rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #25d366;
  color: #fff;
  font-size: .72rem;
}

.top-icon {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
}

.top-icon:hover {
  background: rgba(255, 255, 255, .26);
  color: #fff;
}

.bottom-tabs {
  position: fixed;
  left: 50%;
  bottom: .8rem;
  transform: translateX(-50%);
  width: min(720px, calc(100% - 1.5rem));
  min-height: 70px;
  display: none;
  grid-template-columns: repeat(5, 1fr);
  gap: .25rem;
  padding: .45rem;
  border: 1px solid rgba(220, 232, 227, .9);
  border-radius: 28px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 16px 36px rgba(7, 94, 84, .22);
  backdrop-filter: blur(18px);
  z-index: 1500;
}

.bottom-tabs a {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  gap: .1rem;
  min-width: 0;
  border-radius: 24px;
  color: #111;
  font-size: .82rem;
  font-weight: 700;
}

.bottom-tabs a.active {
  background: #e7e7e7;
}

.bottom-tabs .tab-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(8, 31, 45, .06);
  color: #111;
  line-height: 1;
}

.bottom-tabs .tab-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.bottom-tabs a.active .tab-icon {
  background: #111;
  color: #fff;
}

.bottom-tabs img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
}

.bottom-tabs b,
.contact-item b {
  position: absolute;
  top: .15rem;
  right: .55rem;
  min-width: 23px;
  height: 23px;
  padding: 0 .35rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #25d366;
  color: #fff;
  font-size: .78rem;
  font-style: normal;
}

.app-toast {
  position: fixed;
  right: 1rem;
  top: 1rem;
  z-index: 2000;
}

.install-app-sheet {
  position: fixed;
  inset: 0;
  z-index: 3600;
  display: grid;
  place-items: end center;
  padding: 1rem;
  background: rgba(8, 31, 45, .32);
  backdrop-filter: blur(8px);
}

.install-app-sheet[hidden] {
  display: none;
}

.install-app-card {
  position: relative;
  width: min(420px, 100%);
  padding: 1.35rem;
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--shadow-strong);
  text-align: center;
}

.install-app-card img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  margin-bottom: .6rem;
}

.install-app-card span {
  display: inline-flex;
  padding: .25rem .65rem;
  border-radius: 999px;
  background: #eafff4;
  color: #08754f;
  font-size: .82rem;
  font-weight: 900;
}

.install-app-card h2 {
  margin: .65rem 0 .35rem;
  font-size: 1.45rem;
  font-weight: 900;
}

.install-app-card p {
  color: var(--muted);
  font-weight: 700;
}

.install-close {
  position: absolute;
  top: .75rem;
  right: .75rem;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: #eef5f7;
  color: var(--text);
  font-size: 1.35rem;
  line-height: 1;
}

.defi-alerts {
  position: fixed;
  top: 72px;
  right: 1rem;
  width: min(360px, calc(100% - 2rem));
  display: grid;
  gap: .6rem;
  z-index: 2500;
}

.defi-alert {
  padding: .85rem 1rem;
  border-radius: 8px;
  background: #fff;
  border-left: 5px solid var(--defi-green);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .18);
  animation: slideAlert .18s ease-out;
}

.defi-alert.call {
  border-left-color: #25d366;
}

.defi-alert strong,
.defi-alert span {
  display: block;
}

.defi-alert span {
  color: #5f6f69;
  margin-top: .1rem;
}

@keyframes slideAlert {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
  background:
    radial-gradient(circle at top left, rgba(37, 211, 102, .16), transparent 34rem),
    linear-gradient(135deg, #f4fbf7, #dcefe7);
}

.auth-card,
.auth-panel,
.panel,
.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.auth-card {
  width: min(100%, 430px);
  padding: 2rem;
  border: 0;
}

.auth-card .form-label {
  width: 100%;
  font-weight: 600;
  color: #31423c;
}

.auth-card .form-control,
.form-panel .form-control,
.form-panel .form-select {
  min-height: 46px;
  border-radius: 8px;
}

.auth-card h1,
.panel h1 {
  font-size: 1.55rem;
  font-weight: 850;
  margin-bottom: 1rem;
}

.hero-panel {
  width: min(100%, 960px);
  min-height: 560px;
  display: flex;
  align-items: end;
  padding: 3rem;
  color: #fff;
  background:
    linear-gradient(120deg, rgba(7,94,84,.95), rgba(18,140,126,.72)),
    url("../images/avatar.svg") right 3rem center / 280px no-repeat,
    var(--defi-dark);
}

.hero-panel h1 {
  max-width: 650px;
  font-size: clamp(2rem, 6vw, 4.6rem);
  line-height: .98;
}

.hero-panel p { max-width: 560px; font-size: 1.1rem; }

.brand-pill {
  display: inline-flex;
  padding: .35rem .7rem;
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 999px;
  margin-bottom: 1rem;
}

.profile-strip {
  display: flex;
  gap: 1rem;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  overflow: hidden;
}

.profile-strip img {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  object-fit: cover;
}

.profile-strip h1 { margin: 0; font-size: 1.8rem; }
.profile-strip p { margin: .2rem 0 0; color: #6b7a75; }

.stat-card,
.panel {
  padding: 1.25rem;
  border: 0;
}

.stat-card span {
  display: block;
  color: #6b7a75;
}

.stat-card strong {
  font-size: 2.2rem;
  color: var(--defi-green);
}

.admin-create-user-panel {
  background:
    linear-gradient(135deg, rgba(20, 206, 117, .08), rgba(14, 169, 194, .08)),
    #fff;
  box-shadow: 0 18px 45px rgba(8, 31, 45, .08);
}

.admin-create-user-panel .form-label {
  width: 100%;
  font-weight: 850;
  color: var(--ink);
}

.admin-create-user-panel .form-control,
.admin-create-user-panel .form-select {
  min-height: 48px;
  margin-top: .35rem;
  border-radius: 14px;
  font-weight: 750;
}

.admin-user-vip-toggle {
  width: 100%;
  padding: .65rem .85rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.list-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: .75rem;
  align-items: center;
  padding: .8rem 0;
  border-top: 1px solid var(--line);
  min-width: 0;
}

.list-row > *,
.profile-strip div,
.contact-item span {
  min-width: 0;
}

.list-row strong,
.list-row span,
.list-row time,
.contact-item strong,
.contact-item small {
  overflow-wrap: anywhere;
}

.list-row.compact {
  grid-template-columns: 1fr auto;
}

.list-row span,
.list-row time,
.contact-item small,
.chat-header small {
  color: #6b7a75;
  font-size: .9rem;
}

.form-panel {
  max-width: 720px;
  margin: 0 auto;
}

.profile-page {
  min-height: calc(100dvh - 56px);
  padding: 1.25rem;
  background: var(--page);
}

.wa-profile {
  width: min(100%, 680px);
  margin: 0 auto;
}

.wa-profile-hero {
  padding: 1.5rem 1rem 1.2rem;
  text-align: center;
}

.wa-avatar {
  position: relative;
  width: 164px;
  height: 164px;
  margin: 0 auto 1rem;
  display: block;
  cursor: pointer;
}

.wa-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 5px solid #fff;
  box-shadow: 0 18px 40px rgba(7, 94, 84, .18);
}

.profile-photo-button {
  position: absolute;
  right: .45rem;
  bottom: .45rem;
  min-width: 62px;
  height: 42px;
  padding: 0 .65rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #25d366;
  color: #fff;
  font-size: .72rem;
  font-weight: 800;
  border: 3px solid #fff;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(7, 94, 84, .18);
}

.wa-avatar input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}

.profile-photo-note {
  min-height: 24px;
  margin: -.25rem 0 .55rem;
  color: var(--muted);
  font-size: .85rem;
  font-weight: 700;
}

.profile-photo-note.ready {
  color: var(--defi-green);
}

.wa-profile-hero h1 {
  margin: 0;
  font-size: 1.85rem;
  font-weight: 800;
  color: #111;
}

.wa-profile-hero p {
  margin: .25rem 0;
  color: var(--defi-green);
  font-weight: 800;
  letter-spacing: .08em;
}

.country-badge {
  width: fit-content;
  margin: .35rem auto .4rem;
  padding: .35rem .75rem;
  border-radius: 999px;
  background: #eafff4;
  color: #0b6a4b;
  font-weight: 850;
  box-shadow: 0 8px 18px rgba(8, 31, 45, .06);
}

.wa-profile-hero small {
  display: block;
  color: #66756f;
  overflow-wrap: anywhere;
}

.wa-profile-card {
  margin-bottom: .9rem;
  background: #fff;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.wa-info-row,
.wa-link-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1rem;
  align-items: center;
  min-height: 66px;
  padding: .85rem 1rem;
  border-bottom: 1px solid #eef2f0;
}

.wa-info-row:last-child,
.wa-link-row:last-child {
  border-bottom: 0;
}

.wa-info-row span,
.wa-link-row span {
  color: #67736e;
  font-weight: 700;
}

.wa-info-row input,
.wa-info-row textarea,
.wa-info-row select {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #111;
  font-weight: 700;
}

.wa-info-row textarea {
  min-height: 58px;
  resize: vertical;
}

.wa-info-row.readonly strong {
  color: #111;
  letter-spacing: .08em;
}

.wa-help {
  margin: 0;
  padding: 0 1rem .9rem calc(140px + 2rem);
  color: #87918d;
  font-size: .9rem;
}

.wa-link-row {
  color: #111;
}

.wa-link-row small {
  color: #77847f;
  font-weight: 600;
}

.wa-link-row.danger span {
  color: #dc3545;
}

.wa-save {
  width: 100%;
  min-height: 48px;
  border-radius: 8px;
  font-weight: 800;
}

.chat-shell {
  min-height: calc(100vh - 60px);
  height: calc(100dvh - 60px);
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  background: var(--surface);
}

.chat-sidebar {
  border-right: 1px solid var(--line);
  overflow-y: auto;
  background: #fff;
}

.chat-list-head {
  padding: 1rem .85rem .35rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-list-head h1 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 800;
  color: #0f1714;
}

.chat-head-actions {
  position: relative;
}

.chat-head-actions > a,
.chat-head-actions > button {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
}

.quick-add-menu {
  position: absolute;
  right: 0;
  top: calc(100% + .55rem);
  width: 250px;
  padding: .55rem;
  border-radius: 20px;
  background: rgba(255,255,255,.98);
  box-shadow: var(--shadow-strong);
  z-index: 30;
}

.quick-add-menu a,
.quick-add-menu button {
  width: 100%;
  min-height: 54px;
  border: 0;
  border-radius: 14px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: .65rem;
  padding: .55rem .7rem;
  background: transparent;
  color: var(--text);
  text-align: left;
  font-size: .98rem;
  font-weight: 850;
  line-height: 1.1;
  white-space: nowrap;
}

.chat-head-actions .quick-add-menu a,
.chat-head-actions .quick-add-menu button {
  width: 100%;
  height: auto;
  min-height: 52px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  place-items: initial;
  align-items: center;
  gap: .65rem;
  padding: .55rem .72rem;
  border-radius: 14px;
  background: transparent;
  color: var(--text);
  font-size: .96rem;
  font-weight: 850;
  line-height: 1.1;
  white-space: nowrap;
}

.quick-add-menu a::before,
.quick-add-menu button::before {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #eafff4;
  color: #08754f;
  font-size: .86rem;
  font-weight: 950;
}

.quick-add-menu a[href*="groups"]::before {
  content: "+";
}

.quick-add-menu button::before {
  content: "QR";
}

.quick-add-menu a[href*="profile"]::before {
  content: "ME";
}

.quick-add-menu a:hover,
.quick-add-menu button:hover {
  background: var(--defi-soft);
}

.qr-scan-panel {
  position: fixed;
  inset: 0;
  z-index: 2500;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(8, 31, 45, .35);
  backdrop-filter: blur(5px);
}

.qr-scan-panel[hidden],
.quick-add-menu[hidden] {
  display: none;
}

.qr-scan-panel > div {
  position: relative;
  width: min(420px, 100%);
  padding: 1.2rem;
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--shadow-strong);
}

.qr-scan-panel h2 {
  margin-right: 2rem;
  font-weight: 900;
}

.qr-scan-panel p,
.qr-scan-panel small {
  color: var(--muted);
  font-weight: 700;
}

.qr-camera-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  margin: .85rem 0;
  overflow: hidden;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(8, 31, 45, .86), rgba(7, 94, 84, .72)),
    #09212b;
}

.qr-camera-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.qr-html5-reader {
  position: absolute;
  inset: 0;
}

.qr-html5-reader:empty {
  display: none;
}

.qr-html5-reader video {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
}

.qr-html5-reader div {
  border: 0 !important;
}

.qr-camera-frame {
  position: absolute;
  inset: 16%;
  border: 3px solid rgba(255, 255, 255, .92);
  border-radius: 18px;
  box-shadow: 0 0 0 999px rgba(8, 31, 45, .28);
  pointer-events: none;
}

.chat-search {
  padding: .55rem .75rem;
}

.chat-search .form-control {
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  background: #f0f2f1;
  font-weight: 600;
  padding-left: 1.1rem;
}

.chat-filters {
  display: flex;
  gap: .55rem;
  overflow-x: auto;
  padding: 0 .75rem .55rem;
  scrollbar-width: none;
}

.chat-filters::-webkit-scrollbar {
  display: none;
}

.chat-filters button {
  border: 1px solid #d0d4d2;
  border-radius: 999px;
  background: #fff;
  padding: .42rem .95rem;
  color: #59645f;
  font-weight: 780;
  white-space: nowrap;
}

.chat-filters button.active {
  background: #d8f8df;
  border-color: #a9e6ba;
  color: #0c6f44;
}

.archive-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .85rem 1rem .85rem 4.6rem;
  color: #64706b;
  font-weight: 700;
  border-bottom: 1px solid var(--line);
}

.contact-item {
  position: relative;
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: .75rem;
  align-items: center;
  padding: .68rem .78rem;
  color: var(--text);
  border-bottom: 1px solid var(--line);
  min-height: 68px;
  overflow: hidden;
}

.contact-item:hover { background: var(--defi-soft); }

.contact-item strong {
  color: #111;
  font-size: 1rem;
  line-height: 1.2;
}

.avatar-wrap {
  position: relative;
  width: 50px;
  height: 50px;
  display: block;
}

.contact-item img,
.avatar-wrap img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
}

.presence-dot {
  width: 12px;
  height: 12px;
  display: inline-block;
  border-radius: 50%;
  background: #dc3545;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .06);
}

.presence-dot.online {
  background: #20c463;
}

.presence-dot.offline {
  background: #dc3545;
}

.avatar-wrap .presence-dot {
  position: absolute;
  right: 0;
  bottom: 1px;
}

.presence-dot.inline {
  width: 10px;
  height: 10px;
  margin-right: .45rem;
  vertical-align: middle;
}

.contact-item span {
  display: grid;
}

.contact-item > span:not(.avatar-wrap) {
  min-width: 0;
  overflow: hidden;
}

.contact-item > span:not(.avatar-wrap) > strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-item > span:not(.avatar-wrap) > small {
  display: -webkit-box;
  max-height: 2.7em;
  overflow: hidden;
  overflow-wrap: anywhere;
  line-height: 1.35;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.contact-item em {
  color: #6b7a75;
  font-size: .82rem;
  font-style: normal;
  white-space: nowrap;
}

.fav-heart {
  position: absolute;
  right: 3.05rem;
  top: 1rem;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .72);
  color: #e90046;
  font-size: 1.05rem;
  font-style: normal;
  filter: blur(.25px);
  box-shadow: 0 8px 22px rgba(233, 0, 70, .18);
}

.contact-item b {
  top: auto;
  right: .9rem;
  bottom: .65rem;
}

.group-avatar {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #d8f8df;
  color: var(--defi-dark);
  font-weight: 900;
  object-fit: cover;
}

.empty-filter {
  padding: 1.5rem;
  text-align: center;
  color: #77847f;
  font-weight: 700;
}

.group-picker {
  display: grid;
  gap: .45rem;
  margin-top: .75rem;
}

.group-picker > strong {
  margin-bottom: .25rem;
}

.group-picker label {
  display: grid;
  grid-template-columns: auto 44px 1fr;
  gap: .75rem;
  align-items: center;
  padding: .65rem;
  border: 0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(7, 94, 84, .08);
}

.table {
  --bs-table-bg: transparent;
}

.table thead th {
  color: #66756f;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom-color: #dfe8e4;
}

.table tbody td {
  padding-top: .9rem;
  padding-bottom: .9rem;
  vertical-align: middle;
}

.dropdown-menu {
  border: 0;
  border-radius: 8px;
  box-shadow: var(--shadow-strong);
}

.dropdown-item {
  font-weight: 650;
  padding: .65rem 1rem;
}

.app-nav + .container,
.app-nav + main.container {
  max-width: 1120px;
}

.panel h2 {
  font-size: 1.15rem;
  font-weight: 850;
}

.list-row strong {
  color: #111;
}

.group-picker img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}

.group-picker span {
  display: grid;
  font-weight: 800;
}

.group-picker small {
  color: #77847f;
  font-weight: 600;
}

.group-page {
  width: min(1120px, calc(100% - 1.5rem));
  margin: 1.25rem auto 6rem;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, .8fr);
  gap: 1rem;
}

.group-create-card,
.group-list-card {
  overflow: hidden;
  border: 1px solid rgba(24, 183, 255, .16);
  border-radius: 18px;
  background: rgba(255, 255, 255, .94);
  box-shadow: var(--shadow-soft);
}

.group-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: center;
  padding: 1.25rem;
  background:
    radial-gradient(circle at 92% 15%, rgba(246, 195, 67, .28), transparent 24%),
    linear-gradient(135deg, #071c27, #0b3d48 52%, #0e755f);
  color: #fff;
}

.group-hero span {
  color: #b8fff0;
  font-weight: 800;
  font-size: .85rem;
}

.group-hero h1 {
  margin: .15rem 0;
  font-size: 2rem;
  font-weight: 900;
}

.group-hero p {
  margin: 0;
  color: rgba(255, 255, 255, .78);
}

.group-coin {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--defi-gold), var(--defi-green));
  color: #071c27;
  font-weight: 950;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .22);
}

.group-form {
  display: grid;
  gap: 1rem;
  padding: 1rem;
}

.group-logo-picker {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: .85rem;
  padding: .85rem;
  border-radius: 16px;
  background: #f6fbfd;
}

.group-logo-click {
  display: grid;
  grid-template-columns: 74px auto;
  align-items: center;
  gap: .85rem;
  cursor: pointer;
}

.group-logo-click img {
  width: 74px;
  height: 74px;
  border-radius: 20px;
  object-fit: cover;
  background: #fff;
}

.group-logo-click span {
  align-self: end;
  width: fit-content;
  padding: .48rem .8rem;
  border-radius: 999px;
  background: #19c87b;
  color: #fff;
  font-weight: 850;
  cursor: pointer;
}

.group-logo-picker input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.group-logo-picker small {
  grid-column: 2;
  color: var(--muted);
  font-weight: 700;
}

.group-fields {
  display: grid;
  gap: .75rem;
}

.group-fields .form-control {
  min-height: 48px;
  border-radius: 14px;
  border-color: rgba(8, 31, 45, .1);
  background: #f8fcfd;
}

.group-fields textarea.form-control {
  min-height: 92px;
  resize: vertical;
}

.group-picker-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .65rem;
}

.group-picker-title strong {
  font-size: 1.05rem;
  color: var(--text);
}

.group-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: .65rem;
  max-height: 390px;
  overflow-y: auto;
  padding: .1rem .15rem .15rem;
}

.group-picker-grid label {
  position: relative;
  display: grid;
  grid-template-columns: auto 48px 1fr;
  align-items: center;
  gap: .7rem;
  padding: .72rem;
  border: 1px solid rgba(8, 31, 45, .08);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(8, 31, 45, .07);
  cursor: pointer;
}

.group-picker-grid input {
  position: absolute;
  opacity: 0;
}

.group-check {
  width: 22px;
  height: 22px;
  border-radius: 8px;
  border: 2px solid #bfd4dc;
  background: #fff;
}

.group-picker-grid input:checked + .group-check {
  border-color: var(--defi-green);
  background: linear-gradient(135deg, var(--defi-green), var(--defi-cyan));
  box-shadow: inset 0 0 0 4px #fff;
}

.group-picker-grid img {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  object-fit: cover;
}

.group-picker-grid span:last-child {
  display: grid;
  min-width: 0;
  font-weight: 850;
}

.group-picker-grid small {
  color: var(--muted);
  font-size: .82rem;
}

.group-submit {
  min-height: 50px;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--defi-green), #0aa3ba);
  border: 0;
}

.group-list-card {
  padding: 1rem;
  align-self: start;
}

.group-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .85rem;
}

.group-list-head h2 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 900;
}

.group-list-head span {
  padding: .3rem .6rem;
  border-radius: 999px;
  background: var(--defi-soft);
  color: var(--defi-dark);
  font-weight: 800;
  font-size: .82rem;
}

.group-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: .75rem;
  padding: .75rem;
  border-radius: 15px;
  background: #f8fcfd;
  margin-bottom: .55rem;
}

.shareable-group {
  grid-template-columns: auto 1fr auto;
}

.group-share-tools {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: .45rem;
}

.group-share-tools input,
.share-card input {
  min-width: 0;
  border-radius: 12px;
  font-size: .86rem;
}

.group-admin-tools {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.group-invite-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  border-radius: 18px;
  background: #f4fbfd;
}

.group-member-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .65rem;
  margin: .75rem 0;
}

.group-add-users-form {
  margin-top: .75rem;
}

.admin-user-picker label.already-member {
  opacity: .62;
}

.share-qr {
  width: 132px;
  height: 132px;
  object-fit: contain;
  border-radius: 14px;
  background: #fff;
  padding: .4rem;
  border: 1px solid var(--line);
}

.shareable-group .share-qr {
  grid-column: 1 / -1;
  justify-self: center;
}

.share-card {
  display: grid;
  gap: .75rem;
  justify-items: center;
}

.share-card h2 {
  margin: 0;
}

.share-card .form-control {
  width: 100%;
}

.share-link-box {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: .65rem;
  padding: .55rem .7rem;
  border: 1px solid rgba(24, 199, 132, .28);
  border-radius: 16px;
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    linear-gradient(135deg, rgba(24,199,132,.55), rgba(24,183,255,.45)) border-box;
  box-shadow: 0 10px 24px rgba(8, 31, 45, .08);
}

.share-link-box span {
  min-width: 48px;
  min-height: 36px;
  padding: 0 .65rem;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--defi-green), var(--defi-cyan));
  color: #fff;
  font-size: .82rem;
  font-weight: 900;
}

.share-link-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #102333;
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
}

.danger-zone {
  border: 1px solid rgba(217, 54, 54, .28);
  background: linear-gradient(180deg, #fff, #fff8f8);
}

.danger-zone h2 {
  color: #b42323;
}

.danger-zone p {
  color: #7b3333;
  font-weight: 650;
}

.db-update-panel {
  border: 1px solid rgba(24, 199, 132, .22);
  background:
    radial-gradient(circle at 92% 8%, rgba(24, 183, 255, .12), transparent 28%),
    linear-gradient(180deg, #fff, #f4fffa);
}

.cache-panel {
  border: 1px solid rgba(24, 183, 255, .22);
  background:
    radial-gradient(circle at 92% 8%, rgba(246, 195, 67, .16), transparent 28%),
    linear-gradient(180deg, #fff, #f5fbff);
}

.db-update-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .75rem;
}

.db-update-head span {
  color: var(--defi-green);
  font-size: .82rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.db-update-head h2 {
  margin: .1rem 0 0;
}

.db-update-head strong {
  min-width: 86px;
  min-height: 42px;
  padding: 0 .8rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #eafff4;
  color: #08754f;
  font-weight: 900;
}

.db-update-panel p {
  color: var(--muted);
  font-weight: 700;
}

.update-list {
  display: grid;
  gap: .5rem;
  padding: 0;
  margin: .8rem 0 1rem;
  list-style: none;
}

.update-list li {
  position: relative;
  padding: .65rem .8rem .65rem 2.25rem;
  border: 1px solid rgba(24, 199, 132, .16);
  border-radius: 14px;
  background: rgba(255, 255, 255, .82);
  color: var(--text);
  font-weight: 800;
}

.update-list li::before {
  content: "";
  position: absolute;
  left: .85rem;
  top: 50%;
  width: .72rem;
  height: .72rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--defi-green), var(--defi-cyan));
  transform: translateY(-50%);
}

.group-manage-logo {
  width: 76px;
  height: 76px;
  border-radius: 22px;
  object-fit: cover;
  background: #fff;
  padding: .2rem;
}

.setting-toggle {
  display: flex;
  align-items: center;
  gap: .6rem;
  min-height: 48px;
  padding: .75rem;
  border-radius: 14px;
  background: #f6fbfd;
  font-weight: 850;
}

.setting-toggle input {
  width: 20px;
  height: 20px;
}

.member-admin-row {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: .75rem;
  align-items: center;
  padding: .75rem;
  border-radius: 15px;
  background: #f8fcfd;
  margin-bottom: .65rem;
}

.member-admin-row img {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  object-fit: cover;
}

.member-admin-row div {
  min-width: 0;
}

.member-admin-row strong,
.member-admin-row small {
  display: block;
}

.member-admin-row small {
  color: var(--muted);
  font-weight: 750;
}

.member-admin-row form {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}

.group-avatar.small {
  width: 42px;
  height: 42px;
  border-radius: 14px;
}

.group-row strong {
  min-width: 0;
}

.group-row span {
  color: var(--muted);
  font-weight: 750;
  white-space: nowrap;
}

.chat-window {
  position: relative;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  background: #eef7fb;
}

.chat-header {
  position: relative;
  z-index: 8;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .65rem 1rem;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .96), rgba(238, 252, 255, .94)),
    linear-gradient(135deg, rgba(24, 199, 132, .12), rgba(24, 183, 255, .10));
  backdrop-filter: blur(14px);
}

.chat-header strong {
  font-size: 1.04rem;
}

.chat-header div:first-child { display: grid; }

.chat-profile-trigger {
  min-width: 0;
  display: grid;
  gap: .1rem;
  border: 0;
  background: transparent;
  text-align: left;
  padding: .2rem .35rem;
  border-radius: 12px;
  color: var(--text);
}

.chat-profile-trigger:hover {
  background: rgba(24, 199, 132, .08);
}

.group-manage-open {
  position: relative;
  z-index: 12;
  pointer-events: auto;
}

.profile-sheet {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: end center;
  padding: 1rem;
  background: rgba(8, 31, 45, .34);
  backdrop-filter: blur(5px);
}

.profile-sheet[hidden] {
  display: none;
}

.profile-sheet-card {
  position: relative;
  width: min(420px, 100%);
  padding: 1.25rem;
  border-radius: 24px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 24px 70px rgba(8, 31, 45, .24);
  text-align: center;
}

.profile-sheet-close {
  position: absolute;
  top: .8rem;
  right: .8rem;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: #eef5f7;
  color: var(--text);
  font-size: 1.35rem;
  line-height: 1;
}

.profile-sheet-photo {
  width: 104px;
  height: 104px;
  border-radius: 28px;
  object-fit: cover;
  box-shadow: 0 14px 35px rgba(8, 31, 45, .16);
}

.profile-sheet-card h2 {
  margin: .75rem 0 .2rem;
  font-size: 1.35rem;
  font-weight: 900;
}

.profile-sheet-card p {
  margin: 0 0 1rem;
  color: var(--muted);
  font-weight: 750;
}

.profile-info-row {
  display: grid;
  gap: .18rem;
  padding: .75rem;
  border-radius: 14px;
  background: #f5fbfd;
  text-align: left;
  margin-bottom: .55rem;
}

.profile-info-row span {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
}

.profile-info-row strong {
  color: var(--text);
  font-size: .95rem;
}

.profile-sheet-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .65rem;
  margin-top: .9rem;
}

.group-info-card {
  max-height: min(86dvh, 760px);
  overflow-y: auto;
  text-align: left;
}

.group-info-card > .profile-sheet-photo,
.group-info-card > h2,
.group-info-card > p {
  display: block;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.group-info-members {
  margin-top: .9rem;
}

.group-info-members h3 {
  font-size: 1rem;
  font-weight: 950;
  margin: 0 0 .65rem;
}

.group-info-member {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: .7rem;
  align-items: center;
  padding: .7rem;
  border-radius: 16px;
  background: #f5fbfd;
  margin-bottom: .55rem;
}

.group-info-member img {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  object-fit: cover;
}

.group-info-member strong,
.group-info-member small {
  display: block;
}

.group-info-member > div {
  min-width: 0;
}

.group-info-member strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-info-member small {
  color: var(--muted);
  font-weight: 750;
}

.group-info-member > span {
  border-radius: 999px;
  padding: .28rem .58rem;
  background: #eaf4f6;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 900;
}

.group-info-member > span.admin {
  background: #dfffe9;
  color: #067a5a;
}

.exit-group-form {
  margin-top: .75rem;
}

.exit-group-form .btn {
  border-radius: 14px;
  font-weight: 900;
}

.typing-line {
  min-height: 20px;
  padding: .12rem clamp(1rem, 3vw, 2.5rem);
  color: var(--defi-green);
  font-size: .9rem;
}

.messages {
  padding: 1.25rem clamp(1rem, 3vw, 2.6rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background:
    linear-gradient(rgba(238, 247, 251, .95), rgba(238, 247, 251, .95)),
    linear-gradient(120deg, rgba(24, 183, 255, .08), rgba(24, 199, 132, .08)),
    radial-gradient(circle at 18px 18px, rgba(8, 31, 45, .08) 2px, transparent 2px);
  background-size: auto, auto, 34px 34px;
  min-height: 0;
}

[data-bs-theme="dark"] .messages { background: #081821; }

.message {
  max-width: min(68%, 720px);
  padding: .78rem .95rem;
  border-radius: 16px;
  margin-bottom: .8rem;
  background: var(--surface);
  border: 0;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .06);
  overflow-wrap: anywhere;
}

.message.mine {
  margin-left: auto;
  background: linear-gradient(135deg, #dfffe9, #d9f6ff);
  color: #11202a;
}

.message small {
  display: block;
  text-align: right;
  color: #66756f;
  margin-top: .28rem;
}

.message-form {
  position: relative;
  z-index: 8;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: .5rem;
  padding: .8rem clamp(.85rem, 2vw, 1.5rem);
  border-top: 1px solid var(--line);
  background: var(--surface);
  flex-shrink: 0;
}

.attach-menu {
  position: relative;
}

.attach-toggle {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.attach-plus {
  width: 46px;
  height: 46px;
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 16px;
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    linear-gradient(135deg, var(--defi-gold), var(--defi-green), var(--defi-cyan)) border-box;
  color: #09212b;
  box-shadow: 0 10px 24px rgba(8, 31, 45, .12);
  font-size: 1.45rem;
  font-weight: 900;
  line-height: 1;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}

.attach-plus:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(8, 31, 45, .18);
  color: #09212b;
}

.attach-toggle:checked + .attach-plus {
  transform: rotate(45deg);
  background:
    linear-gradient(135deg, #eafff4, #eef9ff) padding-box,
    linear-gradient(135deg, var(--defi-green), var(--defi-cyan)) border-box;
}

.attach-options {
  position: absolute;
  left: 0;
  bottom: calc(100% + .7rem);
  width: 178px;
  padding: .45rem;
  border-radius: 18px;
  border: 1px solid rgba(24, 183, 255, .18);
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 18px 44px rgba(8, 31, 45, .18);
  backdrop-filter: blur(14px);
  z-index: 10;
  display: none;
}

.attach-toggle:checked ~ .attach-options {
  display: block;
}

.attach-options label,
.attach-options button {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(8, 31, 45, .08);
  background: #ffffff;
  text-align: left;
  padding: .68rem .75rem;
  border-radius: 13px;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: .55rem;
  cursor: pointer;
  margin: 0 0 .35rem;
  box-shadow: 0 8px 18px rgba(8, 31, 45, .08);
  transition: transform .14s ease, border-color .14s ease, background .14s ease;
}

.attach-options label:last-child,
.attach-options button:last-child {
  margin-bottom: 0;
}

.attach-options label::before,
.attach-options button::before {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--defi-green), var(--defi-cyan));
  color: #fff;
  font-size: .78rem;
}

.attach-options label[for="chatImageFile"]::before {
  content: "IMG";
}

.attach-options label[for="chatDocFile"]::before {
  content: "DOC";
  background: linear-gradient(135deg, #172f43, var(--defi-gold));
}

.attach-options button#recordVoiceBtn::before {
  content: "MIC";
  background: linear-gradient(135deg, #ef476f, var(--defi-gold));
}

.attach-options button#recordVoiceBtn.recording {
  color: #b42323;
  background: #fff1f3;
  border-color: rgba(239, 71, 111, .35);
}

.attach-options button#recordVoiceBtn.recording::before {
  content: "REC";
  animation: ringPulse 1.1s infinite;
}

.attachment-preview {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  min-height: 42px;
  padding: .55rem .75rem;
  border: 1px solid rgba(24, 199, 132, .35);
  border-radius: 12px;
  background: #f1fff8;
  color: var(--text);
  font-weight: 750;
}

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

.attachment-preview img {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  object-fit: cover;
}

.attachment-preview audio {
  width: min(260px, 58vw);
  height: 34px;
  vertical-align: middle;
}

.attachment-preview button {
  border: 0;
  background: transparent;
  color: #d93636;
  font-weight: 800;
}

.attach-options label:hover,
.attach-options button:hover {
  transform: translateY(-1px);
  border-color: rgba(24, 199, 132, .35);
  background: #f0fbff;
}

.attach-options label:active,
.attach-options button:active {
  transform: translateY(0);
}

.message-image {
  display: block;
  width: min(100%, 320px);
  max-height: 360px;
  object-fit: cover;
  border-radius: 12px;
  margin-top: .35rem;
}

.message-file {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin-top: .35rem;
  padding: .6rem;
  border-radius: 10px;
  background: rgba(8, 31, 45, .06);
  color: var(--text);
  font-weight: 750;
}

.message-file span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #0f3f54;
  color: #fff;
  font-size: .72rem;
}

.message-audio {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-top: .35rem;
  padding: .75rem .85rem;
  border-radius: 18px;
  background: rgba(24, 199, 132, .12);
}

.voice-play-btn {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #102333;
  color: #fff;
}

.voice-play-btn::before {
  content: "";
  width: 0;
  height: 0;
  margin-left: 3px;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-left: 14px solid currentColor;
}

.voice-play-btn.playing::before {
  width: 14px;
  height: 16px;
  margin: 0;
  border: 0;
  background:
    linear-gradient(currentColor, currentColor) left / 5px 100% no-repeat,
    linear-gradient(currentColor, currentColor) right / 5px 100% no-repeat;
}

.voice-wave {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 3px;
  opacity: .72;
}

.voice-wave i {
  width: 4px;
  border-radius: 999px;
  background: #66756f;
}

.message-audio audio {
  display: none;
}

.message-actions {
  display: flex;
  justify-content: flex-end;
  gap: .35rem;
  margin-top: .3rem;
}

.group-sender-name {
  display: block;
  color: #067a5a;
  font-size: .86rem;
  margin-bottom: .2rem;
}

.group-restriction-note {
  margin: .7rem auto;
  max-width: min(92%, 520px);
  border-radius: 16px;
  background: #fff6d8;
  color: #735000;
  font-weight: 800;
  padding: .85rem 1rem;
  text-align: center;
}

.call-history-panel .section-title-row,
.admin-ad-panel {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.call-history-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
}

.call-history-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: inline-grid;
  place-items: center;
  background: #d9fff0;
  color: #067a5a;
  font-size: .75rem;
  font-weight: 900;
}

.call-history-row.missed .call-history-icon,
.call-history-row.rejected .call-history-icon {
  background: #ffe6e9;
  color: #d63645;
}

.call-empty {
  min-height: 240px;
}

.admin-ad-panel {
  background: linear-gradient(135deg, #ffffff, #effff9);
}

.admin-ad-panel p {
  color: #66736d;
  margin: .25rem 0 0;
}

.admin-ad-form {
  display: grid;
  gap: .75rem;
  min-width: min(420px, 100%);
}

.trust-badge {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  margin-left: .22rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #16d97f);
  color: #fff;
  font-size: .72rem;
  font-style: normal;
  font-weight: 950;
  line-height: 1;
  box-shadow: 0 0 0 2px rgba(255,255,255,.9), 0 8px 18px rgba(16, 185, 129, .28);
  vertical-align: middle;
}

.ad-profile-preview {
  display: inline-flex;
  gap: .65rem;
  align-items: center;
  margin-top: .9rem;
  padding: .55rem .75rem;
  border-radius: 16px;
  background: rgba(255,255,255,.72);
}

.ad-profile-preview img {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  object-fit: cover;
}

.ad-photo-form {
  padding-top: .75rem;
  border-top: 1px solid var(--line);
}

.status-page {
  width: min(1180px, calc(100% - 2rem));
  margin: 1.25rem auto 7rem;
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
  gap: 1.25rem;
}

.status-composer,
.status-feed {
  border-radius: 24px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 18px 55px rgba(8, 31, 45, .10);
  overflow: hidden;
}

.status-hero {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 1.25rem;
  color: #fff;
  background: linear-gradient(135deg, #061821, #0b6a5a);
}

.status-hero img {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, .8);
}

.status-hero span {
  color: #a9fff0;
  font-weight: 900;
  font-size: .82rem;
}

.status-hero h1 {
  margin: .1rem 0;
  font-size: 1.65rem;
  font-weight: 950;
}

.status-hero p {
  margin: 0;
  color: rgba(255, 255, 255, .82);
}

.status-form {
  display: grid;
  gap: .9rem;
  padding: 1.1rem;
}

.status-form textarea {
  border-radius: 18px;
  min-height: 120px;
  resize: vertical;
}

.status-color-row {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
}

.status-color-row input {
  position: absolute;
  opacity: 0;
}

.status-color-row span {
  width: 34px;
  height: 34px;
  display: block;
  border-radius: 50%;
  background: var(--status-color);
  border: 3px solid #fff;
  box-shadow: 0 0 0 1px rgba(8, 31, 45, .16);
}

.status-color-row input:checked + span {
  box-shadow: 0 0 0 3px rgba(24, 199, 132, .34);
}

.status-image-picker {
  display: grid;
  gap: .1rem;
  padding: 1rem;
  border-radius: 18px;
  border: 1px dashed rgba(24, 199, 132, .55);
  background: #f2fffa;
  cursor: pointer;
}

.status-image-picker input {
  display: none;
}

.status-image-picker span {
  font-weight: 900;
  color: #067a5a;
}

.status-image-picker small {
  color: var(--muted);
  font-weight: 750;
}

.status-feed {
  padding: 1.25rem;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1rem;
}

.status-card {
  min-height: 260px;
  position: relative;
  display: grid;
  align-content: start;
  gap: .85rem;
  padding: 1rem;
  border-radius: 24px;
  color: #fff;
  overflow: hidden;
  background: radial-gradient(circle at top right, rgba(255,255,255,.22), transparent 38%), var(--status-bg);
  box-shadow: 0 16px 40px rgba(8, 31, 45, .14);
}

.status-card.viewed {
  filter: saturate(.82);
}

.status-card header {
  display: flex;
  gap: .65rem;
  align-items: center;
  position: relative;
  z-index: 1;
}

.status-card header img {
  width: 44px;
  height: 44px;
  border-radius: 15px;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,.75);
}

.status-card strong,
.status-card small {
  display: block;
}

.status-card small {
  color: rgba(255,255,255,.78);
  font-weight: 700;
  font-size: .78rem;
}

.status-card p {
  margin: 0;
  font-size: clamp(1.05rem, 3vw, 1.45rem);
  line-height: 1.25;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.status-media {
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: 20px;
  object-fit: cover;
  background: rgba(255,255,255,.14);
}

.status-delete {
  position: absolute;
  right: .85rem;
  bottom: .85rem;
  border: 0;
  border-radius: 999px;
  padding: .35rem .75rem;
  background: rgba(255,255,255,.9);
  color: #d63645;
  font-weight: 900;
  z-index: 3;
}

.status-open {
  position: absolute;
  inset: 0;
  border: 0;
  background: transparent;
  z-index: 1;
}

.status-views {
  position: relative;
  z-index: 3;
  align-self: end;
  margin-top: auto;
  padding: .55rem .7rem;
  border-radius: 14px;
  background: rgba(255,255,255,.18);
  backdrop-filter: blur(8px);
}

.status-views summary {
  cursor: pointer;
  font-weight: 900;
}

.status-views small {
  display: block;
  margin-top: .35rem;
}

.status-viewer {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, .92);
}

.status-viewer[hidden] {
  display: none;
}

.status-viewer-card {
  position: relative;
  width: min(100vw, 520px);
  height: min(100dvh, 920px);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: hidden;
  background: #061821;
}

.status-progress {
  display: flex;
  gap: .25rem;
  padding: .65rem .65rem .2rem;
}

.status-progress i {
  height: 4px;
  flex: 1;
  border-radius: 999px;
  background: rgba(255,255,255,.28);
  overflow: hidden;
}

.status-progress i.done,
.status-progress i.active {
  background: rgba(255,255,255,.92);
}

.status-viewer-card header {
  position: relative;
  z-index: 2;
  display: flex;
  gap: .7rem;
  align-items: center;
  padding: .65rem .8rem;
  color: #fff;
}

.status-viewer-card header img {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  object-fit: cover;
}

.status-viewer-card header strong,
.status-viewer-card header small {
  display: block;
}

.status-viewer-card header small {
  color: rgba(255,255,255,.72);
}

#closeStatusViewer {
  margin-left: auto;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.14);
  color: #fff;
  font-size: 1.45rem;
  line-height: 1;
}

.status-viewer-body {
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  color: #fff;
  text-align: center;
}

.status-viewer-image {
  max-width: 100%;
  max-height: 72vh;
  border-radius: 22px;
  object-fit: contain;
}

.status-viewer-body p {
  margin: .8rem 0 0;
  font-size: clamp(1.2rem, 6vw, 2rem);
  font-weight: 900;
  overflow-wrap: anywhere;
}

.status-viewer-text {
  max-width: 90%;
  margin: 0 !important;
}

.status-step {
  position: absolute;
  top: 84px;
  bottom: 0;
  width: 42%;
  border: 0;
  background: transparent;
  z-index: 1;
}

.status-step.prev {
  left: 0;
}

.status-step.next {
  right: 0;
}

.status-interactions {
  position: relative;
  z-index: 4;
  display: grid;
  gap: .55rem;
  padding: .7rem;
  background: rgba(0, 0, 0, .38);
  backdrop-filter: blur(14px);
}

.status-interactions[hidden] {
  display: none;
}

.status-reactions {
  display: flex;
  gap: .4rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.status-reactions::-webkit-scrollbar {
  display: none;
}

.status-reactions button {
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 999px;
  padding: .35rem .72rem;
  background: rgba(255, 255, 255, .13);
  color: #fff;
  font-weight: 850;
  white-space: nowrap;
}

.status-reactions button.active {
  background: #25d366;
  border-color: #25d366;
  color: #051b14;
}

#statusReplyForm {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .5rem;
}

#statusReplyForm .form-control {
  min-height: 44px;
  border-radius: 999px;
  border: 0;
}

#statusReplyForm .btn {
  border-radius: 999px;
}

#statusInteractNote {
  min-height: 18px;
  color: rgba(255, 255, 255, .78);
  font-weight: 750;
}

.status-card-meta {
  position: relative;
  z-index: 3;
  display: flex;
  gap: .5rem;
  align-items: center;
  margin-top: auto;
}

.status-card-meta span,
.status-card-meta strong {
  padding: .28rem .58rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .18);
  color: #fff;
  font-size: .82rem;
  font-weight: 900;
}

.status-reply-line {
  padding-top: .35rem;
  color: #fff !important;
}

.chat-hold-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2500;
  border: 0;
  background: rgba(8, 31, 45, .28);
  backdrop-filter: blur(5px);
}

.chat-hold-menu {
  position: fixed;
  left: 50%;
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 2501;
  width: min(430px, calc(100% - 1.4rem));
  padding: .7rem;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 26px;
  background: rgba(255,255,255,.88);
  box-shadow: 0 28px 80px rgba(8, 31, 45, .24);
  transform: translateX(-50%);
  backdrop-filter: blur(18px);
}

.chat-hold-preview {
  padding: .75rem .9rem .9rem;
  color: var(--text);
  font-size: 1.03rem;
  font-weight: 950;
}

.chat-hold-menu button[data-action] {
  width: 100%;
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: .6rem;
  align-items: center;
  min-height: 54px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: #111827;
  text-align: left;
  font-weight: 850;
  font-size: 1rem;
}

.chat-hold-menu button[data-action]:hover {
  background: rgba(24, 199, 132, .12);
}

.chat-hold-menu button[data-action] span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(8, 31, 45, .07);
  font-weight: 950;
}

.chat-hold-menu button.danger {
  color: #ef233c;
}

.message-icon-btn {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(8, 31, 45, .08);
  color: #102333;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
}

.message-icon-btn:hover {
  background: rgba(24, 199, 132, .18);
}

.message-icon-btn.delete-message {
  color: #d93636;
}

.message-icon-btn.delete-message:hover {
  background: rgba(217, 54, 54, .12);
}

.forward-panel {
  position: absolute;
  right: 1rem;
  bottom: 5.5rem;
  width: min(360px, calc(100% - 2rem));
  z-index: 30;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-strong);
  padding: .85rem;
}

.forward-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .7rem;
}

.forward-head button {
  border: 0;
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
}

.forward-select-all,
.forward-list label {
  display: flex;
  align-items: center;
  gap: .55rem;
}

.forward-list {
  display: grid;
  gap: .35rem;
  max-height: 250px;
  overflow-y: auto;
  margin: .65rem 0;
}

.forward-list label {
  padding: .5rem;
  border-radius: 10px;
  background: #f6fafb;
}

.forward-list small {
  margin-left: auto;
  color: var(--muted);
}

.message-form .form-control {
  border-radius: 999px;
}

.message-form .btn {
  border-radius: 999px;
  min-height: 42px;
}

.chat-pin-card h2 {
  margin: 0 0 .35rem;
  font-size: 1.25rem;
  font-weight: 900;
}

.chat-pin-card p {
  color: var(--muted);
  font-weight: 700;
}

.pin-input-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .85rem;
}

.pin-code-input {
  text-align: center;
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: .35em;
}

.locked-chat-panel {
  min-height: 0;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 1rem;
  background:
    radial-gradient(circle at top, rgba(24, 199, 132, .12), transparent 22rem),
    #eef8fb;
}

.locked-chat-panel > div {
  width: min(360px, 100%);
  padding: 1.25rem;
  border-radius: 22px;
  background: rgba(255, 255, 255, .94);
  box-shadow: var(--shadow-strong);
  text-align: center;
}

.lock-mark {
  width: 74px;
  height: 74px;
  margin: 0 auto .8rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #18c784, #12a9c4);
  box-shadow: 0 14px 35px rgba(24, 199, 132, .24);
}

.lock-mark::before {
  content: "";
  width: 34px;
  height: 34px;
  background: #fff;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M17 9V7A5 5 0 0 0 7 7v2H5v12h14V9h-2Zm-8 0V7a3 3 0 1 1 6 0v2H9Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M17 9V7A5 5 0 0 0 7 7v2H5v12h14V9h-2Zm-8 0V7a3 3 0 1 1 6 0v2H9Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.locked-chat-panel h2 {
  margin: 0 0 .35rem;
  font-size: 1.45rem;
  font-weight: 950;
}

.locked-chat-panel p,
.locked-chat-panel a {
  color: var(--muted);
  font-weight: 750;
}

.mic-btn {
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: transparent;
  color: #102333;
}

.mic-btn::before {
  content: "";
  width: 24px;
  height: 30px;
  display: block;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 14a3 3 0 0 0 3-3V5a3 3 0 1 0-6 0v6a3 3 0 0 0 3 3Zm5-3a5 5 0 0 1-10 0H5a7 7 0 0 0 6 6.92V21h2v-3.08A7 7 0 0 0 19 11h-2Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 14a3 3 0 0 0 3-3V5a3 3 0 1 0-6 0v6a3 3 0 0 0 3 3Zm5-3a5 5 0 0 1-10 0H5a7 7 0 0 0 6 6.92V21h2v-3.08A7 7 0 0 0 19 11h-2Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.mic-btn.recording {
  color: #e90046;
  background: #fff1f4;
  animation: ringPulse 1.1s infinite;
}

.voice-recording-bar {
  grid-column: 2 / 4;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 0 .9rem;
  border-radius: 999px;
  background: #fff8f0;
  color: #6f6b65;
  font-size: 1rem;
}

.voice-recording-bar[hidden] {
  display: none;
}

.voice-record-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #e90046;
  box-shadow: 0 0 0 6px rgba(233, 0, 70, .12);
}

.voice-recording-bar strong {
  color: #102333;
  font-size: 1.25rem;
}

.empty-chat {
  display: grid;
  place-content: center;
  text-align: center;
  color: #6b7a75;
  background: #f7fbf9;
}

.call-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.72);
  z-index: 3000;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.ongoing-call-bar {
  position: fixed;
  top: max(.65rem, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 3300;
  width: min(94vw, 520px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .7rem .85rem;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #052e36, #10a76d);
  box-shadow: 0 18px 45px rgba(8, 31, 45, .28);
}

.ongoing-call-bar[hidden] {
  display: none;
}

.ongoing-call-bar strong,
.ongoing-call-bar span {
  display: block;
  line-height: 1.05;
}

.ongoing-call-bar span {
  opacity: .85;
  font-weight: 900;
}

.incoming-call {
  position: fixed;
  inset: 0;
  z-index: 3200;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(4, 18, 15, .62);
}

.incoming-call[hidden],
.call-modal[hidden] {
  display: none;
}

.incoming-call-card {
  width: min(92vw, 380px);
  padding: 2rem 1.25rem;
  border-radius: 18px;
  background: #fff;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .32);
}

.ring-avatar {
  width: 86px;
  height: 86px;
  margin: 0 auto 1rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #d8f8df;
  color: var(--defi-dark);
  font-size: 2.4rem;
  font-weight: 800;
  animation: ringPulse 1.1s infinite;
}

.incoming-call-card p {
  margin: 0;
  color: #6b7a75;
  font-weight: 700;
}

.incoming-call-card h2 {
  margin: .35rem 0;
  font-size: 1.5rem;
}

.ringing-text {
  color: var(--defi-green);
  font-weight: 700;
  margin-bottom: 1.25rem;
}

.incoming-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}

@keyframes ringPulse {
  0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, .38); }
  100% { box-shadow: 0 0 0 18px rgba(37, 211, 102, 0); }
}

.call-box {
  width: min(100%, 760px);
  background: #06110f;
  color: #fff;
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  box-shadow: 0 28px 70px rgba(0, 0, 0, .35);
}

.call-invite {
  width: min(100%, 520px);
  margin: .9rem auto 0;
  padding: .85rem;
  display: grid;
  gap: .7rem;
  color: #102c32;
  background: #f7fbfa;
  border: 1px solid rgba(24, 199, 132, .35);
  border-radius: 8px;
  text-align: left;
}

.call-invite[hidden] {
  display: none;
}

.call-invite-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.call-invite-head strong,
.call-invite-head small {
  display: block;
}

.call-invite-head small {
  margin-top: .1rem;
  color: #6b7a75;
  font-size: .78rem;
}

.call-invite-head button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  color: #24423e;
  background: #e7f1ef;
  font-size: 1.35rem;
  line-height: 1;
}

.call-invite-search {
  min-height: 44px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: .5rem;
  padding: 0 .75rem;
  background: #fff;
  border: 1px solid #d7e7e3;
  border-radius: 8px;
}

.call-invite-search input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
}

.call-invite-results {
  max-height: 230px;
  overflow-y: auto;
  display: grid;
  gap: .4rem;
}

.call-invite-person {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 28px;
  align-items: center;
  gap: .65rem;
  padding: .45rem .55rem;
  color: #102c32;
  background: #fff;
  border: 1px solid #deebe8;
  border-radius: 8px;
  text-align: left;
}

.call-invite-person:hover,
.call-invite-person.selected {
  border-color: #18c784;
  background: #e8fbf3;
}

.call-invite-person:disabled {
  opacity: .52;
  cursor: not-allowed;
  background: #f1f5f4;
}

.call-invite-person:disabled i {
  color: #fff;
  background: #8ea7a0;
  border-color: #8ea7a0;
}

.call-invite-person[hidden] {
  display: none;
}

.call-invite-person img {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border-radius: 50%;
}

.call-invite-person strong,
.call-invite-person small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.call-invite-person small {
  color: #6b7a75;
  font-size: .76rem;
}

.call-invite-person i {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border: 1px solid #bfd6d0;
  border-radius: 50%;
  color: transparent;
  font-style: normal;
}

.call-invite-person.selected i {
  color: #fff;
  background: #18b779;
  border-color: #18b779;
}

.call-invite-empty {
  padding: .9rem;
  color: #6b7a75;
  text-align: center;
}

.call-invite > .btn {
  min-height: 44px;
  border-radius: 8px;
  font-weight: 850;
}

.call-video-tile audio {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: .75rem;
  margin: 1rem 0;
  max-height: min(58vh, 560px);
  overflow-y: auto;
}

.call-video-tile {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: #000;
}

.video-grid video {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #000;
  object-fit: cover;
  display: block;
}

.call-video-tile.pending video {
  opacity: .25;
}

.call-video-tile.pending::after {
  content: "Ringing...";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
  background: rgba(0, 0, 0, .28);
}

.call-video-label,
.call-mute-badge {
  position: absolute;
  left: .55rem;
  bottom: .55rem;
  padding: .25rem .55rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, .58);
  color: #fff;
  font-size: .78rem;
  font-weight: 800;
}

.call-mute-badge {
  left: auto;
  right: .55rem;
  background: rgba(233, 0, 70, .88);
}

.call-status-line {
  min-height: 22px;
  color: rgba(255, 255, 255, .78);
  font-size: .9rem;
  font-weight: 700;
  margin-top: -.35rem;
}

.call-history-row {
  grid-template-columns: auto minmax(0, 1fr) auto auto;
}

.recall-call-btn {
  white-space: nowrap;
}

@media (max-width: 800px) {
  body {
    padding-bottom: 86px;
  }

  .navbar .container-fluid {
    align-items: center;
  }

  .desktop-menu {
    display: none;
  }

  .auth-page {
    align-items: stretch;
    padding: .75rem;
  }

  .auth-card {
    align-self: center;
    padding: 1.25rem;
    border-radius: 8px;
  }

  .auth-card h1,
  .panel h1 {
    font-size: 1.45rem;
  }

  .container {
    padding-left: .75rem;
    padding-right: .75rem;
  }

  .panel,
  .stat-card {
    padding: 1rem;
  }

  .group-page {
    width: calc(100% - 1rem);
    grid-template-columns: 1fr;
    margin-top: .75rem;
  }

  .group-hero {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .group-hero h1 {
    font-size: 1.65rem;
  }

  .group-picker-grid {
    grid-template-columns: 1fr;
    max-height: 330px;
  }

  .group-row {
    grid-template-columns: auto 1fr;
  }

  .group-row span {
    grid-column: 2;
  }

  .group-invite-card,
  .group-member-search {
    grid-template-columns: 1fr;
  }

  .group-invite-card .share-qr {
    justify-self: center;
  }

  .profile-strip {
    align-items: flex-start;
  }

  .profile-strip img {
    width: 62px;
    height: 62px;
  }

  .profile-strip h1 {
    font-size: 1.35rem;
  }

  .profile-page {
    padding: .75rem .75rem 5.5rem;
  }

  .wa-profile-hero {
    padding-top: .75rem;
  }

  .wa-avatar {
    width: 138px;
    height: 138px;
  }

  .wa-profile-hero h1 {
    font-size: 1.55rem;
  }

  .wa-info-row,
  .wa-link-row {
    grid-template-columns: 1fr;
    gap: .25rem;
    min-height: 64px;
  }

  .wa-help {
    padding: 0 1rem .85rem;
  }

  .chat-shell {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 18dvh) minmax(0, 1fr);
    height: calc(100dvh - 142px);
    min-height: 0;
    overflow: hidden;
  }

  .chat-sidebar {
    max-height: 18dvh;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow-y: auto;
  }

  .chat-list-head {
    padding: .45rem .7rem .2rem;
  }

  .chat-list-head h1 {
    font-size: 1.25rem;
  }

  .chat-head-actions > a {
    width: 36px;
    height: 36px;
    font-size: 1.45rem;
  }

  .quick-add-menu {
    width: min(270px, calc(100vw - 1.4rem));
    right: 0;
    top: calc(100% + .45rem);
    padding: .5rem;
  }

  .quick-add-menu a,
  .quick-add-menu button {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: .6rem;
    min-height: 50px;
    padding: .5rem .62rem;
    font-size: .92rem;
  }

  .chat-head-actions .quick-add-menu a,
  .chat-head-actions .quick-add-menu button {
    width: 100%;
    height: auto;
    min-height: 50px;
    grid-template-columns: 36px minmax(0, 1fr);
    font-size: .9rem;
    line-height: 1.08;
  }

  .quick-add-menu a::before,
  .quick-add-menu button::before {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font-size: .72rem;
  }

  .chat-search {
    padding: .25rem .65rem;
  }

  .chat-search .form-control {
    min-height: 36px;
    font-size: .9rem;
  }

  .chat-filters {
    gap: .35rem;
    padding: 0 .65rem .3rem;
  }

  .chat-filters button {
    padding: .25rem .65rem;
    font-size: .82rem;
  }

  .archive-row {
    display: none;
  }

  .chat-shell.chat-open {
    grid-template-rows: minmax(0, 1fr);
    height: calc(var(--app-vh, 100dvh) - 60px);
    max-height: calc(var(--app-vh, 100dvh) - 60px);
    min-height: 0;
    overflow: hidden;
  }

  .chat-shell.chat-open .chat-sidebar {
    display: none;
  }

  body:has(.chat-shell.chat-open) {
    padding-bottom: 0;
    overflow: hidden;
    height: var(--app-vh, 100dvh);
    max-height: var(--app-vh, 100dvh);
  }

  body.chat-is-open {
    padding-bottom: 0;
    overflow: hidden;
    height: var(--app-vh, 100dvh);
    max-height: var(--app-vh, 100dvh);
  }

  body:has(.chat-shell.chat-open) .bottom-tabs {
    display: none;
  }

  body.chat-is-open .bottom-tabs {
    display: none;
  }

  .chat-shell.chat-home {
    grid-template-rows: minmax(0, 1fr);
  }

  .chat-shell.chat-home .chat-sidebar {
    max-height: none;
    display: block;
  }

  .chat-shell.chat-home .chat-window {
    display: none;
  }

  .chat-window {
    height: 100%;
    max-height: 100%;
    min-height: 0;
    overflow: hidden;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
  }

  .chat-header {
    position: relative;
    top: 0;
    z-index: 5;
    align-items: center;
    padding: .6rem .75rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .45rem;
  }

  .chat-header .d-flex {
    flex-shrink: 0;
    gap: .35rem !important;
    flex-wrap: nowrap;
  }

  .chat-header strong {
    font-size: .98rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .chat-header small {
    font-size: .74rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .chat-header .btn {
    min-width: 0;
    padding: .34rem .58rem;
    font-size: .78rem;
    white-space: nowrap;
  }

  .messages {
    min-height: 0;
    height: 100%;
    max-height: none;
    overflow-y: auto;
    padding: .9rem .75rem 1rem;
  }

  .message {
    max-width: 92%;
    padding: .72rem .82rem;
    margin-bottom: .72rem;
  }

  .message-form {
    grid-template-columns: auto 1fr auto auto;
    position: relative;
    bottom: auto;
    z-index: 6;
  }

  .pin-input-grid {
    grid-template-columns: 1fr;
  }

  .locked-chat-panel {
    padding: .85rem;
  }

  .locked-chat-panel > div {
    border-radius: 18px;
  }
  .list-row { grid-template-columns: 1fr; }

  .list-row.compact {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    min-height: calc(100dvh - 1.5rem);
    padding: 1.25rem;
    background-position: right 1rem top 1rem;
    background-size: 132px;
  }

  .hero-panel h1 {
    font-size: 2.35rem;
  }

  .hero-panel p {
    font-size: 1rem;
  }

  .video-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 52vh;
  }

  .video-grid video {
    aspect-ratio: 4 / 5;
  }

  .call-history-row {
    grid-template-columns: auto 1fr;
  }

  .call-history-row time,
  .call-history-row .recall-call-btn {
    grid-column: 2;
    justify-self: start;
  }

  .status-page {
    width: 100%;
    margin: 0 0 5.5rem;
    grid-template-columns: 1fr;
    gap: .75rem;
  }

  .status-composer,
  .status-feed {
    border-radius: 0;
    box-shadow: none;
  }

  .status-hero {
    padding: 1rem;
  }

  .status-grid {
    grid-template-columns: 1fr;
  }

  .status-card {
    min-height: 220px;
    border-radius: 20px;
  }

  .table-responsive {
    border: 0;
  }

  .bottom-tabs {
    display: grid;
    bottom: .45rem;
    width: calc(100% - .8rem);
    min-height: 64px;
    border-radius: 24px;
  }

  .bottom-tabs a {
    font-size: .72rem;
  }

  .bottom-tabs .tab-icon,
  .bottom-tabs img {
    width: 25px;
    height: 25px;
  }

  .defi-alerts {
    top: 64px;
    right: .6rem;
    width: calc(100% - 1.2rem);
  }
}

@media (max-width: 420px) {
  .message-form {
    grid-template-columns: auto 1fr auto auto;
  }

  .message-form input[name="message"] {
    min-width: 0;
  }

  .chat-header .btn {
    min-width: 0;
    padding: .32rem .48rem;
    font-size: .74rem;
  }
}

/* Admin group operations */
.admin-groups-page {
  max-width: 1500px;
}

.admin-groups-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  color: #fff;
  background: linear-gradient(120deg, #062c35 0%, #075e54 58%, #18a86b 100%);
  border-radius: 8px;
}

.admin-groups-hero h1 {
  margin: .15rem 0 .35rem;
  font-size: clamp(1.75rem, 3vw, 2.6rem);
}

.admin-groups-hero p {
  margin: 0;
  color: rgba(255, 255, 255, .78);
}

.admin-groups-total {
  min-width: 130px;
  padding: 1rem 1.25rem;
  text-align: center;
  color: #062c35;
  background: #fff;
  border-radius: 8px;
}

.admin-groups-total strong,
.admin-groups-total span {
  display: block;
}

.admin-groups-total strong {
  font-size: 2rem;
}

.admin-groups-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.admin-group-list {
  position: sticky;
  top: 1rem;
  padding: .8rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
}

.admin-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .75rem;
}

.admin-section-heading h2 {
  margin: 0;
  font-size: 1.15rem;
}

.admin-section-heading span {
  color: #667a78;
  font-size: .82rem;
}

.admin-group-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: .75rem;
  align-items: center;
  padding: .8rem;
  margin-bottom: .4rem;
  color: #102c32;
  text-decoration: none;
  border: 1px solid #deece9;
  border-radius: 8px;
}

.admin-group-row:hover,
.admin-group-row.active {
  color: #075e54;
  background: #eafaf4;
  border-color: #86dab9;
}

.admin-group-row img,
.admin-selected-group-title img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
}

.admin-group-row strong,
.admin-group-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-group-row small {
  color: #71827f;
  font-size: .78rem;
}

.admin-group-row b {
  min-width: 28px;
  padding: .18rem .4rem;
  text-align: center;
  color: #075e54;
  background: #cef5e3;
  border-radius: 999px;
  font-size: .75rem;
}

.admin-group-workspace {
  display: grid;
  gap: 1.25rem;
}

.admin-selected-group-title {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.admin-selected-group-title img {
  width: 68px;
  height: 68px;
}

.admin-selected-group-title h2,
.admin-selected-group-title p {
  margin: 0;
}

.admin-selected-group-title p {
  color: #667a78;
}

.admin-group-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .75rem;
  margin: 1.25rem 0;
}

.admin-group-metrics div {
  padding: .9rem;
  background: #f3f8f7;
  border-radius: 8px;
}

.admin-group-metrics strong,
.admin-group-metrics span {
  display: block;
}

.admin-group-metrics strong {
  font-size: 1.45rem;
}

.admin-group-metrics span {
  color: #667a78;
  font-size: .8rem;
}

.admin-group-tools-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.admin-group-tool-card {
  position: relative;
  overflow: hidden;
}

.admin-group-tool-card h2 {
  margin: .4rem 0;
  font-size: 1.3rem;
}

.admin-group-tool-card p {
  min-height: 48px;
  color: #667a78;
}

.admin-group-tool-card textarea {
  resize: vertical;
}

.tool-number {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #075e54;
  background: #dff8ec;
  border-radius: 8px;
  font-size: .78rem;
  font-weight: 800;
}

.admin-activity-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .75rem 0;
  border-top: 1px solid #e2ecea;
}

.admin-activity-row span,
.admin-activity-row strong,
.admin-activity-row small {
  display: block;
  min-width: 0;
}

.admin-activity-row small {
  max-width: 65ch;
  overflow: hidden;
  color: #667a78;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-activity-row time {
  flex: 0 0 auto;
  color: #71827f;
  font-size: .8rem;
}

@media (max-width: 900px) {
  .app-nav .container-fluid {
    flex-wrap: nowrap;
  }

  .app-nav .container-fluid > div {
    display: flex;
    gap: .3rem;
    overflow-x: auto;
    padding-bottom: .15rem;
  }

  .app-nav .btn {
    flex: 0 0 auto;
  }

  .admin-groups-layout,
  .admin-group-tools-grid {
    grid-template-columns: 1fr;
  }

  .admin-group-list {
    position: static;
    max-height: 360px;
  }
}

@media (max-width: 560px) {
  .admin-groups-page {
    padding-right: .75rem;
    padding-left: .75rem;
  }

  .admin-groups-hero {
    align-items: stretch;
    flex-direction: column;
    padding: 1.1rem;
  }

  .admin-groups-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
  }

  .admin-group-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-activity-row {
    flex-direction: column;
    gap: .25rem;
  }
}
