html[data-theme=dark] {
  color-scheme: dark;
  --gold: #2b7a82;
  --gold2: #d8bc86;
  --cyan: #58999e;
  --bg: #0a0c0e;
  --txt: #f4f2ed;
  --mut: #8b9698;
  --glass: rgba(18, 22, 25, .88);
  --bd: rgba(255, 255, 255, .09);
  --card: #121518;
  --field: rgba(255, 255, 255, .06);
  --shadow: 0 18px 50px rgba(0, 0, 0, .65);
}

html[data-theme=light] {
  color-scheme: light;
  --gold: #1e565e;
  --gold2: #b58d47;
  --cyan: #4a8889;
  --bg: #f5f5f2;
  --txt: #162629;
  --mut: #627478;
  --glass: rgba(255, 255, 255, .92);
  --bd: rgba(30, 86, 94, .12);
  --card: #ffffff;
  --field: rgba(30, 86, 94, .055);
  --shadow: 0 16px 48px rgba(22, 38, 41, .08);
}

html[data-theme] body {
  background: var(--bg);
  color: var(--txt);
}

html[data-theme] .glass {
  background: var(--glass);
  border-color: var(--bd);
  box-shadow: var(--shadow);
}

html[data-theme=dark] #bg {
  opacity: .22;
}

html[data-theme=light] #bg {
  opacity: .12;
}

html[data-theme] ::placeholder {
  color: var(--mut);
}

html[data-theme] .mut {
  color: var(--mut);
}

html[data-theme] input:not([type=checkbox]):not([type=file]),
html[data-theme] textarea,
html[data-theme] select {
  background: var(--field);
  color: var(--txt);
  border: 1px solid var(--bd);
  border-radius: 12px;
}

html[data-theme] input:focus,
html[data-theme] textarea:focus,
html[data-theme] select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(43, 122, 130, .2);
  outline: 0;
}

html[data-theme] select option {
  background: var(--card);
  color: var(--txt);
}

html[data-theme] .btn {
  background: var(--field);
  color: var(--txt);
  border: 1px solid var(--bd);
}

html[data-theme] .btn.gold {
  background: linear-gradient(135deg, #2b7a82, #1e565e);
  color: #fff;
  border: 1px solid rgba(216, 188, 134, .22);
  box-shadow: 0 8px 22px rgba(30, 86, 94, .28);
}

html[data-theme] .btn.gold:hover {
  background: linear-gradient(135deg, #328891, #23626b);
  color: #fff;
  border-color: rgba(216, 188, 134, .4);
  box-shadow: 0 10px 26px rgba(30, 86, 94, .38);
}

html[data-theme] .btn.gold:after {
  display: none;
}

html[data-theme] .btn.ghost {
  background: transparent;
}

html[data-theme] .btn.danger {
  background: rgba(225, 49, 75, .12);
  color: #e14b63;
  border-color: rgba(225, 49, 75, .35);
}

html[data-theme=dark] .link,
html[data-theme=dark] .forgot-link:hover {
  color: var(--gold2);
}

html[data-theme=light] .link,
html[data-theme=light] .forgot-link:hover {
  color: var(--gold);
}

html[data-theme] .forgot-link {
  color: var(--mut);
}

html[data-theme] .badge,
html[data-theme] .tab-pill {
  background: var(--gold);
  color: #fff;
}

/* =========================================================
   BIG-PLATFORM SPLIT LOGIN SCREEN (LEFT: LOGO, RIGHT: PANEL)
   ========================================================= */
html[data-theme=dark] #login {
  background: #0a0c0e;
}

html[data-theme=light] #login {
  background: #f5f5f2;
}

html[data-theme] #login:not(.hidden) {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  direction: ltr;
  padding: 0;
  align-items: stretch;
  justify-items: center;
  overflow-y: auto;
}

html[dir=rtl] #login .login-showcase,
html[dir=rtl] #login .login-card {
  direction: rtl;
}

html[dir=ltr] #login .login-showcase,
html[dir=ltr] #login .login-card {
  direction: ltr;
}

/* Left Column: Brand & Logo Showcase */
.login-showcase {
  grid-column: 1;
  grid-row: 1;
  width: 100%;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  position: relative;
  overflow: hidden;
  border-right: 1px solid var(--bd);
}

html[data-theme=dark] .login-showcase {
  background:
    radial-gradient(540px 440px at 50% 44%, rgba(43, 122, 130, .18), transparent 70%),
    radial-gradient(380px 320px at 54% 36%, rgba(216, 188, 134, .09), transparent 65%),
    linear-gradient(160deg, #0d1215 0%, #090b0d 100%);
}

html[data-theme=light] .login-showcase {
  background:
    radial-gradient(540px 440px at 50% 44%, rgba(30, 86, 94, .07), transparent 70%),
    radial-gradient(380px 320px at 54% 36%, rgba(201, 162, 95, .1), transparent 65%),
    linear-gradient(160deg, #f7f7f4 0%, #eeeee9 100%);
}

.login-showcase-inner {
  position: relative;
  z-index: 1;
  max-width: 460px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 22px;
  animation: fadeUp .55s cubic-bezier(.2, .8, .2, 1);
}

.showcase-logo-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.showcase-logo {
  width: min(310px, 72vw);
  height: auto;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 16px 36px rgba(0, 0, 0, .18));
  transition: transform .35s ease;
}

.showcase-logo:hover {
  transform: translateY(-4px);
}

html[data-theme=dark] .logo-light-img {
  display: none !important;
}

html[data-theme=light] .logo-dark-img {
  display: none !important;
}

.showcase-tagline {
  font-family: Cairo, Tajawal, sans-serif;
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--txt);
  opacity: .92;
  max-width: 360px;
  line-height: 1.65;
  margin-top: -4px;
}

.showcase-pills {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 2px;
}

.showcase-pill {
  font-size: .84rem;
  font-weight: 600;
  color: var(--mut);
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--field);
  border: 1px solid var(--bd);
}

.showcase-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold2);
  opacity: .65;
}

/* Right Column: Sleek Login Panel */
html[data-theme] #login .login-card {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  justify-self: center;
  width: min(410px, calc(100% - 40px));
  margin: 32px 20px;
  padding: 36px 32px 28px;
  border-radius: 24px;
  gap: 14px;
  border: 1px solid var(--bd);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

html[data-theme=dark] #login .login-card {
  background: #111417;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .04);
}

html[data-theme=light] #login .login-card {
  background: #ffffff;
  box-shadow: 0 20px 60px rgba(22, 38, 41, .08), 0 0 0 1px rgba(30, 86, 94, .06);
}

html[data-theme] .login-card .logo {
  width: 56px;
  height: 56px;
  margin: 0 auto -2px;
  border-radius: 0;
  font-size: 0;
  background: url("logo-icon.png") center/contain no-repeat !important;
  box-shadow: none !important;
  animation: none;
}

html[data-theme] .login-card .logo:before {
  display: none !important;
}

html[data-theme] .brand,
html[data-theme] .side-brand span {
  background: none;
  color: var(--txt);
  -webkit-text-fill-color: var(--txt);
  animation: none;
  text-shadow: none !important;
  letter-spacing: 0;
}

html[data-theme] .login-card .brand {
  font-size: 1.85rem;
  line-height: 1.2;
}

html[data-theme] .side-brand:before {
  background: url("logo-icon.png") center/contain no-repeat !important;
  -webkit-mask: none !important;
  mask: none !important;
  width: 34px;
  height: 34px;
}

html[data-theme] .login-card input {
  height: 48px;
  border-radius: 12px;
  padding-inline: 16px;
}

html[data-theme=dark] .login-card input {
  background: #171b1f;
  border: 1px solid rgba(255, 255, 255, .09);
}

html[data-theme=light] .login-card input {
  background: #f7f8f8;
  border: 1px solid rgba(30, 86, 94, .14);
}

html[data-theme] .login-card input:focus {
  border-color: var(--gold);
  background: var(--card);
}

html[data-theme] .login-card .btn {
  height: 48px;
  border-radius: 12px;
  font-weight: 700;
}

html[data-theme] .login-card .btn.google {
  background: var(--field);
  color: var(--txt);
  border: 1px solid var(--bd);
  box-shadow: none;
}

html[data-theme] .login-card .btn.google:hover {
  border-color: var(--gold);
  background: rgba(43, 122, 130, .08);
}

.login-tools {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 2px;
}

.theme-quick-btn {
  color: var(--txt);
}

html[data-theme=dark] .theme-quick-btn .ico-moon {
  display: none;
}

html[data-theme=light] .theme-quick-btn .ico-sun {
  display: none;
}

/* Mobile & Tablet Responsive Login Layout */
@media (max-width: 880px) {
  html[data-theme] #login:not(.hidden) {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 28px 16px 40px;
    gap: 18px;
  }

  .login-showcase {
    min-height: auto;
    padding: 12px 16px 4px;
    border-right: 0;
    background: none !important;
  }

  .showcase-logo {
    width: min(190px, 52vw);
  }

  .showcase-tagline,
  .showcase-pills {
    display: none;
  }

  html[data-theme] #login .login-card {
    margin: 0 auto;
    width: min(410px, 100%);
    padding: 28px 22px 24px;
  }

  html[data-theme] #login .login-card .logo {
    display: none;
  }
}

html[data-theme] .divider {
  color: var(--mut);
}

html[data-theme] .msg {
  color: #e14b63;
}

html[data-theme] .msg.ok {
  color: #19b36b;
}

html[data-theme] #sidebar,
html[data-theme] #topbar,
html[data-theme] #bottomnav {
  background: var(--glass);
  border-color: var(--bd);
  box-shadow: none;
}

html[data-theme] #sidebar nav a {
  color: var(--txt);
}

html[data-theme] #sidebar nav a.active,
html[data-theme] .set-menu li.active {
  background: rgba(43, 122, 130, .15);
  color: var(--gold);
  box-shadow: none;
}

html[data-theme=dark] #sidebar nav a.active,
html[data-theme=dark] .set-menu li.active {
  color: var(--gold2);
}

html[data-theme] #bottomnav a {
  color: var(--txt);
}

html[data-theme] #bottomnav a.active {
  background: none;
  color: var(--gold);
  opacity: 1;
}

html[data-theme=dark] #bottomnav a.active {
  color: var(--gold2);
}

html[data-theme] #bottomnav a.plus {
  background: linear-gradient(135deg, #2b7a82, #1e565e);
  color: #fff;
  border-radius: 12px;
  padding: 8px 14px;
  opacity: 1;
  border: 1px solid rgba(216, 188, 134, .3);
}

html[data-theme] .avatar {
  background-color: var(--field);
  color: var(--txt);
}

html[data-theme] .search-dropdown,
html[data-theme] #langMenu,
html[data-theme] .picker-pop,
html[data-theme] #comments {
  background: var(--card);
}

html[data-theme] #langMenu button {
  color: var(--txt);
}

html[data-theme] .otp-card,
html[data-theme] .gate-card {
  background: var(--card);
  color: var(--txt);
}

html[data-theme] .gate {
  background: color-mix(in srgb, var(--bg) 94%, transparent);
}

html[data-theme] .otp-tile b {
  background: var(--field);
  color: var(--txt);
}

html[data-theme] .card,
html[data-theme] .set-menu,
html[data-theme] .msg-layout {
  background: var(--glass);
}

html[data-theme] .set-menu li {
  color: var(--txt);
}

html[data-theme] .trow input {
  background: #7f7f7f59;
}

html[data-theme] .trow input:checked {
  background: var(--gold);
}

html[data-theme] .tf-badge.on {
  color: #19b36b;
  border-color: #19b36b73;
  background: #19b36b1a;
}

html[data-theme] .mItem {
  background: var(--field);
  border-color: var(--bd);
}

html[data-theme] .notif-card,
html[data-theme] .msg-user-card,
html[data-theme] .m-bubble {
  color: var(--txt);
}

html[data-theme] .m-row.me .m-bubble {
  background: var(--gold);
  color: #fff;
}

html[data-theme] .m-row.them .m-bubble {
  background: var(--field);
}

html[data-theme] #feed {
  padding: calc(var(--top) + 14px) 12px 90px;
  scroll-snap-type: none;
  scroll-behavior: auto;
}

html[data-theme] .feed-list {
  max-width: 620px;
  margin: 0 auto;
  padding: 0;
  gap: 14px;
}

html[data-theme] .feed-filter-bar {
  position: static;
  max-width: 620px;
  margin: 0 auto 12px;
  padding: 4px;
  border-radius: 14px;
  justify-content: stretch;
  background: var(--glass);
  border: 1px solid var(--bd);
  backdrop-filter: none;
  box-shadow: none;
}

html[data-theme] .feed-mode-btn {
  flex: 1;
  border-radius: 10px;
  padding: 9px 10px;
  font-size: .92rem;
}

html[data-theme] .feed-mode-btn.active {
  background: rgba(43, 122, 130, .16);
  color: var(--gold);
}

html[data-theme=dark] .feed-mode-btn.active {
  color: var(--gold2);
}

html[data-theme] .feed-mode-btn.active:after {
  display: none;
}

.composer,
#composer {
  display: none !important;
}

.composer-fake {
  flex: 1;
  padding: 11px 16px;
  border-radius: 999px;
  background: var(--field);
  color: var(--mut);
}

.composer-btn {
  font-weight: 700;
  color: var(--gold);
  white-space: nowrap;
}

html[data-theme=dark] .composer-btn {
  color: var(--gold2);
}

html[data-theme] #storiesBar {
  max-width: 620px;
  padding: 2px 2px 12px;
  scroll-snap-align: none;
}

html[data-theme] .post {
  position: static;
  height: auto;
  min-height: 0;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--bd);
  box-shadow: none;
  scroll-snap-align: none;
  isolation: auto;
  content-visibility: auto;
  contain-intrinsic-size: 620px 640px;
  display: flex;
  flex-direction: column;
}

html[data-theme] .post-head {
  position: static;
  order: -2;
  padding: 12px 14px;
  color: var(--txt);
  background: none;
  pointer-events: auto;
}

html[data-theme] .post-head .author-disp {
  color: var(--txt);
  text-shadow: none;
  font-weight: 800;
}

html[data-theme] .post-head .by,
html[data-theme] .post-head .post-time {
  color: var(--mut);
  text-shadow: none;
}

html[data-theme] .post-follow-pill {
  background: rgba(43, 122, 130, .15);
  color: var(--gold);
  border-radius: 999px;
  padding: 6px 14px;
}

html[data-theme=dark] .post-follow-pill {
  color: var(--gold2);
}

html[data-theme] .post-follow-pill.following {
  background: var(--field);
  color: var(--mut);
}

html[data-theme] .post-foot {
  position: static;
  order: 1;
  padding: 4px 14px 14px;
  color: var(--txt);
  background: none;
  pointer-events: auto;
}

html[data-theme] .post-foot h3 {
  color: var(--txt);
  font-size: 1.02rem;
}

html[data-theme] .post-foot p {
  color: var(--txt);
  opacity: .85;
  font-size: .93rem;
}

html[data-theme] .post-quick-cmt {
  background: var(--field);
  color: var(--mut);
  backdrop-filter: none;
  margin-top: 4px;
}

html[data-theme] .post-quick-cmt .mut {
  color: var(--mut);
}

html[data-theme] .post-stage {
  position: relative;
  order: -1;
  inset: auto;
  border-radius: 0;
  background: var(--field);
  border: 0;
  display: block;
}

html[data-theme] .post-stage img.post-art {
  width: 100%;
  height: auto;
  max-height: 78dvh;
  object-fit: contain;
  display: block;
  background: #000;
}

html[data-theme] .acts {
  position: static;
  order: 0;
  flex-direction: row;
  justify-content: space-around;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-bottom: 1px solid var(--bd);
  inset: auto;
}

html[data-theme] .acts .act-author-box {
  display: none;
}

html[data-theme] .acts .ab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-direction: row;
}

html[data-theme] .act {
  background: none;
  color: var(--mut);
  width: 42px;
  height: 42px;
  backdrop-filter: none;
}

html[data-theme] .act:hover {
  background: var(--field);
}

html[data-theme] .act.like.on {
  color: #e14b63;
}

html[data-theme] .act.save.on {
  color: #d8bc86;
}

html[data-theme] .acts .ab b {
  color: var(--mut);
  text-shadow: none;
  font-size: .85rem;
  min-width: 1ch;
}

html[data-theme] .zoom-btn {
  background: #00000073;
  color: #fff;
  z-index: 4;
}

@media (max-width: 760px) {
  html[data-theme] #feed {
    padding: calc(var(--top) + 8px) 0 calc(80px + env(safe-area-inset-bottom, 0px));
  }

  html[data-theme] .feed-filter-bar,
  html[data-theme] .composer {
    margin-inline: 8px;
  }

  html[data-theme] .feed-list {
    gap: 8px;
  }

  html[data-theme] .post {
    border-radius: 0;
    border-inline: 0;
  }
}

.ctx-menu {
  position: fixed;
  z-index: 200;
  min-width: 190px;
  padding: 6px;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  background: var(--card);
  animation: fadeIn .12s;
}

.ctx-menu button {
  background: none;
  border: 0;
  color: var(--txt);
  text-align: start;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}

.ctx-menu button:hover {
  background: var(--field);
}

.theme-seg {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 6px 0 14px;
}

.theme-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 8px;
  border-radius: 16px;
  background: var(--field);
  border: 2px solid transparent;
  color: var(--txt);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.theme-opt.on {
  border-color: var(--gold);
}

.theme-opt i {
  width: 54px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--bd);
  display: block;
  position: relative;
  overflow: hidden;
}

.theme-opt i.d {
  background: #0a0c0e;
}

.theme-opt i.l {
  background: #f5f5f2;
}

.theme-opt i.a {
  background: linear-gradient(90deg, #0a0c0e 50%, #f5f5f2 50%);
}

.theme-opt i:after {
  content: "";
  position: absolute;
  inset: auto 6px 6px;
  height: 6px;
  border-radius: 4px;
  background: var(--gold);
}

#storiesBar {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 8px 14px 12px;
  max-width: 460px;
  margin: 0 auto;
  scroll-snap-align: start;
  scrollbar-width: none;
}

#storiesBar::-webkit-scrollbar {
  display: none;
}

.st-item {
  flex: none;
  width: 66px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  background: none;
  border: 0;
  color: var(--txt);
  font: inherit;
}

.st-ring {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  padding: 3px;
  position: relative;
  background: conic-gradient(var(--gold), var(--gold2), var(--cyan), var(--gold));
}

.st-ring.seen {
  background: var(--bd);
}

.st-ring.add {
  background: var(--field);
  border: 2px dashed var(--mut);
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  color: var(--gold);
}

.st-ring .avatar {
  width: 100%;
  height: 100%;
  border: 3px solid var(--bg);
}

.st-cnt-badge {
  position: absolute;
  bottom: -2px;
  inset-inline-end: -2px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--gold);
  color: #fff;
  font-size: .7rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg);
}

.st-name {
  font-size: .72rem;
  max-width: 66px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--mut);
}

.st-viewer {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: #000000eb;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn .18s;
}

.st-box {
  position: relative;
  width: min(440px, 100%);
  height: min(100dvh, 860px);
  background: #0c0c0f;
  overflow: hidden;
  border-radius: 0;
  display: flex;
  flex-direction: column;
}

@media (min-width: 761px) {
  .st-box {
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, .12);
  }
}

.st-stage {
  position: relative;
  flex: 1;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  touch-action: manipulation;
}

.st-stage img,
.st-stage video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.st-bars {
  position: absolute;
  inset: 10px 10px auto;
  display: flex;
  gap: 5px;
  z-index: 5;
  direction: ltr;
}

.st-bars i {
  flex: 1;
  height: 3.5px;
  border-radius: 4px;
  background: #ffffff52;
  overflow: hidden;
}

.st-bars i b {
  display: block;
  height: 100%;
  width: 0%;
  background: #fff;
  border-radius: 4px;
  transition: none !important;
}

.st-bars i.done b {
  width: 100% !important;
}

.st-top {
  position: absolute;
  inset: 22px 12px auto;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  pointer-events: auto;
}

.st-top .avatar {
  width: 36px;
  height: 36px;
}

.st-owner-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.st-top b {
  text-shadow: 0 1px 4px rgba(0, 0, 0, .7);
  font-size: .92rem;
}

.st-top .st-time {
  opacity: .82;
  font-size: .74rem;
}

.st-top .grow {
  flex: 1;
}

.st-pause-pill {
  display: none !important;
}

.st-x {
  background: #0000007a;
  border: 1px solid rgba(255, 255, 255, .15);
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.05rem;
  display: grid;
  place-items: center;
}

.st-x:hover {
  background: #ffffff2e;
}

.st-cap {
  position: absolute;
  inset: auto 0 74px;
  padding: 36px 18px 16px;
  color: #fff;
  text-align: center;
  background: linear-gradient(transparent, #000000d1);
  z-index: 3;
  pointer-events: none;
  font-size: .95rem;
}

.st-views {
  position: absolute;
  inset-inline-start: 14px;
  bottom: 16px;
  z-index: 5;
  color: #fff;
  background: #0000008c;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: .85rem;
}

.st-reply-bar {
  position: absolute;
  inset: auto 10px 12px;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 6px;
  background: #121218e0;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 999px;
  padding: 5px 8px;
  backdrop-filter: blur(10px);
}

.st-quick-reacts {
  display: flex;
  gap: 2px;
}

.st-quick-reacts button {
  background: none;
  border: 0;
  font-size: 1.15rem;
  padding: 4px 5px;
  cursor: pointer;
  border-radius: 50%;
  transition: transform .15s;
}

.st-quick-reacts button:hover {
  transform: scale(1.22);
}

.st-reply-bar input {
  flex: 1;
  min-width: 0;
  height: 36px;
  border: 0 !important;
  background: transparent !important;
  color: #fff !important;
  padding-inline: 8px;
  font-size: .88rem;
  box-shadow: none !important;
}

.st-reply-bar .btn {
  height: 34px;
  border-radius: 999px;
  padding-inline: 14px;
  font-size: .82rem;
  flex: none;
}

.st-audio-pick {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}

.st-audio-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .84rem;
  color: var(--cyan);
  background: rgba(88, 153, 158, .14);
  padding: 6px 12px;
  border-radius: 12px;
  max-width: 100%;
}

.st-audio-info span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 210px;
}

.chat-gate-banner {
  padding: 14px 16px;
  border-top: 1px solid var(--bd);
  background: var(--field);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  font-size: .9rem;
  color: var(--txt);
}

.chat-gate-banner.wait {
  color: var(--mut);
  font-weight: 600;
}

.chat-gate-banner.rejected {
  color: #e14b63;
  font-weight: 700;
}

.chat-gate-banner .cgb-text {
  font-weight: 700;
}

.chat-gate-banner .cgb-acts {
  display: flex;
  gap: 10px;
  justify-content: center;
}

:root {
  --i-groups: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M23 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E");
}

[data-view=groups] {
  --ic: var(--i-groups);
}

#topbar a.icon-btn[href="#groups"] {
  font-size: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

#topbar a.icon-btn[href="#groups"]:before {
  content: "";
  width: 22px;
  height: 22px;
  background: currentColor;
  -webkit-mask: var(--i-groups) center/contain no-repeat;
  mask: var(--i-groups) center/contain no-repeat;
}

#v-groups .gr-wrap {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.gr-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.gr-bar input {
  flex: 1;
  min-width: 160px;
  height: 46px;
  padding-inline: 16px;
}

.gr-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.gr-card {
  padding: 0;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: transform .15s;
  overflow: hidden;
  position: relative;
}

.gr-card:hover {
  transform: translateY(-2px);
}

.gr-card:before {
  content: "";
  display: block;
  height: 64px;
  background: linear-gradient(135deg, var(--gold), var(--cyan));
  opacity: .85;
}

.gr-ico {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  background-size: cover;
  background-position: center;
}

.gr-card .gr-ico {
  margin: -26px 14px 0;
  border: 3px solid var(--card);
  position: relative;
}

.gr-card h4,
.gr-card p,
.gr-card .gr-meta {
  padding-inline: 14px;
}

.gr-card h4 {
  font-size: 1.05rem;
}

.gr-card p {
  font-size: .85rem;
  color: var(--mut);
  line-height: 1.5;
  max-height: 3em;
  overflow: hidden;
}

.gr-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .8rem;
  color: var(--mut);
  gap: 8px;
  padding-bottom: 14px;
}

.gr-tag {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--field);
  font-weight: 700;
}

.gr-room {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - var(--top) - 120px);
  min-height: 420px;
  border-radius: 20px;
  overflow: hidden;
  background: var(--glass);
  border: 1px solid var(--bd);
}

.gr-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--bd);
}

.gr-head .grow {
  flex: 1;
  min-width: 0;
}

.gr-head h3 {
  font-size: 1.05rem;
}

.gr-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gr-msg {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  max-width: 86%;
}

.gr-msg.me {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.gr-bub {
  padding: 9px 13px;
  border-radius: 16px;
  background: var(--field);
  line-height: 1.55;
  word-break: break-word;
}

.gr-msg.me .gr-bub {
  background: var(--gold);
  color: #fff;
}

.gr-bub small {
  display: block;
  font-size: .7rem;
  opacity: .7;
  margin-bottom: 2px;
  font-weight: 700;
}

.gr-bub img {
  max-width: 220px;
  max-height: 260px;
  border-radius: 12px;
  display: block;
  margin-top: 4px;
}

.gr-form {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--bd);
  align-items: center;
}

.gr-form input[type=text] {
  flex: 1;
  height: 44px;
  padding-inline: 14px;
}

.gr-locked {
  padding: 40px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.gr-form-new {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  border-radius: 18px;
}

.gr-form-new select,
.gr-form-new input,
.gr-form-new textarea {
  height: 46px;
  padding-inline: 14px;
}

.gr-form-new textarea {
  height: 80px;
  padding-block: 10px;
}

.gr-members {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 14px;
  max-height: 160px;
  overflow: auto;
  border-bottom: 1px solid var(--bd);
  font-size: .88rem;
}

.gr-page {
  border-radius: 18px;
  overflow: hidden;
  background: var(--card);
  max-width: 680px;
  margin: 0 auto;
}

.gr-cover {
  height: 150px;
  background: linear-gradient(135deg, var(--gold), var(--cyan)) center/cover;
  position: relative;
}

.gr-back {
  position: absolute;
  top: 12px;
  inset-inline-start: 12px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 0;
  background: #00000073;
  color: #fff;
  cursor: pointer;
  font-size: 1.1rem;
}

.gr-info {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 0 16px 14px;
  flex-wrap: wrap;
}

.gr-ico.big {
  width: 78px;
  height: 78px;
  font-size: 2rem;
  border-radius: 22px;
  margin-top: -34px;
  border: 4px solid var(--card);
  flex: none;
}

.gr-info .grow {
  flex: 1;
  min-width: 180px;
  padding-top: 8px;
}

.gr-info h2 {
  font-size: 1.35rem;
}

.gr-info p {
  margin-top: 6px;
  line-height: 1.6;
  font-size: .92rem;
}

.gr-actions {
  display: flex;
  gap: 8px;
  padding-top: 10px;
}

.gr-tabs {
  display: flex;
  border-top: 1px solid var(--bd);
  border-bottom: 1px solid var(--bd);
}

.gr-tabs button {
  flex: 1;
  padding: 13px 8px;
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  color: var(--mut);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.gr-tabs button.on {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.gp-compose {
  display: flex;
  gap: 10px;
  padding: 14px;
  align-items: flex-start;
}

.gp-compose textarea {
  width: 100%;
  min-height: 56px;
  padding: 10px 14px;
  resize: none;
  border-radius: 14px;
}

.gp-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.gp-list {
  max-width: 680px;
  margin: 14px auto 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gp {
  border-radius: 16px;
  overflow: hidden;
  background: var(--card);
}

.gp-head {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
}

.gp-head div {
  display: flex;
  flex-direction: column;
}

.gp-text {
  padding: 0 14px 12px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.gp-img {
  width: 100%;
  max-height: 70dvh;
  object-fit: contain;
  background: #000;
  display: block;
}

.gp-acts {
  display: flex;
  border-top: 1px solid var(--bd);
}

.gp-acts button {
  flex: 1;
  padding: 11px;
  background: none;
  border: 0;
  color: var(--mut);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.gp-acts button:hover {
  background: var(--field);
}

.gp-acts button.on {
  color: var(--gold);
}

.gc-box {
  border-top: 1px solid var(--bd);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gc-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.gc-bub {
  background: var(--field);
  padding: 8px 12px;
  border-radius: 14px;
  font-size: .9rem;
  line-height: 1.5;
  position: relative;
  word-break: break-word;
}

.gc-del {
  background: none;
  border: 0;
  color: var(--mut);
  cursor: pointer;
  font-size: 1rem;
  padding: 0 6px;
}

.gc-form {
  display: flex;
  gap: 8px;
}

.gc-form input {
  flex: 1;
  height: 40px;
  padding-inline: 14px;
}

.gr-members-list {
  display: flex;
  flex-direction: column;
}

.gr-mrow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--bd);
}

.gr-mrow .grow {
  flex: 1;
}

/* =========================================================
   Clean Solid Background, Hidden Toggles, E2EE & Delete Modal
   ========================================================= */
#bg {
  display: none !important;
}

label.trow:has(#tgBg),
label.trow:has(#tgCalm) {
  display: none !important;
}

.chat-e2ee-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  color: var(--gold2);
  background: rgba(43, 122, 130, .14);
  border: 1px solid rgba(138, 200, 206, .22);
  white-space: nowrap;
  margin-top: 2px;
  width: fit-content;
}

html[data-theme="light"] .chat-e2ee-badge {
  color: var(--gold);
  background: rgba(31, 100, 108, .1);
  border-color: rgba(31, 100, 108, .22);
}

.del-acc-back {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(4, 8, 12, .78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: fadeIn .2s ease;
  overflow-y: auto;
}

.del-acc-modal {
  position: relative;
  width: min(460px, 100%);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  border-radius: 24px;
  padding: 28px 24px 24px;
  background: #101418;
  border: 1px solid rgba(225, 75, 99, .28);
  box-shadow: 0 24px 64px rgba(0, 0, 0, .65), 0 0 0 1px rgba(255, 255, 255, .04) inset;
  display: flex;
  flex-direction: column;
  gap: 16px;
  color: var(--txt);
  animation: zoomIn .25s cubic-bezier(.2, .8, .2, 1);
  margin: auto;
}

html[data-theme="light"] .del-acc-modal {
  background: #ffffff;
  border-color: rgba(217, 56, 84, .3);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .18);
}

.del-acc-x {
  position: absolute;
  top: 14px;
  inset-inline-end: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--bd);
  background: var(--field);
  color: var(--mut);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: .18s;
}

.del-acc-x:hover {
  color: var(--txt);
  background: rgba(225, 75, 99, .15);
  border-color: rgba(225, 75, 99, .35);
}

.del-acc-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding-top: 4px;
}

.del-acc-icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: rgba(225, 75, 99, .14);
  border: 1px solid rgba(225, 75, 99, .32);
  color: #ff5c77;
  display: grid;
  place-items: center;
  margin-bottom: 2px;
}

.del-acc-head h3 {
  font-size: 1.28rem;
  font-weight: 800;
  color: var(--txt);
  margin: 0;
}

.del-acc-head p {
  font-size: .88rem;
  color: var(--mut);
  line-height: 1.55;
  margin: 0;
  max-width: 38ch;
}

.del-acc-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  text-align: start;
}

.del-acc-lbl {
  font-size: .84rem;
  font-weight: 700;
  color: var(--txt);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.del-acc-tag {
  font-size: .73rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(43, 122, 130, .18);
  color: var(--gold2);
  border: 1px solid rgba(138, 200, 206, .24);
}

html[data-theme="light"] .del-acc-tag {
  color: var(--gold);
}

.del-acc-field input {
  width: 100%;
  height: 48px;
  border-radius: 13px;
  padding-inline: 14px;
  font-size: 16px;
  background: var(--field);
  border: 1px solid var(--bd);
  color: var(--txt);
  transition: border-color .18s, box-shadow .18s;
}

.del-acc-field input:focus {
  border-color: #e14b63;
  box-shadow: 0 0 0 3px rgba(225, 75, 99, .16);
  outline: none;
}

.del-acc-code-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.del-acc-code-row input {
  flex: 1;
  min-width: 0;
  letter-spacing: .24em;
  font-weight: 800;
  text-align: center;
}

.del-acc-send-btn {
  flex: none;
  height: 48px;
  padding-inline: 14px;
  border-radius: 13px;
  font-size: .84rem;
  font-weight: 700;
  white-space: nowrap;
  background: rgba(43, 122, 130, .18);
  color: var(--gold2);
  border: 1px solid rgba(138, 200, 206, .28);
  cursor: pointer;
  transition: .18s;
}

html[data-theme="light"] .del-acc-send-btn {
  color: var(--gold);
  border-color: rgba(31, 100, 108, .28);
}

.del-acc-send-btn:hover:not(:disabled) {
  background: rgba(43, 122, 130, .28);
}

.del-acc-send-btn:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.del-acc-code-banner {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(43, 122, 130, .14);
  border: 1px solid rgba(138, 200, 206, .25);
  font-size: .82rem;
  line-height: 1.5;
  color: var(--txt);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.del-acc-code-banner code {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: .16em;
  color: var(--gold2);
  background: rgba(0, 0, 0, .25);
  padding: 3px 10px;
  border-radius: 8px;
  direction: ltr;
}

html[data-theme="light"] .del-acc-code-banner code {
  color: var(--gold);
  background: rgba(0, 0, 0, .06);
}

.del-acc-policy {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(225, 75, 99, .07);
  border: 1px solid rgba(225, 75, 99, .22);
  cursor: pointer;
  user-select: none;
  text-align: start;
  transition: background .18s, border-color .18s;
}

.del-acc-policy:hover {
  background: rgba(225, 75, 99, .11);
}

.del-acc-policy input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: #e14b63;
  cursor: pointer;
  flex: none;
}

.del-acc-policy span {
  font-size: .84rem;
  line-height: 1.55;
  color: var(--txt);
  font-weight: 600;
}

.del-acc-err {
  min-height: 1.2em;
  font-size: .84rem;
  font-weight: 700;
  color: #ff5c77;
  text-align: center;
  margin: -4px 0;
}

.del-acc-actions {
  display: flex;
  gap: 10px;
  margin-top: 2px;
}

.del-acc-cancel {
  flex: 1;
  height: 48px;
  border-radius: 13px;
  background: var(--field);
  border: 1px solid var(--bd);
  color: var(--txt);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.del-acc-submit {
  flex: 1.6;
  height: 48px;
  border-radius: 13px;
  background: linear-gradient(135deg, #e14b63, #b82941);
  border: 0;
  color: #fff;
  font: inherit;
  font-weight: 800;
  font-size: .95rem;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(225, 75, 99, .32);
  transition: transform .15s, opacity .18s, box-shadow .18s;
}

.del-acc-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(225, 75, 99, .42);
}

.del-acc-submit:disabled {
  opacity: .42;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

@media (max-width: 520px) {
  .del-acc-back {
    padding: 12px;
    align-items: center;
  }

  .del-acc-modal {
    padding: 22px 16px 18px;
    border-radius: 20px;
    gap: 13px;
    max-height: calc(100dvh - 24px);
  }

  .del-acc-head h3 {
    font-size: 1.15rem;
  }

  .del-acc-code-row {
    flex-direction: column;
  }

  .del-acc-send-btn {
    width: 100%;
    height: 44px;
  }

  .del-acc-actions {
    flex-direction: column-reverse;
  }

  .del-acc-cancel,
  .del-acc-submit {
    width: 100%;
    flex: none;
    height: 48px;
  }
}
