/* =========================================
   SHAHINAZ ULTRA v9.0 — NEBULA DESIGN SYSTEM
   Edge-to-Edge OLED • Ambient Cover • SVG UI
   Segmented Friends Hub • Clean Chats • Light/Dark
========================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #a875ff;
  --primary-2: #7c3aed;
  --accent: #ff477e;
  --green: #22c55e;
  --grad: linear-gradient(135deg, #a855f7, #ec4899);
  --grad-story: linear-gradient(135deg, #f59e0b, #ec4899, #8b5cf6);

  --bg: #050508;
  --bg-elev: #0f0f15;
  --card: #111118;
  --card-soft: #181822;
  --glass: rgba(9, 9, 14, 0.82);
  --text: #f7f7fc;
  --text-soft: #c9cadb;
  --muted: #7f8198;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(168, 117, 255, 0.35);
  --hairline: rgba(255, 255, 255, 0.065);
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.42);

  --bubble-mine: linear-gradient(135deg, #8b5cf6, #ec4899);
  --bubble-theirs: #1c1c27;
  --bubble-theirs-text: #f7f7fc;

  --radius: 18px;
  --font: "Cairo", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

[data-theme="light"] {
  --bg: #ffffff;
  --bg-elev: #f7f8fb;
  --card: #ffffff;
  --card-soft: #f1f2f6;
  --glass: rgba(255, 255, 255, 0.88);
  --text: #10111a;
  --text-soft: #3c3e52;
  --muted: #73768c;
  --border: rgba(16, 17, 26, 0.09);
  --border-strong: rgba(124, 58, 237, 0.32);
  --hairline: rgba(16, 17, 26, 0.07);
  --shadow: 0 8px 24px rgba(16, 17, 26, 0.06);

  --bubble-theirs: #eff1f7;
  --bubble-theirs-text: #10111a;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  width: 100%;
  max-width: 100%;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  padding-bottom: 96px;
  overflow-x: clip;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.25s ease, color 0.25s ease;
}

button,
input,
textarea {
  font-family: inherit;
  color: inherit;
}

button {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  transition: transform 0.15s ease, background 0.2s ease, opacity 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

[hidden] {
  display: none !important;
}

img,
video {
  max-width: 100%;
  display: block;
}

svg {
  flex-shrink: 0;
}

#loading {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.splash-logo {
  font-size: 38px;
  font-weight: 900;
  letter-spacing: -1px;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.splash-sub {
  font-size: 10px;
  letter-spacing: 3.5px;
  color: var(--muted);
  font-weight: 800;
  margin-top: -8px;
  margin-bottom: 8px;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

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

.app-header {
  position: sticky;
  top: 0;
  z-index: 200;
  height: 58px;
  width: 100%;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--glass);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-bottom: 1px solid var(--hairline);
}

.header-brand {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.app-header h1 {
  font-size: 23px;
  font-weight: 900;
  letter-spacing: -0.5px;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.header-email {
  font-size: 12px;
  color: var(--muted);
  max-width: 145px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--card-soft);
  color: var(--text-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-btn svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-btn:active {
  transform: scale(0.9);
}

.icon-btn-danger {
  color: var(--accent);
  background: rgba(255, 71, 126, 0.1);
}

.pill-search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 14px;
  border-radius: 99px;
  background: var(--card-soft);
  border: 1px solid var(--border);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.pill-search:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(168, 117, 255, 0.14);
}

.pill-search .search-svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pill-search input {
  flex: 1;
  height: 100%;
  padding: 0;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 13.5px;
  color: var(--text);
}

.search-go-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.search-go-btn svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#auth {
  min-height: calc(100dvh - 60px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 26px;
  padding: 30px 22px;
  box-shadow: var(--shadow);
}

.auth-badge {
  width: fit-content;
  margin: 0 auto 10px;
  padding: 4px 14px;
  border-radius: 99px;
  background: rgba(168, 117, 255, 0.12);
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
}

.auth-card h2 {
  text-align: center;
  font-size: 28px;
  font-weight: 900;
}

.subtitle {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin: 6px 0 22px;
}

.tabs {
  display: flex;
  gap: 5px;
  background: var(--card-soft);
  padding: 4px;
  border-radius: 14px;
  margin-bottom: 18px;
}

.tabs button {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 700;
}

.tabs button.active {
  background: var(--grad);
  color: #fff;
}

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-soft);
}

input,
textarea {
  width: 100%;
  min-width: 0;
  padding: 11px 14px;
  border-radius: 13px;
  background: var(--card-soft);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
}

input:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(168, 117, 255, 0.14);
}

.btn-primary {
  width: 100%;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--grad);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  box-shadow: 0 6px 20px rgba(168, 85, 247, 0.28);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-soft {
  padding: 10px 14px;
  border-radius: 13px;
  background: var(--card-soft);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
}

.btn-soft-sm {
  padding: 6px 12px;
  border-radius: 10px;
  background: var(--card-soft);
  border: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
}

.btn-danger-sm {
  padding: 6px 12px;
  border-radius: 10px;
  background: rgba(255, 71, 126, 0.12);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.auth-message {
  text-align: center;
  margin-top: 14px;
  font-size: 13px;
  min-height: 20px;
}

#feedArea,
.panel,
.profile-shell,
.chats-shell {
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
}

#feedArea,
.panel {
  padding: 10px 12px;
}

.profile-shell {
  padding: 0 0 24px;
  animation: fadeUp 0.22s ease;
}

.prof-hero {
  position: relative;
  width: 100%;
  height: 140px;
  overflow: hidden;
  background:
    radial-gradient(circle at 25% 25%, rgba(168, 85, 247, 0.45), transparent 55%),
    radial-gradient(circle at 80% 40%, rgba(236, 72, 153, 0.35), transparent 55%),
    var(--bg-elev);
}

.prof-banner {
  position: absolute;
  inset: -24px;
  background-size: cover;
  background-position: center;
  filter: blur(28px) saturate(1.45) brightness(0.75);
  transform: scale(1.12);
  opacity: 0.72;
  transition: background-image 0.4s ease;
}

[data-theme="light"] .prof-banner {
  filter: blur(32px) saturate(1.25) brightness(1.05);
  opacity: 0.48;
}

.prof-banner-fade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(5, 5, 8, 0.08) 0%, var(--bg) 100%);
}

[data-theme="light"] .prof-banner-fade {
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.05) 0%, var(--bg) 100%);
}

.prof-main-head {
  position: relative;
  margin-top: -54px;
  padding: 0 18px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.prof-avatar-stage {
  position: relative;
  margin-bottom: 10px;
}

.prof-avatar-ring {
  width: 102px;
  height: 102px;
  padding: 3px;
  border-radius: 50%;
  background: var(--grad-story);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

.profile-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 3.5px solid var(--bg);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card-soft);
  font-size: 36px;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.prof-online-badge {
  position: absolute;
  bottom: 5px;
  left: 5px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--green);
  border: 3px solid var(--bg);
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.65);
}

.prof-name-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.prof-name {
  font-size: 21px;
  font-weight: 900;
  color: var(--text);
  line-height: 1.25;
}

.verified-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.verified-check svg {
  width: 11px;
  height: 11px;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.prof-handle {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-top: 2px;
  unicode-bidi: isolate;
}

.prof-bio {
  margin-top: 8px;
  max-width: 340px;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text-soft);
  white-space: pre-wrap;
}

.prof-stats-bar {
  width: 100%;
  max-width: 360px;
  margin-top: 16px;
  padding: 10px 6px;
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  border-radius: 18px;
  background: var(--card-soft);
  border: 1px solid var(--hairline);
}

.prof-stat-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 2px 4px;
  border-radius: 12px;
}

.prof-stat-item:active {
  background: rgba(255, 255, 255, 0.05);
}

.prof-stat-item strong {
  font-size: 18px;
  font-weight: 900;
  color: var(--text);
  line-height: 1.2;
}

.prof-stat-item span {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.stat-sep {
  width: 1px;
  height: 24px;
  background: var(--border);
}

.prof-cta-row {
  width: 100%;
  max-width: 360px;
  margin-top: 14px;
  display: flex;
  gap: 8px;
}

.prof-btn-primary,
.prof-btn-secondary {
  flex: 1;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
}

.prof-btn-primary {
  background: var(--text);
  color: var(--bg);
}

.prof-btn-secondary {
  background: var(--card-soft);
  color: var(--text);
  border: 1px solid var(--border);
}

.prof-btn-primary svg,
.prof-btn-secondary svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.prof-btn-primary:active,
.prof-btn-secondary:active {
  transform: scale(0.96);
}

.sh-edit-form {
  margin: 0 14px 16px;
  padding: 16px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 20px;
  animation: fadeUp 0.2s ease;
}

.sh-edit-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.sh-edit-heading h3 {
  font-size: 15px;
  font-weight: 800;
}

.upload-label {
  display: block;
  text-align: center;
  cursor: pointer;
  margin-top: 8px;
}

#avatarPreview img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  margin: 8px auto;
  border: 2px solid var(--primary);
}

.prof-tabs {
  display: flex;
  width: 100%;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  background: var(--bg);
  position: sticky;
  top: 58px;
  z-index: 50;
}

.prof-tabs button {
  flex: 1;
  padding: 11px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--muted);
  position: relative;
}

.prof-tabs button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.prof-tabs button span {
  font-size: 10.5px;
  font-weight: 700;
}

.prof-tabs button.active {
  color: var(--text);
}

.prof-tabs button.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 18%;
  width: 64%;
  height: 2.5px;
  border-radius: 99px;
  background: var(--grad);
}

.tab-icon-wrap {
  position: relative;
  display: inline-flex;
}

.tab-dot-badge {
  position: absolute;
  top: -5px;
  left: -9px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 99px;
  background: var(--accent);
  color: #fff;
  font-size: 9.5px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.prof-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px;
  margin-top: 2px;
}

.sh-profile-post {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--card-soft);
  cursor: pointer;
}

.sh-profile-post img,
.sh-profile-post video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sh-profile-text {
  height: 100%;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text-soft);
  background: linear-gradient(145deg, rgba(168, 117, 255, 0.14), var(--bg-elev));
  overflow: hidden;
}

.sh-grid-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.48);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 700;
  opacity: 0;
  transition: opacity 0.2s;
}

.sh-profile-post:hover .sh-grid-overlay {
  opacity: 1;
}

.profile-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  padding: 46px 14px;
  font-size: 13px;
}

.prof-friends-hub {
  padding: 14px 14px 10px;
}

.seg-control {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: var(--card-soft);
  margin-bottom: 14px;
}

.seg-btn {
  flex: 1;
  height: 36px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.seg-btn.active {
  background: var(--bg);
  color: var(--text);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
}

.seg-badge {
  padding: 0 6px;
  height: 17px;
  border-radius: 99px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
}

.discover-search {
  margin-bottom: 12px;
}

.clean-list-wrap {
  display: flex;
  flex-direction: column;
}

.user-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 2px;
  border-bottom: 1px solid var(--hairline);
}

.user-row:last-child {
  border-bottom: 0;
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-info strong {
  display: block;
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-info small {
  display: block;
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.user-row button {
  height: 33px;
  padding: 0 14px;
  border-radius: 99px;
  background: var(--text);
  color: var(--bg);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.user-row button.secondary {
  background: var(--card-soft);
  color: var(--muted);
  border: 1px solid var(--border);
}

.user-row button.danger {
  background: rgba(255, 71, 126, 0.12);
  color: var(--accent);
}

.chats-shell {
  padding: 12px 0 24px;
  animation: fadeUp 0.2s ease;
}

.chats-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 12px;
}

.chats-top-bar h2 {
  font-size: 22px;
  font-weight: 900;
}

.ghost-pill-btn {
  height: 34px;
  padding: 0 12px;
  border-radius: 99px;
  background: var(--card-soft);
  color: var(--text-soft);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
}

.ghost-pill-btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chats-search-wrap {
  padding: 0 14px 12px;
}

.online-strip-section {
  padding: 4px 14px 14px;
  border-bottom: 1px solid var(--hairline);
}

.online-strip {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scrollbar-width: none;
}

.online-strip::-webkit-scrollbar {
  display: none;
}

.online-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 60px;
  cursor: pointer;
}

.online-chip span {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-soft);
  max-width: 62px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clean-conv-list {
  display: flex;
  flex-direction: column;
}

.conversation-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--hairline);
  cursor: pointer;
  transition: background 0.16s;
}

.conversation-row:active {
  background: var(--card-soft);
}

.conversation-row .avatar {
  width: 50px;
  height: 50px;
}

.conversation-info {
  flex: 1;
  min-width: 0;
}

.conversation-info strong {
  display: block;
  font-size: 14.5px;
  font-weight: 800;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-info p {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
}

.conversation-info p.unread-preview {
  color: var(--text);
  font-weight: 700;
}

.conversation-meta {
  text-align: left;
  font-size: 11px;
  color: var(--muted);
  flex-shrink: 0;
}

.unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--grad);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  margin-top: 4px;
}

.stories {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  overflow-x: auto;
  padding: 10px 2px 14px;
  scrollbar-width: none;
}

.stories::-webkit-scrollbar {
  display: none;
}

.story-loading {
  color: var(--muted);
  font-size: 13px;
  padding: 10px;
}

.story {
  min-width: 72px;
  max-width: 72px;
  text-align: center;
  cursor: pointer;
  flex-shrink: 0;
}

.story-ring {
  width: 68px;
  height: 68px;
  padding: 2.5px;
  margin: 0 auto 6px;
  border-radius: 50%;
  background: var(--grad-story);
  transition: transform 0.2s ease;
}

.story:active .story-ring {
  transform: scale(0.92);
}

.story-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--bg);
  background: var(--card-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.story-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story-add .story-ring {
  background: var(--grad);
}

.story-add .story-avatar {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
}

.story-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar-wrap {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}

.avatar {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card-soft);
  border: 1px solid var(--border);
  font-size: 19px;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.online-dot {
  position: absolute;
  bottom: 1px;
  left: 1px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--green);
  border: 2.5px solid var(--bg);
}

.composer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  background: var(--bg-elev);
  border: 1px solid var(--hairline);
  border-radius: 18px;
}

.composer-trigger {
  flex: 1;
  min-width: 0;
  text-align: right;
  padding: 9px 14px;
  border-radius: 99px;
  background: var(--card-soft);
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-media-btn {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--card-soft);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.composer-media-btn svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.createbox {
  margin-bottom: 14px;
  padding: 16px;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  animation: fadeUp 0.2s ease;
}

.createbox-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.createbox-head h3 {
  font-size: 15px;
  color: var(--text);
}

.close-mini {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--card-soft);
  color: var(--muted);
  font-size: 14px;
}

.createbox textarea {
  min-height: 92px;
  resize: vertical;
}

.createbox .actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.createbox .actions button {
  flex: 1;
  min-width: 90px;
}

#preview {
  margin-top: 10px;
  overflow: hidden;
  border-radius: 14px;
  background: #000;
}

#preview img,
#preview video {
  width: 100%;
  max-height: 340px;
  object-fit: contain;
  margin: 0 auto;
  transition: filter 0.18s ease, transform 0.2s ease;
}

.photo-editor {
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  background: var(--card-soft);
  border: 1px solid var(--hairline);
}

.editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 10px;
  color: var(--text-soft);
}

.compression-badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 99px;
  background: rgba(34, 197, 94, 0.14);
  color: var(--green);
}

.filter-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
}

.filter-strip::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  padding: 6px 12px;
  border-radius: 99px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}

.filter-chip.active {
  background: var(--grad);
  color: #fff;
  border-color: transparent;
}

.editor-sliders {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.editor-sliders label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-soft);
}

.editor-sliders label span {
  min-width: 60px;
}

.editor-sliders input[type="range"] {
  padding: 0;
  height: 6px;
  accent-color: var(--primary);
}

.editor-mini-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.feed-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.feed-tabs {
  display: flex;
  gap: 6px;
}

.feed-tab {
  flex: 1;
  padding: 7px 6px;
  border-radius: 99px;
  background: var(--card-soft);
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
}

.feed-tab.active {
  background: var(--text);
  color: var(--bg);
}

.feed-search-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
}

.icon-btn-sm {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--card-soft);
  border: 1px solid var(--border);
  color: var(--text-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-btn-sm svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.post {
  position: relative;
  background: var(--bg-elev);
  border: 1px solid var(--hairline);
  border-radius: 20px;
  margin-bottom: 14px;
  animation: fadeUp 0.22s ease;
}

.posthead {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
}

.post-author {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.post-author strong {
  display: block;
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  overflow-wrap: anywhere;
}

.post-author small {
  display: block;
  font-size: 11px;
  color: var(--muted);
}

.post-menu-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 19px;
}

.post-menu-btn:hover {
  background: var(--card-soft);
}

.post-menu {
  position: absolute;
  top: 52px;
  left: 14px;
  z-index: 60;
  width: 185px;
  padding: 6px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.55);
}

.post-menu button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 10px;
  text-align: right;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.post-menu button:hover {
  background: var(--card-soft);
}

.post-menu button.menu-danger {
  color: var(--accent);
}

.posttext {
  padding: 0 15px 13px;
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.hashtag {
  color: var(--primary);
  font-weight: 700;
  cursor: pointer;
}

.post-link {
  color: #38bdf8;
  text-decoration: underline;
  word-break: break-all;
}

.post-media-wrap {
  position: relative;
  background: #000;
  overflow: hidden;
  cursor: pointer;
}

.postimage,
.postvideo {
  width: 100%;
  max-height: 580px;
  object-fit: contain;
  margin: 0 auto;
}

.reel-badge-overlay {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 3px 10px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.68);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  backdrop-filter: blur(6px);
}

.double-tap-heart {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 82px;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.4);
}

.double-tap-heart.burst {
  animation: heartBurst 0.72s ease forwards;
}

@keyframes heartBurst {
  0% { opacity: 0; transform: scale(0.3); }
  25% { opacity: 1; transform: scale(1.18); }
  55% { opacity: 1; transform: scale(0.95); }
  100% { opacity: 0; transform: scale(1.3); }
}

.postactions {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 10px;
  border-top: 1px solid var(--hairline);
}

.postactions > button {
  flex: 1;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: 10px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 700;
}

.postactions > button:hover {
  background: var(--card-soft);
}

.postactions > button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.postactions > button.bookmark-btn,
.postactions > button.react-picker-trigger {
  flex: 0 0 38px;
}

.postactions > button.saved {
  color: #f59e0b;
}

.postactions > button.saved svg {
  fill: currentColor;
}

.postactions > button.liked {
  color: var(--accent);
}

.reaction-popover {
  position: absolute;
  bottom: 48px;
  right: 12px;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border-radius: 99px;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
  animation: fadeUp 0.16s ease;
}

.reaction-popover button {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 19px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reaction-popover button:hover {
  transform: scale(1.26);
  background: var(--card-soft);
}

.post-highlight {
  outline: 2px solid var(--primary);
  box-shadow: 0 0 28px rgba(168, 117, 255, 0.45);
}

.comments {
  padding: 8px 14px 13px;
  border-top: 1px solid var(--hairline);
}

.comment-toggle-btn {
  width: 100%;
  text-align: right;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 8px;
}

.comments-list.collapsed {
  display: none;
}

.comment {
  display: flex;
  gap: 9px;
  margin-bottom: 8px;
  padding: 8px 11px;
  border-radius: 14px;
  background: var(--card-soft);
}

.comment .avatar {
  width: 30px;
  height: 30px;
  font-size: 13px;
}

.comment-body {
  flex: 1;
  min-width: 0;
}

.comment-body strong {
  display: block;
  font-size: 12.5px;
  color: var(--text);
  cursor: pointer;
}

.comment-body p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-soft);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.comment-body small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 2px;
}

.comment-form {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.comment-form input {
  flex: 1;
  border-radius: 99px;
  padding: 8px 14px;
  font-size: 13px;
}

.comment-form button {
  padding: 0 15px;
  border-radius: 99px;
  background: var(--text);
  color: var(--bg);
  font-weight: 700;
  font-size: 12.5px;
}

.reels-panel {
  position: fixed;
  inset: 58px 0 80px 0;
  z-index: 150;
  background: #000;
  display: flex;
  flex-direction: column;
}

.reels-topbar {
  position: absolute;
  top: 12px;
  left: 14px;
  right: 14px;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.reels-topbar h2 {
  font-size: 19px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.reel-upload-btn {
  pointer-events: auto;
  padding: 6px 14px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(12px);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.reels-container {
  flex: 1;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
}

.reels-container::-webkit-scrollbar {
  display: none;
}

.reel-slide {
  position: relative;
  width: 100%;
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.reel-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.reel-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.78) 0%, transparent 40%, rgba(0, 0, 0, 0.32) 100%);
  pointer-events: none;
}

.reel-side-actions {
  position: absolute;
  left: 12px;
  bottom: 24px;
  z-index: 25;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.reel-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: #fff;
  font-size: 24px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.reel-action-btn span {
  font-size: 11px;
  font-weight: 800;
}

.reel-action-btn.liked { color: var(--accent); }
.reel-action-btn.saved { color: #f59e0b; }

.reel-info-bottom {
  position: absolute;
  right: 14px;
  left: 74px;
  bottom: 22px;
  z-index: 25;
  color: #fff;
}

.reel-author-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 8px;
  cursor: pointer;
}

.reel-author-row .avatar {
  width: 38px;
  height: 38px;
  border-color: #fff;
}

.reel-caption {
  font-size: 13px;
  line-height: 1.6;
  color: #f1f1f7;
  max-height: 70px;
  overflow-y: auto;
}

.reels-empty {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 28px;
  text-align: center;
  color: #d5d5e4;
}

body.in-chat {
  overflow: hidden;
  padding-bottom: 0;
}

body.in-chat .app-header,
body.in-chat .bottom {
  display: none !important;
}

.chat-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 500;
  width: 100%;
  max-width: 100%;
  height: 100dvh;
  margin: 0;
  padding: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  animation: chatSlideIn 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

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

@media (min-width: 720px) {
  .chat-fullscreen {
    max-width: 680px;
    left: 50%;
    transform: translateX(-50%);
    border-inline: 1px solid var(--hairline);
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.5);
  }
}

.chat-v10-header {
  flex-shrink: 0;
  height: calc(60px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 10px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--glass);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--hairline);
  z-index: 20;
}

.chat-hdr-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-hdr-btn:hover,
.chat-hdr-btn:active {
  background: var(--card-soft);
}

.chat-hdr-btn svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-hdr-user {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.chat-hdr-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.chat-hdr-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--card-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.chat-hdr-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-hdr-dot {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--green);
  border: 2px solid var(--bg);
}

.chat-hdr-meta {
  flex: 1;
  min-width: 0;
}

.chat-hdr-meta h3 {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.25;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.presence-text {
  display: block;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.2;
}

.presence-text.online {
  color: var(--green);
  font-weight: 700;
}

.ig-chat-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.chat-v10-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-anchor: none;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 14px 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  background:
    radial-gradient(circle at 12% 18%, rgba(168, 85, 247, 0.06), transparent 42%),
    radial-gradient(circle at 88% 82%, rgba(236, 72, 153, 0.05), transparent 42%),
    var(--bg);
  scroll-behavior: auto;
}

.msg-row {
  display: flex;
  flex-direction: column;
  max-width: min(80%, 340px);
  position: relative;
}

.msg-row.mine {
  align-self: flex-start;
  align-items: flex-start;
}

.msg-row.theirs {
  align-self: flex-end;
  align-items: flex-end;
}

.chat-message {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  width: fit-content;
  max-width: 100%;
  padding: 8px 13px 6px;
  border-radius: 20px;
  font-size: var(--chat-msg-size, 14.5px);
  line-height: 1.48;
  overflow-wrap: anywhere;
  white-space: normal;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  transition: transform 0.14s ease;
  animation: fadeUp 0.16s ease;
}

.chat-message.pressing {
  transform: scale(0.95);
}

.msg-text {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.48;
}

.chat-mine {
  background: var(--bubble-mine);
  color: #fff;
  border-bottom-right-radius: 6px;
}

.chat-theirs {
  background: var(--bubble-theirs);
  color: var(--bubble-theirs-text);
  border-bottom-left-radius: 6px;
}

.chat-message small {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 3px;
  font-size: 9.5px;
  line-height: 1.1;
  opacity: 0.76;
}

.read-status.read {
  color: #67e8f9;
  font-weight: 800;
}

.reply-quote {
  padding: 5px 9px;
  margin-bottom: 5px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
  border-right: 2.5px solid rgba(255, 255, 255, 0.75);
  font-size: 11.5px;
  line-height: 1.4;
}

.chat-theirs .reply-quote {
  background: rgba(168, 117, 255, 0.12);
  border-right-color: var(--primary);
}

.reply-quote strong {
  display: block;
  font-size: 11px;
  opacity: 0.92;
}

.msg-reaction-float {
  margin-top: -10px;
  margin-inline: 10px;
  z-index: 3;
  padding: 1px 7px;
  border-radius: 99px;
  background: var(--bg-elev);
  border: 1.5px solid var(--bg);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.32);
  font-size: 13px;
  line-height: 1.35;
}

.chat-media {
  width: 100%;
  max-width: 240px;
  max-height: 290px;
  object-fit: cover;
  border-radius: 14px;
  cursor: pointer;
}

.voice-player {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 195px;
  max-width: 240px;
  padding: 3px 2px;
}

.voice-play-btn {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chat-theirs .voice-play-btn {
  background: var(--grad);
  color: #fff;
}

.voice-play-btn svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.voice-track-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.voice-progress-bg {
  width: 100%;
  height: 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.28);
  overflow: hidden;
  cursor: pointer;
}

.chat-theirs .voice-progress-bg {
  background: var(--border);
}

.voice-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: #fff;
  transition: width 0.1s linear;
}

.chat-theirs .voice-progress-fill {
  background: var(--primary);
}

.voice-time {
  font-size: 10px;
  opacity: 0.85;
  direction: ltr;
  text-align: right;
}

.typing-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 16px 6px;
  font-size: 12px;
  color: var(--primary);
  background: var(--bg);
}

.typing-dots {
  display: inline-flex;
  gap: 3px;
}

.typing-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary);
  animation: bounceDot 1.2s infinite ease-in-out;
}

.typing-dots i:nth-child(2) { animation-delay: 0.18s; }
.typing-dots i:nth-child(3) { animation-delay: 0.36s; }

@keyframes bounceDot {
  0%, 80%, 100% { transform: scale(0.5); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

.chat-status-pill {
  margin: 2px auto 6px;
  padding: 4px 14px;
  border-radius: 99px;
  background: var(--card-soft);
  color: var(--primary);
  font-size: 11.5px;
  font-weight: 700;
}

.chat-v10-dock {
  flex-shrink: 0;
  position: relative;
  padding: 8px 10px calc(10px + env(safe-area-inset-bottom));
  background: var(--glass);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-top: 1px solid var(--hairline);
}

.reply-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  margin-bottom: 8px;
  border-radius: 14px;
  background: var(--card-soft);
  border-right: 3px solid var(--primary);
}

.reply-banner-body {
  flex: 1;
  min-width: 0;
}

.reply-banner-body strong {
  display: block;
  font-size: 11px;
  color: var(--primary);
}

.reply-banner-body p {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attach-sheet {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 14px 10px;
  margin-bottom: 10px;
  border-radius: 22px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.42);
  animation: fadeUp 0.18s ease;
}

.attach-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-soft);
}

.attach-tile small {
  font-size: 11.5px;
  font-weight: 700;
}

.attach-circle {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28);
  transition: transform 0.16s ease;
}

.attach-tile:active .attach-circle {
  transform: scale(0.9);
}

.attach-circle svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.attach-photo { background: linear-gradient(135deg, #8b5cf6, #6366f1); }
.attach-video { background: linear-gradient(135deg, #ec4899, #f43f5e); }
.attach-camera { background: linear-gradient(135deg, #06b6d4, #3b82f6); }
.attach-voice { background: linear-gradient(135deg, #f59e0b, #ef4444); }

.chat-v10-composer {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 48px;
  padding: 4px 5px;
  border-radius: 99px;
  background: var(--card-soft);
  border: 1px solid var(--border);
}

.chat-v10-composer:focus-within {
  border-color: var(--border-strong);
}

.composer-plus-btn {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--bg-elev);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.22s ease, background 0.2s ease, color 0.2s ease;
}

.composer-plus-btn.open {
  transform: rotate(45deg);
  background: var(--grad);
  color: #fff;
}

.composer-plus-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.3;
  stroke-linecap: round;
}

.chat-v10-composer input {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 8px;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 14.5px;
  color: var(--text);
}

.composer-mic-btn,
.composer-send-btn {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.composer-mic-btn {
  color: var(--text-soft);
  background: transparent;
}

.composer-mic-btn:active {
  background: var(--bg-elev);
  transform: scale(0.92);
}

.composer-send-btn {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 4px 14px rgba(168, 85, 247, 0.35);
  animation: popIn 0.16s ease;
}

@keyframes popIn {
  from { transform: scale(0.7); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.composer-mic-btn svg,
.composer-send-btn svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.record-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: 48px;
  padding: 4px 6px;
  border-radius: 99px;
  background: rgba(255, 71, 126, 0.12);
  border: 1px solid rgba(255, 71, 126, 0.35);
  animation: fadeUp 0.16s ease;
}

.record-cancel-btn,
.record-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.record-cancel-btn {
  background: rgba(255, 71, 126, 0.16);
  color: var(--accent);
}

.record-send-btn {
  background: var(--grad);
  color: #fff;
}

.record-cancel-btn svg,
.record-send-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.record-live-info {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
}

.record-red-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ef4444;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  50% { opacity: 0.35; }
}

.record-wave {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 18px;
}

.record-wave i {
  width: 3px;
  height: 8px;
  border-radius: 99px;
  background: var(--accent);
  animation: waveBar 0.8s infinite ease-in-out;
}

.record-wave i:nth-child(2) { animation-delay: 0.12s; }
.record-wave i:nth-child(3) { animation-delay: 0.24s; }
.record-wave i:nth-child(4) { animation-delay: 0.36s; }
.record-wave i:nth-child(5) { animation-delay: 0.48s; }

@keyframes waveBar {
  0%, 100% { height: 5px; }
  50% { height: 18px; }
}

.msg-ctx-overlay {
  position: fixed;
  inset: 0;
  z-index: 99992;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.16s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.msg-ctx-sheet {
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: ctxPop 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes ctxPop {
  from { opacity: 0; transform: scale(0.9) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.msg-ctx-preview {
  padding: 10px 14px;
  border-radius: 18px;
  background: var(--card-soft);
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.5;
  max-height: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid var(--border);
  text-align: right;
}

.msg-ctx-reactions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 99px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.msg-ctx-reactions button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 23px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.msg-ctx-reactions button:active,
.msg-ctx-reactions button.active-emoji {
  background: rgba(168, 117, 255, 0.22);
  transform: scale(1.2);
}

.msg-ctx-actions {
  border-radius: 20px;
  overflow: hidden;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.48);
  display: flex;
  flex-direction: column;
}

.msg-ctx-actions button {
  width: 100%;
  padding: 13px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  border-bottom: 1px solid var(--hairline);
}

.msg-ctx-actions button:last-child {
  border-bottom: 0;
}

.msg-ctx-actions button:active {
  background: var(--card-soft);
}

.msg-ctx-actions button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.msg-ctx-actions button.ctx-danger {
  color: var(--accent);
}
.story-viewer {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(0, 0, 0, 0.94);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.story-viewer-box {
  position: relative;
  width: 100%;
  max-width: 440px;
  height: min(90dvh, 800px);
  background: #0b0b10;
  border-radius: 22px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.story-progress {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  z-index: 20;
  display: flex;
  gap: 4px;
  height: 3px;
}

.story-progress-item {
  flex: 1;
  height: 100%;
  background: rgba(255, 255, 255, 0.28);
  border-radius: 99px;
  overflow: hidden;
}

.story-progress-fill {
  height: 100%;
  width: 0%;
  background: #fff;
  border-radius: 99px;
}

.story-viewer-header {
  position: absolute;
  top: 20px;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 14px;
  color: #fff;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), transparent);
}

.story-viewer-user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
}

.story-viewer-user img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
}

.story-views {
  font-size: 11px;
  background: rgba(255, 255, 255, 0.16);
  padding: 2px 8px;
  border-radius: 99px;
}

.story-header-btns {
  display: flex;
  gap: 8px;
}

.story-header-btns button {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 15px;
}

.story-media-box {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

.story-media-box img,
.story-media-box video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.story-tap-zone {
  position: absolute;
  top: 76px;
  bottom: 58px;
  width: 32%;
  z-index: 15;
}

.story-tap-prev { right: 0; }
.story-tap-next { left: 0; }

.story-viewer-actions {
  display: flex;
  justify-content: space-between;
  padding: 10px 14px;
  background: #101018;
  z-index: 20;
}

.story-viewer-actions button {
  padding: 7px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.bottom {
  position: fixed;
  z-index: 300;
  bottom: calc(8px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: min(calc(100% - 18px), 520px);
  height: 64px;
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.bottom button {
  flex: 1;
  height: 52px;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--muted);
}

.bottom button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bottom button small {
  font-size: 9.5px;
  font-weight: 700;
}

.bottom button.active {
  color: var(--text);
  background: rgba(168, 117, 255, 0.14);
}

.bottom button.active svg {
  color: var(--primary);
}

.bottom .create-icon {
  width: 38px;
  height: 38px;
  border-radius: 13px;
  background: var(--grad);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(168, 85, 247, 0.36);
}

.bottom .create-icon svg {
  stroke: #fff;
  stroke-width: 2.5;
}

.toast {
  position: fixed;
  top: 68px;
  left: 50%;
  transform: translate(-50%, -14px);
  opacity: 0;
  z-index: 99999;
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 99px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 99995;
  background: rgba(0, 0, 0, 0.94);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.lightbox img {
  max-width: 96vw;
  max-height: 90dvh;
  border-radius: 14px;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 19px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 99990;
  background: rgba(0, 0, 0, 0.74);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.modal-box {
  width: 100%;
  max-width: 460px;
  max-height: 88dvh;
  overflow-y: auto;
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 26px;
  padding: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.modal-close {
  float: left;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--card-soft);
  color: var(--text);
  font-size: 16px;
}

.public-profile-head {
  text-align: center;
  padding: 10px 0 14px;
}

.public-profile-avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  margin: 0 auto 10px;
  overflow: hidden;
  border: 3px solid var(--primary);
  background: var(--card-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}

.public-profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.public-profile-actions {
  display: flex;
  gap: 8px;
  margin: 10px 0 16px;
}

.public-profile-actions button {
  flex: 1;
}

.public-post-item {
  background: var(--card-soft);
  border-radius: 14px;
  padding: 11px;
  margin-top: 10px;
}

.public-post-item img,
.public-post-item video {
  width: 100%;
  border-radius: 10px;
  margin-top: 8px;
}

.status,
.empty {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 16px 10px;
}

#fatal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: var(--bg);
  color: var(--text);
  padding: 32px 20px;
}

#error {
  color: var(--accent);
  margin-top: 12px;
}

@media (max-width: 520px) {
  .app-header {
    padding: 0 12px;
  }

  .app-header h1 {
    font-size: 20px;
  }

  .header-email {
    display: none;
  }

  #feedArea,
  .panel {
    padding: 8px;
  }

  .story-viewer {
    padding: 0;
  }

  .story-viewer-box {
    max-width: 100%;
    height: 100dvh;
    border-radius: 0;
  }
}

.reel-comments-overlay {
  position: absolute;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.56);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.16s ease;
}

.reel-comments-sheet {
  width: 100%;
  max-width: 560px;
  height: 68%;
  max-height: 540px;
  background: var(--bg-elev);
  color: var(--text);
  border-top: 1px solid var(--border);
  border-radius: 24px 24px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 -14px 40px rgba(0, 0, 0, 0.6);
  animation: sheetSlideUp 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes sheetSlideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.reel-sheet-handle {
  width: 40px;
  height: 4px;
  border-radius: 99px;
  background: var(--border);
  margin: 9px auto 2px;
  flex-shrink: 0;
}

.reel-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px 12px;
  border-bottom: 1px solid var(--hairline);
  flex-shrink: 0;
}

.reel-sheet-head h3 {
  font-size: 15px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
}

.reel-sheet-head h3 span {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  background: var(--card-soft);
  padding: 1px 8px;
  border-radius: 99px;
}

.reel-comments-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.reel-comment-form {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
  background: var(--bg);
  border-top: 1px solid var(--hairline);
}

.reel-comment-form input {
  flex: 1;
  height: 42px;
  border-radius: 99px;
  padding: 0 15px;
  font-size: 13.5px;
  background: var(--card-soft);
  border: 1px solid var(--border);
}

.reel-comment-form button {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.reel-comment-form button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sr-file-input {
  position: fixed !important;
  top: -9999px !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  overflow: hidden !important;
}

.camera-modal {
  position: fixed;
  inset: 0;
  z-index: 99998;
  background: #000;
  color: #fff;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  animation: fadeIn 0.16s ease;
}

.camera-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(12px + env(safe-area-inset-top)) 14px 12px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.72), transparent);
}

.camera-title {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

.camera-icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.camera-icon-btn svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.camera-icon-btn:active {
  transform: scale(0.92);
}

.camera-stage {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #050508;
}

#cameraVideo,
#cameraPreviewImg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#cameraVideo.mirrored {
  transform: scaleX(-1);
}

#cameraPreviewImg {
  object-fit: contain;
  background: #000;
}

.camera-fallback {
  position: relative;
  z-index: 5;
  width: min(90%, 340px);
  padding: 26px 20px;
  border-radius: 24px;
  background: rgba(20, 20, 30, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.camera-fallback-icon {
  font-size: 46px;
  line-height: 1;
}

.camera-fallback h3 {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
}

.camera-fallback p {
  font-size: 13px;
  color: #b8bad0;
  line-height: 1.6;
}

.camera-fallback-btns {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.camera-native-label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  text-align: center;
  cursor: pointer;
}

.camera-controls {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 18px 24px calc(22px + env(safe-area-inset-bottom));
  background: rgba(5, 5, 8, 0.92);
}

.camera-side-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.camera-side-btn svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.camera-side-btn:active {
  transform: scale(0.92);
}

.camera-shutter {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  border: 4px solid #fff;
  padding: 5px;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.camera-shutter span {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.14s ease, background 0.14s ease;
}

.camera-shutter:active span {
  transform: scale(0.86);
  background: var(--primary);
}

.camera-confirm-bar {
  flex-shrink: 0;
  display: flex;
  gap: 10px;
  padding: 14px 16px calc(18px + env(safe-area-inset-bottom));
  background: rgba(10, 10, 16, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.camera-confirm-bar button {
  flex: 1;
}

.post-viewer-modal {
  position: fixed;
  inset: 0;
  z-index: 760;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  height: 100dvh;
  animation: chatSlideIn 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (min-width: 720px) {
  .post-viewer-modal {
    max-width: 680px;
    left: 50%;
    transform: translateX(-50%);
    border-inline: 1px solid var(--hairline);
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.55);
  }
}

.post-viewer-header {
  flex-shrink: 0;
  height: calc(58px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 10px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--glass);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-bottom: 1px solid var(--hairline);
}

.post-viewer-header h3 {
  flex: 1;
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  text-align: center;
}

.post-viewer-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 38px;
  justify-content: flex-end;
}

.post-viewer-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 10px calc(24px + env(safe-area-inset-bottom));
}

.post-viewer-body .post {
  margin-bottom: 0;
}

.nav-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-chat-badge {
  position: absolute;
  top: -5px;
  left: -10px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 99px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg);
  box-shadow: 0 2px 8px rgba(255, 71, 126, 0.45);
}

.pub-profile-shell {
  position: fixed;
  inset: 0;
  z-index: 750;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  height: 100dvh;
  animation: chatSlideIn 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (min-width: 720px) {
  .pub-profile-shell {
    max-width: 680px;
    left: 50%;
    transform: translateX(-50%);
    border-inline: 1px solid var(--hairline);
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.55);
  }
}

.pub-profile-topbar {
  flex-shrink: 0;
  height: calc(56px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 10px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--glass);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-bottom: 1px solid var(--hairline);
  z-index: 15;
}

.pub-profile-topbar h3 {
  flex: 1;
  font-size: 16px;
  font-weight: 800;
  text-align: center;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pub-block-btn {
  color: var(--accent);
}

.pub-block-btn.is-blocked {
  background: rgba(255, 71, 126, 0.16);
}

.pub-profile-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-bottom: calc(28px + env(safe-area-inset-bottom));
}

.pub-profile-scroll .prof-tabs {
  top: 0;
}

.pub-blocked-banner {
  margin: 18px 16px;
  padding: 20px 16px;
  border-radius: 18px;
  background: var(--card-soft);
  border: 1px solid var(--border);
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.story-reply-dock {
  position: relative;
  z-index: 25;
  padding: 8px 12px 6px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.92), rgba(0, 0, 0, 0.45));
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.story-quick-reacts {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.story-quick-reacts button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  font-size: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, background 0.15s ease;
}

.story-quick-reacts button:active {
  transform: scale(1.28);
  background: rgba(255, 255, 255, 0.28);
}

.story-reply-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.story-reply-form input {
  flex: 1;
  height: 40px;
  border-radius: 99px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: #fff;
  font-size: 13.5px;
}

.story-reply-form input::placeholder {
  color: rgba(255, 255, 255, 0.72);
}

.story-reply-form button {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.story-reply-form button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.story-own-bar {
  position: relative;
  z-index: 25;
  padding: 6px 14px;
  background: rgba(10, 10, 16, 0.9);
  display: flex;
  justify-content: center;
}

.story-viewers-trigger {
  height: 36px;
  padding: 0 16px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.story-viewers-trigger svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.story-viewers-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  max-height: 62%;
  background: var(--bg-elev);
  color: var(--text);
  border-top: 1px solid var(--border);
  border-radius: 22px 22px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 -14px 36px rgba(0, 0, 0, 0.65);
  animation: sheetSlideUp 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.story-viewers-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--hairline);
}

.story-viewers-head h4 {
  font-size: 14.5px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
}

.story-viewers-head h4 span {
  font-size: 11.5px;
  color: var(--muted);
  background: var(--card-soft);
  padding: 1px 8px;
  border-radius: 99px;
}

.story-viewers-list {
  flex: 1;
  min-height: 120px;
  overflow-y: auto;
  padding: 8px 14px 16px;
}

.story-viewer-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 2px;
  border-bottom: 1px solid var(--hairline);
  cursor: pointer;
}

.story-viewer-row:last-child {
  border-bottom: 0;
}

.story-viewer-row strong {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
}

.settings-modal {
  position: fixed;
  inset: 0;
  z-index: 650;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  height: 100dvh;
  animation: chatSlideIn 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (min-width: 720px) {
  .settings-modal {
    max-width: 680px;
    left: 50%;
    transform: translateX(-50%);
    border-inline: 1px solid var(--hairline);
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.55);
  }
}

.settings-header {
  flex-shrink: 0;
  height: calc(58px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 10px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--glass);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-bottom: 1px solid var(--hairline);
}

.settings-header h3 {
  font-size: 16.5px;
  font-weight: 800;
}

.settings-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 14px calc(32px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.settings-group {
  background: var(--bg-elev);
  border: 1px solid var(--hairline);
  border-radius: 20px;
  padding: 16px;
}

.settings-group h4 {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 12px;
}

.settings-toggle-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--hairline);
  cursor: pointer;
}

.settings-toggle-row:last-child {
  border-bottom: 0;
  padding-bottom: 2px;
}

.settings-row-text {
  flex: 1;
  min-width: 0;
}

.settings-row-text strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.settings-row-text small {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}

.switch-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: relative;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 99px;
  background: var(--card-soft);
  border: 1px solid var(--border);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.switch-slider::after {
  content: "";
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease;
}

.switch-input:checked + .switch-slider {
  background: var(--grad);
  border-color: transparent;
}

.switch-input:checked + .switch-slider::after {
  transform: translateX(-20px);
}

.settings-pass-form {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.blocked-list {
  display: flex;
  flex-direction: column;
}

.settings-footer-note {
  text-align: center;
  font-size: 11.5px;
  color: var(--muted);
  padding: 8px 0 4px;
}

.msg-edited-tag {
  font-size: 9px;
  opacity: 0.72;
  font-style: italic;
}

.settings-hint {
  font-size: 12px;
  color: var(--muted);
  margin: -6px 0 12px;
}

.lang-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.lang-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 12px 6px;
  border-radius: 16px;
  background: var(--card-soft);
  border: 1.5px solid var(--border);
  color: var(--text-soft);
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.14s ease;
}

.lang-card:active {
  transform: scale(0.95);
}

.lang-card .lang-flag {
  font-size: 22px;
  line-height: 1;
}

.lang-card strong {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
}

.lang-card small {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.6px;
}

.lang-card.active {
  background: rgba(168, 117, 255, 0.16);
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(168, 117, 255, 0.18);
}

.lang-card.active strong {
  color: var(--primary);
}

.auth-lang-switcher {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--hairline);
}

.lang-pill {
  padding: 5px 12px;
  border-radius: 99px;
  background: var(--card-soft);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.lang-pill.active {
  background: var(--grad);
  border-color: transparent;
  color: #fff;
}

.plain-heading {
  font-size: inherit !important;
  font-weight: inherit !important;
  color: inherit !important;
  background: transparent !important;
  padding: 0 !important;
}

html[dir="ltr"] {
  --font: "Inter", "Cairo", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[dir="ltr"] .back-chevron-btn svg,
html[dir="ltr"] .search-go-btn svg,
html[dir="ltr"] .post-viewer-nav svg {
  transform: scaleX(-1);
}

html[dir="ltr"] .composer-trigger,
html[dir="ltr"] .post-menu button,
html[dir="ltr"] .comment-toggle-btn,
html[dir="ltr"] .msg-ctx-preview {
  text-align: left;
}

html[dir="ltr"] .conversation-meta {
  text-align: right;
}

html[dir="ltr"] .post-menu {
  left: auto;
  right: 14px;
}

html[dir="ltr"] .reaction-popover {
  right: auto;
  left: 12px;
}

html[dir="ltr"] .reel-badge-overlay {
  right: auto;
  left: 10px;
}

html[dir="ltr"] .reel-side-actions {
  left: auto;
  right: 12px;
}

html[dir="ltr"] .reel-info-bottom {
  right: 74px;
  left: 14px;
}

html[dir="ltr"] .online-dot,
html[dir="ltr"] .chat-hdr-dot {
  left: auto;
  right: 1px;
}

html[dir="ltr"] .prof-online-badge {
  left: auto;
  right: 5px;
}

html[dir="ltr"] .nav-chat-badge,
html[dir="ltr"] .tab-dot-badge {
  left: auto;
  right: -10px;
}

html[dir="ltr"] .msg-row.mine {
  align-self: flex-end;
  align-items: flex-end;
}

html[dir="ltr"] .msg-row.theirs {
  align-self: flex-start;
  align-items: flex-start;
}

html[dir="ltr"] .chat-mine {
  border-bottom-right-radius: 6px;
  border-bottom-left-radius: 20px;
}

html[dir="ltr"] .chat-theirs {
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 20px;
}

html[dir="ltr"] .reply-quote {
  border-right: 0;
  border-left: 2.5px solid rgba(255, 255, 255, 0.75);
}

html[dir="ltr"] .chat-theirs .reply-quote {
  border-left-color: var(--primary);
}

html[dir="ltr"] .reply-banner {
  border-right: 0;
  border-left: 3px solid var(--primary);
}

html[dir="ltr"] .voice-time {
  text-align: left;
}

html[dir="ltr"] .switch-slider::after {
  right: auto;
  left: 2px;
}

html[dir="ltr"] .switch-input:checked + .switch-slider::after {
  transform: translateX(20px);
}

html[dir="ltr"] .story-tap-prev {
  right: auto;
  left: 0;
}

html[dir="ltr"] .story-tap-next {
  left: auto;
  right: 0;
}

html[dir="ltr"] .lightbox-close {
  left: auto;
  right: 16px;
}

html[dir="ltr"] .modal-close {
  float: right;
}


button,
a,
input,
textarea,
label,
.story,
.online-chip,
.conversation-row,
.sh-profile-post {
  touch-action: manipulation;
}

.post {
  content-visibility: auto;
  contain-intrinsic-size: auto 390px;
}

.load-more-wrap {
  display: flex;
  justify-content: center;
  padding: 6px 0 18px;
}

.load-more-btn {
  padding: 10px 22px;
  border-radius: 99px;
  background: var(--card-soft);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.load-more-btn:active {
  transform: scale(0.96);
}

.chat-older-wrap {
  display: flex;
  justify-content: center;
  padding: 4px 0 10px;
}

.chat-older-btn {
  padding: 6px 14px;
  border-radius: 99px;
  background: var(--card-soft);
  border: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
}

.settings-group-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.settings-group-head-row h4 {
  margin-bottom: 0;
}

.notif-status-pill {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 99px;
  background: var(--card-soft);
  color: var(--muted);
  border: 1px solid var(--border);
}

.notif-status-pill.granted {
  background: rgba(34, 197, 94, 0.14);
  color: var(--green);
  border-color: rgba(34, 197, 94, 0.3);
}

.notif-status-pill.denied {
  background: rgba(255, 71, 126, 0.12);
  color: var(--accent);
  border-color: rgba(255, 71, 126, 0.3);
}

.settings-notif-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.settings-notif-actions button {
  flex: 1;
  min-width: 135px;
}

.inapp-notif-banner {
  position: fixed;
  top: calc(10px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  width: min(calc(100% - 20px), 440px);
  z-index: 99999;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  border-radius: 18px;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55);
  cursor: pointer;
  animation: bannerDrop 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes bannerDrop {
  from { opacity: 0; transform: translate(-50%, -22px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.inapp-notif-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  flex-shrink: 0;
}

.inapp-notif-text {
  flex: 1;
  min-width: 0;
}

.inapp-notif-text strong {
  display: block;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inapp-notif-text p {
  font-size: 12.5px;
  color: var(--text-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 1px;
}

.avatar-wrap.has-story-ring {
  padding: 2.5px;
  border-radius: 50%;
  background: var(--grad-story);
  cursor: pointer;
  box-shadow: 0 0 14px rgba(236, 72, 153, 0.35);
  transition: transform 0.16s ease;
}

.avatar-wrap.has-story-ring:active {
  transform: scale(0.92);
}

.avatar-wrap.has-story-ring .avatar {
  border: 2.5px solid var(--bg);
}

.prof-avatar-ring {
  background: var(--border);
  cursor: default;
}

.prof-avatar-ring.story-live-ring {
  background: var(--grad-story);
  cursor: pointer;
  box-shadow: 0 0 26px rgba(236, 72, 153, 0.45);
}

.chat-hdr-avatar.chat-has-story {
  padding: 2px;
  background: var(--grad-story);
}

.chat-hdr-avatar.chat-has-story img {
  border-radius: 50%;
  border: 2px solid var(--bg);
}

.chats-top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.group-create-pill {
  background: rgba(168, 117, 255, 0.14);
  border-color: var(--border-strong);
  color: var(--primary);
}

.chats-seg-wrap {
  padding: 0 14px 4px;
}

.group-avatar-badge {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.28), rgba(236, 72, 153, 0.25));
  border: 1px solid var(--border-strong);
  font-size: 21px;
}

.group-count-pill {
  display: inline-block;
  margin-top: 3px;
  padding: 1px 7px;
  border-radius: 99px;
  background: var(--card-soft);
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 700;
}

.group-icon-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.group-icon-opt {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--card-soft);
  border: 1.5px solid var(--border);
  font-size: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.group-icon-opt.active {
  background: rgba(168, 117, 255, 0.2);
  border-color: var(--primary);
  transform: scale(1.06);
}

.group-friend-picker {
  display: flex;
  flex-direction: column;
}

.group-friend-pick-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--hairline);
  cursor: pointer;
}

.group-friend-pick-row:last-child {
  border-bottom: 0;
}

.group-friend-pick-row strong {
  flex: 1;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.group-friend-check {
  width: 22px !important;
  height: 22px !important;
  accent-color: var(--primary);
  cursor: pointer;
}

.group-sender-meta {
  font-size: 11px;
  font-weight: 800;
  color: var(--primary);
  margin: 0 8px 3px;
  cursor: pointer;
}

.group-danger-full {
  width: 100%;
  padding: 13px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 800;
}

.bg-push-status {
  margin-top: 10px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.5;
}

/* =========================================
   v21 GROUP CALL ROOM, EMOJI BAR & DESIGN PICKER
========================================= */

.group-react-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-elev);
  border-top: 1px solid var(--hairline);
}

.group-react-bar button[data-gr-emoji] {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--card-soft);
  font-size: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.group-react-bar button[data-gr-emoji].active-emoji {
  background: rgba(168, 117, 255, 0.25);
  transform: scale(1.15);
}

.group-call-overlay {
  position: fixed;
  inset: 0;
  z-index: 99990;
  background: radial-gradient(circle at top, #22163b, #07070d 75%);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: calc(18px + env(safe-area-inset-top)) 16px calc(26px + env(safe-area-inset-bottom));
}
.group-call-overlay.minimized {
  inset: auto;
  top: calc(68px + env(safe-area-inset-top));
  left: 12px;
  width: 240px;
  height: 62px;
  padding: 8px 12px;
  border-radius: 99px;
  background: rgba(18, 16, 32, 0.95);
  border: 1.5px solid rgba(168, 117, 255, 0.55);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.62);
  flex-direction: row;
  cursor: pointer;
}
html[dir="ltr"] .group-call-overlay.minimized { left: auto; right: 12px; }
.group-call-overlay.minimized .gcall-top,
.group-call-overlay.minimized .gcall-video-wrap,
.group-call-overlay.minimized .gcall-voice-wrap,
.group-call-overlay.minimized .gcall-controls {
  display: none !important;
}
.gcall-pip-bar {
  display: none;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.group-call-overlay.minimized .gcall-pip-bar { display: flex; }
.gcall-pip-meta { flex: 1; min-width: 0; }
.gcall-pip-meta strong {
  display: block;
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gcall-pip-meta small { display: block; font-size: 10.5px; color: #86efac; font-weight: 700; }
.gcall-pip-actions { display: flex; gap: 6px; flex-shrink: 0; }
.gcall-pip-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.gcall-pip-btn.pip-end { background: #ef4444; }

.gcall-top {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.gcall-top strong { display: block; font-size: 18px; font-weight: 900; }
.gcall-top small { display: block; font-size: 12.5px; color: #d5c7f0; margin-top: 2px; }

.gcall-pill {
  padding: 4px 12px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 12px;
  font-weight: 700;
}

.gcall-video-wrap {
  width: 100%;
  flex: 1;
  margin: 12px 0;
  border-radius: 22px;
  overflow: hidden;
  background: #000;
  position: relative;
}

.gcall-video-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.gcall-voice-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gcall-pulse-circle {
  width: 118px;
  height: 118px;
  border-radius: 50%;
  background: var(--grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 46px;
  box-shadow: 0 0 0 14px rgba(168, 85, 247, 0.22);
  animation: callAcceptPulse 1.8s infinite;
}

@keyframes callAcceptPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.07); }
}

.gcall-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.gcall-controls .call-circle-btn {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.gcall-controls .call-circle-btn.active-on {
  background: #fff;
  color: #101018;
}

.gcall-controls .call-circle-btn.active-off {
  background: rgba(255, 71, 126, 0.28);
  color: #ff7ea3;
  border: 1px solid rgba(255, 71, 126, 0.5);
}

.gcall-controls .call-circle-btn.danger-end {
  background: #ef4444;
  color: #fff;
  width: 58px;
  height: 58px;
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.48);
}

.design-palette-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.design-chip {
  padding: 9px 14px;
  border-radius: 99px;
  background: var(--card-soft);
  border: 1.5px solid var(--border);
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text-soft);
}

.design-chip.active {
  background: rgba(168, 117, 255, 0.18);
  border-color: var(--primary);
  color: var(--primary);
}
  
/* =========================================
   v22 COVER PHOTO, POLLS, SHARED CARDS & GROUP MESH CALLS
========================================= */

.prof-banner.has-real-cover {
  inset: 0;
  filter: none !important;
  transform: none !important;
  opacity: 0.96 !important;
}

.prof-cover-edit-btn {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 6;
  padding: 6px 12px;
  border-radius: 99px;
  background: rgba(10, 10, 16, 0.62);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  font-size: 11.5px;
  font-weight: 800;
}

html[dir="ltr"] .prof-cover-edit-btn {
  left: auto;
  right: 12px;
}

#coverPreview img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: 14px;
  margin-top: 8px;
  border: 1px solid var(--border);
}

/* Interactive Polls */
.poll-builder-box {
  margin-top: 10px;
  padding: 12px;
  border-radius: 14px;
  background: var(--card-soft);
  border: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sh-poll-card {
  margin-top: 4px;
  padding: 12px;
  border-radius: 16px;
  background: var(--card-soft);
  border: 1px solid var(--border);
  min-width: 220px;
}

.chat-mine .sh-poll-card {
  background: rgba(0, 0, 0, 0.22);
  border-color: rgba(255, 255, 255, 0.25);
}

.sh-poll-q {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 9px;
}

.sh-poll-opts {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.poll-opt-btn {
  position: relative;
  overflow: hidden;
  width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  text-align: start;
}

.poll-opt-btn.voted {
  border-color: var(--primary);
}

.poll-opt-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: rgba(168, 117, 255, 0.24);
  pointer-events: none;
  transition: width 0.28s ease;
}

html[dir="rtl"] .poll-opt-fill {
  inset: 0 0 0 auto;
}

.poll-opt-label,
.poll-opt-pct {
  position: relative;
  z-index: 1;
}

.poll-opt-pct {
  font-size: 11.5px;
  opacity: 0.85;
}

.sh-poll-meta {
  margin-top: 8px;
  font-size: 11px;
  opacity: 0.78;
}

/* Shared Post / Reel Card inside Chat */
.shared-post-card {
  min-width: 210px;
  max-width: 260px;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.18);
  cursor: pointer;
}

.chat-theirs .shared-post-card {
  background: var(--bg-elev);
  border-color: var(--border);
}

.shared-card-top {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.shared-card-badge {
  font-size: 10px;
  font-weight: 800;
  opacity: 0.8;
}

.shared-card-top strong {
  font-size: 13px;
  font-weight: 800;
}

.shared-card-thumb {
  width: 100%;
  max-height: 150px;
  object-fit: cover;
}

.shared-card-media {
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  background: rgba(0, 0, 0, 0.35);
}

.shared-card-snippet {
  padding: 7px 10px;
  font-size: 12px;
  line-height: 1.45;
  opacity: 0.92;
}

.shared-card-cta {
  padding: 7px 10px;
  font-size: 11.5px;
  font-weight: 800;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  text-align: center;
}

.attach-poll {
  background: linear-gradient(135deg, #10b981, #059669);
}

/* Group Live Call Join Banner & Multi-Peer Grid */
.group-live-call-banner {
  flex-shrink: 0;
  padding: 9px 14px;
  background: linear-gradient(135deg, #16a34a, #059669);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  font-weight: 800;
  animation: fadeUp 0.2s ease;
}

.group-join-call-btn {
  padding: 5px 14px;
  border-radius: 99px;
  background: #fff;
  color: #065f46;
  font-size: 12px;
  font-weight: 900;
}

.gcall-streams-grid {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 6px;
  padding: 6px;
}

.gcall-tile {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: #12121c;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gcall-tile video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #06060b;
}

.gcall-avatar-tile {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
}

.gcall-avatar-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gcall-tile-name {
  position: absolute;
  bottom: 8px;
  right: 8px;
  padding: 2px 9px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

/* =========================================
   v23 COMPLETE 35-FEATURE UI STYLES
========================================= */

.trending-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 2px 10px;
  scrollbar-width: none;
}
.trending-bar::-webkit-scrollbar { display: none; }
.trend-lbl { font-size: 15px; }
.trend-chip {
  padding: 5px 11px;
  border-radius: 99px;
  background: var(--card-soft);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}
.trend-chip small { opacity: 0.7; font-size: 10px; }

.post-meta-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 15px 8px;
}
.feeling-post-badge,
.cf-post-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 700;
  background: rgba(168, 117, 255, 0.14);
  color: var(--primary);
}
.cf-post-badge {
  background: rgba(34, 197, 94, 0.16);
  color: var(--green);
}

.sh-spoiler {
  background: var(--muted);
  color: transparent;
  border-radius: 6px;
  padding: 1px 6px;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s, color 0.2s;
}
.sh-spoiler.revealed {
  background: rgba(168, 117, 255, 0.15);
  color: inherit;
}
.sh-mention {
  color: var(--primary);
  font-weight: 800;
}

.mention-popup {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  width: min(92%, 420px);
  z-index: 99995;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 6px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mention-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
}
.mention-item:hover { background: var(--card-soft); }

.sh-carousel {
  position: relative;
  background: #000;
  overflow: hidden;
}
.sh-carousel-slide { display: none; cursor: pointer; }
.sh-carousel-slide.active { display: block; }
.sh-carousel-slide img { width: 100%; max-height: 520px; object-fit: contain; margin: 0 auto; }
.sh-car-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.58);
  color: #fff;
  font-size: 14px;
}
.sh-car-btn.prev { right: 10px; }
.sh-car-btn.next { left: 10px; }
.sh-car-counter {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 2px 9px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}
.carousel-composer-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 8px;
}
.carousel-composer-strip img {
  width: 84px;
  height: 84px;
  object-fit: cover;
  border-radius: 10px;
}

.sh-audio-post-box { padding: 4px 14px 12px; }
.sh-repost-embed {
  margin: 4px 14px 12px;
  padding: 11px 13px;
  border-radius: 15px;
  background: var(--card-soft);
  border: 1px solid var(--border);
  cursor: pointer;
}
.sh-repost-head { font-size: 12.5px; margin-bottom: 4px; color: var(--primary); }
.sh-repost-embed p { font-size: 13px; color: var(--text-soft); }
.sh-repost-embed img { width: 100%; max-height: 220px; object-fit: cover; border-radius: 10px; margin-top: 8px; }

.comment-reply-link {
  font-size: 11px;
  font-weight: 800;
  color: var(--primary);
  padding: 0 4px;
}

.grid-pin-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 4;
  padding: 2px 7px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}

.prof-badges-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  margin-top: 6px;
}
.prof-badge-pill {
  padding: 2px 9px;
  border-radius: 99px;
  background: rgba(168, 117, 255, 0.15);
  border: 1px solid var(--border-strong);
  font-size: 11px;
  font-weight: 800;
  color: var(--primary);
}
.mutual-friends-pill {
  margin-top: 5px;
  font-size: 12px;
  font-weight: 700;
  color: var(--green);
}

.notes-strip {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 8px 14px 12px;
  border-bottom: 1px solid var(--hairline);
  scrollbar-width: none;
}
.notes-strip::-webkit-scrollbar { display: none; }
.note-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 74px;
  max-width: 82px;
  cursor: pointer;
}
.note-bubble {
  background: var(--card-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 4px 8px;
  font-size: 10.5px;
  font-weight: 700;
  text-align: center;
  margin-bottom: -6px;
  z-index: 2;
  max-width: 82px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.note-card span {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
  max-width: 74px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-inline-search {
  padding: 8px 12px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--hairline);
}
.pinned-msg-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  background: rgba(168, 117, 255, 0.14);
  border-bottom: 1px solid var(--border-strong);
  font-size: 12.5px;
}
.pinned-msg-banner p {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.voice-speed-btn {
  padding: 2px 7px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.22);
  font-size: 10.5px;
  font-weight: 800;
  flex-shrink: 0;
}
.chat-theirs .voice-speed-btn {
  background: var(--bg-elev);
  color: var(--primary);
}

.sh-loc-card,
.sh-doc-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.2);
  text-decoration: none;
  color: inherit;
}
.chat-theirs .sh-loc-card,
.chat-theirs .sh-doc-card {
  background: var(--bg-elev);
}
.sh-loc-icon,
.sh-doc-icon { font-size: 26px; }
.sh-loc-body strong,
.sh-doc-info strong { display: block; font-size: 13px; }
.sh-loc-body small,
.sh-doc-info small { display: block; font-size: 11px; opacity: 0.8; }
.sh-loc-body span { font-size: 11px; font-weight: 800; text-decoration: underline; }

.sh-videonote-circle {
  width: 170px;
  height: 170px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--primary);
  background: #000;
  cursor: pointer;
}
.sh-videonote-circle video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.quick-replies-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 6px 4px 8px;
  scrollbar-width: none;
}
.quick-replies-strip::-webkit-scrollbar { display: none; }
.qr-chip {
  padding: 6px 12px;
  border-radius: 99px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.group-seen-footer {
  padding: 3px 14px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-align: end;
}

.reel-speed-pill {
  position: absolute;
  top: 56px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  padding: 5px 14px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.pin-lock-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.text-story-preview-box {
  width: 100%;
  height: 360px;
  border-radius: 24px;
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.text-story-preview-box textarea {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: #fff;
  font-size: 22px;
  font-weight: 900;
  text-align: center;
  resize: none;
  height: 220px;
}
.text-story-preview-box textarea::placeholder { color: rgba(255, 255, 255, 0.72); }

.qr-card-frame {
  padding: 18px;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
  margin: 16px auto;
}

.insights-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.insight-box {
  padding: 16px 12px;
  border-radius: 18px;
  background: var(--bg-elev);
  border: 1px solid var(--hairline);
  text-align: center;
}
.insight-box strong {
  display: block;
  font-size: 24px;
  font-weight: 900;
  color: var(--primary);
}
.insight-box span {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}

/* Clean Chat Header Dropdown Menu */
.chat-hdr-dropdown {
  position: absolute;
  top: calc(58px + env(safe-area-inset-top));
  left: 12px;
  z-index: 80;
  min-width: 215px;
  padding: 6px;
  border-radius: 18px;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.58);
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: fadeUp 0.16s ease;
}
html[dir="ltr"] .chat-hdr-dropdown {
  left: auto;
  right: 12px;
}
.chat-hdr-dropdown button {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  text-align: start;
  color: var(--text);
}
.chat-hdr-dropdown button:active,
.chat-hdr-dropdown button:hover {
  background: var(--card-soft);
}
/* =========================================
   v25 COMMENT REACTIONS, GROUP CALL CARD & NOTES POLISH
========================================= */
.comment-meta-row {
  position: relative;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.comment-meta-row small {
  margin-top: 0;
}
.comment-react-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.comment-react-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-soft);
}
.comment-react-btn.reacted {
  border-color: var(--primary);
  background: rgba(168, 117, 255, 0.16);
  color: var(--text);
}
.comment-react-cnt {
  font-size: 11px;
  font-weight: 800;
}
.comment-react-more {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-elev);
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.comment-react-strip {
  font-size: 11px;
  letter-spacing: -1px;
}
.comment-react-pop {
  position: absolute;
  bottom: 28px;
  right: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px 6px;
  border-radius: 99px;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.55);
}
html[dir="ltr"] .comment-react-pop { right: auto; left: 0; }
.comment-react-pop button {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.comment-react-pop button:active,
.comment-react-pop button:hover {
  transform: scale(1.22);
  background: var(--card-soft);
}

/* Clickable Group Call Card in Chat */
.gcall-msg-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 195px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.45);
}
.gcall-msg-head { font-size: 13px; display: flex; align-items: center; gap: 6px; }
.gcall-msg-join-btn {
  padding: 7px 12px;
  border-radius: 99px;
  background: linear-gradient(135deg, #16a34a, #059669);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

/* Active 24h Note Bubble Highlight */
.note-bubble.active-note {
  background: var(--grad);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(168, 85, 247, 0.35);
}

/* =========================================
   v26 DEVELOPER ADMIN PANEL & FEEDBACK STYLES
========================================= */

.modal-layer-top {
  z-index: 700 !important;
}

.admin-header-btn {
  position: relative;
  color: var(--primary);
  background: rgba(168, 117, 255, 0.14);
  border: 1px solid var(--border-strong);
}

.admin-pending-badge {
  position: absolute;
  top: -3px;
  left: -3px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 99px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg);
}

html[dir="ltr"] .admin-pending-badge {
  left: auto;
  right: -3px;
}

.admin-settings-card {
  border-color: var(--border-strong);
  background: linear-gradient(145deg, rgba(168, 117, 255, 0.1), var(--bg-elev));
}

.feedback-cat-row,
.admin-filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.admin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.admin-kpi-card {
  padding: 12px 8px;
  border-radius: 16px;
  background: var(--bg-elev);
  border: 1px solid var(--hairline);
  text-align: center;
}

.admin-kpi-card strong {
  display: block;
  font-size: 21px;
  font-weight: 900;
  color: var(--primary);
  line-height: 1.2;
}

.admin-kpi-card span {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  margin-top: 3px;
}

.admin-cards-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-card {
  padding: 14px;
  border-radius: 18px;
  background: var(--bg-elev);
  border: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-user-mini {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  min-width: 0;
}

.admin-user-mini strong {
  display: block;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text);
}

.admin-user-mini small {
  display: block;
  font-size: 11px;
  color: var(--muted);
}

.admin-card-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.admin-cat-chip {
  padding: 3px 10px;
  border-radius: 99px;
  background: rgba(168, 117, 255, 0.14);
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
}

.admin-status-pill {
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 10.5px;
  font-weight: 800;
}

.admin-status-pill.open {
  background: rgba(245, 158, 11, 0.16);
  color: #f59e0b;
}

.admin-status-pill.replied {
  background: rgba(56, 189, 248, 0.16);
  color: #38bdf8;
}

.admin-status-pill.resolved {
  background: rgba(34, 197, 94, 0.16);
  color: var(--green);
}

.admin-status-pill.dismissed {
  background: var(--card-soft);
  color: var(--muted);
}

.admin-card-msg {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.admin-card-time {
  font-size: 11px;
  color: var(--muted);
}

.admin-reason-box {
  padding: 9px 12px;
  border-radius: 12px;
  background: rgba(255, 71, 126, 0.1);
  border: 1px solid rgba(255, 71, 126, 0.25);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
}

.admin-post-preview {
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--card-soft);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-post-preview.deleted {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
}

.admin-post-preview-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-soft);
}

.admin-post-preview p {
  font-size: 12.5px;
  color: var(--text-soft);
  line-height: 1.5;
}

.admin-post-thumb {
  width: 100%;
  max-height: 160px;
  object-fit: cover;
  border-radius: 10px;
}

.admin-media-tag {
  display: inline-block;
  width: fit-content;
  padding: 3px 10px;
  border-radius: 99px;
  background: var(--bg-elev);
  font-size: 11.5px;
  font-weight: 700;
}

.admin-actions-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.admin-reply-form {
  display: flex;
  gap: 6px;
  align-items: center;
}

.admin-reply-form input {
  flex: 1;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 13px;
}

.admin-reply-send {
  width: auto !important;
  padding: 9px 14px !important;
  border-radius: 12px !important;
  font-size: 12.5px !important;
  flex-shrink: 0;
}

.my-feedback-reply {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(168, 117, 255, 0.12);
  border-right: 3px solid var(--primary);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

html[dir="ltr"] .my-feedback-reply {
  border-right: 0;
  border-left: 3px solid var(--primary);
}

.my-feedback-reply strong {
  font-size: 12px;
  color: var(--primary);
}

.my-feedback-reply p {
  font-size: 13px;
  color: var(--text);
  line-height: 1.55;
  white-space: pre-wrap;
}

.my-feedback-reply small {
  font-size: 10.5px;
  color: var(--muted);
}

/* =========================================
   v27 DEVELOPER COMMAND CENTER, BANNERS & REAL VERIFIED BADGE
========================================= */

.author-name-inline {
  display: inline-flex !important;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.verified-mini {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.verified-mini svg {
  width: 9.5px;
  height: 9.5px;
  fill: none;
  stroke: currentColor;
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.global-pinned-post {
  border-color: var(--border-strong) !important;
  box-shadow: 0 0 0 1px rgba(168, 117, 255, 0.22);
}

.global-pin-ribbon {
  padding: 6px 14px;
  font-size: 11.5px;
  font-weight: 800;
  color: #fff;
  background: var(--grad);
  border-radius: 19px 19px 0 0;
}

.admin-maint-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  margin-bottom: 10px;
  border-radius: 14px;
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fbbf24;
  font-size: 12px;
  font-weight: 800;
}

.global-ann-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  margin-bottom: 10px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  animation: fadeUp 0.2s ease;
}

.global-ann-banner p {
  flex: 1;
  min-width: 0;
}

.global-ann-banner.ann-info {
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: var(--text);
}

.global-ann-banner.ann-warning {
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: var(--text);
}

.global-ann-banner.ann-promo {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.22), rgba(236, 72, 153, 0.2));
  border: 1px solid var(--border-strong);
  color: var(--text);
}

.global-ann-icon {
  font-size: 19px;
  flex-shrink: 0;
}

.apk-update-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 13px;
  margin-bottom: 10px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.22), rgba(6, 182, 212, 0.18));
  border: 1px solid rgba(16, 185, 129, 0.45);
  animation: fadeUp 0.2s ease;
}

.apk-upd-text {
  flex: 1;
  min-width: 0;
}

.apk-upd-text strong {
  display: block;
  font-size: 13px;
  font-weight: 900;
  color: var(--text);
}

.apk-upd-text p {
  font-size: 11.5px;
  color: var(--text-soft);
  margin-top: 2px;
}

.apk-upd-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.apk-upd-dl-btn {
  padding: 7px 14px;
  border-radius: 99px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
}

.admin-kpi-4 {
  grid-template-columns: repeat(4, 1fr);
}

.admin-tabs-scroll {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: var(--card-soft);
  overflow-x: auto;
  scrollbar-width: none;
}

.admin-tabs-scroll::-webkit-scrollbar {
  display: none;
}

.admin-tabs-scroll .seg-btn {
  flex: 1 0 auto;
  padding: 0 11px;
  white-space: nowrap;
}

.admin-card-banned {
  border-color: rgba(255, 71, 126, 0.42);
}

.admin-status-pill.banned-pill {
  background: rgba(255, 71, 126, 0.18);
  color: var(--accent);
}

.active-chip-on {
  border-color: var(--primary) !important;
  background: rgba(168, 117, 255, 0.18) !important;
  color: var(--primary) !important;
}

/* =========================================
   v28 LITE & FAST ENGINE — 60FPS GPU, SKELETONS & OFFLINE PILL
========================================= */

.net-offline-pill {
  position: sticky;
  top: 58px;
  z-index: 190;
  padding: 6px 12px;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border-bottom: 1px solid rgba(245, 158, 11, 0.38);
}

/* Feed Skeleton Loader */
.feed-skeleton-card {
  background: var(--bg-elev);
  border: 1px solid var(--hairline);
  border-radius: 20px;
  padding: 14px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sk-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sk-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--card-soft);
  flex-shrink: 0;
  animation: skPulse 1.3s ease-in-out infinite;
}

.sk-lines {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sk-line {
  height: 11px;
  border-radius: 99px;
  background: var(--card-soft);
  animation: skPulse 1.3s ease-in-out infinite;
}

.sk-line.w30 { width: 30%; }
.sk-line.w50 { width: 50%; }
.sk-line.w70 { width: 70%; }
.sk-line.w90 { width: 90%; }

.sk-media {
  width: 100%;
  height: 190px;
  border-radius: 14px;
  background: var(--card-soft);
  animation: skPulse 1.3s ease-in-out infinite;
}

@keyframes skPulse {
  0%, 100% { opacity: 0.48; }
  50% { opacity: 0.92; }
}

/* Mobile GPU Optimization: Lighter blur on mobile hardware for silky 60fps scrolling */
@media (max-width: 720px) {
  .app-header,
  .bottom,
  .chat-v10-header,
  .chat-v10-dock,
  .settings-header,
  .pub-profile-topbar,
  .post-viewer-header {
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    background: var(--bg-elev) !important;
  }
}

/* LITE / DATA SAVER MODE: Zero heavy blur filters & instant transitions */
html[data-lite="1"] .app-header,
html[data-lite="1"] .bottom,
html[data-lite="1"] .chat-v10-header,
html[data-lite="1"] .chat-v10-dock,
html[data-lite="1"] .settings-header,
html[data-lite="1"] .pub-profile-topbar,
html[data-lite="1"] .post-viewer-header,
html[data-lite="1"] .msg-ctx-overlay {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

html[data-lite="1"] .prof-banner {
  filter: none !important;
  opacity: 0.25 !important;
}

html[data-lite="1"] .post,
html[data-lite="1"] .chat-message {
  animation: none !important;
}

.apk-dl-secondary {
  background: var(--card-soft) !important;
  color: var(--text) !important;
  border: 1px solid var(--border);
}
