:root {
  color-scheme: dark;
  --app-height: 100dvh;
  --visual-height: 100dvh;
  --visual-top: 0px;
  --bg: #05070b;
  --bg-2: #090d14;
  --panel: #0d131d;
  --panel-2: #121a26;
  --panel-3: #182230;
  --line: #263241;
  --text: #f4f7fb;
  --muted: #8996a7;
  --soft: #c3ccd8;
  --accent: #f4f7fb;
  --accent-2: #2f8b83;
  --danger: #ff6b7a;
  --ok: #57d68d;
  --social-action: #285f88;
  --social-link: #397db4;
  --social-link-hover: #356f9d;
  --social-action-soft: rgba(40, 95, 136, 0.18);
  --social-teal-soft: rgba(47, 139, 131, 0.16);
  --social-blue: var(--social-action);
  --social-pink: #d64d87;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.58);
}


html {
  width: 100%;
  max-width: 100%;
  height: var(--app-height);
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
  background: var(--bg);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  width: 100%;
  max-width: 100%;
  height: var(--app-height);
  min-height: var(--app-height);
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

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

a {
  color: var(--accent);
}

.auth-screen,
.public-screen {
  min-height: var(--app-height);
  display: grid;
  place-items: center;
  padding: 24px;
  background: #05070b;
}

.auth-box,
.public-box {
  width: min(960px, 100%);
  display: grid;
  grid-template-columns: 1fr 390px;
  gap: 22px;
  align-items: stretch;
}

.auth-box-single {
  width: min(420px, 100%);
  grid-template-columns: 1fr;
}

.auth-mark {
  width: 48px;
  height: 48px;
  margin: 4px auto 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #f4f7fb;
  background: #141b26;
  border: 1px solid rgba(255, 255, 255, 0.11);
}

.auth-mark .ui-icon {
  width: 24px;
  height: 24px;
}

.intro,
.auth-card,
.public-card,
.panel-card {
  background: rgba(13, 19, 29, 0.92);
  border: 1px solid rgba(244, 247, 251, 0.09);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.intro {
  padding: 34px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 470px;
}

.intro h1,
.public-card h1 {
  margin: 0 0 12px;
  font-size: clamp(34px, 6vw, 68px);
  line-height: 0.96;
  letter-spacing: 0;
}

.intro p,
.public-card p {
  margin: 0;
  max-width: 620px;
  color: var(--soft);
  font-size: 17px;
}

.feature-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 30px;
}

.feature-strip span {
  display: block;
  padding: 12px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 8px;
  color: var(--soft);
}

.auth-card,
.public-card {
  padding: 22px;
}

.public-profile-screen {
  width: 100%;
  height: var(--app-height);
  overflow: auto;
  background: #05070b;
}

.public-profile-page {
  width: min(620px, 100%);
  min-height: var(--app-height);
  margin: 0 auto;
  padding: 0 18px calc(30px + env(safe-area-inset-bottom));
}

.public-profile-header {
  min-height: 62px;
  padding-top: env(safe-area-inset-top);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.public-profile-header > strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
}

.public-login-btn {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 7px;
  color: #fff;
  background: var(--social-blue);
  font-weight: 750;
}

.public-profile-overview {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  padding: 28px 2px 16px;
}

.public-profile-overview .profile-details {
  grid-column: 1 / -1;
}

.public-profile-overview .profile-details p {
  margin: 5px 0 0;
  color: var(--soft);
}

.public-profile-cta {
  width: 100%;
  min-height: 36px;
  border-radius: 7px;
  color: #fff;
  background: var(--social-blue);
}

.public-profile-lock {
  min-height: 210px;
  margin-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  color: var(--muted);
  text-align: center;
}

.public-profile-lock .ui-icon {
  width: 30px;
  height: 30px;
}

.public-profile-lock strong {
  color: var(--text);
}

.public-profile-missing {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  text-align: center;
}

.public-profile-missing h1 {
  margin: 0;
  font-size: 24px;
}

.auth-tabs,
.tabs,
.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  background: rgba(2, 3, 5, 0.66);
  border: 1px solid rgba(244, 247, 251, 0.08);
  border-radius: 8px;
}

.auth-tabs button,
.tabs button,
.segmented button {
  min-height: 38px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
}

.auth-tabs button.active,
.tabs button.active,
.segmented button.active {
  background: var(--panel-2);
  color: var(--text);
}

.form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.field input,
.field textarea,
.search-input,
.composer-input {
  width: 100%;
  border: 1px solid var(--line);
  background: #070b12;
  color: var(--text);
  border-radius: 8px;
  outline: none;
}

.field input,
.search-input {
  height: 42px;
  padding: 0 12px;
}

.field textarea {
  min-height: 92px;
  resize: vertical;
  padding: 11px 12px;
}

.field input:focus,
.field textarea:focus,
.search-input:focus,
.composer-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(244, 247, 251, 0.08);
}

.primary,
.secondary,
.danger,
.ghost,
.icon-btn,
.mini-btn {
  min-height: 38px;
  border-radius: 8px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--text);
}

.primary {
  background: var(--text);
  color: #05070b;
  font-weight: 700;
}

.secondary {
  background: var(--panel-2);
  border: 1px solid var(--line);
}

.danger {
  background: rgba(255, 107, 122, 0.13);
  border: 1px solid rgba(255, 107, 122, 0.35);
  color: #ffd5da;
}

.ghost,
.icon-btn {
  background: transparent;
  border: 0;
}

.mini-btn {
  background: #151a22;
  border: 0;
}

.ghost:hover,
.icon-btn:hover,
.mini-btn:hover:not(:disabled) {
  background: #1a2029;
}

.icon-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  flex: 0 0 auto;
  border-radius: 50%;
}

.ui-icon {
  width: 21px;
  height: 21px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ui-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mini-btn {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.error {
  min-height: 20px;
  color: #ffb1ba;
  font-size: 13px;
}

.hint {
  color: var(--muted);
  font-size: 13px;
}

.app-shell {
  width: 100%;
  max-width: 100%;
  height: var(--app-height);
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  overflow: hidden;
  background: #020305;
}

.sidebar {
  min-width: 0;
  border-right: 1px solid var(--line);
  background: #05070b;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
}

.app-topbar,
.chat-header {
  min-height: 66px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.app-topbar {
  justify-content: space-between;
}

.app-topbar > strong {
  font-size: 24px;
  letter-spacing: 0;
}

.notification-btn {
  position: relative;
}

.red-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ff334b;
  box-shadow: 0 0 0 2px #05070b;
}

.chat-title strong,
.person strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-title small,
.person small {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}

.profile-mini {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 10px;
  align-items: center;
  padding: 14px;
  color: var(--text);
  text-align: left;
  background: transparent;
  border: 0;
}

.app-topbar .profile-mini {
  flex: 1;
  padding: 0;
  grid-template-columns: 44px 1fr;
}

.avatar {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: visible;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #f4f7fb, #2f8b83);
  color: #05070b;
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

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

.side-content {
  min-height: 0;
  overflow: auto;
  padding: calc(14px + env(safe-area-inset-top)) 14px 18px;
}

.tab-content.animate-tab.from-right {
  animation: tabFromRight 0.22s ease;
}

.tab-content.animate-tab.from-left {
  animation: tabFromLeft 0.22s ease;
}

.tab-content[data-tab="profile"],
.tab-content[data-tab="search"] {
  padding-top: 8px;
}

.messages-head {
  margin-bottom: 8px;
}

.messages-search-row {
  display: grid;
  grid-template-columns: 1fr 40px;
  gap: 8px;
  align-items: center;
}

.conversation-search,
.search-page-head .search-input {
  height: 40px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.search-page-head {
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  margin-bottom: 18px;
  padding: 0 8px 0 12px;
  border-radius: 8px;
  background: #10151d;
}

.search-page-head:focus-within {
  background: #141a23;
  box-shadow: 0 0 0 2px rgba(47, 95, 136, 0.22);
}

.search-field-icon,
.search-clear {
  display: grid;
  place-items: center;
  color: var(--muted);
}

.search-field-icon .ui-icon {
  width: 18px;
  height: 18px;
}

.search-clear {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
}

.search-clear .ui-icon {
  width: 16px;
  height: 16px;
}

.panel-heading {
  margin: 0 0 18px;
}

.panel-heading h2 {
  margin: 0;
  font-size: 17px;
  letter-spacing: 0;
}

.panel-heading p {
  margin: 3px 0 0;
  color: var(--muted);
}

.bottom-tabs {
  align-self: end;
  height: 58px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 5px 10px max(5px, env(safe-area-inset-bottom));
  background: rgba(5, 7, 11, 0.96);
  border-top: 1px solid var(--line);
}

html.keyboard-open .bottom-tabs {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.bottom-tab {
  position: relative;
  min-width: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  padding: 5px 0;
  transition: color 0.18s ease, transform 0.18s ease;
}

.bottom-tab.active {
  color: var(--text);
  background: transparent;
  transform: translateY(-1px);
}

.bottom-tab.active .ui-icon {
  transform: scale(1.18);
}

.bottom-tab.active svg {
  stroke-width: 2.9;
}

.bottom-tab .tab-dot {
  top: 9px;
  right: calc(50% - 16px);
}

.chat-list,
.result-list {
  display: grid;
  gap: 8px;
}

.result-list {
  gap: 0;
}

.chat-item,
.person-card,
.profile-link-box {
  width: 100%;
  padding: 10px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.043);
  border: 1px solid rgba(255, 255, 255, 0.075);
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 10px;
  align-items: center;
  text-align: left;
  color: var(--text);
}

.chat-item {
  border: 0;
  background: transparent;
  padding: 10px 6px;
}

.person-card {
  padding: 10px 4px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 0;
  background: transparent;
}

.chat-item.active {
  background: rgba(255, 255, 255, 0.045);
}

.chat-item.unread .person strong {
  color: #fff;
  font-weight: 850;
}

.chat-item.unread .person small,
.chat-item.unread .chat-meta {
  color: rgba(237, 245, 255, 0.78);
}

.conversation-hit .person small {
  color: var(--soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-meta {
  display: grid;
  justify-items: end;
  gap: 5px;
  color: var(--muted);
}

.person {
  min-width: 0;
}

.empty-state {
  height: 100%;
  display: grid;
  place-items: center;
  padding: 26px;
  text-align: center;
  color: var(--muted);
}

.chat-pane {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: var(--app-height);
  overflow: hidden;
  background: #06080d;
}

.chat-pane.chat-returning {
  animation: chatBackIn 0.18s ease;
}

.chat-header {
  background: rgba(5, 7, 11, 0.96);
  padding-top: calc(12px + env(safe-area-inset-top));
}

.chat-profile-button,
.chat-title {
  background: transparent;
  border: 0;
  color: var(--text);
  padding: 0;
  text-align: left;
}

.back-btn {
  display: none;
}

.messages {
  width: 100%;
  max-width: 100%;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  overflow-anchor: none;
  touch-action: pan-y;
  padding: 18px clamp(12px, 3vw, 34px);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.message {
  max-width: min(680px, 84%);
  width: max-content;
  min-width: 0;
  touch-action: pan-y;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  transition: transform 0.16s ease;
}

.message.mine {
  align-self: flex-end;
  align-items: flex-end;
}

.message.theirs {
  align-self: flex-start;
  align-items: flex-start;
}

.message.highlighted .bubble {
  border-color: rgba(255, 255, 255, 0.58);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.22), 0 0 28px rgba(117, 103, 255, 0.42);
}

.bubble {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  width: max-content;
  max-width: 100%;
  min-width: 0;
  position: relative;
  border: 1px solid rgba(236, 114, 202, 0.22);
  border-radius: 18px;
  padding: 8px 11px;
  background: linear-gradient(135deg, #101a34, #25183e 58%, #361832 100%);
  box-shadow: 0 0 18px rgba(185, 88, 210, 0.16), 0 10px 24px rgba(0, 0, 0, 0.2);
  overflow: visible;
}

.mine .bubble {
  align-items: flex-end;
  background: linear-gradient(135deg, #0e2b50, #442266 62%, #6b255f 100%);
  border-color: rgba(238, 122, 206, 0.34);
  box-shadow: 0 0 20px rgba(220, 91, 205, 0.22), 0 10px 24px rgba(0, 0, 0, 0.22);
}

.swipe-time {
  display: block;
  position: absolute;
  top: calc(100% + 3px);
  left: 6px;
  color: rgba(196, 203, 214, 0.78);
  font-size: 11px;
  line-height: 1.15;
  white-space: nowrap;
  opacity: 0;
  padding: 0;
  pointer-events: none;
  text-align: left;
  transition: opacity 0.12s ease, transform 0.12s ease;
  transform: translateY(-2px);
}

.mine .swipe-time {
  left: auto;
  right: 6px;
  text-align: right;
}

.message.reveal-time .swipe-time {
  opacity: 1;
  transform: translateY(0);
}

.message.reveal-time {
  margin-bottom: 16px;
}

.deleted .bubble {
  opacity: 0.62;
  font-style: italic;
}

.reply-preview,
.replying-to {
  border-left: 3px solid #8e6cff;
  padding: 7px 9px;
  margin-bottom: 8px;
  background: rgba(0, 0, 0, 0.16);
  border-radius: 6px;
  color: var(--soft);
  font-size: 13px;
}

.message-text {
  display: inline-block;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 14px;
  width: max-content;
  max-width: 100%;
}

.message-meta {
  display: none;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-top: 8px;
  color: rgba(237, 245, 255, 0.66);
  font-size: 11px;
}

.message-actions {
  display: none;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-top: 8px;
}

.media-image,
.media-video,
.sticker-img {
  display: block;
  max-width: min(360px, 100%);
  max-height: 410px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.045);
  object-fit: contain;
  background: rgba(255, 255, 255, 0.018);
  user-select: none;
  -webkit-user-drag: none;
}

.media-image {
  cursor: zoom-in;
}

.media-video {
  width: min(420px, 100%);
}

.sticker-img {
  max-width: 180px;
  max-height: 180px;
  border-radius: 0;
  border: 0;
  background: transparent;
}

.older-loader {
  display: grid;
  place-items: center;
  min-height: 38px;
}

.voice-note {
  min-width: 210px;
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 9px;
  align-items: center;
  padding: 3px 0;
  color: var(--text);
  background: transparent;
  border: 0;
}

.voice-play {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #111827;
}

.voice-play .ui-icon {
  width: 16px;
  height: 16px;
}

.voice-wave {
  height: 34px;
  display: flex;
  align-items: center;
  gap: 3px;
}

.voice-wave i {
  width: 3px;
  height: var(--h);
  min-height: 7px;
  border-radius: 99px;
  background: rgba(237, 245, 255, 0.76);
}

.voice-note.playing .voice-wave i {
  background: #ff8bd6;
  animation: wavePulse 0.85s ease-in-out infinite alternate;
}

.voice-time {
  color: rgba(237, 245, 255, 0.72);
  font-size: 12px;
}

.message.sticker-message .bubble {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.message.media-message .bubble {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.message.media-message.highlighted .bubble {
  filter: drop-shadow(0 0 20px rgba(117, 103, 255, 0.44));
}

.message.media-message .swipe-time {
  padding: 0 2px;
}

.message.sticker-message.highlighted .bubble {
  filter: drop-shadow(0 0 20px rgba(117, 103, 255, 0.44));
}

.message.sticker-message .swipe-time {
  padding: 0 2px;
}

.typing-message {
  align-self: flex-start;
  width: fit-content;
  max-width: min(680px, 84%);
}

.typing-bubble {
  width: fit-content;
  border: 1px solid rgba(165, 115, 255, 0.18);
  border-radius: 18px;
  padding: 8px 11px;
  background: rgba(13, 20, 35, 0.92);
  color: rgba(214, 220, 231, 0.76);
  font-size: 13px;
  box-shadow: 0 0 14px rgba(94, 87, 255, 0.12);
}

.doc-tile,
.sticker-placeholder {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: min(320px, 74vw);
  padding: 12px;
  background: rgba(0, 0, 0, 0.16);
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 8px;
}

.composer {
  border-top: 1px solid var(--line);
  padding: 10px clamp(10px, 2vw, 20px) max(10px, env(safe-area-inset-bottom));
  background: rgba(5, 7, 11, 0.97);
}

.replying-to {
  display: grid;
  grid-template-columns: 1fr 38px;
  align-items: center;
  margin: 0 0 8px;
}

.composer-row {
  display: grid;
  grid-template-columns: auto auto 1fr auto auto;
  gap: 8px;
  align-items: end;
}

.composer-input {
  min-height: 42px;
  max-height: 120px;
  padding: 10px 12px;
  resize: none;
}

.send-btn {
  width: 42px;
  height: 42px;
  padding: 0;
}

.recording {
  background: rgba(255, 107, 122, 0.18);
  border-color: rgba(255, 107, 122, 0.55);
  color: #ffd5da;
}

.panel-card {
  padding: 14px;
  margin-bottom: 12px;
}

.profile-hero {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 12px 4px 8px;
}

.profile-page-header {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.profile-page-header > strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
}

.profile-avatar-column {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.profile-link-icon {
  width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--soft);
  background: #151a21;
}

.profile-link-icon .ui-icon {
  width: 15px;
  height: 15px;
}

.profile-stat-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 8px;
}

.profile-stat {
  min-width: 0;
  display: grid !important;
  justify-items: center;
  align-content: center;
  gap: 1px !important;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.profile-stat strong {
  display: block !important;
  color: var(--text) !important;
  font-size: 16px !important;
  line-height: 1.2;
}

.profile-stat span {
  display: block !important;
  color: var(--muted) !important;
}

.private-social-note {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.profile-details {
  min-width: 0;
  grid-column: 1 / -1;
}

.profile-display-name {
  display: flex !important;
  align-items: center;
  gap: 6px;
}

.profile-display-name > strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.icon-inline-btn {
  width: 25px;
  height: 25px;
  padding: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  display: inline-grid;
  place-items: center;
  vertical-align: middle;
}

.icon-inline-btn .ui-icon {
  width: 14px;
  height: 14px;
}

.profile-bio {
  margin: 6px 0 0;
  color: var(--soft);
  font-size: 13px;
}

.profile-avatar-btn {
  position: relative;
  width: 78px;
  height: 78px;
  padding: 0;
  border-radius: 50%;
  border: 0;
}

.profile-picture-button {
  padding: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: #141923;
  cursor: zoom-in;
}

.profile-avatar-stack {
  position: relative;
  flex: 0 0 auto;
}

.big-avatar-stack {
  width: 92px;
  height: 92px;
}

.profile-avatar-stack > .avatar {
  width: 100%;
  height: 100%;
}

.profile-story-view {
  position: absolute;
  right: -3px;
  bottom: -3px;
  z-index: 5;
  width: 26px;
  height: 26px;
  min-height: 26px;
  padding: 0 0 0 1px;
  border: 2px solid var(--bg);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, #6858df, #d84f95);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.42);
}

.profile-story-view .ui-icon {
  width: 12px;
  height: 12px;
  fill: currentColor;
}

.story-ring {
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  border: 2px solid #ff5fb8;
  box-shadow: 0 0 0 1px rgba(116, 92, 255, 0.8), 0 0 16px rgba(255, 95, 184, 0.42);
  pointer-events: none;
}

.story-ring.viewed {
  border-color: rgba(163, 172, 187, 0.58);
  box-shadow: 0 0 0 1px rgba(163, 172, 187, 0.28);
}

.social-stats {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.social-stat-btn {
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--muted);
  display: inline-flex;
  gap: 4px;
  align-items: baseline;
}

.social-stats strong {
  display: inline;
  font-size: 12px;
  color: var(--text);
}

.social-stats.centered {
  justify-content: center;
}

.checkbox-field {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.social-switch {
  position: relative;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  gap: 0;
  padding: 0;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 0;
  background: transparent;
}

.social-switch::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 50%;
  height: 2px;
  border-radius: 999px;
  background: #f4f7fb;
  transition: transform 0.18s ease;
}

.social-switch.is-following::before {
  transform: translateX(100%);
}

.social-switch button {
  position: relative;
  z-index: 1;
  background: transparent !important;
  min-height: 45px;
  border-radius: 0;
  color: var(--muted);
  font-size: 12px;
}

.social-switch button.active {
  color: var(--text);
}

.social-switch button strong {
  margin-right: 3px;
  color: inherit;
}

.social-page {
  display: grid;
  gap: 12px;
  min-height: 100%;
  align-content: start;
}

.social-user-list {
  display: grid;
  gap: 8px;
}

.social-user-row {
  grid-template-columns: minmax(0, 1fr) auto;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  padding-left: 4px;
  padding-right: 4px;
}

.social-row-action {
  justify-self: end;
}

.suggestion-section,
.search-discover,
.settings-block {
  padding: 14px 4px;
}

.search-page,
.search-results-section {
  display: grid;
  align-content: start;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 4px 8px;
}

.section-heading h2 {
  margin: 0;
  font-size: 15px;
}

.search-discover .section-heading h2 {
  margin: 0;
}

.section-heading small {
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.suggested-user-list,
.social-user-list {
  display: grid;
  gap: 0;
}

.account-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding: 8px 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}

.account-row:hover {
  background: rgba(255, 255, 255, 0.018);
}

.account-identity {
  min-width: 0;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 0;
  color: var(--text);
  text-align: left;
  background: transparent;
  text-decoration: none;
}

.account-identity:active {
  opacity: 0.72;
}

.account-row-actions {
  display: flex;
  align-items: center;
  gap: 3px;
}

.account-action {
  min-width: 76px;
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: #171c24;
  color: #eef2f7;
  font-weight: 700;
}

.account-action.primary-action,
.follow-btn {
  background: var(--social-blue);
  color: #fff;
}

.account-action.primary-action:hover:not(:disabled),
.follow-btn:hover:not(:disabled) {
  background: #285f88;
}

.account-dismiss {
  width: 30px;
  height: 30px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #727d8b;
  background: transparent;
}

.account-dismiss .ui-icon {
  width: 16px;
  height: 16px;
}

.search-empty {
  min-height: 210px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.search-empty.compact {
  min-height: 140px;
}

.search-empty .ui-icon {
  width: 32px;
  height: 32px;
  margin-bottom: 4px;
  color: #596473;
}

.search-empty strong {
  color: var(--soft);
}

.search-empty small {
  display: block;
}

.account-row-skeleton {
  grid-template-columns: 44px minmax(90px, 1fr) 76px;
}

.skeleton-avatar,
.skeleton-copy,
.skeleton-action {
  display: block;
  background: #151a22;
}

.skeleton-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
}

.skeleton-copy {
  width: min(170px, 75%);
  height: 26px;
  border-radius: 5px;
}

.skeleton-action {
  width: 76px;
  height: 32px;
  border-radius: 7px;
}

.search-profile-page {
  display: grid;
  align-content: start;
  gap: 18px;
}

.search-profile-mobile {
  display: none;
}

.search-profile-desktop-context {
  display: block;
}

.searched-profile-pane {
  display: block;
  overflow: hidden;
}

.searched-profile-scroll {
  height: var(--app-height);
  overflow: auto;
  padding: calc(18px + env(safe-area-inset-top)) clamp(22px, 5vw, 72px) 36px;
}

.searched-profile-scroll > .search-profile-page,
.searched-profile-scroll > .social-page {
  width: min(680px, 100%);
  min-height: 100%;
  margin: 0 auto;
}

.search-profile-header {
  grid-template-columns: 40px minmax(0, 1fr) 40px;
}

.search-profile-header h2 {
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-profile-hero {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 10px 4px 0;
}

.search-profile-copy {
  min-width: 0;
  grid-column: 1 / -1;
}

.search-profile-copy > strong {
  display: block;
}

.search-profile-copy > strong {
  font-size: 18px;
}

.search-profile-copy p {
  color: var(--muted);
}

.search-profile-copy p {
  margin: 8px 0 0;
  color: var(--soft);
}

.search-profile-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 7px;
  padding: 0 4px 4px;
}

.search-profile-actions .mini-btn {
  flex: 1 1 110px;
  min-height: 36px;
  border: 0;
  background: #171c24;
  font-weight: 700;
}

.search-profile-actions .profile-primary-action {
  color: #fff;
  background: var(--social-blue);
}

.suggestion-section h2,
.search-discover h2 {
  margin: 0 0 10px;
  font-size: 15px;
}

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

.discover-grid article {
  min-height: 82px;
  border-radius: 8px;
  background: #0d1219;
  padding: 12px;
  display: grid;
  align-content: center;
  gap: 3px;
}

.discover-grid strong {
  font-size: 18px;
}

.discover-grid small {
  color: var(--muted);
}

.discover-grid {
  grid-template-columns: 1fr 1fr;
  margin-bottom: 18px;
}

.suggestion-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 14px;
  padding: 10px 4px;
  background: transparent;
  color: var(--text);
  font-weight: 700;
}

.suggestion-heading-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.suggestion-toggle > span:first-child {
  display: grid;
  gap: 2px;
  text-align: left;
}

.suggestion-toggle small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}

.suggestion-see-all {
  min-height: 32px;
  padding: 0 5px;
  border: 0;
  color: var(--social-link);
  background: transparent;
  font-size: 11px;
  font-weight: 800;
}

.suggestion-see-all:is(:hover, :focus-visible) {
  color: var(--social-link-hover);
}

.suggestion-section {
  margin-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.profile-suggestion-section {
  min-width: 0;
  margin-top: 8px;
  padding: 15px 4px 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.profile-suggestion-section .section-heading {
  margin-bottom: 10px;
}

.profile-recommendation-row {
  padding-bottom: 12px;
}

.chevron {
  transition: transform 0.18s ease;
}

.chevron.open {
  transform: rotate(180deg);
}

.recommendation-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(132px, 150px);
  gap: 10px;
  overflow-x: auto;
  padding: 4px 0 8px;
}

.recommendation-row.expanded {
  animation: suggestionsDown 0.18s ease;
}

.recommend-card {
  position: relative;
  min-height: 206px;
  border: 1px solid rgba(255, 255, 255, 0.105);
  border-radius: 8px;
  background: #0d1219;
  padding: 12px;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 7px;
  text-align: center;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.16);
  transition: border-color 160ms ease, background 160ms ease, opacity 180ms ease, transform 180ms ease;
}

.recommend-card:is(:hover, :focus-within) {
  border-color: rgba(255, 255, 255, 0.18);
  background: #10161e;
}

.recommend-identity {
  width: 100%;
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 6px;
  color: var(--text);
  text-decoration: none;
}

.recommend-identity:active {
  opacity: 0.72;
}

.recommend-card > .account-action {
  width: 100%;
  margin-top: auto;
}

.recommend-dismiss {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 24px;
  height: 24px;
  min-height: 24px;
  padding: 0;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--soft);
}

.recommend-dismiss:is(:hover, :focus-visible) {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
}

.recommend-card .avatar {
  width: 58px;
  height: 58px;
}

.recommend-card strong,
.recommend-display-name,
.recommend-card small {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recommend-card strong {
  font-size: 12px;
}

.recommend-display-name {
  max-width: 100%;
  color: #aeb6c2;
  font-size: 10px;
}

.recommend-card small {
  color: var(--muted);
  min-height: 28px;
  white-space: normal;
  line-height: 1.3;
}

.recommendation-removing {
  opacity: 0;
  transform: scale(.94);
  pointer-events: none;
}

.follow-btn {
  width: 100%;
  background: var(--social-blue);
  color: #fff;
  border-color: transparent;
  font-weight: 700;
}

.story-card .story-preview {
  width: 100%;
  aspect-ratio: 9 / 12;
  max-height: 280px;
}

.story-preview {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: #05070b;
  margin-bottom: 10px;
  display: grid;
  place-items: center;
}

.story-preview img,
.story-preview video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: center;
}

.story-preview.compact {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  margin: 0;
}

.story-preview.compact img,
.story-preview.compact video {
  object-fit: cover;
}

.story-text-overlay {
  position: absolute;
  z-index: 4;
  width: max-content;
  min-width: 0;
  max-width: 86%;
  text-align: center;
  color: #fff;
  font-weight: 800;
  pointer-events: none;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 6px 10px;
  border-radius: 14px;
  line-height: 1.05;
}

.text-effect-shadow {
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.78);
}

.text-effect-glow {
  text-shadow: 0 0 12px currentColor, 0 0 28px currentColor;
}

.text-effect-neon {
  text-shadow: 0 0 6px #fff, 0 0 18px #ff5fb8, 0 0 34px #8e6cff;
}

.text-effect-sparkle {
  text-shadow: 0 0 5px #fff, 8px -7px 0 rgba(255, 255, 255, 0.9), -9px 5px 0 rgba(255, 214, 244, 0.82), 0 0 24px currentColor;
}

.text-effect-shimmer {
  background-image: linear-gradient(90deg, #aeb4c2, #fff 38%, #dbeafe 52%, #fff 66%, #aeb4c2) !important;
  background-size: 180% 100% !important;
  background-clip: text !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 4px 16px rgba(0, 0, 0, 0.42);
}

.text-effect-pixel {
  font-family: "SFMono-Regular", Consolas, monospace !important;
  text-shadow: 3px 0 0 rgba(255, 60, 121, 0.72), -3px 0 0 rgba(52, 211, 255, 0.72), 0 4px 0 rgba(0, 0, 0, 0.7);
}

.text-effect-none {
  text-shadow: none;
}

.text-effect-outline {
  text-shadow:
    -2px -2px 0 rgba(0, 0, 0, 0.9),
    2px -2px 0 rgba(0, 0, 0, 0.9),
    -2px 2px 0 rgba(0, 0, 0, 0.9),
    2px 2px 0 rgba(0, 0, 0, 0.9),
    0 4px 16px rgba(0, 0, 0, 0.45);
}

.text-effect-lift {
  text-shadow: 6px 8px 0 rgba(0, 0, 0, 0.68), 0 13px 26px rgba(0, 0, 0, 0.34);
}

.text-effect-rainbow {
  background-image: linear-gradient(90deg, #ff304f, #ff8a00, #ffd166, #2f8b83, #285f88, #9f7cff) !important;
  background-size: 200% 100% !important;
  background-clip: text !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 4px 16px rgba(0, 0, 0, 0.38);
}

.text-anim-fade {
  animation: storyTextFade 0.55s ease both;
}

.text-anim-rise {
  animation: storyTextRise 0.58s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.text-anim-pop {
  animation: storyTextPop 0.42s cubic-bezier(0.2, 1.35, 0.3, 1) both;
}

.text-anim-type {
  animation: storyTextType 0.9s steps(12, end) both;
}

.text-anim-bounce {
  animation: storyTextBounce 0.72s cubic-bezier(0.22, 1.5, 0.36, 1) both;
}

.text-anim-flicker {
  animation: storyTextFlicker 1.35s linear both;
}

.text-anim-pulse {
  animation: storyTextPulse 1.3s ease-in-out infinite alternate;
}

.story-media-effect,
.story-vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  contain: strict;
}

.story-editor-page .story-media-effect-grain {
  animation-duration: 0.7s;
}

.story-editor-page .story-media-effect-sparkle {
  animation-duration: 2s;
}

.story-media-effect-grain {
  opacity: 0.42;
  background-image:
    repeating-radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.17) 0 1px, transparent 1px 4px),
    repeating-radial-gradient(circle at 70% 65%, rgba(0, 0, 0, 0.2) 0 1px, transparent 1px 5px);
  background-size: 9px 11px, 13px 15px;
  mix-blend-mode: overlay;
  animation: storyGrain 0.22s steps(2) infinite;
}

.story-media-effect-dream {
  background: radial-gradient(circle at 50% 38%, rgba(255, 255, 255, 0.24), rgba(224, 176, 255, 0.08) 44%, transparent 76%);
  mix-blend-mode: screen;
}

.story-media-effect-vhs {
  opacity: 0.58;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 2px, rgba(0, 0, 0, 0.1) 2px 5px);
  mix-blend-mode: overlay;
  animation: storyScan 4s linear infinite;
}

.story-media-effect-spotlight {
  background: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.08) 38%, transparent 68%);
  mix-blend-mode: screen;
}

.story-media-effect-sparkle {
  background-image:
    radial-gradient(circle at 16% 22%, rgba(255, 255, 255, 0.95) 0 2px, transparent 3px),
    radial-gradient(circle at 78% 18%, rgba(255, 255, 255, 0.88) 0 3px, transparent 4px),
    radial-gradient(circle at 66% 63%, rgba(255, 255, 255, 0.92) 0 2px, transparent 3px),
    radial-gradient(circle at 28% 76%, rgba(255, 255, 255, 0.82) 0 3px, transparent 4px);
  animation: storySparkle 1.4s ease-in-out infinite alternate;
}

.story-media-effect-chroma {
  background: linear-gradient(90deg, rgba(255, 20, 95, 0.2), transparent 42%, transparent 58%, rgba(0, 220, 255, 0.18));
  mix-blend-mode: screen;
}

.story-vignette {
  background: radial-gradient(circle, transparent 36%, rgba(0, 0, 0, 0.94) 100%);
}

.story-drawing-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.story-drawing-layer path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.story-drawing-layer .story-brush-marker {
  opacity: 0.42;
  mix-blend-mode: screen;
}

.story-drawing-layer .story-brush-neon {
  filter: drop-shadow(0 0 2px currentColor) drop-shadow(0 0 5px currentColor);
}

.story-drawing-layer .story-brush-chalk {
  opacity: 0.78;
  stroke-dasharray: 0.8 0.55;
}

.story-sticker {
  position: absolute;
  z-index: 3;
  display: inline-grid;
  place-items: center;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 999px;
  color: #111827;
  background: rgba(255, 255, 255, 0.9);
  font-weight: 850;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
  pointer-events: none;
  transform-origin: center;
}

.story-sticker-emoji {
  padding: 0;
  min-height: 0;
  background: transparent;
  box-shadow: none;
  color: #fff;
  font-size: 54px;
  animation: stickerFloat 1.8s ease-in-out infinite alternate;
}

.story-sticker-gif {
  color: #fff;
  background: linear-gradient(135deg, #ff5fb8, #8e6cff);
  animation: stickerPulse 0.9s ease-in-out infinite alternate;
}

.story-sticker-question {
  background: rgba(255, 255, 255, 0.92);
}

.story-sticker-hashtag {
  background: rgba(47, 139, 131, 0.92);
}

.story-sticker-countdown {
  color: #fff;
  background: rgba(17, 24, 39, 0.82);
}

.story-sticker-location {
  color: #fff;
  background: rgba(30, 64, 175, 0.88);
}

.story-sticker-link,
.story-sticker-add_yours,
.story-sticker-quiz,
.story-sticker-emoji_slider,
.story-sticker-time,
.story-sticker-weather,
.story-sticker-captions {
  color: #fff;
  background: rgba(22, 24, 31, 0.88);
}

.story-sticker-link {
  display: inline-flex;
  grid-template-columns: 18px auto;
  align-items: center;
  gap: 7px;
  color: #10131a;
  background: rgba(255, 255, 255, 0.94);
  text-decoration: none;
  pointer-events: auto;
}

.story-sticker-link .ui-icon {
  width: 17px;
  height: 17px;
}

.story-viewer-stage .story-sticker-link {
  z-index: 93;
}

.story-sticker-add_yours {
  color: #17131d;
  background: linear-gradient(135deg, #fff, #ffd7eb);
}

.story-sticker-emoji_slider {
  background: linear-gradient(135deg, #ff5ca8, #8b5cf6);
}

.story-sticker-time {
  color: #fff;
  background: rgba(0, 0, 0, 0.58);
  font-size: 24px;
}

.story-sticker-captions {
  color: #10131a;
  background: rgba(255, 240, 90, 0.94);
}

.story-audio-sticker {
  position: absolute;
  left: 50%;
  bottom: 8%;
  transform: translateX(-50%);
  z-index: 4;
  width: min(360px, 84%);
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 18px;
  background: rgba(5, 7, 11, 0.72);
  color: var(--text);
  backdrop-filter: blur(14px);
}

.story-audio-sticker audio {
  grid-column: 1 / -1;
  width: 100%;
  height: 34px;
}

.story-poll-sticker {
  position: absolute;
  left: 50%;
  top: 58%;
  transform: translate(-50%, -50%);
  width: min(340px, 78%);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.94);
  color: #111827;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.34);
  z-index: 3;
}

.story-poll-sticker strong {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 16px;
  line-height: 1.15;
}

.story-poll-sticker span {
  min-width: 0;
  display: grid;
  place-items: center;
  min-height: 34px;
  padding: 6px;
  border-radius: 999px;
  background: #eef2f7;
  font-weight: 800;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.highlight-strip {
  margin: 8px 0 14px;
}

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

.highlight-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  align-items: start;
}

.highlight-item {
  display: grid;
  justify-items: center;
  gap: 5px;
  min-width: 76px;
}

.highlight-add,
.highlight-media {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
}

.highlight-add {
  display: grid;
  justify-items: center;
  gap: 5px;
  min-width: 76px;
}

.highlight-add span {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.045);
  color: rgba(244, 247, 251, 0.92);
  font-size: 30px;
  line-height: 1;
}

.highlight-media {
  border-radius: 50%;
}

.public-highlights .highlight-media {
  width: 68px;
  height: 68px;
  overflow: hidden;
  display: block;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.public-highlights .highlight-media img,
.public-highlights .highlight-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.highlight-item small {
  color: var(--muted);
  font-size: 11px;
}

.highlight-title {
  max-width: 76px;
  padding: 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.highlight-title:focus-visible {
  color: var(--text);
  outline: 1px solid rgba(255, 255, 255, 0.6);
  outline-offset: 3px;
  border-radius: 3px;
}

.highlight-composer-overlay {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  animation: overlay-fade-in 160ms ease-out both;
}

.highlight-composer {
  width: min(440px, 100%);
  max-height: min(680px, calc(var(--visual-height, var(--app-height, 100dvh)) - 36px));
  overflow: hidden auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text);
  background: #11151d;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.56);
  animation: highlight-composer-in 210ms cubic-bezier(.2, .8, .2, 1) both;
}

.highlight-composer-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  align-items: center;
  min-height: 54px;
  padding: 5px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(17, 21, 29, 0.96);
  backdrop-filter: blur(14px);
}

.highlight-composer-head strong {
  text-align: center;
  font-size: 14px;
}

.highlight-composer-icon {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--text);
  background: transparent;
}

.highlight-composer-icon:hover {
  background: rgba(255, 255, 255, 0.08);
}

.highlight-composer-icon .ui-icon {
  width: 20px;
  height: 20px;
}

.highlight-create-story,
.highlight-target-row {
  width: 100%;
  min-height: 68px;
  padding: 10px 14px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: grid;
  grid-template-columns: 46px 1fr 18px;
  align-items: center;
  gap: 11px;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.highlight-create-story:hover,
.highlight-target-row:hover {
  background: rgba(255, 255, 255, 0.045);
}

.highlight-create-story > span:first-child,
.highlight-target-cover {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
}

.highlight-create-story .ui-icon,
.highlight-target-row > .ui-icon {
  width: 18px;
  height: 18px;
}

.highlight-target-row > .ui-icon,
.highlight-create-story > .ui-icon {
  transform: rotate(-90deg);
  color: var(--muted);
}

.highlight-create-story strong,
.highlight-create-story small,
.highlight-target-row strong,
.highlight-target-row small {
  display: block;
}

.highlight-create-story small,
.highlight-target-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.highlight-library-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 17px 14px 10px;
}

.highlight-library-head strong {
  font-size: 13px;
}

.highlight-library-head small {
  color: var(--muted);
  font-size: 10px;
}

.highlight-story-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  padding: 0 2px 2px;
}

.highlight-story-grid > button {
  position: relative;
  aspect-ratio: 9 / 16;
  padding: 0;
  border: 0;
  overflow: hidden;
  color: var(--text);
  background: #080a0e;
}

.highlight-story-grid .story-preview,
.highlight-target-cover .story-preview,
.highlight-story-grid img,
.highlight-story-grid video,
.highlight-target-cover img,
.highlight-target-cover video {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.highlight-story-grid > button > span {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(0, 0, 0, 0.72);
  font-size: 10px;
  font-weight: 800;
}

.highlight-empty {
  margin: 0;
  padding: 28px 20px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.highlight-new-target,
.highlight-name-editor {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.highlight-new-target {
  grid-template-columns: 1fr auto;
}

.highlight-new-target input,
.highlight-name-editor input {
  min-width: 0;
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 7px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
  font: inherit;
}

.highlight-name-editor label {
  color: var(--muted);
  font-size: 11px;
}

.highlight-new-target button,
.highlight-confirm {
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 7px;
  color: #07111f;
  background: #f7f9fc;
  font-weight: 800;
}

@keyframes highlight-composer-in {
  from { opacity: 0; transform: translateY(12px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.story-engagement {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 10px;
}

.story-engagement.compact {
  gap: 6px;
  margin: 0;
}

.story-engagement button {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(237, 245, 255, 0.74);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
}

.story-engagement .ui-icon {
  width: 17px;
  height: 17px;
}

.story-engagement.compact .ui-icon {
  width: 14px;
  height: 14px;
}

.story-engagement button.active {
  color: #ff5fb8;
}

.danger-zone {
  background: rgba(255, 107, 122, 0.05);
  border-color: rgba(255, 107, 122, 0.22);
}

.logout-btn {
  width: 100%;
  color: #ff8e9a;
}

.chat-profile-content {
  overflow: auto;
  padding: 18px clamp(14px, 3vw, 34px);
}

.peer-profile-hero {
  display: grid;
  justify-items: center;
  gap: 7px;
  text-align: center;
  padding: 20px 0 24px;
}

.big-avatar {
  width: 92px;
  height: 92px;
  position: relative;
}

.story-avatar-btn {
  padding: 0;
  border: 0;
}

.peer-profile-hero > strong {
  font-size: 22px;
}

.peer-profile-hero > span,
.peer-profile-hero > p {
  color: var(--muted);
  margin: 0;
}

.peer-profile-stats {
  width: min(250px, 100%);
  margin: 6px auto 2px;
}

.profile-control-list {
  display: grid;
  gap: 8px;
}

.profile-control-list button {
  width: 100%;
  justify-content: flex-start;
}

.profile-hero .avatar {
  width: 78px;
  height: 78px;
}

.panel-card h2,
.panel-card h3 {
  margin: 0 0 12px;
  font-size: 16px;
  letter-spacing: 0;
}

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

.sticker-panel {
  border-top: 1px solid var(--line);
  padding: 10px clamp(10px, 2vw, 20px);
  background: #05070b;
  display: grid;
  gap: 10px;
}

.sticker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 8px;
}

.sticker-tile {
  aspect-ratio: 1;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.045);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.sticker-tile img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.call-dock {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: min(420px, calc(100vw - 32px));
  background: #0d131d;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 12px;
  z-index: 20;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  align-items: end;
  background: rgba(0, 0, 0, 0.36);
  animation: overlayIn 0.18s ease;
}

.overlay.closing {
  pointer-events: none;
  animation: overlayOut 0.18s ease forwards;
}

.overlay.no-motion,
.overlay.no-motion.closing {
  animation: none;
}

.center-overlay {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.46);
  animation: modalBackdropIn 0.18s ease both;
}

.center-modal,
.crop-modal {
  width: min(430px, 100%);
  max-height: min(720px, calc(var(--app-height) - 36px));
  overflow: auto;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #080c13;
  padding: 14px;
  box-shadow: var(--shadow);
  animation: modalPopIn 0.22s cubic-bezier(0.2, 0.82, 0.2, 1) both;
}

.media-viewer {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.94);
  animation: viewerFadeIn 0.18s ease both;
}

.media-viewer img,
.media-viewer video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  animation: viewerMediaIn 0.24s cubic-bezier(0.2, 0.82, 0.2, 1) both;
}

.media-close {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  right: 14px;
  background: rgba(255, 255, 255, 0.12);
}

.story-editor-page {
  position: fixed;
  inset: auto 0 auto;
  top: var(--visual-top);
  width: 100%;
  height: var(--visual-height);
  z-index: 80;
  background: #020305;
  overflow: hidden;
  overscroll-behavior: none;
  color: var(--text);
}

.story-editor-canvas {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.story-editor-preview {
  width: 100%;
  height: var(--visual-height);
  position: relative;
  overflow: hidden;
  border-radius: 0;
  background: #05070b;
  display: grid;
  place-items: center;
  margin: 0;
  touch-action: none;
}

.story-editor-preview img,
.story-editor-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: center;
  will-change: transform;
  user-select: none;
  -webkit-user-drag: none;
}

.story-draggable-text {
  position: absolute;
  z-index: 4;
  width: max-content;
  max-width: 82%;
  min-width: 0;
  min-height: 0;
  padding: 6px 10px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: #fff;
  font-size: 44px;
  line-height: 1.05;
  font-weight: 850;
  text-align: center;
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.78);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.story-draggable-text.empty {
  color: rgba(255, 255, 255, 0.48);
  outline: 0;
}

.story-top-bar {
  position: absolute;
  left: max(10px, env(safe-area-inset-left));
  right: max(10px, env(safe-area-inset-right));
  top: max(10px, env(safe-area-inset-top));
  z-index: 5;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.story-top-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: min(330px, calc(100vw - 64px));
}

.story-top-btn {
  width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--text);
  background: rgba(0, 0, 0, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(14px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.story-top-btn.active {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.44);
  transform: translateY(-1px);
}

.story-top-btn .ui-icon {
  width: 19px;
  height: 19px;
}

.story-top-btn .ui-icon svg {
  stroke-width: 2.25;
}

.story-aa {
  font-size: 17px;
  font-weight: 850;
  letter-spacing: 0;
}

.story-close-btn {
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.18);
}

.story-floating-tray {
  position: absolute;
  left: max(10px, env(safe-area-inset-left));
  right: max(10px, env(safe-area-inset-right));
  bottom: calc(74px + env(safe-area-inset-bottom));
  z-index: 5;
  display: grid;
  justify-items: center;
  gap: 9px;
  pointer-events: none;
}

.story-floating-tray > * {
  pointer-events: auto;
}

.story-size-control {
  position: absolute;
  left: calc(14px + env(safe-area-inset-left));
  top: 50%;
  z-index: 8;
  width: 36px;
  height: 188px;
  padding: 7px 0;
  border: 0;
  border-radius: 999px;
  display: grid;
  grid-template-rows: 24px 1fr 24px;
  place-items: center;
  color: #fff;
  background: rgba(5, 7, 11, 0.38);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px) saturate(1.15);
  transform: translateY(-50%);
}

.story-size-control .story-size-slider {
  --range-progress: 30%;
  position: absolute;
  left: 50%;
  top: 50%;
  width: 122px;
  height: 24px;
  margin: 0;
  padding: 0;
  border: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  transform: translate(-50%, -50%) rotate(-90deg);
  filter: none;
  touch-action: none;
  user-select: none;
}

.story-size-control .story-size-slider::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, #fff 0 var(--range-progress), rgba(255, 255, 255, 0.28) var(--range-progress) 100%);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.22);
}

.story-size-control .story-size-slider::-webkit-slider-thumb {
  width: 19px;
  height: 19px;
  margin-top: -8px;
  border: 3px solid rgba(17, 20, 27, 0.94);
  border-radius: 50%;
  appearance: none;
  -webkit-appearance: none;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.52), 0 4px 14px rgba(0, 0, 0, 0.46);
}

.story-size-control .story-size-slider::-moz-range-track {
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, #fff 0 var(--range-progress), rgba(255, 255, 255, 0.28) var(--range-progress) 100%);
}

.story-size-control .story-size-slider::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border: 3px solid rgba(17, 20, 27, 0.94);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.52), 0 4px 14px rgba(0, 0, 0, 0.46);
}

.story-size-control > span {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.story-size-large {
  font-size: 15px;
  font-weight: 850;
}

.story-size-small {
  font-size: 9px;
  font-weight: 750;
}

.story-brush-large,
.story-brush-small {
  border-radius: 50%;
  background: #fff;
}

.story-brush-large {
  width: 14px;
  height: 14px;
}

.story-brush-small {
  width: 5px;
  height: 5px;
}

.story-post-btn {
  position: absolute;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 5;
  height: 42px;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  background: #f4f7fb;
  color: #05070b;
}

.story-swatch-row,
.story-pill-row,
.story-sticker-dock {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  max-width: 100%;
  padding: 1px 2px;
  scrollbar-width: none;
}

.story-swatch-row::-webkit-scrollbar,
.story-pill-row::-webkit-scrollbar,
.story-sticker-dock::-webkit-scrollbar {
  display: none;
}

.story-swatch-row button {
  width: 28px;
  height: 28px;
  min-height: 28px;
  border-radius: 50%;
  padding: 0;
  background: var(--swatch);
  border: 2px solid rgba(255, 255, 255, 0.26);
}

.story-swatch-row button.active {
  box-shadow: 0 0 0 2px #fff;
}

.story-pill-row button,
.story-sticker-dock button,
.story-audio-pick,
.story-range,
.story-mini-grid label {
  min-height: 34px;
  border-radius: 999px;
  padding: 0 12px;
  background: rgba(0, 0, 0, 0.42);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(14px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

.story-pill-row button.active,
.story-sticker-dock button.active {
  background: rgba(255, 255, 255, 0.9);
  color: #05070b;
}

.story-pill-row .ui-icon {
  width: 17px;
  height: 17px;
}

.story-caption-input {
  width: min(420px, calc(100vw - 24px));
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 0 16px;
  background: rgba(0, 0, 0, 0.42);
  color: var(--text);
  outline: none;
  backdrop-filter: blur(14px);
  text-align: center;
}

.story-caption-input:focus {
  border-color: rgba(255, 255, 255, 0.46);
}

.story-range {
  gap: 10px;
}

.story-range input {
  width: 160px;
  accent-color: #fff;
}

.story-mini-grid {
  display: flex;
  gap: 8px;
}

.story-mini-grid input {
  width: 76px;
  border: 0;
  background: transparent;
  color: var(--text);
  outline: none;
}

.story-audio-edit {
  display: grid;
  gap: 10px;
}

.story-audio-edit audio {
  width: 100%;
}

.overlay.over-story {
  z-index: 100;
}

.story-editor-page {
  height: var(--visual-height);
  background: #030405;
  isolation: isolate;
}

.story-editor-canvas {
  background: #030405;
}

.story-editor-preview {
  height: var(--visual-height);
  background: #0a0c10;
}

.story-editor-preview img,
.story-editor-preview video {
  object-fit: cover;
}

.story-draggable-text,
.story-live-text {
  position: absolute;
  z-index: 7;
  max-width: 84%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 6px 10px;
  border-radius: 12px;
  color: #fff;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  will-change: left, top, transform, font-size;
}

.story-draggable-text {
  width: max-content;
  cursor: grab;
}

.story-live-text {
  width: auto;
  min-width: 4ch;
  max-height: 46vh;
  resize: none;
  overflow: hidden;
  outline: 0;
  field-sizing: content;
  caret-color: currentColor;
  user-select: text;
  -webkit-user-select: text;
}

.story-live-text::placeholder {
  color: rgba(255, 255, 255, 0.62);
}

.story-editor-preview .story-editor-sticker {
  pointer-events: auto;
  border: 0;
  touch-action: none;
  cursor: grab;
}

.story-object-trash {
  position: absolute;
  left: 50%;
  bottom: calc(68px + env(safe-area-inset-bottom));
  z-index: 8;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(16, 17, 20, 0.82);
  opacity: 0;
  transform: translate(-50%, 12px) scale(0.82);
  transition: opacity 0.14s ease, transform 0.14s ease, background 0.14s ease;
  pointer-events: none;
}

.story-object-trash.visible {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.story-object-trash.active {
  background: #e63f5b;
  transform: translate(-50%, 0) scale(1.14);
}

.story-object-trash .ui-icon {
  width: 21px;
  height: 21px;
}

.story-sticker-mention {
  color: #fff;
  background: rgba(94, 57, 180, 0.9);
}

.story-top-bar {
  top: calc(10px + env(safe-area-inset-top));
  left: max(10px, env(safe-area-inset-left));
  right: max(10px, env(safe-area-inset-right));
  align-items: center;
}

.story-top-tools {
  max-width: calc(100vw - 58px);
  flex-wrap: nowrap;
  gap: 4px;
}

.story-top-btn {
  width: 34px;
  height: 34px;
  min-height: 34px;
  border: 0;
  background: transparent;
  box-shadow: none;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.72));
}

.story-top-btn.active {
  background: rgba(0, 0, 0, 0.46);
  border-color: transparent;
}

.story-top-bar .story-close-btn {
  background: rgba(0, 0, 0, 0.38);
}

.story-top-btn .ui-icon {
  width: 20px;
  height: 20px;
}

.story-close-btn .ui-icon {
  width: 22px;
  height: 22px;
}

.story-aa-frame {
  border: 1px solid currentColor;
  border-radius: 3px;
  padding: 0 2px;
}

.story-done-btn {
  min-height: 34px;
  padding: 0 4px;
  border-radius: 0;
  color: #fff;
  background: transparent;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  font-weight: 800;
}

.story-mode-topbar {
  justify-content: space-between;
}

.story-draw-topbar .story-brush-row {
  position: absolute;
  left: 50%;
  max-width: calc(100% - 102px);
  overflow-x: auto;
  transform: translateX(-50%);
  scrollbar-width: none;
}

.story-draw-topbar .story-brush-row::-webkit-scrollbar {
  display: none;
}

.story-floating-tray {
  position: absolute;
  inset: auto;
  z-index: 7;
  pointer-events: none;
}

.story-floating-tray > * {
  pointer-events: auto;
}

.story-text-tray {
  left: 50%;
  right: auto;
  bottom: calc(6px + env(safe-area-inset-bottom));
  width: min(680px, 100vw);
  transform: translateX(-50%);
  display: block;
  max-height: none;
  overflow: visible;
}

.story-draw-tray {
  left: 50%;
  right: auto;
  bottom: calc(12px + env(safe-area-inset-bottom));
  width: min(520px, calc(100vw - 20px));
  transform: translateX(-50%);
  display: block;
}

.story-filter-tray {
  left: 50%;
  right: auto;
  bottom: calc(10px + env(safe-area-inset-bottom));
  width: min(680px, 100vw);
  transform: translateX(-50%);
}

.story-brush-row button {
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: transparent;
}

.story-brush-row .ui-icon {
  width: 19px;
  height: 19px;
}

.story-stickers-tray,
.story-audio-tray {
  inset: 0;
}

.story-more-tray {
  top: calc(54px + env(safe-area-inset-top));
  right: max(10px, env(safe-area-inset-right));
}

.story-share-bar {
  position: absolute;
  left: max(14px, env(safe-area-inset-left));
  right: max(14px, env(safe-area-inset-right));
  bottom: calc(10px + env(safe-area-inset-bottom));
  z-index: 6;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

.story-share-bar button {
  pointer-events: auto;
}

.story-share-pill {
  min-height: 44px;
  padding: 5px 15px 5px 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #08090b;
  background: #fff;
}

.story-share-pill .avatar {
  width: 34px;
  height: 34px;
  border: 0;
  font-size: 11px;
}

.story-share-send {
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #08090b;
  background: #fff;
}

.story-share-send .ui-icon {
  width: 20px;
  height: 20px;
}

.story-send-story {
  min-height: 44px;
  padding: 0 17px;
  border-radius: 999px;
  color: #08090b;
  background: #fff;
  font-weight: 800;
  white-space: nowrap;
}

@media (max-width: 600px) {
  .highlight-composer-overlay {
    align-items: end;
    padding: 0;
  }

  .highlight-composer {
    width: 100%;
    max-height: min(78dvh, calc(var(--visual-height, var(--app-height, 100dvh)) - 12px));
    border-width: 1px 0 0;
    border-radius: 8px 8px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
    animation-name: highlight-composer-mobile-in;
  }

  @keyframes highlight-composer-mobile-in {
    from { opacity: .6; transform: translateY(100%); }
    to { opacity: 1; transform: translateY(0); }
  }
}

.story-swatch-row {
  justify-content: center;
  padding: 3px;
}

.story-draw-colors {
  width: 100%;
  min-height: 46px;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(16px);
}

.story-custom-color {
  position: relative;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 50%;
  padding: 3px;
  background: conic-gradient(#ff304f, #ffd166, #2f8b83, #285f88, #9f7cff, #ff304f);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.76);
  overflow: hidden;
}

.story-custom-color input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.story-text-choice-rail .story-custom-color {
  background: conic-gradient(#ff304f, #ffd166, #2f8b83, #285f88, #9f7cff, #ff304f);
}

.story-swatch-row button {
  width: 30px;
  height: 30px;
  min-height: 30px;
  border: 2px solid rgba(255, 255, 255, 0.72);
}

.story-swatch-row button.active {
  box-shadow: 0 0 0 2px #111, 0 0 0 4px #fff;
}

.story-text-composer {
  width: 100%;
  display: grid;
  gap: 7px;
  padding: 0 8px;
}

.story-text-choice-rail {
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  padding: 3px 16px 5px;
  scroll-snap-type: x proximity;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
}

.story-text-choice-rail::-webkit-scrollbar {
  display: none;
}

.story-text-choice-rail button {
  position: relative;
  flex: 0 0 auto;
  min-height: 50px;
  padding: 0 10px;
  border-radius: 0;
  border: 0;
  color: #fff;
  background: transparent;
  white-space: nowrap;
  scroll-snap-align: center;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.78);
}

.story-text-choice-rail button::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 0;
  height: 2px;
  border-radius: 999px;
  background: #fff;
  transform: translateX(-50%);
  transition: width 0.16s ease;
}

.story-text-choice-rail button.active::after {
  width: 24px;
}

.story-font-choice {
  min-width: 82px;
  font-size: 15px;
}

.story-font-choice span {
  display: block;
  max-width: 116px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.story-effect-choice,
.story-animation-choice {
  min-width: 62px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
}

.story-effect-choice small,
.story-animation-choice small {
  color: rgba(255, 255, 255, 0.72);
  font-size: 9px;
}

.story-text-option-preview {
  min-width: 42px;
  min-height: 30px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 22px;
  font-weight: 850;
  line-height: 1;
}

.story-color-choices {
  justify-content: flex-start;
  gap: 13px;
}

.story-text-choice-rail .story-color-choice {
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.78);
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
}

.story-text-choice-rail .story-color-choice::after {
  display: none;
}

.story-text-choice-rail .story-color-choice.active {
  box-shadow: 0 0 0 2px #101114, 0 0 0 4px #fff;
}

.story-text-choice-rail .story-color-sampler,
.story-draw-colors .story-draw-sampler {
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.54);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(0, 0, 0, 0.42);
}

.story-text-choice-rail .story-color-sampler::after {
  display: none;
}

.story-color-sampler .ui-icon,
.story-draw-sampler .ui-icon {
  width: 16px;
  height: 16px;
}

.story-text-format-bar {
  justify-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 44px;
  padding: 4px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.56);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
}

.story-text-format-bar button {
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: transparent;
}

.story-text-format-bar button.active {
  color: #07090c;
  background: #fff;
}

.story-text-format-bar .ui-icon {
  width: 18px;
  height: 18px;
}

.story-color-wheel {
  width: 20px;
  height: 20px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: conic-gradient(#ff304f, #ffd166, #2f8b83, #285f88, #9f7cff, #ff304f);
}

.story-text-format-bar button.active .story-color-wheel {
  border-color: #07090c;
}

.story-animation-choice:is(:hover, :focus-visible) .preview-fade,
.story-animation-choice.active .preview-fade { animation: storyTextFade 0.55s ease both; }
.story-animation-choice:is(:hover, :focus-visible) .preview-rise,
.story-animation-choice.active .preview-rise { animation: storyTextRise 0.58s ease both; }
.story-animation-choice:is(:hover, :focus-visible) .preview-pop,
.story-animation-choice.active .preview-pop { animation: storyTextPop 0.42s ease both; }
.story-animation-choice:is(:hover, :focus-visible) .preview-type,
.story-animation-choice.active .preview-type { animation: storyTextType 0.9s steps(12, end) both; }
.story-animation-choice:is(:hover, :focus-visible) .preview-bounce,
.story-animation-choice.active .preview-bounce { animation: storyTextBounce 0.72s ease both; }
.story-animation-choice:is(:hover, :focus-visible) .preview-flicker,
.story-animation-choice.active .preview-flicker { animation: storyTextFlicker 1.35s linear both; }
.story-animation-choice:is(:hover, :focus-visible) .preview-pulse,
.story-animation-choice.active .preview-pulse { animation: storyTextPulse 0.8s ease-in-out 2 alternate; }

.story-filter-carousel {
  width: 100%;
  display: flex;
  justify-content: flex-start;
  gap: 14px;
  overflow-x: auto;
  padding: 5px 18px 7px;
  scrollbar-width: none;
}

.story-filter-carousel::-webkit-scrollbar {
  display: none;
}

.story-filter-carousel button {
  flex: 0 0 62px;
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 0;
  color: rgba(255, 255, 255, 0.76);
  background: transparent;
}

.story-filter-carousel button > span {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  background-size: cover;
  background-position: center;
}

.story-filter-carousel button.active > span {
  border-color: #fff;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.55), 0 0 0 4px #fff;
}

.story-filter-carousel small {
  font-size: 11px;
  text-transform: capitalize;
}

.story-effects-panel {
  width: min(660px, calc(100vw - 18px));
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 0 4px;
  overflow: hidden;
  color: #fff;
  background: transparent;
}

.story-editor-mode-switch {
  order: 2;
  align-self: center;
  display: flex;
  max-width: calc(100vw - 24px);
  overflow-x: auto;
  gap: 2px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.58);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
  scrollbar-width: none;
}

.story-editor-mode-switch::-webkit-scrollbar {
  display: none;
}

.story-editor-mode-switch button {
  min-height: 32px;
  padding: 0 13px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.78);
  background: transparent;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.story-editor-mode-switch button.active {
  color: #08090b;
  background: #fff;
}

.story-effect-browser {
  order: 1;
  min-height: 70px;
  display: grid;
  align-items: center;
}

.story-background-carousel,
.story-overlay-effects {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 5px 18px 7px;
  scrollbar-width: none;
}

.story-background-carousel::-webkit-scrollbar,
.story-overlay-effects::-webkit-scrollbar,
.story-adjustment-picker::-webkit-scrollbar {
  display: none;
}

.story-background-carousel button,
.story-overlay-effects button {
  flex: 0 0 58px;
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 0;
  color: rgba(255, 255, 255, 0.72);
  background: transparent;
}

.story-background-carousel button > span,
.story-overlay-effects .effect-preview {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.28);
  background: linear-gradient(145deg, var(--bg-from), var(--bg-to));
  overflow: hidden;
}

.story-background-carousel button.active > span,
.story-overlay-effects button.active .effect-preview {
  border-color: #fff;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.58), 0 0 0 4px #fff;
}

.story-background-carousel small,
.story-overlay-effects small {
  max-width: 66px;
  overflow: hidden;
  color: inherit;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-overlay-effects .effect-preview {
  color: #fff;
  background: #161922;
}

.story-overlay-effects .effect-preview .ui-icon {
  width: 18px;
  height: 18px;
}

.story-overlay-effects .effect-grain {
  background: repeating-radial-gradient(circle, #8b8e98 0 1px, #242731 1px 4px);
}

.story-overlay-effects .effect-dream {
  background: radial-gradient(circle, #f8eaff, #7a5aa7);
}

.story-overlay-effects .effect-vhs {
  background: repeating-linear-gradient(0deg, #20232b 0 3px, #737786 3px 5px);
}

.story-overlay-effects .effect-spotlight {
  background: radial-gradient(circle, #fff, #2b2e36 70%);
}

.story-overlay-effects .effect-sparkle {
  background: linear-gradient(145deg, #31194b, #e4589c);
}

.story-overlay-effects .effect-chroma {
  background: linear-gradient(90deg, #ef336c, #242733 48%, #24cde2);
}

.story-adjustment-picker {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 2px 12px 5px;
  scrollbar-width: none;
}

.story-adjustment-picker button {
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(0, 0, 0, 0.38);
  font-size: 10px;
  white-space: nowrap;
}

.story-adjustment-picker button.active {
  color: #08090b;
  background: #fff;
}

.story-adjustment-control {
  width: min(430px, calc(100vw - 36px));
  justify-self: center;
  display: grid;
  gap: 7px;
  padding: 6px 12px 9px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.82);
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(14px);
  font-size: 11px;
}

.story-adjustment-control > span {
  display: flex;
  justify-content: space-between;
  gap: 6px;
}

.story-adjustment-control output {
  color: #fff;
}

.story-adjustment-control input {
  width: 100%;
  accent-color: #fff;
}

.story-brush-row {
  display: flex;
  gap: 3px;
  padding: 3px 4px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(16px);
}

.story-brush-row button.active {
  color: #08090b;
  background: #fff;
}

.story-undo-btn {
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
}

.story-undo-btn .ui-icon {
  width: 18px;
  height: 18px;
}

.story-sticker-sheet {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: min(560px, 100%);
  max-height: min(640px, 66vh);
  overflow: auto;
  transform: translateX(-50%);
  padding: 8px 14px calc(18px + env(safe-area-inset-bottom));
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-bottom: 0;
  border-radius: 24px 24px 0 0;
  color: #f7f7f8;
  background: rgba(20, 22, 27, 0.98);
  box-shadow: 0 -18px 60px rgba(0, 0, 0, 0.44);
  backdrop-filter: blur(24px);
  animation: storySheetUp 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
  scrollbar-width: none;
}

.story-sticker-sheet::-webkit-scrollbar {
  display: none;
}

.story-sheet-grabber {
  width: 38px;
  height: 4px;
  margin: 0 auto 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.3);
}

.story-sticker-sheet header {
  min-height: 42px;
  display: grid;
  grid-template-columns: 38px 1fr 38px;
  align-items: center;
  text-align: center;
}

.story-sticker-sheet header button {
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: transparent;
}

.story-sticker-sheet header button:last-child {
  background: rgba(255, 255, 255, 0.1);
}

.story-sticker-sheet header strong {
  font-size: 16px;
}

.story-sticker-search {
  height: 40px;
  margin: 7px 0 14px;
  padding: 0 12px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #a7aab2;
  background: #2a2c32;
}

.story-sticker-search .ui-icon {
  width: 18px;
  height: 18px;
}

.story-sticker-search input,
.story-sheet-input,
.story-poll-options input {
  width: 100%;
  border: 0;
  outline: 0;
  color: #fff;
  background: transparent;
}

.story-sticker-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 8px;
}

.story-sticker-grid > button {
  min-width: 0;
  min-height: 68px;
  padding: 4px;
  display: grid;
  place-items: center;
  color: #fff;
  background: transparent;
}

.story-sticker-grid > button[hidden] {
  display: none;
}

.story-sticker-grid .raw-emoji {
  font-size: 48px;
  line-height: 1;
}

.mention-sticker,
.location-sticker,
.gif-sticker,
.music-sticker,
.poll-choice,
.question-sticker,
.hashtag-sticker,
.countdown-sticker,
.add-yours-sticker,
.link-sticker,
.emoji-slider-sticker,
.quiz-sticker,
.time-sticker,
.weather-sticker,
.captions-sticker {
  max-width: 100%;
  min-height: 42px;
  padding: 8px 13px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0;
  color: #15161a;
  background: #fff;
}

.mention-sticker,
.gif-sticker {
  color: #fff;
  background: #7c4dff;
}

.gif-sticker {
  animation: stickerPulse 0.9s ease-in-out infinite alternate;
}

.music-sticker {
  background: #ff5ca8;
}

.hashtag-sticker {
  background: #58d4c2;
}

.countdown-sticker {
  color: #fff;
  background: #20222a;
}

.add-yours-sticker {
  background: linear-gradient(135deg, #fff, #ffd7eb);
}

.link-sticker,
.quiz-sticker {
  color: #fff;
  background: #5367d8;
}

.emoji-slider-sticker {
  color: #fff;
  background: linear-gradient(135deg, #ff5ca8, #8b5cf6);
}

.time-sticker {
  color: #fff;
  background: rgba(0, 0, 0, 0.72);
  font-size: 18px;
}

.weather-sticker {
  background: #ffd166;
}

.captions-sticker {
  background: #fff05a;
}

.story-sheet-input {
  min-height: 48px;
  margin: 14px 0;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: #282a31;
  text-align: center;
}

.story-poll-options,
.story-mini-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.story-poll-options input {
  height: 42px;
  padding: 0 10px;
  border-radius: 10px;
  background: #282a31;
  text-align: center;
}

.story-sheet-confirm,
.story-audio-pick {
  width: 100%;
  min-height: 44px;
  margin-top: 12px;
  border-radius: 10px;
  color: #08090b;
  background: #fff;
  font-weight: 800;
}

.story-audio-edit {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.story-audio-edit small,
.story-sheet-empty {
  margin: 0;
  color: #a7aab2;
  text-align: center;
}

.story-audio-edit .story-mini-grid label,
.story-more-menu .story-mini-grid label {
  min-width: 0;
  min-height: 42px;
  padding: 6px 10px;
  border-radius: 10px;
  color: #c9cbd1;
  background: #282a31;
}

.story-more-menu {
  width: min(260px, calc(100vw - 20px));
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  display: grid;
  gap: 4px;
  color: #fff;
  background: rgba(22, 24, 29, 0.98);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(20px);
}

.story-more-menu > button,
.story-more-menu > label {
  min-height: 42px;
  padding: 0 10px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: #fff;
  background: transparent;
}

.story-more-menu > label {
  display: grid;
  grid-template-columns: auto 1fr;
}

.story-more-menu input[type="range"] {
  width: 100%;
  accent-color: #fff;
}

.story-editor-page .story-video-tray {
  left: 50%;
  right: auto;
  bottom: calc(14px + env(safe-area-inset-bottom));
  width: min(580px, calc(100vw - 16px));
  transform: translateX(-50%);
}

.story-video-editor {
  width: 100%;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  color: #fff;
  background: rgba(12, 13, 17, 0.9);
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(22px);
}

.story-video-time-row {
  min-height: 22px;
  margin: 0 2px 7px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}

.story-video-time-row strong {
  font-variant-numeric: tabular-nums;
}

.story-video-time-row span {
  color: rgba(255, 255, 255, 0.76);
}

.story-video-time-row small {
  color: rgba(255, 255, 255, 0.5);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.story-video-timeline {
  position: relative;
  height: 74px;
  overflow: hidden;
  border-radius: 8px;
  background: #24262c;
  touch-action: none;
  cursor: ew-resize;
  user-select: none;
  -webkit-user-select: none;
}

.story-video-filmstrip {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 1px;
}

.story-video-frame {
  min-width: 0;
  background-color: #343740;
  background-image: linear-gradient(135deg, #383b45, #202229);
  background-position: center;
  background-size: cover;
}

.story-video-dim {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 2;
  background: rgba(0, 0, 0, 0.64);
  pointer-events: none;
}

.story-video-dim-start {
  left: 0;
}

.story-video-dim-end {
  right: 0;
}

.story-video-trim-window {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 3;
  border-top: 3px solid #fff;
  border-bottom: 3px solid #fff;
  pointer-events: none;
}

.story-video-trim-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 18px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: #fff;
  pointer-events: auto;
  touch-action: none;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.34);
}

.story-video-trim-handle::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2px;
  height: 20px;
  border-radius: 999px;
  background: #9a9ca3;
  transform: translate(-50%, -50%);
}

.story-video-trim-handle.start {
  left: 0;
  transform: translateX(-50%);
}

.story-video-trim-handle.end {
  right: 0;
  transform: translateX(50%);
}

.story-video-playhead {
  position: absolute;
  top: -3px;
  bottom: -3px;
  z-index: 4;
  width: 2px;
  border-radius: 999px;
  background: #fff;
  transform: translateX(-50%);
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.38);
}

.story-video-playhead::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  transform: translate(-50%, -35%);
}

.story-video-controls {
  margin-top: 9px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 2px;
}

.story-video-controls button {
  min-width: 0;
  min-height: 48px;
  padding: 4px 1px;
  border: 0;
  border-radius: 8px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  color: rgba(255, 255, 255, 0.88);
  background: transparent;
}

.story-video-controls button:active,
.story-video-controls button.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.story-video-controls .ui-icon {
  width: 20px;
  height: 20px;
}

.story-video-controls strong {
  font-size: 13px;
  line-height: 20px;
}

.story-video-controls small {
  max-width: 100%;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.58);
  font-size: 9px;
  line-height: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-viewer-page {
  position: fixed;
  inset: 0;
  z-index: 90;
  height: var(--app-height);
  overflow: hidden;
  color: #fff;
  background: #020203;
}

.story-viewer-stage {
  position: absolute;
  left: 50%;
  top: 0;
  width: 100%;
  height: var(--app-height);
  transform: translateX(-50%);
  overflow: hidden;
  background: #08090c;
}

.story-viewer-stage .story-preview {
  width: 100%;
  height: 100%;
  margin: 0;
  border-radius: 0;
}

.story-viewer-stage .story-preview img,
.story-viewer-stage .story-preview video {
  object-fit: cover;
}

.story-viewer-top {
  position: fixed;
  left: 50%;
  top: 0;
  z-index: 94;
  width: 100%;
  padding: calc(8px + env(safe-area-inset-top)) 10px 0;
  transform: translateX(-50%);
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.58), transparent);
  pointer-events: none;
}

.story-progress {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 3px;
}

.story-progress > span {
  height: 2px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.38);
}

.story-progress i {
  display: block;
  width: 100%;
  height: 100%;
  background: #fff;
  transform: scaleX(0);
  transform-origin: left center;
  will-change: transform;
}

.story-progress .complete i {
  transform: scaleX(1);
}

.story-progress .active i {
  animation: storyProgress var(--story-duration) linear forwards;
}

.story-viewer-head {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  pointer-events: auto;
}

.story-viewer-owner {
  min-width: 0;
  display: grid;
  grid-template-columns: 34px auto 1fr;
  align-items: center;
  gap: 8px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.75);
}

.story-viewer-owner .avatar {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  font-size: 11px;
}

.story-viewer-owner small {
  color: rgba(255, 255, 255, 0.72);
}

.story-viewer-head > button {
  width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: transparent;
}

.story-tap-zone {
  position: fixed;
  top: 72px;
  bottom: 76px;
  z-index: 91;
  width: 34%;
  padding: 0;
  background: transparent;
}

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

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

.highlight-comment-preview {
  position: fixed;
  left: 14px;
  bottom: calc(68px + env(safe-area-inset-bottom));
  z-index: 93;
  width: min(280px, calc(100vw - 96px));
  display: grid;
  gap: 5px;
  padding: 0;
  border: 0;
  color: #fff;
  background: transparent;
  text-align: left;
  pointer-events: auto;
  touch-action: manipulation;
}

.highlight-comment-preview-card {
  min-width: 0;
  min-height: 44px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 5px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 999px;
  background: rgba(0, 0, 0, .58);
  box-shadow: 0 5px 18px rgba(0, 0, 0, .26);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: highlightCommentPreviewIn 420ms cubic-bezier(.18, .9, .25, 1) both;
  animation-delay: calc(var(--comment-preview-order, 0) * 140ms);
}

.highlight-comment-preview-card .avatar {
  width: 30px;
  height: 30px;
  border: 0;
  font-size: 9px;
}

.highlight-comment-preview-copy {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 5px;
  overflow: hidden;
  font-size: 11px;
  line-height: 1.2;
}

.highlight-comment-preview-copy strong {
  flex: 0 0 auto;
  font-weight: 700;
}

.highlight-comment-preview-copy > span {
  min-width: 0;
  overflow: hidden;
  color: rgba(255, 255, 255, .9);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.highlight-comment-preview-gif {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.highlight-comment-preview-gif img {
  width: 28px;
  height: 20px;
  object-fit: cover;
  border-radius: 5px;
}

@keyframes highlightCommentPreviewIn {
  from { opacity: 0; transform: translate3d(-14px, 8px, 0) scale(.94); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

.story-viewer-actions {
  position: fixed;
  left: 50%;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 94;
  width: 100%;
  padding: 0 12px;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px 40px 40px;
  gap: 6px;
  align-items: center;
}

.story-viewer-actions input {
  height: 42px;
  min-width: 0;
  padding: 0 15px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  outline: 0;
  color: #fff;
  background: rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.story-viewer-actions button {
  position: relative;
  z-index: 2;
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.story-viewer-actions button.active {
  color: #ff4f88;
}

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

@keyframes storyProgress {
  to {
    transform: scaleX(1);
  }
}

@media (min-width: 700px) {
  .story-editor-preview,
  .story-viewer-stage,
  .story-viewer-top,
  .story-viewer-actions {
    width: min(100vw, calc(var(--app-height) * 0.5625));
  }

  .highlight-comment-preview {
    left: calc(50% - min(50vw, calc(var(--app-height) * 0.28125)) + 14px);
    width: min(280px, calc(min(100vw, calc(var(--app-height) * 0.5625)) - 96px));
  }

  .story-editor-preview,
  .story-viewer-stage {
    box-shadow: 0 0 70px rgba(0, 0, 0, 0.72);
  }

  .story-editor-page .story-top-bar,
  .story-editor-page .story-share-bar,
  .story-editor-page .story-text-tray,
  .story-editor-page .story-draw-tray,
  .story-editor-page .story-filter-tray {
    left: 50%;
    right: auto;
    width: min(100vw, calc(var(--app-height) * 0.5625));
    transform: translateX(-50%);
  }

  .story-editor-page .story-top-bar {
    padding: 0 10px;
  }

  .story-editor-page .story-share-bar {
    padding: 0 12px;
  }

  .story-editor-page .story-effects-panel {
    width: 100%;
  }

  .story-editor-page .story-size-control {
    left: calc(50% - min(50vw, calc(var(--app-height) * 0.28125)) + 14px);
  }

  .story-editor-page .story-more-tray {
    right: calc(50% - min(50vw, calc(var(--app-height) * 0.28125)) + 10px);
  }

  .story-tap-zone {
    width: calc(min(100vw, calc(var(--app-height) * 0.5625)) * 0.34);
  }

  .story-tap-prev {
    left: calc(50% - min(50vw, calc(var(--app-height) * 0.28125)));
  }

  .story-tap-next {
    right: calc(50% - min(50vw, calc(var(--app-height) * 0.28125)));
  }
}

.settings-drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 65;
  display: flex;
  justify-content: flex-end;
  background: rgba(0, 0, 0, 0.5);
  overscroll-behavior: contain;
}

.settings-drawer-overlay.opening {
  animation: drawerBackdropIn 0.24s ease both;
}

.settings-drawer-overlay.closing {
  pointer-events: none;
  animation: drawerBackdropOut 0.22s ease forwards;
}

.settings-drawer {
  width: min(430px, 94vw);
  height: var(--app-height);
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: calc(12px + env(safe-area-inset-top)) 12px calc(18px + env(safe-area-inset-bottom));
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  background: #080c13;
  box-shadow: -24px 0 64px rgba(0, 0, 0, 0.52);
  overscroll-behavior: contain;
}

.settings-drawer.opening {
  animation: drawerIn 0.28s cubic-bezier(0.22, 0.82, 0.2, 1) both;
}

.settings-drawer.closing {
  animation: drawerOut 0.22s cubic-bezier(0.4, 0, 0.8, 0.2) forwards;
}

.settings-drawer .panel-card {
  margin: 0;
  border-radius: 8px;
  box-shadow: none;
  background: rgba(255, 255, 255, 0.045);
}

.settings-drawer-head {
  position: sticky;
  top: calc(-12px - env(safe-area-inset-top));
  z-index: 2;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(8, 12, 19, 0.96);
  backdrop-filter: blur(18px);
}

.settings-drawer-head h2 {
  margin: 0;
  font-size: 18px;
}

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

.modal-head h2 {
  margin: 0;
  font-size: 18px;
}

.profile-edit-modal {
  width: min(440px, 100%);
  padding: 10px 14px 14px;
}

.profile-photo-editor {
  min-width: 0;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 2px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.075);
}

.profile-edit-avatar {
  width: 64px;
  height: 64px;
}

.profile-photo-editor > span {
  min-width: 0;
}

.profile-photo-editor strong,
.profile-photo-editor small {
  display: block;
}

.profile-photo-editor strong {
  font-size: 14px;
}

.profile-photo-editor small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.profile-photo-change {
  min-height: 32px;
  padding: 0 4px;
  border: 0;
  color: var(--social-link);
  background: transparent;
  font-size: 13px;
  font-weight: 700;
}

.profile-edit-form {
  gap: 13px;
  padding-top: 15px;
}

.profile-edit-field {
  display: grid;
  gap: 6px;
}

.profile-edit-field > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.profile-edit-field input,
.profile-edit-field textarea {
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  background: #111720;
}

.profile-edit-save {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--social-action);
  font-weight: 700;
}

.settings-block {
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  padding: 14px;
}

.settings-block h3 {
  margin: 0 0 12px;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.switch-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
}

.switch-row + .switch-row {
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

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

.switch-row small {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.switch-row input {
  appearance: none;
  width: 52px;
  height: 30px;
  border-radius: 999px;
  background: #202938;
  position: relative;
  outline: none;
  transition: background 0.18s ease;
}

.switch-row input::before {
  content: "";
  position: absolute;
  width: 24px;
  height: 24px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #f4f7fb;
  transition: transform 0.18s ease;
}

.switch-row input:checked {
  background: #705cff;
}

.switch-row input:checked::before {
  transform: translateX(22px);
}

.privacy-choice-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
}

.privacy-choice-row + .privacy-choice-row {
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.privacy-choice-row strong,
.privacy-choice-row small {
  display: block;
}

.privacy-choice-row small {
  max-width: 270px;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.privacy-choice-row select {
  max-width: 136px;
  min-height: 34px;
  padding: 0 28px 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  outline: 0;
  color: var(--text);
  background: #151b24;
  font: inherit;
  font-size: 12px;
}

.notifications-page {
  display: grid;
  gap: 10px;
}

.page-header {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.page-header h2 {
  margin: 0;
  font-size: 19px;
}

.page-header.search-profile-header {
  grid-template-columns: 40px minmax(0, 1fr) 40px;
}

.notifications-page h3 {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
}

.notification-list {
  display: grid;
  gap: 0;
}

.notification-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 2px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 0;
  background: transparent;
}

.notification-identity {
  min-width: 0;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}

.notification-identity:active {
  opacity: 0.72;
}

.notification-row .mini-btn {
  min-height: 32px;
  border: 0;
  background: #171c24;
}

.notification-row .mini-btn:not(.danger) {
  background: var(--social-blue);
}

.notification-row .mini-btn.danger {
  color: #aeb6c1;
  background: #171c24;
}

.notification-permission {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto 28px;
  align-items: center;
  gap: 9px;
  margin: 2px 0 16px;
  padding: 9px 8px;
  border-radius: 8px;
  background: #0d1219;
}

.notification-permission-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #e7ebf0;
  background: #181e27;
}

.notification-permission-icon .ui-icon {
  width: 18px;
  height: 18px;
}

.notification-permission-copy {
  min-width: 0;
}

.notification-permission-copy strong,
.notification-permission-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-permission-copy small {
  color: var(--muted);
  font-size: 11px;
}

.notification-enable {
  color: #fff;
  background: var(--social-blue);
}

.notification-prompt-close {
  width: 28px;
  height: 28px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
}

.notification-prompt-close .ui-icon {
  width: 15px;
  height: 15px;
}

.toast-stack {
  position: fixed;
  top: calc(10px + env(safe-area-inset-top));
  left: 50%;
  z-index: 120;
  width: min(420px, calc(100vw - 20px));
  display: grid;
  gap: 7px;
  transform: translateX(-50%);
  pointer-events: none;
}

.app-toast {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: center;
  padding: 6px;
  border-radius: 8px;
  color: var(--text);
  background: rgba(15, 19, 26, 0.97);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(18px);
  animation: toastIn 0.2s ease both;
  pointer-events: auto;
}

.toast-main {
  min-width: 0;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  padding: 2px;
  color: inherit;
  text-align: left;
  background: transparent;
}

.toast-main .avatar {
  width: 40px;
  height: 40px;
}

.toast-symbol {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, var(--social-blue), var(--social-pink));
}

.toast-copy {
  min-width: 0;
}

.toast-copy strong,
.toast-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toast-copy small {
  color: #a7b0bc;
  font-size: 12px;
}

.toast-close {
  width: 32px;
  height: 32px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
}

.toast-close .ui-icon {
  width: 16px;
  height: 16px;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.action-sheet {
  width: min(520px, 100%);
  justify-self: center;
  display: grid;
  gap: 6px;
  padding: 10px;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  background: #080c13;
  border: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
  box-shadow: var(--shadow);
  animation: sheetUp 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.action-sheet.closing {
  animation: sheetDown 0.18s ease forwards;
}

.story-sheet {
  width: min(360px, calc(100% - 24px));
  margin-bottom: max(10px, env(safe-area-inset-bottom));
  border-radius: 14px;
  padding-bottom: 10px;
}

.story-sheet.closing {
  animation: sheetDown 0.18s ease forwards;
}

.crop-overlay {
  z-index: 55;
}

.crop-stage {
  width: min(320px, calc(100vw - 58px));
  aspect-ratio: 1;
  margin: 12px auto;
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background: #05070b;
  touch-action: none;
  cursor: grab;
}

.crop-stage:active {
  cursor: grabbing;
}

.crop-photo-position {
  position: absolute;
  inset: 0;
  transform-origin: center;
  will-change: transform;
  pointer-events: none;
}

.crop-stage img {
  position: absolute;
  left: 50%;
  top: 50%;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  object-fit: initial;
  transform-origin: center;
  will-change: transform;
  user-select: none;
  pointer-events: none;
}

.crop-stage img.crop-landscape {
  height: 100%;
}

.crop-stage img.crop-portrait {
  width: 100%;
}

.crop-mask {
  position: absolute;
  inset: 0;
  background: transparent;
  pointer-events: none;
}

.crop-circle {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 76%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.52), 0 0 20px rgba(255, 255, 255, 0.22);
  pointer-events: none;
}

.crop-confirm {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  color: #070a0f;
  background: #f7f8fa;
  font-weight: 700;
}

.crop-confirm:hover:not(:disabled) {
  background: #e5e9ef;
}

.crop-guidance {
  margin: 2px 0 8px;
  color: var(--muted);
  text-align: center;
  font-size: 11px;
}

.zoom-control {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 26px;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  margin: 8px 2px 14px;
}

.zoom-control input {
  --range-progress: 0%;
  appearance: none;
  width: 100%;
  height: 4px;
  border: 0;
  border-radius: 999px;
  outline: 0;
  background: linear-gradient(90deg, #f4f7fb var(--range-progress), #29303a var(--range-progress));
}

.zoom-control input::-webkit-slider-thumb {
  appearance: none;
  width: 19px;
  height: 19px;
  border: 2px solid #080c13;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 9px rgba(0, 0, 0, 0.45);
}

.zoom-control input::-moz-range-thumb {
  width: 17px;
  height: 17px;
  border: 2px solid #080c13;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 9px rgba(0, 0, 0, 0.45);
}

.zoom-symbol {
  display: grid;
  place-items: center;
  color: #aeb7c3;
}

.zoom-symbol.small .ui-icon {
  width: 15px;
  height: 15px;
}

.zoom-symbol.large .ui-icon {
  width: 21px;
  height: 21px;
}

.action-sheet button {
  min-height: 46px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.075);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.action-sheet .sheet-note {
  display: grid;
  gap: 4px;
  padding: 8px 10px 10px;
  color: var(--text);
}

.action-sheet .sheet-note small {
  color: var(--muted);
  font-size: 12px;
}

.action-sheet .danger-text {
  color: #ff8e9a;
}

.story-comment-list {
  display: grid;
  gap: 8px;
  max-height: 240px;
  overflow: auto;
  padding: 0 2px;
}

.story-comment-list article {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 9px;
  align-items: start;
}

.story-comment-list .avatar {
  width: 34px;
  height: 34px;
  font-size: 11px;
}

.story-comment-list strong,
.story-comment-list small {
  display: block;
}

.story-comment-list small {
  color: var(--soft);
  font-size: 13px;
}

.story-comment-box {
  display: grid;
  grid-template-columns: 1fr 46px;
  gap: 8px;
  align-items: center;
  padding-top: 8px;
}

.story-comment-box button {
  min-height: 40px;
  padding: 0;
}

@keyframes tabFromRight {
  from {
    opacity: 0;
    transform: translateX(18px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes tabFromLeft {
  from {
    opacity: 0;
    transform: translateX(-18px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

@keyframes chatBackIn {
  from {
    opacity: 0.85;
    transform: translateX(-18px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes wavePulse {
  to {
    transform: scaleY(0.55);
  }
}

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

@keyframes storyTextRise {
  from {
    opacity: 0;
    translate: 0 18px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}

@keyframes storyTextPop {
  from {
    opacity: 0;
    scale: 0.82;
  }
  to {
    opacity: 1;
    scale: 1;
  }
}

@keyframes storyTextType {
  from {
    clip-path: inset(0 100% 0 0);
    opacity: 0.35;
  }
  to {
    clip-path: inset(0 0 0 0);
    opacity: 1;
  }
}

@keyframes storyTextBounce {
  0% {
    opacity: 0;
    scale: 0.55;
  }
  62% {
    opacity: 1;
    scale: 1.12;
  }
  100% {
    scale: 1;
  }
}

@keyframes storyTextFlicker {
  0%, 18%, 24%, 62%, 68%, 100% { opacity: 1; }
  20%, 64% { opacity: 0.18; }
  22%, 66% { opacity: 0.72; }
}

@keyframes storyTextPulse {
  from { filter: brightness(0.9); }
  to { filter: brightness(1.25); }
}

@keyframes storyGrain {
  from { transform: translate(0, 0); }
  to { transform: translate(-4px, 3px); }
}

@keyframes storyScan {
  from { background-position: 0 0; }
  to { background-position: 0 60px; }
}

@keyframes storySparkle {
  from { opacity: 0.38; transform: scale(0.995); }
  to { opacity: 1; transform: scale(1.01); }
}

@keyframes stickerFloat {
  to {
    translate: 0 -8px;
  }
}

@keyframes stickerPulse {
  to {
    scale: 1.06;
  }
}

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

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

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

@keyframes viewerMediaIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes drawerBackdropIn {
  from { background: rgba(0, 0, 0, 0); }
  to { background: rgba(0, 0, 0, 0.5); }
}

@keyframes drawerBackdropOut {
  from { background: rgba(0, 0, 0, 0.5); }
  to { background: rgba(0, 0, 0, 0); }
}

@keyframes drawerIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

@keyframes drawerOut {
  from { transform: translateX(0); }
  to { transform: translateX(100%); }
}

@keyframes overlayIn {
  from {
    background: rgba(0, 0, 0, 0);
  }
  to {
    background: rgba(0, 0, 0, 0.36);
  }
}

@keyframes overlayOut {
  from {
    background: rgba(0, 0, 0, 0.36);
  }
  to {
    background: rgba(0, 0, 0, 0);
  }
}

@keyframes sheetUp {
  from {
    opacity: 0.6;
    transform: translateY(100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes sheetDown {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0.6;
    transform: translateY(100%);
  }
}

.call-videos {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 8px;
  margin-bottom: 10px;
}

.call-videos video {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: #07101b;
  border-radius: 8px;
}

.hidden,
[hidden] {
  display: none !important;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

@media (max-width: 860px) {
  body {
    overflow: hidden;
  }

  .auth-box,
  .public-box {
    grid-template-columns: 1fr;
  }

  .intro {
    min-height: auto;
  }

  .feature-strip {
    grid-template-columns: 1fr;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

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

  .app-shell:not(.chat-open) .chat-pane {
    display: none;
  }

  .app-shell.profile-route-open .sidebar {
    display: grid;
  }

  .app-shell.profile-route-open .chat-pane {
    display: none;
  }

  .search-profile-mobile {
    display: block;
  }

  .search-profile-desktop-context {
    display: none;
  }

  .back-btn {
    display: inline-flex;
  }

  .message {
    max-width: 92%;
  }

  .composer-row {
    grid-template-columns: auto auto 1fr auto auto;
    gap: 6px;
  }

  .icon-btn {
    width: 38px;
    height: 38px;
  }
}

@media (max-width: 520px) {
  .auth-screen,
  .public-screen {
    padding: 10px;
    align-items: stretch;
  }

  .intro,
  .auth-card,
  .public-card {
    padding: 18px;
  }

  .app-topbar,
  .chat-header {
    padding: 10px;
  }

  .messages {
    padding: 12px 9px;
  }

  .composer {
    padding-left: 7px;
    padding-right: 7px;
  }

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

  .primary,
  .secondary,
  .danger,
  .ghost {
    padding: 0 10px;
  }

  .chat-header .toolbar {
    gap: 5px;
  }

  .chat-header .mini-btn {
    width: 34px;
    padding: 0;
    overflow: hidden;
  }

  .account-row {
    gap: 6px;
  }

  .account-identity {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 8px;
  }

  .account-identity .avatar {
    width: 40px;
    height: 40px;
  }

  .account-action {
    min-width: 68px;
    padding: 0 9px;
    font-size: 11px;
  }

  .account-dismiss {
    width: 26px;
    height: 28px;
  }

  .notification-permission {
    grid-template-columns: 32px minmax(0, 1fr) auto 26px;
    gap: 7px;
    padding-left: 7px;
    padding-right: 5px;
  }

  .notification-permission-copy small {
    display: none;
  }

  .notification-enable {
    padding: 0 9px;
    font-size: 11px;
  }
}

/* Compact social story controls and interactive stickers */
.profile-avatar-wrap {
  position: relative;
  width: 78px;
  height: 78px;
  flex: 0 0 78px;
}

.profile-avatar-wrap .profile-avatar-btn {
  display: block;
}

.profile-avatar-wrap .profile-story-view {
  right: auto;
  left: -3px;
  bottom: -3px;
}

.profile-avatar-add {
  position: absolute;
  right: -2px;
  bottom: -2px;
  z-index: 4;
  width: 24px;
  height: 24px;
  min-height: 24px;
  padding: 0 0 1px;
  border: 2px solid var(--bg);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--social-action);
  font-size: 18px;
  line-height: 1;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.38);
}

.story-upload-progress {
  position: absolute;
  left: 0;
  right: 0;
  top: -9px;
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  pointer-events: none;
}

.story-upload-progress i {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: #fff;
  animation: storyUpload 0.9s ease-in-out infinite;
}

@keyframes storyUpload {
  from { transform: translateX(-110%); }
  to { transform: translateX(340%); }
}

.story-native-entry {
  min-height: 42px;
  margin: 7px 0 10px;
  padding: 0 8px 0 12px;
  border-radius: 11px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 8px;
  color: #aeb2bb;
  background: #2a2c32;
}

.story-native-entry > .ui-icon {
  width: 17px;
  height: 17px;
}

.story-native-entry input,
.story-native-text,
.story-gif-submit input,
.story-option-editor input,
.story-emoji-choice input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  border: 0;
  outline: 0;
  color: #fff;
  background: transparent;
  font-size: 16px;
}

.story-native-entry > button,
.story-sheet-done {
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.story-sheet-done {
  margin: 12px 0 0 auto;
  background: #fff;
  color: #0a0b0e;
}

.story-sheet-done .ui-icon,
.story-native-entry > button .ui-icon {
  width: 17px;
  height: 17px;
}

.story-inline-loading {
  min-height: 30px;
  display: grid;
  place-items: center;
}

.story-location-results {
  display: grid;
  gap: 2px;
}

.story-location-results > button {
  min-height: 48px;
  padding: 5px 4px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  color: #f4f4f5;
  background: transparent;
  text-align: left;
}

.story-location-results > button + button {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.story-location-results .ui-icon {
  width: 17px;
  height: 17px;
  justify-self: center;
  color: #b9bec8;
}

.story-location-results span,
.story-location-results strong,
.story-location-results small {
  min-width: 0;
  display: block;
}

.story-location-results strong,
.story-location-results small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-location-results small {
  color: #969ca8;
  font-size: 11px;
}

.story-map-preview {
  position: relative;
  min-height: 152px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 12px;
  background: #11151b;
}

.story-map-preview iframe {
  display: block;
  width: 100%;
  height: 152px;
  border: 0;
  filter: saturate(0.72) brightness(0.78);
}

.story-map-preview > span {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  padding: 7px 9px;
  border-radius: 8px;
  display: grid;
  background: rgba(5, 7, 11, 0.82);
  backdrop-filter: blur(10px);
}

.story-map-preview small,
.story-weather-preview small {
  color: rgba(255, 255, 255, 0.66);
  font-size: 10px;
}

.story-weather-preview {
  min-height: 58px;
  margin-top: 8px;
  padding: 9px 11px;
  border-radius: 12px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 2px 10px;
  color: #fff;
  background: linear-gradient(135deg, rgba(32, 83, 139, 0.9), rgba(74, 93, 116, 0.88));
}

.story-weather-preview > strong {
  grid-row: 1 / 3;
  font-size: 23px;
}

.story-weather-preview > small {
  grid-column: 2;
}

.story-use-typed {
  min-height: 38px;
  max-width: 100%;
  margin: 5px auto 0;
  padding: 0 12px;
  overflow: hidden;
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-gif-submit {
  margin: 6px 0 10px;
  padding: 8px 10px;
  border-radius: 11px;
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.055);
}

.story-gif-submit input {
  min-height: 36px;
  padding: 0 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.24);
}

.story-gif-submit button {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #111318;
  background: #fff;
  font-size: 11px;
  font-weight: 750;
}

.story-gif-submit small {
  grid-column: 1 / -1;
  color: #969ca8;
  font-size: 10px;
}

.story-gif-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
}

.story-gif-grid > button {
  aspect-ratio: 1;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 4px;
  background: #101216;
}

.story-gif-grid img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story-gif-grid > p {
  grid-column: 1 / -1;
  margin: 18px 0;
  color: #969ca8;
  text-align: center;
  font-size: 12px;
}

.story-option-editor {
  display: grid;
  gap: 6px;
}

.story-option-editor label {
  min-height: 42px;
  padding-left: 10px;
  border-radius: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  align-items: center;
  background: #2a2c32;
}

.story-option-editor button {
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: transparent;
  background: rgba(255, 255, 255, 0.08);
}

.story-option-editor button.active {
  color: #101216;
  background: #fff;
}

.story-option-editor .ui-icon {
  width: 15px;
  height: 15px;
}

.story-emoji-choice {
  min-height: 42px;
  margin-top: 7px;
  padding: 0 10px;
  border-radius: 10px;
  display: grid;
  grid-template-columns: 1fr 64px;
  align-items: center;
  color: #aeb2bb;
  background: #2a2c32;
}

.story-emoji-choice input {
  text-align: center;
  font-size: 24px;
}

.story-slider-preview {
  height: 42px;
  margin-top: 8px;
  padding: 0 12px;
  border-radius: 11px;
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.92);
}

.story-slider-preview > span {
  font-size: 24px;
}

.story-slider-preview i {
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff5ca8, #775cff);
}

.story-sticker-gif,
.story-editor-sticker.story-sticker-gif {
  width: min(180px, 42vw);
  min-height: 0;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 5px;
  background: transparent;
  box-shadow: none;
  animation: none;
}

.story-gif-media {
  display: block;
  width: 100%;
  max-height: 190px;
  border: 0;
  border-radius: 5px;
  object-fit: contain;
  filter: drop-shadow(0 7px 15px rgba(0, 0, 0, 0.18));
}

.story-sticker-location,
.story-sticker-weather {
  min-width: 130px;
  max-width: min(250px, 72vw);
  padding: 8px 11px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  text-decoration: none;
}

.story-sticker-location {
  background: rgba(24, 54, 91, 0.9);
}

.story-sticker-weather {
  background: rgba(27, 35, 49, 0.88);
}

.story-sticker-location .ui-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.story-sticker-location span,
.story-sticker-weather span,
.story-sticker-location strong,
.story-sticker-location small,
.story-sticker-weather strong,
.story-sticker-weather small {
  min-width: 0;
  display: block;
}

.story-sticker-location strong,
.story-sticker-location small,
.story-sticker-weather small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-sticker-location small,
.story-sticker-weather small {
  color: rgba(255, 255, 255, 0.68);
  font-size: 9px;
}

.story-weather-symbol {
  font-size: 24px;
}

.story-sticker-countdown {
  min-width: 145px;
  gap: 2px;
  padding: 9px 13px;
  display: grid;
  text-align: center;
}

.story-sticker-countdown time {
  font-variant-numeric: tabular-nums;
  font-size: 17px;
}

.story-sticker-quiz,
.story-sticker-emoji_slider,
.story-sticker-question,
.story-sticker-add_yours {
  width: min(285px, 76vw);
  min-height: 0;
  padding: 10px;
  border-radius: 12px;
  display: grid;
  gap: 7px;
  color: #121319;
  background: rgba(255, 255, 255, 0.94);
  text-align: center;
}

.story-sticker-interactive {
  z-index: 93;
  pointer-events: auto;
}

.story-choice-list {
  display: grid;
  gap: 4px;
}

.story-choice-list > span,
.story-choice-list > button,
.story-poll-sticker > button {
  min-height: 30px;
  padding: 3px 9px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  color: #181a20;
  background: #eceef2;
  font-size: 11px;
  font-weight: 750;
}

.story-choice-list > button.selected,
.story-poll-sticker > button.selected {
  color: #fff;
  background: #5266c9;
}

.story-choice-list small,
.story-poll-sticker button small {
  font-size: 9px;
  opacity: 0.72;
}

.story-live-slider {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 7px;
}

.story-live-slider > span {
  font-size: 24px;
}

.story-live-slider input {
  width: 100%;
  accent-color: #d94d8d;
}

.story-sticker-emoji_slider > small {
  color: #656b76;
  font-size: 9px;
}

.story-sticker-reply {
  justify-self: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  color: #fff;
  background: #252832;
  font-size: 11px;
  font-weight: 750;
}

.story-viewer-sticker {
  pointer-events: auto;
}

.story-poll-sticker > button {
  min-width: 0;
}

.story-poll-sticker > button > span {
  min-height: 0;
  padding: 0;
  display: block;
  color: inherit;
  background: transparent;
  font-size: inherit;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-audio-sticker {
  width: min(330px, 84%);
  padding: 0;
  border-radius: 12px;
  display: block;
  background: transparent;
  pointer-events: auto;
}

.story-audio-ui {
  min-height: 54px;
  padding: 7px 9px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  display: grid;
  grid-template-columns: 36px minmax(70px, auto) minmax(80px, 1fr);
  align-items: center;
  gap: 8px;
  color: #fff;
  background: rgba(8, 10, 15, 0.76);
  backdrop-filter: blur(16px);
}

.story-audio-ui > button {
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #111318;
  background: #fff;
}

.story-audio-ui > button .ui-icon {
  width: 16px;
  height: 16px;
}

.story-audio-copy,
.story-audio-copy strong,
.story-audio-copy small {
  min-width: 0;
  display: block;
}

.story-audio-copy strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-audio-copy small {
  color: rgba(255, 255, 255, 0.58);
  font-size: 9px;
}

.story-audio-wave {
  height: 28px;
  display: flex;
  align-items: center;
  gap: 2px;
}

.story-audio-wave i {
  width: 2px;
  height: var(--bar-height);
  max-height: 25px;
  min-height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  transform-origin: center;
}

.story-audio-ui.playing .story-audio-wave i {
  animation: storyAudioWave 0.55s ease-in-out infinite alternate;
  animation-delay: calc(var(--bar-height) * -4ms);
}

.story-audio-ui audio {
  display: none;
}

@keyframes storyAudioWave {
  to { transform: scaleY(0.42); opacity: 0.55; }
}

.story-audio-edit {
  gap: 8px;
}

.story-audio-trim {
  display: grid;
  gap: 6px;
}

.story-audio-trim label {
  padding: 7px 9px;
  border-radius: 9px;
  display: grid;
  gap: 4px;
  background: rgba(255, 255, 255, 0.055);
}

.story-audio-trim label > span {
  display: flex;
  justify-content: space-between;
  color: #b7bbc4;
  font-size: 10px;
}

.story-audio-trim input {
  width: 100%;
  accent-color: #fff;
}

.story-viewer-head-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.story-viewer-head-actions button {
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: transparent;
}

.story-viewer-head-actions .ui-icon {
  width: 19px;
  height: 19px;
}

.story-reply-pill {
  min-width: 0;
  height: 42px;
  padding-right: 3px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: center;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(12px);
}

.story-reply-pill input {
  width: 100%;
  height: 38px;
  padding: 0 4px 0 13px;
  border: 0;
  background: transparent;
}

.story-reply-pill button {
  width: 32px;
  height: 32px;
  min-height: 32px;
  background: transparent;
  backdrop-filter: none;
}

.story-replies-off {
  min-width: 0;
  height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  display: flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(12px);
  font-size: 11px;
}

.story-replies-off.comments-disabled {
  height: auto;
  justify-content: center;
  margin-top: 4px;
  padding: 10px;
  border: 0;
  border-radius: 0;
  color: #858c98;
  background: transparent;
}

.story-viewer-actions.own-story-actions {
  grid-template-columns: 1fr auto auto;
  justify-items: end;
}

.story-owner-metric {
  min-height: 36px;
  padding: 0 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(12px);
  font-size: 11px;
}

.story-viewer-actions button.story-owner-metric {
  width: auto;
  height: 36px;
  min-height: 36px;
  padding: 0 10px;
  display: inline-flex;
  place-items: initial;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.28);
}

.story-owner-metric .ui-icon {
  width: 16px;
  height: 16px;
}

.action-sheet.compact-sheet {
  width: min(440px, 100%);
  max-height: min(62vh, 520px);
  padding: 10px 12px max(12px, env(safe-area-inset-bottom));
  border-radius: 18px 18px 0 0;
  overflow: hidden;
  gap: 4px;
  background: #101217;
}

.story-comments-head,
.story-owner-menu-head {
  min-height: 38px;
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  align-items: center;
  text-align: center;
}

.story-comments-head strong,
.story-owner-menu-head strong {
  grid-column: 2;
  font-size: 14px;
}

.action-sheet .story-sheet-icon {
  grid-column: 3;
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: transparent;
}

.story-sheet-icon .ui-icon {
  width: 18px;
  height: 18px;
}

.story-comment-list {
  min-height: 80px;
  max-height: min(38vh, 330px);
  padding: 6px 2px;
  gap: 11px;
}

.story-comment-list article {
  grid-template-columns: 31px minmax(0, 1fr);
  gap: 8px;
}

.story-comment-list .avatar {
  width: 31px;
  height: 31px;
}

.story-comment-list article > span {
  min-width: 0;
}

.story-comment-list strong {
  font-size: 11px;
}

.story-comment-list time {
  margin-left: 4px;
  color: #777d88;
  font-size: 9px;
  font-weight: 500;
}

.story-comment-list small {
  margin-top: 1px;
  color: #e1e3e7;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.story-comments-empty {
  align-self: center;
  margin: 20px 0;
  color: #777d88;
  text-align: center;
  font-size: 12px;
}

.story-comment-box {
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 5px;
  padding: 7px 2px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.story-comment-box input {
  min-width: 0;
  height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  outline: 0;
  color: #fff;
  background: rgba(255, 255, 255, 0.075);
  font-size: 16px;
}

.action-sheet .story-comment-box button {
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
}

.story-owner-saved {
  padding: 10px;
  color: #8c929e;
  text-align: center;
  font-size: 11px;
}

.action-sheet .story-owner-action {
  min-height: 42px;
  padding: 0 8px;
  border: 0;
  border-radius: 7px;
  display: grid;
  grid-template-columns: 28px 1fr;
  justify-items: start;
  color: #f1f2f4;
  background: transparent;
  font-size: 13px;
}

.story-owner-action .ui-icon {
  width: 18px;
  height: 18px;
}

.gif-review-list {
  display: grid;
  gap: 5px;
}

.gif-review-row {
  min-height: 48px;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 30px 30px;
  align-items: center;
  gap: 7px;
}

.gif-review-row img {
  width: 46px;
  height: 46px;
  border-radius: 4px;
  object-fit: cover;
}

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

.gif-review-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.gif-review-row small {
  color: var(--muted);
  font-size: 10px;
}

.gif-review-row button {
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
}

.gif-review-row .ui-icon {
  width: 14px;
  height: 14px;
}

@media (max-width: 430px) {
  .story-sticker-sheet {
    max-height: min(660px, 72vh);
    padding-left: 11px;
    padding-right: 11px;
  }

  .story-gif-submit {
    grid-template-columns: 1fr 1fr;
  }

  .story-gif-submit button {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .story-audio-ui {
    grid-template-columns: 34px minmax(62px, 0.72fr) minmax(70px, 1fr);
    gap: 6px;
  }
}

/* Conversation appearance, GIFs, and sticker creation */
.nav-profile-avatar {
  width: 25px;
  height: 25px;
  border: 1.5px solid #7f8997;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #dbe1e8;
  background: #151a22;
  font-size: 8px;
  font-weight: 800;
  transition: border-color 0.18s ease, border-width 0.18s ease, transform 0.18s ease;
}

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

.bottom-tab.active .nav-profile-avatar {
  border-width: 2px;
  border-color: #fff;
  transform: scale(1.08);
}

.bottom-tab[data-tab="chats"].active svg path:first-child {
  fill: currentColor;
  stroke: currentColor;
}

.bottom-tab[data-tab="chats"].active svg path:last-child {
  fill: none;
  stroke: #05070b;
  stroke-width: 2.4;
}

.chat-pane.active-chat .messages {
  position: relative;
  color: var(--text);
  background-color: var(--chat-bg);
  background-attachment: local;
}

.chat-pane.chat-background-plain .messages,
.chat-pane.chat-background-custom .messages {
  background-image: none;
}

.chat-pane.chat-background-midnight .messages {
  background-image:
    linear-gradient(135deg, rgba(69, 58, 133, 0.16), transparent 46%),
    linear-gradient(315deg, rgba(28, 79, 101, 0.12), transparent 52%);
}

.chat-pane.chat-background-dusk .messages {
  background-image:
    linear-gradient(145deg, rgba(180, 54, 111, 0.16), transparent 45%),
    linear-gradient(325deg, rgba(88, 54, 125, 0.14), transparent 54%);
}

.chat-pane.chat-background-ocean .messages {
  background-image:
    linear-gradient(155deg, rgba(17, 126, 157, 0.17), transparent 46%),
    linear-gradient(335deg, rgba(29, 68, 100, 0.16), transparent 50%);
}

.chat-pane.chat-background-aurora .messages {
  background-image:
    linear-gradient(150deg, rgba(29, 132, 105, 0.16), transparent 44%),
    linear-gradient(330deg, rgba(30, 84, 101, 0.15), transparent 54%);
}

.chat-pane.chat-background-graphite .messages {
  background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 18px);
}

.chat-pane.chat-background-rose .messages {
  background-image:
    linear-gradient(145deg, rgba(177, 59, 92, 0.17), transparent 45%),
    linear-gradient(325deg, rgba(103, 47, 77, 0.15), transparent 52%);
}

.chat-pane.active-chat .bubble {
  color: var(--chat-theirs-text);
  background: var(--chat-theirs);
  border-color: rgba(255, 255, 255, 0.075);
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.2);
}

.chat-pane.active-chat .mine .bubble {
  color: var(--chat-mine-text);
  background: var(--chat-mine);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
}

.chat-pane.active-chat .message.media-message .bubble,
.chat-pane.active-chat .message.sticker-message .bubble {
  color: inherit;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.chat-pane.active-chat .typing-bubble {
  color: var(--chat-theirs-text);
  background: var(--chat-theirs);
  border-color: rgba(255, 255, 255, 0.07);
}

.chat-pane.active-chat .reply-preview {
  color: inherit;
  background: rgba(0, 0, 0, 0.2);
  border-left-color: currentColor;
}

.chat-pane.active-chat .chat-header > .toolbar {
  flex-wrap: nowrap;
  gap: 3px;
  flex: 0 0 auto;
}

.chat-pane.active-chat .chat-title {
  min-width: 0;
  flex: 1 1 auto;
}

.chat-pane.active-chat .chat-header > .toolbar .icon-btn {
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
}

@media (max-width: 430px) {
  .chat-pane.active-chat .chat-header {
    gap: 7px;
    padding-left: 8px;
    padding-right: 8px;
  }

  .chat-pane.active-chat .chat-header > .toolbar {
    margin-left: 2px !important;
  }

  .chat-pane.active-chat .chat-header > .toolbar .icon-btn {
    width: 32px;
    height: 32px;
    min-height: 32px;
  }
}

.chat-customization-overlay {
  position: fixed;
  inset: 0;
  z-index: 76;
  display: grid;
  align-items: end;
  background: rgba(0, 0, 0, 0.5);
  animation: overlayIn 0.18s ease both;
}

.chat-customization-sheet {
  width: min(540px, 100%);
  max-height: min(760px, 86vh);
  justify-self: center;
  overflow: auto;
  padding: 10px 14px max(18px, env(safe-area-inset-bottom));
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
  background: #0a0e14;
  box-shadow: 0 -24px 60px rgba(0, 0, 0, 0.46);
  animation: sheetUp 0.22s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.chat-customization-head {
  min-height: 50px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.chat-customization-head > span {
  min-width: 0;
  text-align: center;
}

.chat-customization-head strong,
.chat-customization-head small {
  display: block;
}

.chat-customization-head strong {
  font-size: 15px;
}

.chat-customization-head small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.chat-customization-head .icon-btn {
  width: 34px;
  height: 34px;
  min-height: 34px;
  border-radius: 50%;
  background: transparent;
}

.chat-appearance-section {
  padding: 15px 0 5px;
}

.chat-appearance-section + .chat-appearance-section {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.chat-appearance-section h3 {
  margin: 0 0 11px;
  font-size: 13px;
}

.chat-theme-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.chat-theme-choice {
  position: relative;
  min-height: 70px;
  padding: 8px 6px;
  border: 1px solid transparent;
  border-radius: 8px;
  display: grid;
  justify-items: center;
  gap: 5px;
  color: var(--muted);
  background: #111720;
}

.chat-theme-choice.active {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.42);
  background: #171e28;
}

.chat-theme-choice > .ui-icon {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 13px;
  height: 13px;
}

.theme-preview {
  width: 52px;
  height: 28px;
  position: relative;
  display: block;
}

.theme-preview i {
  position: absolute;
  width: 31px;
  height: 14px;
  border-radius: 9px;
}

.theme-preview i:first-child {
  left: 0;
  top: 0;
  background: var(--theme-theirs);
}

.theme-preview i:last-child {
  right: 0;
  bottom: 0;
  background: var(--theme-mine);
}

.chat-theme-choice small,
.chat-background-choice small {
  font-size: 10px;
}

.chat-background-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 58px;
  gap: 9px;
  overflow-x: auto;
  padding-bottom: 5px;
}

.chat-background-choice {
  padding: 0;
  display: grid;
  justify-items: center;
  gap: 5px;
  color: var(--muted);
  background: transparent;
}

.chat-background-choice > span {
  width: 46px;
  height: 46px;
  border: 2px solid transparent;
  border-radius: 50%;
  background: var(--choice-bg);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.chat-background-choice.active > span {
  border-color: #fff;
}

.custom-background {
  cursor: pointer;
}

.custom-background input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.chat-color-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 10px;
  min-height: 58px;
}

.chat-color-row + .chat-color-row {
  border-top: 1px solid rgba(255, 255, 255, 0.055);
}

.chat-color-preview {
  width: 42px;
  height: 30px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--preview-color);
  font-size: 11px;
  font-weight: 800;
}

.chat-color-row strong,
.chat-color-row small {
  display: block;
}

.chat-color-row strong {
  font-size: 12px;
}

.chat-color-row small {
  color: var(--muted);
  font-size: 10px;
}

.chat-color-row input {
  width: 32px;
  height: 32px;
  padding: 2px;
  border: 0;
  border-radius: 50%;
  background: transparent;
}

.chat-media-tray {
  height: min(330px, 42vh);
  padding: 7px 10px 10px;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 7px;
  overflow: hidden;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: #080c12;
}

.chat-tray-head {
  min-height: 35px;
  display: grid;
  grid-template-columns: 1fr 34px;
  align-items: center;
}

.chat-tray-tabs {
  justify-self: center;
  display: grid;
  grid-template-columns: 56px 56px;
}

.chat-tray-tabs button {
  position: relative;
  height: 34px;
  padding: 0;
  display: grid;
  place-items: center;
  color: #788392;
  background: transparent;
}

.chat-tray-tabs button::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 0;
  height: 2px;
  border-radius: 999px;
  background: transparent;
}

.chat-tray-tabs button.active {
  color: #fff;
}

.chat-tray-tabs button.active::after {
  background: #fff;
}

.chat-tray-tabs .ui-icon {
  width: 20px;
  height: 20px;
}

.chat-tray-close {
  width: 31px;
  height: 31px;
  min-height: 31px;
  border-radius: 50%;
  background: transparent;
}

.chat-tray-actions {
  display: flex;
  gap: 7px;
}

.chat-tray-actions button {
  min-height: 31px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #dce2e9;
  background: #151b24;
  font-size: 11px;
}

.chat-tray-actions .ui-icon {
  width: 15px;
  height: 15px;
}

.chat-media-tray .sticker-grid {
  grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
  align-content: start;
  gap: 5px;
  overflow-y: auto;
  padding: 2px 0 8px;
}

.chat-media-tray .sticker-tile {
  position: relative;
  min-width: 0;
  padding: 5px;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}

.chat-media-tray .sticker-tile:hover {
  background: rgba(255, 255, 255, 0.04);
}

.animated-mark {
  position: absolute;
  right: 3px;
  bottom: 3px;
  padding: 2px 4px;
  border-radius: 4px;
  color: #fff;
  background: rgba(0, 0, 0, 0.64);
  font-size: 7px;
  font-weight: 800;
}

.chat-gif-search {
  min-height: 36px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 5px;
  padding: 0 3px 0 10px;
  border-radius: 8px;
  background: #151b24;
}

.chat-gif-search > .ui-icon {
  width: 16px;
  height: 16px;
  color: #7e8997;
}

.chat-gif-search input {
  min-width: 0;
  height: 34px;
  padding: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
}

.chat-gif-search button {
  width: 31px;
  height: 31px;
  min-height: 31px;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--social-action);
}

.chat-gif-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: start;
  gap: 3px;
  overflow-y: auto;
}

.chat-gif-grid button {
  aspect-ratio: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 3px;
  overflow: hidden;
  background: #121821;
}

.chat-gif-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-gif-grid p {
  grid-column: 1 / -1;
  margin: 32px 0;
  color: var(--muted);
  text-align: center;
  font-size: 11px;
}

.chat-gif {
  display: block;
  width: min(280px, 72vw);
  max-height: 360px;
  border: 1px solid rgba(255, 255, 255, 0.045);
  border-radius: 8px;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.2);
  cursor: zoom-in;
}

.sticker-creator-page {
  position: fixed;
  inset: 0;
  z-index: 86;
  display: grid;
  place-items: center;
  padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom));
  background: #05070b;
}

.sticker-creator-shell {
  width: min(520px, 100%);
  height: min(760px, calc(var(--app-height) - 20px));
  display: grid;
  grid-template-rows: auto minmax(210px, 1fr) auto auto auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: #080c12;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
}

.sticker-creator-head {
  min-height: 52px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 54px;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.sticker-creator-head strong {
  text-align: center;
  font-size: 15px;
}

.sticker-creator-head .icon-btn {
  width: 34px;
  height: 34px;
  min-height: 34px;
  border-radius: 50%;
  background: transparent;
}

.sticker-save-btn {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 7px;
  color: #fff;
  background: var(--social-action);
  font-size: 11px;
  font-weight: 800;
}

.sticker-save-btn:disabled {
  opacity: 0.4;
}

.sticker-creator-stage {
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  margin: 10px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  background: #111720;
}

.sticker-live-text {
  width: max-content;
  max-width: 86%;
  max-height: 80%;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  padding: 12px 16px;
  border-radius: 14px;
  line-height: 1.05;
  font-weight: 800;
}

.sticker-creator-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  align-items: center;
  gap: 8px;
  padding: 0 10px 9px;
}

.sticker-creator-input-row > input {
  min-width: 0;
  height: 39px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  outline: 0;
  color: var(--text);
  background: #151b24;
  font-size: 16px;
}

.sticker-size-control {
  height: 39px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  padding: 0 8px;
  border-radius: 8px;
  background: #151b24;
}

.sticker-size-control .ui-icon {
  width: 16px;
  height: 16px;
}

.sticker-size-control input {
  width: 100%;
  accent-color: #fff;
}

.sticker-creator-choice-rail {
  min-height: 72px;
  display: flex;
  align-items: stretch;
  gap: 7px;
  overflow-x: auto;
  padding: 6px 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.055);
}

.sticker-creator-choice-rail > button,
.sticker-creator-choice-rail > label {
  flex: 0 0 auto;
}

.sticker-bg-color-choice {
  width: 44px;
  height: 44px;
  position: relative;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #fff;
  background: #191f29;
  font-size: 10px;
  font-weight: 800;
}

.sticker-bg-color-choice input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.sticker-creator-format-bar {
  min-height: 52px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: center;
  padding: 3px 8px 7px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  background: #0b1017;
}

.sticker-creator-format-bar button {
  width: 38px;
  height: 38px;
  min-height: 38px;
  justify-self: center;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #a7b0bc;
  background: transparent;
}

.sticker-creator-format-bar button.active {
  color: #080b10;
  background: #fff;
}

.sticker-creator-format-bar .ui-icon {
  width: 18px;
  height: 18px;
}

@media (max-width: 560px) {
  .chat-theme-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .chat-gif-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sticker-creator-page {
    padding: 0;
  }

  .sticker-creator-shell {
    width: 100%;
    height: var(--visual-height);
    border: 0;
    border-radius: 0;
  }

  .sticker-creator-input-row {
    grid-template-columns: minmax(0, 1fr) 104px;
  }

  .sticker-creator-format-bar button {
    width: 34px;
    height: 34px;
    min-height: 34px;
  }
}

/* Layered detail navigation */
#app {
  position: relative;
  isolation: isolate;
  width: 100%;
  max-width: 100%;
  height: var(--app-height);
  overflow: hidden;
}

.route-page-preview {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
  background: #030407;
  will-change: transform;
  overflow-anchor: none;
}

.route-page-preview::after {
  content: '';
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
  background: #030407;
  opacity: var(--route-backdrop-opacity, 0);
}

.navigation-edge-zone {
  display: none;
}

.route-page-preview > .app-shell {
  position: absolute;
  inset: 0;
  width: 100%;
}

.app-shell.route-page-current,
.app-shell.route-page-exiting,
.app-shell.route-swipe-current {
  position: relative;
  z-index: 2;
  will-change: transform, opacity;
}

.route-preview-forward {
  animation: routeBackdropForward 290ms cubic-bezier(.22,.76,.2,1) both;
}

.route-preview-forward::after {
  animation: routeBackdropDimForward 290ms cubic-bezier(.22,.76,.2,1) both;
}

.route-page-entering {
  animation: routePageForwardDesktop 270ms cubic-bezier(.2,.8,.2,1) both;
}

.route-page-exiting {
  animation: routePageBackDesktop 260ms cubic-bezier(.28,.74,.22,1) both;
}

.route-preview-back.route-page-revealing {
  animation: routeBackdropBackDesktop 260ms cubic-bezier(.28,.74,.22,1) both;
}

.route-preview-back.route-page-revealing::after {
  animation: routeBackdropDimBack 260ms cubic-bezier(.28,.74,.22,1) both;
}

.route-preview-swipe {
  transform: translateX(-18%);
  --route-backdrop-opacity: .22;
}

.route-preview-swipe.route-swipe-settling::after {
  transition: opacity 240ms cubic-bezier(.24,.78,.22,1);
}

.social-user-list.social-list-slide {
  will-change: transform, opacity;
}

.social-user-list.social-list-from-right {
  animation: socialListFromRight 210ms cubic-bezier(.24,.76,.2,1) both;
}

.social-user-list.social-list-from-left {
  animation: socialListFromLeft 210ms cubic-bezier(.24,.76,.2,1) both;
}

.social-switch.is-following.social-switch-from-right::before {
  animation: socialUnderlineToRight 220ms cubic-bezier(.24,.76,.2,1) both;
}

.social-switch:not(.is-following).social-switch-from-left::before {
  animation: socialUnderlineToLeft 220ms cubic-bezier(.24,.76,.2,1) both;
}

@keyframes routePageForwardDesktop {
  from { opacity: .72; transform: translateX(26px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes routePageBackDesktop {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: .75; transform: translateX(34px); }
}

@keyframes routeBackdropForward {
  from { transform: translateX(0); }
  to { transform: translateX(-4%); }
}

@keyframes routeBackdropBackDesktop {
  from { transform: translateX(-4%); }
  to { transform: translateX(0); }
}

@keyframes routeBackdropDimForward {
  from { opacity: 0; }
  to { opacity: .2; }
}

@keyframes routeBackdropDimBack {
  from { opacity: .22; }
  to { opacity: 0; }
}

@keyframes socialListFromRight {
  from { opacity: .45; transform: translateX(18px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes socialListFromLeft {
  from { opacity: .45; transform: translateX(-18px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes socialUnderlineToRight {
  from { transform: translateX(0); }
  to { transform: translateX(100%); }
}

@keyframes socialUnderlineToLeft {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

@media (max-width: 860px) {
  .navigation-edge-zone {
    position: fixed;
    z-index: 12;
    top: calc(66px + env(safe-area-inset-top));
    bottom: max(8px, env(safe-area-inset-bottom));
    left: max(16px, env(safe-area-inset-left));
    display: block;
    width: 32px;
    touch-action: pan-y;
    background: transparent;
  }

  .app-shell.route-page-entering {
    animation-name: routePageForwardMobile;
  }

  .app-shell.route-page-entering .chat-pane.chat-opening {
    animation: none;
  }

  .app-shell.route-page-exiting {
    animation-name: routePageBackMobile;
  }

  .route-preview-back.route-page-revealing {
    animation-name: routeBackdropBackMobile;
  }

  .route-preview-back.route-page-revealing::after {
    animation-name: routeBackdropDimBack;
  }

  @keyframes routePageForwardMobile {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
  }

  @keyframes routePageBackMobile {
    from { transform: translateX(0); }
    to { transform: translateX(100%); }
  }

  @keyframes routeBackdropBackMobile {
    from { transform: translateX(-18%); }
    to { transform: translateX(0); }
  }
}

[data-action="like-story"] {
  position: relative;
  overflow: visible;
}

.story-viewer-actions button,
.story-comments-sheet button,
.story-viewer-actions input,
.story-comments-sheet input {
  -webkit-appearance: none;
  appearance: none;
}

[data-action="like-story"].is-pending {
  opacity: .55;
  pointer-events: none;
}

.story-engagement [data-action="like-story"].active,
.story-viewer-actions [data-action="like-story"].active {
  color: #ff3040;
}

.story-engagement [data-action="like-story"].active svg,
.story-viewer-actions [data-action="like-story"].active svg {
  fill: currentColor;
  stroke: currentColor;
}

[data-action="like-story"].story-heart-pop .ui-icon {
  animation: instagramHeartPop 440ms cubic-bezier(.18, .89, .32, 1.28) both;
}

[data-action="like-story"].story-heart-pop.active::before,
[data-action="like-story"].story-heart-pop.active::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 4px;
  margin: -2px;
  border-radius: 50%;
  box-shadow: 0 -17px #ff3040, 14px -9px #ff3040, 15px 9px #ff3040, 0 17px #ff3040, -14px 9px #ff3040, -14px -9px #ff3040;
  animation: instagramHeartBurst 480ms ease-out both;
  pointer-events: none;
}

[data-action="like-story"].story-heart-pop.active::after {
  transform: rotate(30deg) scale(.72);
  animation-delay: 40ms;
}

@media (min-width: 861px) and (max-width: 1099px) {
  .overlay:has(.post-comments-sheet) {
    box-sizing: border-box;
    padding-left: 76px;
  }
}

@media (min-width: 1100px) {
  .overlay:has(.post-comments-sheet) {
    align-items: center;
    justify-items: end;
    box-sizing: border-box;
    padding: 18px;
  }

  .action-sheet.compact-sheet.story-comments-sheet.post-comments-sheet {
    width: clamp(320px, 30vw, 430px);
    height: min(84vh, 760px);
    min-height: min(560px, calc(var(--visual-height) - 36px));
    max-height: calc(var(--visual-height) - 36px);
    justify-self: end;
    border-radius: 16px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, .55);
  }
}

@media (prefers-reduced-motion: reduce) {
  .route-page-preview,
  .route-page-entering,
  .route-page-exiting,
  .social-user-list.social-list-slide,
  .social-switch::before {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

/* --------------------------------------------------------------------------
   2026 social shell, carousels, crop gestures, native video, and Clips
   -------------------------------------------------------------------------- */

:root {
  --bg: #000;
  --bg-2: #080808;
  --panel: #0b0b0b;
  --panel-2: #171717;
  --panel-3: #262626;
  --line: #262626;
  --text: #f5f5f5;
  --muted: #a8a8a8;
  --soft: #d4d4d4;
  --social-blue: var(--social-action);
  --social-icon-blue: var(--social-action);
  --social-icon-blue-soft: var(--social-action-soft);
  --social-surface: #000;
  --social-surface-raised: #101010;
  --social-hairline: #262626;
}

.desktop-brand,
.nav-label {
  display: none;
}

.home-page {
  background: #000;
}

.home-brand,
.desktop-brand {
  font-family: "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  font-weight: 760;
  letter-spacing: -0.055em;
}

.home-layout {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 630px) 320px;
  justify-content: center;
  align-items: start;
  gap: clamp(28px, 4vw, 64px);
}

.home-primary {
  width: 100%;
  min-width: 0;
}

.home-suggestions {
  position: sticky;
  top: 38px;
  min-width: 0;
  display: grid;
  gap: 14px;
  padding-top: 30px;
}

.home-current-user,
.home-suggestion-row {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.home-current-user .avatar {
  width: 46px;
  height: 46px;
}

.home-current-user span,
.home-suggestion-name {
  min-width: 0;
  display: grid;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.home-current-user strong,
.home-current-user small,
.home-suggestion-name strong,
.home-suggestion-name small {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-current-user small,
.home-suggestion-name small {
  color: var(--muted);
}

.home-current-user b,
.home-follow-link,
.home-suggestions > header button {
  padding: 8px 0;
  color: var(--social-link);
  background: transparent;
  font-size: 11px;
  font-weight: 750;
}

.home-suggestions > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.home-suggestion-row {
  grid-template-columns: 36px minmax(0, 1fr) auto;
}

.home-suggestion-row .avatar {
  width: 36px;
  height: 36px;
}

.home-legal {
  margin-top: 14px;
  color: #555;
  font-size: 10px;
  line-height: 1.8;
}

.post-media-frame {
  aspect-ratio: var(--post-aspect, 1);
  background: #0a0a0a;
}

.post-media-frame.post-media-grid {
  aspect-ratio: 1;
}

.post-carousel-track {
  width: 100%;
  height: 100%;
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  touch-action: pan-x pan-y;
}

.post-carousel-track::-webkit-scrollbar,
.post-selection-rail::-webkit-scrollbar {
  display: none;
}

.post-carousel-slide {
  position: relative;
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  overflow: hidden;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  background: #080808;
}

.post-carousel-slide > img,
.post-carousel-slide > video,
.post-media-grid > img,
.post-media-grid > video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.post-native-video {
  transform: none !important;
  object-fit: cover;
  background: #000;
}

.post-carousel-count,
.post-composer-count {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 7;
  min-width: 42px;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  border-radius: 999px;
  color: #fff;
  background: rgba(0, 0, 0, 0.66);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  backdrop-filter: blur(8px);
}

.post-carousel-arrow {
  position: absolute;
  top: 50%;
  z-index: 7;
  width: 32px;
  height: 32px;
  min-height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  transform: translateY(-50%);
  backdrop-filter: blur(7px);
}

.post-carousel-arrow.previous {
  left: 10px;
}

.post-carousel-arrow.next {
  right: 10px;
  transform: translateY(-50%) rotate(180deg);
}

.post-carousel-arrow:disabled {
  visibility: hidden;
}

.post-carousel-dots {
  position: absolute;
  left: 50%;
  bottom: 10px;
  z-index: 7;
  max-width: calc(100% - 90px);
  display: flex;
  justify-content: center;
  gap: 4px;
  transform: translateX(-50%);
  pointer-events: none;
}

.post-carousel-dots i {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.52);
}

.post-carousel-dots i.active {
  background: var(--social-action);
}

.post-carousel-mark {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 4;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
}

.post-carousel-mark .ui-icon {
  width: 15px;
  height: 15px;
}

.post-like-burst {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 12;
  color: #fff;
  filter: drop-shadow(0 4px 15px rgba(0, 0, 0, 0.42));
  transform: translate(-50%, -50%) scale(0);
  animation: postLikeBurst 720ms cubic-bezier(.18, .8, .2, 1) both;
  pointer-events: none;
}

.post-like-burst .ui-icon {
  width: 88px;
  height: 88px;
}

.post-like-burst svg {
  fill: currentColor;
  stroke: currentColor;
}

@keyframes postLikeBurst {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.25); }
  28% { opacity: 1; transform: translate(-50%, -50%) scale(1.12); }
  55% { transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(.86); }
}

.post-composer-page,
.post-composer-head,
.post-stage-meta,
.post-stage-dots {
  background: #000;
}

.post-composer-page.is-publishing .post-editor-body,
.post-composer-page.is-publishing .post-details-layout {
  opacity: .58;
  pointer-events: none;
}

.post-composer-head .post-next,
.post-adjust-slider output {
  color: var(--social-link);
}

.post-stage-dots i.active {
  background: var(--social-action);
}

.post-composer-media {
  aspect-ratio: var(--post-aspect, 1);
  border-color: #262626;
  border-radius: 4px;
  background: #090909;
  touch-action: none;
}

.post-composer-media > img,
.post-composer-media > video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-crop-gesture-layer {
  position: absolute;
  inset: 0;
  z-index: 5;
  cursor: grab;
  touch-action: none;
}

.post-crop-gesture-layer.is-video {
  bottom: 54px;
}

.post-crop-gesture-layer:active {
  cursor: grabbing;
}

.post-crop-hint {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.post-crop-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.post-crop-actions .secondary {
  min-height: 44px;
}

.post-comments-off {
  display: block;
  margin-top: 8px;
  color: #737373;
  font-size: 11px;
}

.post-comments-disabled {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid #262626;
  color: #a8a8a8;
}

.post-comments-disabled > .ui-icon {
  width: 24px;
  height: 24px;
}

.post-comments-disabled span {
  display: grid;
}

.post-comments-disabled strong {
  color: #f5f5f5;
  font-size: 12px;
}

.post-comments-disabled small {
  font-size: 10px;
}

.post-selection-rail {
  width: min(100%, 580px);
  min-height: 82px;
  display: flex;
  align-items: center;
  gap: 9px;
  overflow-x: auto;
  padding: 7px 3px 12px;
  margin-inline: auto;
  scrollbar-width: none;
}

.post-editor-body:has(.post-crop-controls) .post-selection-rail {
  grid-column: 1;
  grid-row: 2;
}

.post-editor-body:has(.post-crop-controls) .post-crop-controls {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.post-selection-item {
  position: relative;
  flex: 0 0 64px;
  width: 64px;
}

.post-selection-thumb,
.post-selection-add {
  position: relative;
  width: 64px;
  height: 64px;
  min-height: 64px;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 5px;
  color: #fff;
  background: #171717;
}

.post-selection-item.active .post-selection-thumb {
  border-color: var(--social-action);
}

.post-selection-thumb img,
.post-selection-thumb video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.post-selection-thumb > i,
.post-selection-thumb > b {
  position: absolute;
  z-index: 2;
}

.post-selection-thumb > i {
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.28);
}

.post-selection-thumb > b {
  right: 4px;
  bottom: 3px;
  width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.72);
  font-size: 9px;
}

.post-selection-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  z-index: 4;
  width: 24px;
  height: 24px;
  min-height: 24px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 0, 0, 0.88);
}

.post-selection-remove .ui-icon {
  width: 13px;
  height: 13px;
}

.post-selection-order {
  position: absolute;
  left: 50%;
  bottom: -10px;
  z-index: 4;
  display: flex;
  overflow: hidden;
  border: 1px solid #333;
  border-radius: 999px;
  background: #111;
  transform: translateX(-50%);
}

.post-selection-order button {
  width: 28px;
  height: 24px;
  min-height: 24px;
  display: grid;
  place-items: center;
  padding: 0;
  color: #fff;
  background: transparent;
}

.post-selection-order button:last-child {
  transform: rotate(180deg);
}

.post-selection-order .ui-icon {
  width: 13px;
  height: 13px;
}

.post-selection-add {
  flex: 0 0 64px;
  border: 1px solid #363636;
  color: #d8d8d8;
}

.post-selection-add small {
  font-size: 9px;
}

.post-crop-controls,
.post-adjust-slider,
.post-details-fields {
  border-color: #262626;
  background: #101010;
}

.post-aspect-row button,
.post-adjust-tabs button {
  border-color: #2c2c2c;
  color: #a8a8a8;
  background: #171717;
}

.post-aspect-row button.active,
.post-adjust-tabs button.active {
  border-color: var(--social-action);
  color: #fff;
  background: var(--social-action-soft);
}

.side-content[data-tab="clips"],
.side-content[data-tab="clip-viewer"] {
  overflow: hidden;
  padding: 0;
}

.clips-page {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
  color: #fff;
  background: #000;
}

.clips-head {
  position: absolute;
  inset: 0 0 auto;
  z-index: 12;
  min-height: calc(56px + env(safe-area-inset-top));
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 8px;
  padding: env(safe-area-inset-top) max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
  pointer-events: none;
  background: linear-gradient(rgba(0, 0, 0, .56), rgba(0, 0, 0, 0));
}

.clips-tabs {
  min-width: 0;
  display: flex;
  justify-content: center;
  gap: 18px;
}

.clips-head .clips-tabs button {
  width: auto;
  height: 44px;
  min-height: 44px;
  padding: 0 3px;
  border-radius: 0;
  color: rgba(255, 255, 255, .62);
  font-size: 14px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .72);
  pointer-events: auto;
}

.clips-head .clips-tabs button.active {
  color: #fff;
  font-weight: 750;
}

.clips-head button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  color: #fff;
  background: transparent;
  pointer-events: auto;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .7));
}

.clips-head .clips-sound {
  width: 34px;
  height: 34px;
  justify-self: end;
  border-radius: 50%;
  background: rgba(0, 0, 0, .42);
  filter: none;
}

.clips-head .clips-sound .ui-icon {
  width: 18px;
  height: 18px;
}

.clips-feed {
  grid-row: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  background: #000;
}

.clips-feed::-webkit-scrollbar {
  display: none;
}

.clip-card {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background: #000;
}

.clip-stage {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0 auto;
  overflow: hidden;
  background: #000;
}

.clip-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
}

.clip-video {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  display: block;
  object-fit: cover !important;
  background: #000;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.clip-viewport.letterbox .clip-video {
  object-fit: contain !important;
}

.clip-video::-webkit-media-controls,
.clip-video::-webkit-media-controls-panel,
.clip-video::-webkit-media-controls-start-playback-button,
.post-video-preview::-webkit-media-controls,
.post-video-preview::-webkit-media-controls-panel,
.post-video-preview::-webkit-media-controls-start-playback-button {
  display: none !important;
  -webkit-appearance: none;
}

.clip-shade {
  position: absolute;
  inset: 48% 0 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, .72));
  pointer-events: none;
}

.clip-copy {
  position: absolute;
  right: 70px;
  bottom: max(15px, env(safe-area-inset-bottom));
  left: max(13px, env(safe-area-inset-left));
  z-index: 4;
  display: grid;
  gap: 7px;
  text-shadow: 0 1px 4px #000;
  pointer-events: none;
}

.clip-author-row {
  display: flex;
  align-items: center;
  gap: 9px;
}

.clip-author-row > a {
  width: max-content;
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  color: #fff;
  text-decoration: none;
  pointer-events: auto;
}

.clip-follow {
  min-height: 28px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, .75);
  border-radius: 8px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  background: rgba(0, 0, 0, .12);
  pointer-events: auto;
}

.clip-copy .avatar {
  width: 32px;
  height: 32px;
}

.clip-copy p {
  display: -webkit-box;
  max-width: 100%;
  margin: 0;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.38;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  pointer-events: auto;
}

.clip-audio-line {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clip-audio-line .ui-icon {
  width: 13px;
  height: 13px;
}

.clip-actions {
  position: absolute;
  right: max(7px, env(safe-area-inset-right));
  bottom: max(10px, env(safe-area-inset-bottom));
  z-index: 5;
  display: grid;
  justify-items: center;
  gap: 7px;
}

.clip-actions button {
  width: 46px;
  min-height: 43px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1px;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: #fff;
  background: transparent;
  text-shadow: 0 1px 3px #000;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .76));
}

.clip-actions button .ui-icon {
  width: 28px;
  height: 28px;
}

.clip-actions .clip-like-action.active {
  color: #ff3040;
}

.clip-actions .clip-repost-action.active {
  color: #42d66b;
}

.clip-actions .clip-like-action.active svg,
.clip-actions .clip-save-action.active svg {
  fill: currentColor;
}

.clip-actions small {
  color: #fff;
  font-size: 11px;
  font-weight: 650;
}

.clip-actions .clip-audio-cover {
  width: 36px;
  min-height: 36px;
  height: 36px;
  margin-top: 1px;
  overflow: hidden;
  border: 2px solid #fff;
  border-radius: 9px;
  color: #111;
  font-size: 10px;
  background: #fff;
  filter: none;
}

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

.clip-play-indicator {
  position: absolute;
  z-index: 6;
  top: 50%;
  left: 50%;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  opacity: 0;
  transform: translate(-50%, -50%) scale(.82);
  background: rgba(0, 0, 0, .58);
  pointer-events: none;
  transition: opacity 150ms ease, transform 150ms ease;
}

.clip-card.is-paused .clip-play-indicator {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.clip-play-indicator .ui-icon {
  width: 27px;
  height: 27px;
  margin-left: 3px;
}

.clip-like-burst {
  position: absolute;
  z-index: 7;
  top: 50%;
  left: 50%;
  width: 92px;
  height: 92px;
  color: #fff;
  opacity: 0;
  transform: translate(-50%, -50%) scale(.45) rotate(-10deg);
  filter: drop-shadow(0 3px 10px rgba(0, 0, 0, .35));
  pointer-events: none;
}

.clip-like-burst.show {
  animation: clipHeartBurst 700ms cubic-bezier(.2,.86,.2,1);
}

.clip-like-burst svg {
  fill: currentColor;
}

.clip-progress {
  position: absolute;
  z-index: 8;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  overflow: hidden;
  background: rgba(255, 255, 255, .24);
  pointer-events: none;
}

.clip-progress i {
  width: 100%;
  height: 100%;
  display: block;
  background: #fff;
  transform: scaleX(0);
  transform-origin: left center;
}

.post-video-preview {
  cursor: pointer;
}

.post-video-open-cue {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 50%;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, .42);
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .35));
  pointer-events: none;
}

.post-video-open-cue .ui-icon {
  width: 25px;
  height: 25px;
  margin-left: 3px;
}

@keyframes clipHeartBurst {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.45) rotate(-10deg); }
  22% { opacity: 1; transform: translate(-50%, -50%) scale(1.12) rotate(3deg); }
  68% { opacity: 1; transform: translate(-50%, -50%) scale(.94) rotate(0); }
  100% { opacity: 0; transform: translate(-50%, -58%) scale(.88); }
}

.clips-empty {
  height: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 30px;
  color: #a8a8a8;
  text-align: center;
}

.clips-empty > .ui-icon {
  width: 44px;
  height: 44px;
  color: #fff;
}

.clips-empty strong {
  color: #fff;
  font-size: 20px;
}

@media (min-width: 861px) {
  .app-shell.social-root {
    grid-template-columns: 245px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    background: #000;
  }

  .app-shell.social-root > .sidebar {
    display: contents;
  }

  .app-shell.social-root > .sidebar > .side-content {
    grid-column: 2;
    grid-row: 1;
    width: 100%;
    max-width: none;
    justify-self: stretch;
    border: 0;
    background: #000;
    box-shadow: none;
  }

  .app-shell.social-root > .sidebar > .bottom-tabs {
    position: relative;
    z-index: 40;
    grid-column: 1;
    grid-row: 1;
    width: 245px;
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 7px;
    padding: 28px 12px 20px;
    border-top: 0;
    border-right: 1px solid #262626;
    background: #000;
    backdrop-filter: none;
  }

  .app-shell.social-root > .sidebar > .bottom-tabs .desktop-brand {
    display: block;
    min-height: 70px;
    padding: 8px 12px;
    color: #fff;
    font-size: 20px;
  }

  .app-shell.social-root .bottom-tab {
    width: 100%;
    min-height: 50px;
    display: flex;
    justify-content: flex-start;
    gap: 15px;
    padding: 0 12px;
    border-radius: 8px;
    color: #f5f5f5;
    background: transparent;
  }

  .app-shell.social-root .bottom-tab:hover {
    background: #1a1a1a;
  }

  .app-shell.social-root .bottom-tab .nav-label,
  .app-shell.social-root .bottom-tab-create .nav-label {
    display: inline;
    font-size: 14px;
  }

  .app-shell.social-root .bottom-tab.active .nav-label {
    font-weight: 750;
  }

  .app-shell.social-root .bottom-tab-create {
    width: 100%;
    height: 50px;
    min-height: 50px;
    justify-self: auto;
    justify-content: flex-start;
    align-self: auto;
    gap: 15px;
    padding: 0 12px;
    border: 0;
    border-radius: 8px;
    color: #fff;
    background: transparent;
    box-shadow: none;
  }

  .app-shell.social-root .bottom-tab-create::after {
    content: "Create";
    font-size: 14px;
  }

  .app-shell.social-root .bottom-tab[data-tab="home"] { order: 1; }
  .app-shell.social-root .bottom-tab[data-tab="search"] { order: 2; }
  .app-shell.social-root .bottom-tab[data-tab="clips"] { order: 3; }
  .app-shell.social-root .bottom-tab-create { order: 4; }
  .app-shell.social-root .bottom-tab[data-tab="chats"] { order: 5; }
  .app-shell.social-root .bottom-tab[data-tab="profile"] { order: 6; margin-top: auto; }
  .app-shell.social-root .desktop-brand { order: 0; }

  .app-shell.social-root > .chat-pane {
    display: none;
  }

  .app-shell.social-root .home-topbar {
    width: min(100%, 1040px);
    margin: 0 auto;
    border-bottom-color: #1f1f1f;
    background: rgba(0, 0, 0, .92);
  }

  .app-shell.social-root .home-feed .feed-post {
    width: min(470px, calc(100% - 28px));
    margin: 14px auto 0;
    border: 0;
    border-bottom: 1px solid #262626;
    border-radius: 0;
    background: #000;
    box-shadow: none;
  }

  .app-shell.social-root .home-story-rail {
    border-bottom: 0;
    padding-top: 24px;
  }

  .clips-page {
    height: 100%;
  }

  .clip-card {
    width: 100%;
    border: 0;
    border-radius: 0;
  }

  .clip-stage {
    width: min(650px, calc(100% - 28px));
    display: grid;
    grid-template-columns: minmax(0, calc((var(--visual-height) - 24px) * .5625)) 62px;
    justify-content: center;
    align-items: center;
    gap: 12px;
    overflow: visible;
  }

  .clip-viewport {
    width: 100%;
    height: calc(100% - 24px);
    justify-self: end;
    border-radius: 9px;
  }

  .clip-actions {
    position: static;
    align-self: end;
    margin-bottom: 22px;
  }
}

@media (min-width: 861px) and (max-width: 1239px) {
  .app-shell.social-root {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .app-shell.social-root > .sidebar > .bottom-tabs {
    width: 76px;
    padding-inline: 8px;
  }

  .app-shell.social-root > .sidebar > .bottom-tabs .desktop-brand {
    width: 48px;
    overflow: hidden;
    padding-inline: 8px;
    font-size: 0;
  }

  .app-shell.social-root > .sidebar > .bottom-tabs .desktop-brand::first-letter {
    font-size: 20px;
  }

  .app-shell.social-root .bottom-tab {
    justify-content: center;
    padding: 0;
  }

  .app-shell.social-root .bottom-tab .nav-label,
  .app-shell.social-root .bottom-tab-create::after {
    display: none;
  }

  .app-shell.social-root .bottom-tab-create {
    justify-content: center;
    padding: 0;
  }

  .home-layout {
    grid-template-columns: minmax(0, 630px);
  }

  .home-suggestions {
    display: none;
  }
}

@media (max-width: 860px) {
  .bottom-tabs {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .bottom-tabs > .desktop-brand,
  .bottom-tab .nav-label {
    display: none;
  }

  .home-layout {
    display: block;
  }

  .home-suggestions {
    display: none;
  }

  .home-topbar {
    min-height: calc(52px + env(safe-area-inset-top));
    padding-inline: max(6px, env(safe-area-inset-left));
    background: rgba(0, 0, 0, .95);
  }

  .home-brand {
    font-size: 20px;
  }

  .home-head-actions {
    gap: 0;
  }

  .home-head-actions .icon-btn {
    width: 42px;
    height: 42px;
  }

  .feed-post {
    border-radius: 0;
    background: #000;
  }

  .post-head {
    min-height: 55px;
    padding: 7px 10px;
  }

  .post-head > a {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 9px;
  }

  .post-head .avatar {
    width: 34px;
    height: 34px;
  }

  .post-carousel-arrow {
    display: none;
  }

  .post-carousel-count {
    top: 9px;
    right: 9px;
  }

  .post-editor-body:has(.post-crop-controls) .post-composer-media,
  .post-editor-body:has(.post-crop-controls) .post-selection-rail,
  .post-editor-body:has(.post-crop-controls) .post-crop-controls {
    grid-column: 1;
    grid-row: auto;
  }

  .post-selection-rail {
    width: 100%;
    margin-top: -5px;
  }

  .post-composer-media {
    border-radius: 2px;
  }

  .clip-card {
    width: 100%;
    border-radius: 0;
  }

  .clip-copy,
  .clip-actions {
    bottom: max(10px, env(safe-area-inset-bottom));
  }
}

@media (max-width: 380px) {
  .home-head-actions .icon-btn:first-child {
    display: none;
  }

  .post-selection-thumb,
  .post-selection-add,
  .post-selection-item {
    width: 58px;
  }

  .post-selection-thumb,
  .post-selection-add {
    height: 58px;
    min-height: 58px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .post-like-burst {
    animation-duration: 1ms !important;
  }

  .post-carousel-track,
  .clips-feed {
    scroll-behavior: auto !important;
  }
}

/* Group conversations */
.new-group-btn {
  margin-left: auto;
  color: #f5f7fb;
}

.panel-heading:has(.new-group-btn) {
  min-height: 38px;
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.group-avatar {
  position: relative;
  overflow: hidden;
  background: #171b24;
  border: 1px solid rgba(255, 255, 255, 0.11);
}

.group-avatar-stack img,
.group-avatar-stack i {
  position: absolute;
  width: 58%;
  height: 58%;
  display: grid;
  place-items: center;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid #090b10;
  background: #303746;
  color: #fff;
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
}

.group-avatar-stack img:nth-child(1),
.group-avatar-stack i:nth-child(1) { left: 2%; top: 5%; }
.group-avatar-stack img:nth-child(2),
.group-avatar-stack i:nth-child(2) { right: 1%; bottom: 3%; }
.group-avatar-stack img:nth-child(3),
.group-avatar-stack i:nth-child(3) { right: 0; top: 0; width: 42%; height: 42%; }

.group-avatar.large {
  width: 96px;
  height: 96px;
  font-size: 24px;
}

.group-message-sender {
  display: block;
  height: 21px;
  margin: 0 4px 1px;
}

.group-message-sender .avatar {
  width: 21px;
  height: 21px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 7px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

.message.mine .group-message-sender {
  align-self: flex-end;
}

.typing-message > .avatar {
  width: 20px;
  height: 20px;
  align-self: flex-end;
  margin-right: 3px;
  font-size: 7px;
}

.group-header-info {
  margin-left: auto;
}

.group-profile-content {
  display: grid;
  gap: 12px;
  align-content: start;
}

.group-profile-hero {
  padding-bottom: 10px;
}

.group-photo-button,
.group-edit-photo {
  border: 0;
  background: transparent;
  color: var(--text);
}

.group-photo-button {
  position: relative;
  padding: 0;
}

.group-photo-button > span:last-child {
  position: absolute;
  right: -2px;
  bottom: 2px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #eef2f8;
  color: #090b10;
  border: 3px solid #080a0f;
}

.group-photo-button > span:last-child .ui-icon {
  width: 14px;
  height: 14px;
}

.group-section-head,
.group-member-row,
.group-member-identity {
  display: flex;
  align-items: center;
}

.group-section-head {
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px 10px;
}

.group-section-head > span {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.group-section-head small,
.group-member-identity small {
  color: var(--muted);
}

.group-add-link,
.group-done-btn {
  border: 0;
  background: transparent;
  color: var(--social-link);
  font-weight: 800;
  padding: 6px;
}

.group-add-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.group-add-link .ui-icon {
  width: 15px;
  height: 15px;
}

.group-member-list {
  display: grid;
}

.group-member-row {
  min-height: 58px;
  gap: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.055);
}

.group-member-identity {
  min-width: 0;
  flex: 1;
  gap: 10px;
  border: 0;
  padding: 7px 2px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.group-member-identity > span:last-child {
  min-width: 0;
  display: grid;
}

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

.group-invite-switch {
  margin-top: 5px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.group-chat-actions .profile-setting-link + .profile-setting-link {
  border-top: 1px solid rgba(255, 255, 255, 0.065);
}

.group-composer-overlay {
  position: fixed;
  inset: 0;
  z-index: 240;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.64);
  backdrop-filter: blur(10px);
  animation: groupBackdropIn 160ms ease both;
}

.group-composer {
  width: min(520px, 100%);
  height: min(690px, calc(var(--visual-height) - 36px));
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #0b0e14;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.55);
  animation: groupComposerIn 200ms cubic-bezier(.2,.8,.2,1) both;
}

.group-composer-create {
  grid-template-rows: auto auto auto auto minmax(0, 1fr) auto;
}

.group-composer > header {
  min-height: 56px;
  display: grid;
  grid-template-columns: 42px 1fr 62px;
  align-items: center;
  padding: 6px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.group-composer > header > strong {
  text-align: center;
  font-size: 15px;
}

.group-done-btn:disabled {
  color: #505765;
  cursor: default;
}

.group-name-field,
.group-people-search {
  margin: 10px 14px 0;
}

.group-name-field {
  min-height: 44px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.group-name-field span {
  color: var(--muted);
  font-size: 13px;
}

.group-name-field input,
.group-people-search input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
}

.group-people-search {
  min-height: 40px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-radius: 9px;
  background: #171b23;
}

.group-people-search .ui-icon {
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.group-selected-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  max-height: 0;
  padding: 0 14px;
  opacity: 0;
  transition: max-height 180ms ease, padding 180ms ease, opacity 140ms ease;
}

.group-selected-strip.has-selection {
  max-height: 76px;
  padding: 12px 14px 6px;
  opacity: 1;
}

.group-selected-strip button {
  position: relative;
  width: 54px;
  flex: 0 0 54px;
  display: grid;
  justify-items: center;
  gap: 4px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--soft);
}

.group-selected-strip .avatar {
  width: 42px;
  height: 42px;
}

.group-selected-strip small {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
}

.group-selected-strip button > .ui-icon {
  position: absolute;
  right: 1px;
  top: -2px;
  width: 15px;
  height: 15px;
  padding: 2px;
  border-radius: 50%;
  color: #0a0c10;
  background: #e8edf4;
}

.group-contact-list {
  min-height: 0;
  overflow-y: auto;
  padding: 8px 8px 14px;
}

.group-contact-row {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 22px;
  align-items: center;
  column-gap: 8px;
  border: 0;
  padding: 7px 12px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.group-contact-row > .avatar {
  width: 38px;
  height: 38px;
  justify-self: start;
  margin: 0;
}

.group-contact-row:hover {
  background: rgba(255, 255, 255, 0.035);
}

.group-contact-row > span {
  min-width: 0;
  width: 100%;
  display: grid;
  justify-self: start;
  align-content: center;
  gap: 2px;
}

.group-contact-row strong {
  font-size: 13px;
  line-height: 1.2;
}

.group-contact-row small {
  color: var(--muted);
}

.group-contact-row > i {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border: 1px solid #4a5260;
  border-radius: 50%;
  color: #080a0d;
  font-style: normal;
}

.group-contact-row.selected > i {
  border-color: var(--social-action);
  background: var(--social-action);
}

.group-contact-row > i .ui-icon {
  width: 13px;
  height: 13px;
  stroke-width: 3;
}

.group-privacy-note,
.group-empty {
  margin: 0;
  padding: 10px 16px 14px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.group-edit-composer {
  height: auto;
  grid-template-rows: auto auto auto;
  padding-bottom: 22px;
}

.group-edit-photo {
  display: grid;
  justify-items: center;
  gap: 9px;
  padding: 24px 12px 12px;
}

.group-edit-photo small {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--social-link);
  font-weight: 750;
}

.group-edit-photo .ui-icon {
  width: 15px;
  height: 15px;
}

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

@keyframes groupComposerIn {
  from { opacity: 0; transform: translateY(18px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 620px) {
  .group-composer-overlay {
    place-items: stretch;
    padding: 0;
    background: #080a0f;
    backdrop-filter: none;
  }

  .group-composer {
    width: 100%;
    height: var(--visual-height);
    max-height: var(--visual-height);
    padding-top: var(--visual-top);
    border: 0;
    border-radius: 0;
    animation-name: groupComposerMobileIn;
  }

  .group-edit-composer {
    align-content: start;
  }
}

@keyframes groupComposerMobileIn {
  from { opacity: .7; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Chat composer, message actions, and viewport gradient */
.side-content {
  touch-action: pan-y;
  will-change: transform, opacity;
}

.chat-footer {
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: rgba(5, 7, 11, 0.98);
}

.chat-footer .composer {
  order: 1;
  padding: 8px clamp(8px, 2vw, 14px) max(8px, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, 0.055);
  background: transparent;
}

.chat-footer .chat-media-tray {
  order: 2;
}

.chat-footer.tray-open .composer {
  padding-bottom: 7px;
}

.instagram-composer {
  min-height: 46px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 34px 34px auto;
  align-items: center;
  gap: 1px;
  padding: 3px 5px 3px 4px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 24px;
  background: rgba(12, 16, 23, 0.94);
  transition: border-color 0.18s ease, background 0.18s ease;
}

.instagram-composer:focus-within {
  border-color: rgba(255, 255, 255, 0.32);
  background: #0d1219;
}

.instagram-composer .composer-camera,
.instagram-composer .composer-tool {
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #f4f7fb;
  background: transparent;
}

.instagram-composer .composer-camera {
  color: #fff;
  background: var(--social-action);
}

.instagram-composer .composer-tool.active,
.instagram-composer .composer-tool:hover {
  background: rgba(255, 255, 255, 0.09);
}

.instagram-composer .ui-icon {
  width: 20px;
  height: 20px;
}

.instagram-composer .composer-input {
  min-height: 38px;
  max-height: 112px;
  padding: 9px 7px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  line-height: 20px;
}

.instagram-composer .composer-input:focus {
  border: 0;
  box-shadow: none;
}

.instagram-composer .send-btn {
  width: auto;
  min-width: 43px;
  height: 34px;
  min-height: 34px;
  padding: 0 7px;
  border: 0;
  color: var(--social-link);
  background: transparent;
  font-size: 13px;
  font-weight: 800;
}

.chat-pane.active-chat .message {
  inline-size: fit-content;
  max-inline-size: min(680px, 84%);
}

.chat-pane.active-chat .message .bubble {
  inline-size: fit-content !important;
  max-inline-size: 100%;
  color: var(--chat-bubble-text, #fff);
  background-color: var(--chat-bubble-top, #55339a);
  background-image: linear-gradient(180deg, var(--chat-bubble-top, #55339a), var(--chat-bubble-bottom, #182131));
  background-attachment: fixed;
  background-size: 100vw var(--visual-height);
  background-position: 0 var(--visual-top);
  border-color: rgba(255, 255, 255, 0.09);
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.2);
}

.chat-pane.active-chat .message .message-text {
  width: auto !important;
  min-width: 0;
  max-width: min(60ch, calc(100vw - 76px));
}

.chat-pane.active-chat .message.media-message .bubble,
.chat-pane.active-chat .message.sticker-message .bubble {
  color: inherit;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.chat-pane.active-chat .typing-bubble {
  color: var(--chat-bubble-text, #fff);
  background: var(--chat-bubble-bottom, #182131);
}

.message-context-label,
.forwarded-label {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: rgba(218, 224, 233, 0.64);
  font-size: 10px;
  line-height: 1;
}

.message-context-label {
  margin: 0 7px 1px;
}

.message-context-label .ui-icon {
  width: 11px;
  height: 11px;
}

.forwarded-label {
  margin-bottom: 4px;
  font-style: italic;
}

.message-sticker-overlays {
  position: absolute;
  top: -20px;
  right: -22px;
  z-index: 3;
  width: 54px;
  height: 54px;
  pointer-events: none;
}

.theirs .message-sticker-overlays {
  right: auto;
  left: -22px;
}

.message-sticker-overlays img {
  position: absolute;
  inset: 0;
  width: 54px;
  height: 54px;
  object-fit: contain;
  transform: translate(calc(var(--sticker-index) * 5px), calc(var(--sticker-index) * -3px)) rotate(calc((var(--sticker-index) - 2) * 5deg));
  filter: drop-shadow(0 4px 7px rgba(0, 0, 0, 0.38));
}

.message-reactions {
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: -7px;
  padding: 2px 4px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 12px;
  background: #11161e;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.24);
}

.message.mine .message-reactions {
  margin-right: 7px;
}

.message.theirs .message-reactions {
  margin-left: 7px;
}

.message-reactions button {
  min-width: 20px;
  min-height: 18px;
  padding: 0 2px;
  border: 0;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: #fff;
  background: transparent;
  font-size: 13px;
}

.message-reactions button.mine {
  filter: saturate(1.2);
}

.message-reactions small {
  color: #aeb7c4;
  font-size: 9px;
}

.message-focus-overlay {
  position: fixed;
  inset: 0;
  z-index: 92;
  display: grid;
  place-items: center;
  padding: max(18px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom));
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
  animation: messageFocusFade 0.18s ease both;
}

.message-focus-overlay.closing {
  animation: messageFocusFade 0.18s ease reverse both;
}

.message-focus-stage {
  width: min(480px, 100%);
  max-height: calc(var(--visual-height) - 44px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  animation: messageFocusRise 0.22s cubic-bezier(.2, .8, .2, 1) both;
}

.message-focus-overlay.closing .message-focus-stage {
  animation: none;
}

.message-focus-stage.mine {
  align-items: flex-end;
}

.message-focus-overlay.closing .message-focus-stage {
  animation: messageFocusRise 0.17s ease reverse both;
}

.message-reaction-bar {
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 1px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  background: #161b23;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.message-reaction-bar button {
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: transparent;
  font-size: 22px;
  transition: transform 0.16s ease, background 0.16s ease;
}

.message-reaction-bar button:hover,
.message-reaction-bar button.active {
  transform: translateY(-3px) scale(1.12);
  background: rgba(255, 255, 255, 0.09);
}

.message-reaction-bar button:last-child .ui-icon {
  width: 17px;
  height: 17px;
}

.message-focus-copy {
  margin: 0;
  max-width: 88%;
  pointer-events: auto;
}

.message-focus-copy .bubble {
  width: fit-content;
  max-width: 100%;
  color: var(--chat-bubble-text, #fff);
  background: linear-gradient(180deg, var(--chat-bubble-top, #55339a), var(--chat-bubble-bottom, #182131));
}

.message-action-menu {
  width: min(430px, 100%);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 2px;
  padding: 7px 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: #141920;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.42);
}

.message-action-menu button {
  min-width: 0;
  min-height: 58px;
  padding: 5px 2px;
  border: 0;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: #dce2e9;
  background: transparent;
  font-size: 9px;
}

.message-action-menu button:hover {
  background: rgba(255, 255, 255, 0.065);
}

.message-action-menu .ui-icon {
  width: 19px;
  height: 19px;
}

.message-focus-picker {
  width: min(430px, 100%);
  max-height: min(580px, calc(var(--visual-height) - 52px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: #10151c;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.48);
  animation: messagePickerIn 0.18s ease both;
}

.message-focus-picker > header {
  min-height: 50px;
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  padding: 0 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.message-focus-picker > header button {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: transparent;
}

.message-focus-picker > header strong {
  text-align: center;
  font-size: 14px;
}

.message-focus-list,
.message-focus-stickers {
  overflow-y: auto;
  padding: 7px;
}

.message-focus-list > button {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 7px;
  border: 0;
  border-radius: 9px;
  color: #fff;
  background: transparent;
  text-align: left;
}

.message-focus-list > button:hover {
  background: rgba(255, 255, 255, 0.055);
}

.message-focus-list .avatar {
  width: 42px;
  height: 42px;
}

.message-focus-list span strong,
.message-focus-list span small {
  display: block;
}

.message-focus-list span small {
  color: #8993a0;
  font-size: 10px;
}

.message-focus-list b {
  color: var(--social-link);
  font-size: 11px;
}

.message-focus-stickers {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

.message-focus-stickers button {
  aspect-ratio: 1;
  min-width: 0;
  padding: 5px;
  border: 0;
  border-radius: 6px;
  background: transparent;
}

.message-focus-stickers img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sticker-creator-page {
  place-items: center;
  padding: max(14px, env(safe-area-inset-top)) 12px max(14px, env(safe-area-inset-bottom));
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(3px);
}

.sticker-creator-shell {
  width: min(480px, 100%);
  height: min(620px, calc(var(--visual-height) - 44px));
  border-color: rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.65);
  animation: stickerModalIn 0.2s cubic-bezier(.2, .8, .2, 1) both;
}

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

@keyframes messageFocusRise {
  from { opacity: 0; transform: translateY(18px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes messagePickerIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes stickerModalIn {
  from { opacity: 0; transform: translateY(22px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 560px) {
  .chat-pane.active-chat .message {
    max-inline-size: 88%;
  }

  .instagram-composer {
    grid-template-columns: 35px minmax(0, 1fr) 32px 32px auto;
  }

  .instagram-composer .composer-tool {
    width: 32px;
    height: 32px;
    min-height: 32px;
  }

  .message-focus-overlay {
    align-items: center;
    padding-left: 10px;
    padding-right: 10px;
  }

  .message-reaction-bar button {
    width: min(12vw, 40px);
    height: min(12vw, 40px);
    min-height: 36px;
    font-size: 20px;
  }

  .message-action-menu {
    width: 100%;
  }

  .sticker-creator-page {
    place-items: end center;
    padding: 10px 9px max(10px, env(safe-area-inset-bottom));
  }

  .sticker-creator-shell {
    width: 100%;
    height: min(68vh, 590px);
    max-height: calc(var(--visual-height) - 22px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
  }

  .keyboard-open .chat-footer .chat-media-tray:not(.gifs-tray) {
    display: none;
  }

  .keyboard-open .chat-footer .gifs-tray {
    height: min(330px, calc(var(--visual-height) * .44));
  }
}

@media (prefers-reduced-motion: reduce) {
  .message-focus-overlay,
  .message-focus-stage,
  .message-focus-picker,
  .sticker-creator-shell {
    animation-duration: 0.01ms !important;
  }

  .message .bubble,
  .message-focus-actions,
  .message-focus-overlay.closing .message-reaction-bar,
  .message-focus-overlay.closing .message-action-menu {
    transition-duration: 0.01ms !important;
  }
}

/* Refined message focus, comments, sticker sets, and page gestures */
.chat-pane.active-chat .message .bubble {
  background-color: var(--chat-bubble-top, #55339a);
  background-image: linear-gradient(180deg, var(--chat-bubble-top, #55339a), var(--chat-bubble-bottom, #182131));
  background-attachment: fixed;
  background-size: 100vw var(--visual-height);
  background-position: 0 var(--visual-top);
  transition: border-color 140ms ease, box-shadow 150ms cubic-bezier(.2, .8, .2, 1), filter 150ms cubic-bezier(.2, .8, .2, 1), transform 150ms cubic-bezier(.2, .8, .2, 1);
}

.message .bubble {
  transform-origin: left center;
  transition: border-color 140ms ease, box-shadow 150ms cubic-bezier(.2, .8, .2, 1), filter 150ms cubic-bezier(.2, .8, .2, 1), transform 150ms cubic-bezier(.2, .8, .2, 1);
}

.message.mine .bubble {
  transform-origin: right center;
}

.message.message-press-pending .bubble {
  filter: brightness(.98);
  transform: scale(.985);
}

.message.message-press-held .bubble {
  filter: brightness(1.06) saturate(1.03);
  transform: translateY(-1px) scale(1.025);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .2), 0 16px 38px rgba(0, 0, 0, .42);
}

.message.media-message.message-press-held .bubble,
.message.sticker-message.message-press-held .bubble {
  filter: brightness(1.06) saturate(1.03) drop-shadow(0 14px 24px rgba(0, 0, 0, .42));
  box-shadow: none;
}

.chat-pane.chat-opening {
  animation: chatOpenIn 0.28s cubic-bezier(.22,.78,.2,1) both;
}

@keyframes chatOpenIn {
  from { opacity: 0.72; transform: translateX(34px); }
  to { opacity: 1; transform: translateX(0); }
}

.message-focus-stage {
  height: auto;
  max-height: calc(var(--visual-height) - 36px);
  align-items: stretch;
  animation: none;
}

.message-focus-stage.mine,
.message-focus-stage.theirs {
  align-items: stretch;
}

.message-focus-actions {
  min-height: 0;
  width: 100%;
  height: auto;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.message-focus-actions.hidden {
  display: none;
}

.message-focus-host {
  flex: 0 1 auto;
  min-height: 0;
  width: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 4px;
  scrollbar-width: none;
}

.message-focus-host::-webkit-scrollbar {
  display: none;
}

.message-focus-host .message {
  flex: 0 0 auto;
  width: fit-content;
  max-width: 88%;
  margin: auto;
  align-self: center;
  will-change: transform;
  z-index: 2;
}

.message-focus-host .message .bubble {
  color: var(--chat-bubble-text, #fff);
  background: var(--message-bubble-color, var(--chat-bubble-top, #55339a));
}

.message-focus-host .message.media-message .bubble,
.message-focus-host .message.sticker-message .bubble {
  background: transparent;
}

.message-focus-host .media-image,
.message-focus-host .media-video,
.message-focus-host .chat-gif {
  max-height: min(46vh, 390px);
}

.message-focus-placeholder {
  flex: 0 0 auto;
  min-width: 0;
  pointer-events: none;
}

.message-focus-placeholder.mine {
  align-self: flex-end;
}

.message-focus-placeholder.theirs {
  align-self: flex-start;
}

.message-reaction-bar,
.message-action-menu {
  flex: 0 0 auto;
  justify-self: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.message-focus-overlay.ready .message-reaction-bar,
.message-focus-overlay.ready .message-action-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  animation: focusWidgetIn 0.2s ease both;
}

.message-focus-overlay.closing .message-reaction-bar,
.message-focus-overlay.closing .message-action-menu {
  opacity: 0;
  transform: translateY(6px) scale(0.98);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.message-focus-picker-slot {
  min-height: 0;
  display: grid;
  place-items: center;
}

.message-focus-stage.picker-open .message-focus-picker-slot {
  height: 100%;
}

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

.inline-mention,
.comment-username {
  min-height: 0;
  padding: 0;
  border: 0;
  color: #f2f4f7;
  background: transparent;
  font: inherit;
  font-weight: 750;
}

.inline-mention {
  color: var(--social-link-hover);
}

.story-comment-list {
  max-height: min(48vh, 420px);
  gap: 14px;
}

.action-sheet.compact-sheet.story-comments-sheet {
  max-height: min(78vh, 680px);
}

.story-comment-list .story-comment-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 28px;
  align-items: start;
  gap: 9px;
}

.story-comment-list .story-comment-row.reply {
  margin-left: 34px;
}

.story-comment-content {
  min-width: 0;
}

.story-comment-content p {
  margin: 0;
  color: #e9ebef;
  font-size: 12px;
  line-height: 1.42;
  overflow-wrap: anywhere;
}

.comment-reply-context {
  display: block;
  margin-bottom: 2px;
  color: #747d89;
  font-size: 9px;
}

.story-comment-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 5px;
  color: #747d89;
  font-size: 9px;
  font-weight: 650;
}

.story-comment-meta button {
  min-height: 0;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
}

.story-comment-like {
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 6px;
  border: 0;
  color: #8a929e;
  background: transparent;
}

.story-comment-like .ui-icon {
  width: 14px;
  height: 14px;
}

.story-comment-like.active {
  color: #ff4868;
}

.story-comment-like.active svg {
  fill: currentColor;
}

.comment-replying {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 8px 1px;
  color: #8f98a5;
  font-size: 10px;
}

.comment-replying button {
  width: 26px;
  height: 26px;
  min-height: 26px;
  padding: 6px;
  border: 0;
  border-radius: 50%;
  color: #aab2bd;
  background: transparent;
}

.chat-media-tray.stickers-tray {
  grid-template-rows: auto auto auto minmax(0, 1fr);
}

.sticker-set-rail {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 1px 2px 3px;
  scrollbar-width: none;
}

.sticker-set-rail::-webkit-scrollbar {
  display: none;
}

.sticker-set-rail button {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 14px;
  color: #8993a0;
  background: transparent;
  font-size: 10px;
  font-weight: 700;
}

.sticker-set-rail button.active {
  color: #fff;
  background: #242b35;
}

.sticker-set-rail .sticker-set-add,
.sticker-set-rail .sticker-set-edit {
  width: 28px;
  padding: 6px;
}

.sticker-set-rail .ui-icon {
  width: 15px;
  height: 15px;
}

.sticker-set-empty {
  grid-column: 1 / -1;
  align-self: center;
  color: #747d89;
  text-align: center;
  font-size: 11px;
}

.sticker-manager-overlay {
  position: fixed;
  inset: 0;
  z-index: 94;
  display: grid;
  place-items: center;
  padding: 14px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  animation: messageFocusFade 0.18s ease both;
}

.sticker-manager-sheet {
  width: min(460px, 100%);
  max-height: min(650px, calc(var(--visual-height) - 32px));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 14px;
  background: #0e131a;
  box-shadow: 0 22px 60px rgba(0,0,0,.55);
}

.sticker-manager-sheet > header {
  min-height: 52px;
  display: grid;
  grid-template-columns: 44px 1fr 52px;
  align-items: center;
  padding: 0 6px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}

.sticker-manager-sheet > header > button {
  min-height: 34px;
  padding: 0;
  border: 0;
  color: #fff;
  background: transparent;
  font-size: 11px;
  font-weight: 800;
}

.sticker-manager-sheet > header > button:first-child {
  width: 34px;
  border-radius: 50%;
}

.sticker-manager-sheet > header strong {
  text-align: center;
  font-size: 14px;
}

.sticker-manager-save {
  color: var(--social-link) !important;
}

.sticker-set-name {
  display: grid;
  gap: 5px;
  padding: 12px;
  color: #88919d;
  font-size: 10px;
}

.sticker-set-name input {
  height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 9px;
  outline: 0;
  color: #fff;
  background: #171d25;
  font-size: 16px;
}

.sticker-manager-grid {
  min-height: 120px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-content: start;
  gap: 6px;
  overflow-y: auto;
  padding: 2px 12px 12px;
}

.sticker-manager-grid > button {
  aspect-ratio: 1;
  position: relative;
  padding: 5px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
}

.sticker-manager-grid > button.selected {
  border-color: rgba(57,125,180,.72);
  background: rgba(57,125,180,.1);
}

.sticker-manager-grid img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sticker-manager-grid button > span {
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 20px;
  height: 20px;
  padding: 4px;
  border-radius: 50%;
  display: none;
  color: #fff;
  background: var(--social-action);
}

.sticker-manager-grid button.selected > span {
  display: block;
}

.sticker-set-delete {
  min-height: 42px;
  border: 0;
  border-top: 1px solid rgba(255,255,255,.07);
  color: #ff6f81;
  background: transparent;
  font-size: 12px;
}

.sticker-save-sheet {
  width: min(330px, 100%);
  position: relative;
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 24px 16px 16px;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 16px;
  background: #10151c;
  box-shadow: 0 20px 54px rgba(0,0,0,.55);
}

.sticker-save-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 7px;
  border: 0;
  border-radius: 50%;
  color: #aab2bd;
  background: transparent;
}

.sticker-save-sheet > img {
  width: 142px;
  height: 142px;
  object-fit: contain;
}

.sticker-save-sheet > strong {
  font-size: 14px;
}

.sticker-save-sheet > small {
  color: #7f8996;
  font-size: 10px;
}

.sticker-save-sets {
  width: 100%;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-top: 12px;
}

.sticker-save-sets button {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #c8ced6;
  background: #1b222c;
  font-size: 10px;
}

.sticker-save-sets button.active {
  color: #fff;
  background: var(--social-action);
}

.sticker-save-sets .ui-icon {
  width: 14px;
  height: 14px;
}

.sticker-download-placeholder {
  min-height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 19px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #c9d1dc;
  background: rgba(255,255,255,.075);
  font-size: 10px;
}

.sticker-download-placeholder .ui-icon {
  width: 16px;
  height: 16px;
}

.chat-profile-appearance {
  padding: 0;
}

.profile-setting-link {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 0;
  color: #eef1f5;
  background: transparent;
  text-align: left;
}

.profile-setting-icon {
  width: 34px;
  height: 34px;
  padding: 8px;
  border-radius: 50%;
  color: #d6dbe2;
  background: #1a2029;
}

.profile-setting-link strong,
.profile-setting-link small {
  display: block;
}

.profile-setting-link strong {
  font-size: 12px;
}

.profile-setting-link small {
  margin-top: 2px;
  color: #7f8995;
  font-size: 9px;
}

.profile-setting-link > .ui-icon {
  width: 16px;
  height: 16px;
  transform: rotate(-90deg);
}

.sidebar {
  position: relative;
}

.tab-swipe-preview {
  position: absolute;
  inset: 0 0 58px;
  z-index: 2;
  background: #05070b;
  overflow: auto;
  will-change: transform;
}

.bottom-tabs {
  position: relative;
  z-index: 4;
}

@media (max-width: 560px) {
  .message-focus-stage {
    height: auto;
    max-height: calc(var(--visual-height) - max(24px, env(safe-area-inset-top)) - max(24px, env(safe-area-inset-bottom)));
  }

  .message-focus-host .message {
    max-width: 92%;
  }

  .sticker-manager-overlay {
    place-items: end center;
    padding: 9px 9px max(9px, env(safe-area-inset-bottom));
  }

  .sticker-manager-sheet {
    width: 100%;
    max-height: min(74vh, 620px);
    border-radius: 16px;
  }

  .sticker-save-sheet {
    margin-bottom: 8px;
  }
}

/* Compact social controls and lightweight chat loading states. */
.chat-loading-state {
  min-height: 100%;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 9px;
  color: #7f8996;
}

.chat-loading-state small {
  font-size: 10px;
}

.chat-loading-indicator {
  position: sticky;
  top: 4px;
  z-index: 3;
  align-self: center;
  width: 24px;
  height: 24px;
  margin: -8px auto 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #c8d0da;
  background: rgba(13, 18, 25, 0.84);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(8px);
}

.chat-loading-indicator .spinner {
  width: 13px;
  height: 13px;
}

.account-action,
.search-profile-actions .mini-btn,
.peer-profile-hero .toolbar .mini-btn,
.notification-row .mini-btn {
  min-width: 0;
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  color: #d9dfe7;
  background: #171c23;
  box-shadow: none;
  font-size: 11px;
  font-weight: 700;
}

.account-action.primary-action,
.profile-primary-action,
.notification-row .mini-btn:not(.danger) {
  color: #f5f7fa;
  background: #284e6e;
}

.account-action:is(:hover, :focus-visible),
.search-profile-actions .mini-btn:is(:hover, :focus-visible),
.peer-profile-hero .toolbar .mini-btn:is(:hover, :focus-visible),
.notification-row .mini-btn:is(:hover, :focus-visible) {
  background: #222933;
}

.account-action.primary-action:is(:hover, :focus-visible),
.profile-primary-action:is(:hover, :focus-visible),
.notification-row .mini-btn:not(.danger):is(:hover, :focus-visible) {
  background: #285f88;
}

.notification-row .mini-btn.danger {
  color: #c8ced6;
  background: transparent;
}

.recommend-card > .account-action {
  width: calc(100% - 16px);
  margin: 0 8px 8px;
}

.profile-control-list {
  overflow: hidden;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.025);
}

.profile-control-list > button,
.profile-control-list > .secondary,
.profile-control-list > .danger {
  width: 100%;
  min-height: 44px;
  justify-content: flex-start;
  padding: 0 11px;
  border: 0;
  border-radius: 0;
  color: #d7dde5;
  background: transparent;
  box-shadow: none;
  font-size: 12px;
}

.profile-control-list > button + button {
  border-top: 1px solid rgba(255, 255, 255, 0.055);
}

.profile-control-list > .danger {
  color: #ff7788;
}

.profile-control-list .ui-icon {
  width: 17px;
  height: 17px;
}

.chat-export-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chat-export-panel h2 {
  margin: 0;
  font-size: 13px;
}

.chat-export-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.chat-export-actions button {
  min-height: 32px;
  padding: 0 9px;
  border: 0;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #cfd5dd;
  background: #171d25;
  font-size: 10px;
  font-weight: 700;
}

.chat-export-actions button:is(:hover, :focus-visible) {
  color: #fff;
  background: #222a34;
}

.chat-export-actions .ui-icon {
  width: 14px;
  height: 14px;
}

.chat-profile-content > .panel-card {
  margin: 0;
  padding: 14px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.chat-profile-content > .panel-card + .panel-card {
  margin-top: 4px;
}

.chat-profile-content .profile-control-list {
  overflow: visible;
  border-radius: 0;
  background: transparent;
}

.chat-profile-content .profile-suggestion-section {
  border-top: 0;
}

@media (prefers-reduced-motion: reduce) {
  .chat-pane.chat-opening,
  .chat-loading-indicator .spinner {
    animation-duration: 0.01ms !important;
  }
}

/* One-shot chat settling prevents late media layout from pulling a new chat. */
.messages {
  position: relative;
}

.messages.chat-settling {
  overflow-anchor: none;
}

.messages.chat-settling > * {
  opacity: 0 !important;
  pointer-events: none;
}

.messages.chat-settling::after {
  content: '';
  position: absolute;
  inset: 50% auto auto 50%;
  width: 22px;
  height: 22px;
  margin: -11px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-top-color: #fff;
  border-radius: 50%;
  animation: cameraLoaderSpin .7s linear infinite;
}

.messages.chat-settled > * {
  animation: chatMessagesReveal .16s ease-out both;
}

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

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

/* Instagram-style camera surface shared by stories and the chat camera button. */
.camera-capture-page {
  position: fixed;
  inset: 0;
  z-index: 112;
  overflow: hidden;
  background: #000;
  color: #fff;
  isolation: isolate;
  clip-path: circle(150% at var(--camera-origin-x, 50%) var(--camera-origin-y, 50%));
}

.camera-capture-page.camera-opening {
  animation: cameraCaptureIn .28s cubic-bezier(.2, .8, .2, 1) both;
}

.camera-capture-page.camera-closing {
  pointer-events: none;
  animation: cameraCaptureOut .24s cubic-bezier(.4, 0, .2, 1) both;
}

.camera-capture-surface {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #000;
}

.camera-preview {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  opacity: 0;
  transition: opacity .18s ease;
}

.camera-ready .camera-preview {
  opacity: 1;
}

.camera-facing-user .camera-preview {
  transform: scaleX(-1);
}

.camera-scrim {
  position: absolute;
  right: 0;
  left: 0;
  z-index: 1;
  pointer-events: none;
}

.camera-scrim-top {
  top: 0;
  height: 26%;
  background: linear-gradient(180deg, rgba(0, 0, 0, .54), transparent);
}

.camera-scrim-bottom {
  bottom: 0;
  height: 32%;
  background: linear-gradient(0deg, rgba(0, 0, 0, .76), transparent);
}

.camera-capture-header,
.camera-capture-controls {
  position: absolute;
  z-index: 2;
  right: 0;
  left: 0;
  display: grid;
  align-items: center;
}

.camera-capture-header {
  top: 0;
  grid-template-columns: 48px 1fr 48px;
  min-height: 58px;
  padding: calc(8px + env(safe-area-inset-top)) 10px 8px;
}

.camera-capture-header strong {
  justify-self: center;
  letter-spacing: .18em;
  font-size: 11px;
}

.camera-control-button,
.camera-library-button {
  border: 0;
  color: #fff;
  background: transparent;
  font-weight: 750;
}

.camera-control-button {
  width: 42px;
  height: 42px;
  min-height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, .24);
  backdrop-filter: blur(12px);
}

.camera-control-button:disabled {
  opacity: .4;
}

.camera-control-button .ui-icon {
  width: 21px;
  height: 21px;
}

.camera-status {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 50%;
  width: min(300px, calc(100vw - 56px));
  display: grid;
  justify-items: center;
  gap: 12px;
  transform: translate(-50%, -50%);
  color: rgba(255, 255, 255, .78);
  text-align: center;
}

.camera-status .spinner {
  width: 28px;
  height: 28px;
}

.camera-status-error {
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 16px;
  background: rgba(24, 27, 35, .78);
  backdrop-filter: blur(16px);
}

.camera-status-error strong {
  color: #fff;
}

.camera-status small {
  max-width: 250px;
  line-height: 1.45;
}

.camera-capture-controls {
  bottom: 0;
  grid-template-columns: 1fr 86px 1fr;
  min-height: 110px;
  padding: 12px 26px calc(18px + env(safe-area-inset-bottom));
}

.camera-library-button {
  justify-self: start;
  min-height: 42px;
  padding: 0 8px;
  text-shadow: 0 1px 5px rgba(0, 0, 0, .56);
  font-size: 12px;
}

.camera-capture-controls > :last-child {
  justify-self: end;
}

.camera-shutter {
  width: 70px;
  height: 70px;
  min-height: 70px;
  padding: 4px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: transparent;
  transition: transform .14s ease, opacity .14s ease;
}

.camera-shutter:active:not(:disabled) {
  transform: scale(.9);
}

.camera-shutter:disabled {
  opacity: .42;
}

.camera-shutter i {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: #fff;
}

@keyframes cameraCaptureIn {
  from {
    opacity: .72;
    transform: scale(.94);
    clip-path: circle(var(--camera-origin-size, 24px) at var(--camera-origin-x, 50%) var(--camera-origin-y, 50%));
  }
  to {
    opacity: 1;
    transform: scale(1);
    clip-path: circle(150% at var(--camera-origin-x, 50%) var(--camera-origin-y, 50%));
  }
}

@keyframes cameraCaptureOut {
  from {
    opacity: 1;
    transform: scale(1);
    clip-path: circle(150% at var(--camera-origin-x, 50%) var(--camera-origin-y, 50%));
  }
  to {
    opacity: 0;
    transform: scale(.94);
    clip-path: circle(var(--camera-origin-size, 24px) at var(--camera-origin-x, 50%) var(--camera-origin-y, 50%));
  }
}

@media (prefers-reduced-motion: reduce) {
  .camera-capture-page,
  .camera-capture-page.camera-opening,
  .camera-capture-page.camera-closing,
  .messages.chat-settled > * {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

/* Instagram-style story comments */
.overlay:has(.story-comments-sheet) {
  background: rgba(0, 0, 0, .52);
  animation: instagramCommentsBackdropIn 240ms ease-out both;
}

.overlay.closing:has(.story-comments-sheet) {
  animation: instagramCommentsBackdropOut 220ms ease-in both;
}

.action-sheet.compact-sheet.story-comments-sheet {
  position: relative;
  width: min(520px, 100%);
  height: min(78vh, 720px);
  max-height: calc(var(--visual-height) - max(18px, env(safe-area-inset-top)));
  min-height: min(560px, calc(var(--visual-height) - 18px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 0;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 24px 24px 0 0;
  color: #f5f5f5;
  background: #000;
  box-shadow: 0 -12px 44px rgba(0, 0, 0, .34);
  transform-origin: bottom center;
  animation: instagramCommentsSheetIn 420ms cubic-bezier(.2, .88, .3, 1) both;
  will-change: transform;
}

.action-sheet.compact-sheet.story-comments-sheet.closing {
  animation: instagramCommentsSheetOut 240ms cubic-bezier(.4, 0, 1, 1) both;
}

.action-sheet.compact-sheet.story-comments-sheet.sheet-refreshing {
  animation: none;
}

.story-comments-sheet .story-comments-head {
  position: relative;
  min-height: 58px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  padding: 8px 10px 0;
  border-bottom: 1px solid #262626;
  text-align: center;
  touch-action: none;
  user-select: none;
}

.story-comments-sheet .story-sheet-grabber {
  position: absolute;
  top: 6px;
  left: 50%;
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: #737373;
  transform: translateX(-50%);
}

.story-comments-sheet .story-comments-head strong {
  grid-column: 2;
  color: #f5f5f5;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.01em;
}

.action-sheet.story-comments-sheet .story-sheet-icon {
  grid-column: 3;
  justify-self: end;
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 9px;
  border: 0;
  border-radius: 50%;
  color: #f5f5f5;
  background: transparent;
  transition: background-color 120ms ease, transform 120ms ease;
}

.action-sheet.story-comments-sheet .story-sheet-icon:active {
  background: #1c1c1c;
  transform: scale(.9);
}

.story-comments-sheet .story-comment-list {
  min-height: 0;
  max-height: none;
  display: block;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 14px 28px;
  scrollbar-width: none;
  scroll-behavior: smooth;
}

.story-comments-sheet .story-comment-list::-webkit-scrollbar {
  display: none;
}

.story-comments-sheet .story-comment-thread + .story-comment-thread {
  margin-top: 18px;
}

.story-comments-sheet .story-comment-row {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 36px;
  align-items: start;
  gap: 11px;
  margin: 0;
  animation: instagramCommentIn 260ms cubic-bezier(.2, .75, .25, 1) both;
  animation-delay: calc(var(--comment-order, 0) * 18ms);
}

.story-comments-sheet .story-comment-row.just-posted {
  animation: instagramCommentPosted 480ms cubic-bezier(.16, 1, .3, 1) both;
}

.story-comments-sheet.sheet-refreshing .story-comment-row:not(.just-posted) {
  animation: none;
}

.story-comments-sheet .story-comment-avatar {
  width: 34px;
  height: 34px;
  min-height: 34px;
  display: block;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  transition: transform 130ms ease;
}

.story-comments-sheet .story-comment-avatar:active {
  transform: scale(.92);
}

.story-comments-sheet .story-comment-avatar .avatar {
  width: 34px;
  height: 34px;
  border: 0;
  color: #fff;
  background: #262626;
  font-size: 10px;
}

.story-comments-sheet .story-comment-content {
  min-width: 0;
  padding-top: 1px;
}

.story-comments-sheet .story-comment-content p {
  margin: 0;
  color: #f5f5f5;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.42;
  overflow-wrap: anywhere;
}

.story-comments-sheet .comment-username,
.story-comments-sheet .inline-mention {
  display: inline;
  width: auto;
  height: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font: inherit;
  line-height: inherit;
  vertical-align: baseline;
}

.story-comments-sheet .comment-username {
  color: #f5f5f5;
  font-weight: 600;
}

.story-comments-sheet .inline-mention {
  color: var(--social-link-hover);
  font-weight: 600;
}

.story-comments-sheet .story-comment-kind,
.story-comments-sheet .story-comment-gif-unavailable {
  color: #a8a8a8;
  font-size: 11px;
}

.story-comments-sheet .story-comment-gif {
  width: min(210px, 100%);
  max-height: 220px;
  display: block;
  margin-top: 7px;
  object-fit: cover;
  border-radius: 9px;
  background: #161616;
}

.story-comments-sheet .story-comment-gif-unavailable {
  display: block;
  margin-top: 6px;
}

.story-comments-sheet .story-comment-meta {
  min-height: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 5px;
  color: #a8a8a8;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}

.story-comments-sheet .story-comment-meta time {
  margin: 0;
  color: inherit;
  font: inherit;
}

.story-comments-sheet .story-comment-meta button {
  min-height: 24px;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  transition: color 120ms ease, transform 120ms ease;
}

.story-comments-sheet .story-comment-meta button:active {
  color: #f5f5f5;
  transform: scale(.94);
}

.story-comments-sheet .story-comment-like-count.is-empty {
  display: none;
}

.action-sheet.story-comments-sheet .story-comment-like {
  position: relative;
  justify-self: end;
  width: 36px;
  height: 40px;
  min-height: 40px;
  display: grid;
  place-items: center;
  padding: 11px 10px 13px;
  border: 0;
  border-radius: 50%;
  color: #f5f5f5;
  background: transparent;
  transition: color 140ms ease, opacity 140ms ease, transform 120ms ease;
  overflow: visible;
}

.action-sheet.story-comments-sheet .story-comment-like:active {
  transform: scale(.8);
}

.story-comments-sheet .story-comment-like.is-pending {
  opacity: .5;
  pointer-events: none;
}

.story-comments-sheet .story-comment-like .ui-icon {
  width: 13px;
  height: 13px;
  transition: transform 180ms cubic-bezier(.2, .9, .3, 1), color 140ms ease;
}

.story-comments-sheet .story-comment-like .ui-icon svg {
  stroke-width: 2;
}

.story-comments-sheet .story-comment-like.active {
  color: #ff3040;
}

.story-comments-sheet .story-comment-like.active svg {
  fill: currentColor;
  stroke: currentColor;
}

.story-comments-sheet .story-comment-like.heart-pop .ui-icon {
  animation: instagramHeartPop 440ms cubic-bezier(.18, .89, .32, 1.28) both;
}

.story-comments-sheet .story-comment-like.heart-pop.active::before,
.story-comments-sheet .story-comment-like.heart-pop.active::after {
  content: "";
  position: absolute;
  inset: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  box-shadow: 0 -13px #ff3040, 11px -7px #ff3040, 12px 7px #ff3040, 0 13px #ff3040, -11px 7px #ff3040, -11px -7px #ff3040;
  animation: instagramHeartBurst 480ms ease-out both;
  pointer-events: none;
}

.story-comments-sheet .story-comment-like.heart-pop.active::after {
  transform: rotate(30deg) scale(.7);
  animation-delay: 40ms;
}

.story-comments-sheet .story-comment-replies-toggle {
  width: auto;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin: 8px 0 0 45px;
  padding: 0;
  border: 0;
  color: #a8a8a8;
  background: transparent;
  font-size: 11px;
  font-weight: 600;
}

.story-comments-sheet .story-comment-replies-toggle i {
  width: 24px;
  height: 1px;
  display: block;
  background: #737373;
  transition: width 180ms ease;
}

.story-comments-sheet .story-comment-replies-toggle[aria-expanded="true"] i {
  width: 12px;
}

.story-comments-sheet .story-comment-replies-toggle:active span {
  color: #f5f5f5;
}

.story-comments-sheet .story-comment-replies {
  display: grid;
  gap: 15px;
  margin: 11px 0 0 45px;
}

.story-comments-sheet .story-comment-replies.expanded {
  animation: instagramRepliesOpen 300ms cubic-bezier(.2, .8, .2, 1) both;
}

.story-comments-sheet .story-comment-replies .story-comment-row {
  grid-template-columns: 30px minmax(0, 1fr) 36px;
  gap: 10px;
}

.story-comments-sheet .story-comment-replies .story-comment-row.reply {
  width: 100%;
  margin-left: 0;
}

.story-comments-sheet .story-comment-replies .story-comment-avatar,
.story-comments-sheet .story-comment-replies .story-comment-avatar .avatar {
  width: 30px;
  height: 30px;
  min-height: 30px;
}

.story-comments-sheet .story-comments-empty {
  height: 100%;
  min-height: 240px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 5px;
  margin: 0;
  color: #f5f5f5;
  text-align: center;
}

.story-comments-sheet .story-comments-empty > span {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin-bottom: 8px;
  border: 2px solid #f5f5f5;
  border-radius: 50%;
}

.story-comments-sheet .story-comments-empty .ui-icon {
  width: 27px;
  height: 27px;
}

.story-comments-sheet .story-comments-empty strong {
  font-size: 18px;
  font-weight: 700;
}

.story-comments-sheet .story-comments-empty small {
  color: #a8a8a8;
  font-size: 13px;
}

.story-comments-sheet .story-comment-composer {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 0;
  padding: 0 12px max(10px, env(safe-area-inset-bottom));
  border-top: 1px solid #262626;
  background: #000;
}

.story-comments-sheet .comment-replying {
  min-height: 35px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 5px 0;
  color: #a8a8a8;
  font-size: 11px;
  animation: instagramReplyContextIn 180ms ease-out both;
}

.story-comments-sheet .comment-replying strong {
  color: #f5f5f5;
  font-weight: 600;
}

.action-sheet.story-comments-sheet .comment-replying button {
  width: 28px;
  height: 28px;
  min-height: 28px;
  display: grid;
  place-items: center;
  padding: 7px;
  border: 0;
  border-radius: 50%;
  color: #a8a8a8;
  background: transparent;
}

.story-comments-sheet .story-comment-quick-reactions {
  min-height: 52px;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  align-items: center;
  gap: 2px;
}

.action-sheet.story-comments-sheet .story-comment-quick-reactions button {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  font-size: clamp(19px, 5.6vw, 24px);
  line-height: 1;
  transition: transform 120ms ease, background-color 120ms ease;
}

.action-sheet.story-comments-sheet .story-comment-quick-reactions button:active {
  background: #121212;
  transform: scale(.82);
}

.story-comments-sheet .story-comment-quick-reactions button.reaction-pop {
  animation: instagramReactionPop 300ms cubic-bezier(.18, .89, .32, 1.28);
}

.story-comments-sheet .story-comment-gif-picker {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 10px 0 8px;
  animation: instagramCommentGifPickerIn 220ms cubic-bezier(.2, .8, .2, 1) both;
}

.story-comments-sheet .story-comment-gif-picker.is-posting button:not(.is-sending) {
  opacity: .46;
}

.story-comments-sheet .story-comment-gif-search {
  height: 36px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border-radius: 10px;
  color: #a8a8a8;
  background: #1c1c1c;
}

.story-comments-sheet .story-comment-gif-search .ui-icon {
  width: 17px;
  height: 17px;
}

.story-comments-sheet .story-comment-gif-search input {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0;
  border: 0;
  outline: 0;
  color: #f5f5f5;
  background: transparent;
  font-size: 14px;
}

.story-comments-sheet .story-comment-gif-grid {
  max-height: min(190px, 27vh);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: 9px;
  scrollbar-width: none;
}

.story-comments-sheet .story-comment-gif-grid::-webkit-scrollbar {
  display: none;
}

.action-sheet.story-comments-sheet .story-comment-gif-grid button {
  position: relative;
  min-width: 0;
  min-height: 74px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 5px;
  background: #151515;
}

.action-sheet.story-comments-sheet .story-comment-gif-grid button[hidden] {
  display: none;
}

.action-sheet.story-comments-sheet .story-comment-gif-grid button.is-sending {
  opacity: .5;
  pointer-events: none;
}

.action-sheet.story-comments-sheet .story-comment-gif-grid button.is-sending::after {
  content: '';
  position: absolute;
  inset: 50% auto auto 50%;
  width: 16px;
  height: 16px;
  margin: -10px;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: instagramCommentSpin .65s linear infinite;
}

.story-comments-sheet .story-comment-gif-grid img {
  width: 100%;
  height: 100%;
  min-height: 74px;
  display: block;
  object-fit: cover;
}

.story-comments-sheet .story-comment-gif-empty {
  grid-column: 1 / -1;
  margin: 22px 0;
  color: #a8a8a8;
  font-size: 12px;
  text-align: center;
}

.story-comments-sheet .story-comment-gif-empty[hidden] {
  display: none;
}

.story-comments-sheet .story-comment-gif-loading {
  position: absolute;
  inset: 54px 0 8px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: rgba(0, 0, 0, .48);
  pointer-events: none;
}

.story-comments-sheet .story-comment-gif-loading .spinner {
  width: 22px;
  height: 22px;
}

.story-comments-sheet .story-comment-box {
  min-height: 50px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
}

.action-sheet.story-comments-sheet .story-comment-composer-avatar {
  width: 44px;
  height: 44px;
  min-height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  overflow: hidden;
  color: #fff;
  background: #262626;
  transition: transform 130ms ease;
}

.action-sheet.story-comments-sheet .story-comment-composer-avatar:active {
  transform: scale(.92);
}

.story-comments-sheet .story-comment-composer-avatar .avatar {
  width: 34px;
  height: 34px;
  border: 0;
  font-size: 10px;
}

.story-comments-sheet .story-comment-field {
  min-width: 0;
  height: 44px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px auto;
  align-items: center;
  padding: 0 4px 0 13px;
  border: 1px solid #363636;
  border-radius: 999px;
  background: #000;
  transition: border-color 140ms ease;
}

.story-comments-sheet .story-comment-field:focus-within {
  border-color: #555;
}

.story-comments-sheet .story-comment-box input {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  color: #f5f5f5;
  background: transparent;
  font-size: 14px;
}

.story-comments-sheet .story-comment-box input::placeholder {
  color: #a8a8a8;
  opacity: 1;
}

.action-sheet.story-comments-sheet .story-comment-gif-toggle {
  width: 44px;
  height: 44px;
  min-height: 44px;
  display: grid;
  place-items: center;
  padding: 7px;
  border: 0;
  border-radius: 50%;
  color: #a8a8a8;
  background: transparent;
  transition: color 130ms ease, background-color 130ms ease, transform 120ms ease;
}

.action-sheet.story-comments-sheet .story-comment-gif-toggle.active {
  color: #fff;
  background: #262626;
}

.action-sheet.story-comments-sheet .story-comment-gif-toggle:active {
  transform: scale(.9);
}

.story-comments-sheet .story-comment-gif-toggle .ui-icon {
  width: 18px;
  height: 18px;
}

.action-sheet.story-comments-sheet .story-comment-post {
  width: auto;
  min-width: 48px;
  height: 44px;
  min-height: 44px;
  display: grid;
  place-items: center;
  padding: 0 9px;
  border: 0;
  border-radius: 999px;
  color: var(--social-link);
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  transition: opacity 140ms ease, transform 120ms ease, color 140ms ease;
}

.action-sheet.story-comments-sheet .story-comment-post:active:not(:disabled) {
  transform: scale(.92);
  color: var(--social-link-hover);
}

.action-sheet.story-comments-sheet .story-comment-post:disabled {
  color: #406580;
  opacity: .65;
}

.story-comments-sheet .story-comment-post.posting {
  color: transparent;
}

.story-comments-sheet .story-comment-post.posting::after {
  content: "";
  width: 13px;
  height: 13px;
  border: 2px solid rgba(40, 95, 136, .35);
  border-top-color: var(--social-action);
  border-radius: 50%;
  animation: instagramCommentSpin .65s linear infinite;
}

.post-comments-sheet .post-comment-row + .post-comment-row {
  margin-top: 18px;
}

.post-comments-sheet .story-comment-replies .post-comment-row + .post-comment-row {
  margin-top: 0;
}

.post-comments-sheet .post-comment-row.is-pinned {
  padding-top: 2px;
}

.post-comments-sheet .story-comment-meta {
  flex-wrap: wrap;
  gap: 7px 11px;
}

.post-comments-sheet .post-comment-pinned,
.post-comments-sheet .post-comment-creator-like {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #a8a8a8;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}

.post-comments-sheet .post-comment-pinned .ui-icon {
  width: 11px;
  height: 11px;
}

.post-comments-sheet .post-comment-creator-like {
  width: max-content;
  margin-top: 6px;
}

.post-comments-sheet .post-comment-creator-like .ui-icon {
  width: 12px;
  height: 12px;
  color: #ff3040;
}

.post-comments-sheet .post-comment-creator-like svg {
  fill: currentColor;
  stroke: currentColor;
}

.post-comments-sheet .post-comment-delete {
  color: #ed4956;
}

.post-comments-sheet [data-action="toggle-post-comment-pin"].is-pending,
.post-comments-sheet [data-action="delete-post-comment"].is-pending {
  opacity: .45;
  pointer-events: none;
}

.post-comments-sheet .story-comment-quick-reactions {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.post-comments-sheet .story-comment-field {
  grid-template-columns: minmax(0, 1fr) auto;
}

.profile-media-section.is-loading .profile-post-grid,
.profile-media-section.is-loading .profile-media-empty {
  opacity: 0.55;
  pointer-events: none;
}

.story-comments-sheet .story-replies-off.comments-disabled {
  min-height: 72px;
  display: grid;
  place-items: center;
  padding: 16px;
  border-top: 1px solid #262626;
  color: #a8a8a8;
  background: #000;
  font-size: 12px;
}

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

@keyframes instagramCommentsSheetIn {
  0% { transform: translate3d(0, 100%, 0); }
  72% { transform: translate3d(0, -8px, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

@keyframes instagramCommentsSheetOut {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(0, 100%, 0); }
}

@keyframes instagramCommentsBackdropIn {
  from { background: rgba(0, 0, 0, 0); }
  to { background: rgba(0, 0, 0, .52); }
}

@keyframes instagramCommentsBackdropOut {
  from { background: rgba(0, 0, 0, .52); }
  to { background: rgba(0, 0, 0, 0); }
}

@keyframes instagramCommentIn {
  from { opacity: 0; transform: translate3d(0, 5px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes instagramCommentPosted {
  0% { opacity: 0; transform: translate3d(0, 18px, 0) scale(.97); }
  58% { opacity: 1; transform: translate3d(0, -2px, 0) scale(1.01); }
  100% { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

@keyframes instagramRepliesOpen {
  from { opacity: 0; transform: translate3d(0, -7px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

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

@keyframes instagramHeartPop {
  0% { transform: scale(1); }
  32% { transform: scale(.62); }
  66% { transform: scale(1.55); }
  100% { transform: scale(1); }
}

@keyframes instagramHeartBurst {
  0% { opacity: 0; transform: scale(.35); }
  35% { opacity: 1; }
  100% { opacity: 0; transform: scale(1.3); }
}

@keyframes instagramReactionPop {
  0% { transform: scale(1); }
  45% { transform: scale(1.28) rotate(-5deg); }
  100% { transform: scale(1); }
}

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

@media (max-width: 560px) {
  .action-sheet.compact-sheet.story-comments-sheet {
    width: 100%;
    height: min(78vh, calc(var(--visual-height) - 12px));
    min-height: min(540px, calc(var(--visual-height) - 12px));
    border-radius: 22px 22px 0 0;
  }

  .story-comments-sheet .story-comment-list {
    padding-right: 12px;
    padding-left: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .overlay:has(.story-comments-sheet),
  .overlay.closing:has(.story-comments-sheet),
  .action-sheet.compact-sheet.story-comments-sheet,
  .action-sheet.compact-sheet.story-comments-sheet.closing,
  .story-comments-sheet .story-comment-row,
  .story-comments-sheet .story-comment-row.just-posted,
  .story-comments-sheet .story-comment-replies.expanded,
  .story-comments-sheet .story-comment-like.heart-pop .ui-icon,
  .story-comments-sheet .story-comment-like.heart-pop.active::before,
  .story-comments-sheet .story-comment-like.heart-pop.active::after,
  .story-comments-sheet .story-comment-quick-reactions button.reaction-pop,
  .story-comments-sheet .story-comment-gif-picker,
  .highlight-comment-preview-card,
  [data-action="like-story"].story-heart-pop .ui-icon,
  [data-action="like-story"].story-heart-pop.active::before,
  [data-action="like-story"].story-heart-pop.active::after {
    animation-duration: .01ms !important;
    animation-delay: 0ms !important;
    transition-duration: .01ms !important;
  }
}

/* Safari focus-zooms text controls below 16px, which turns the fixed app
   viewport into a pannable visual viewport. Keep mobile text controls at the
   no-zoom threshold without changing desktop sizing. */
@supports (-webkit-touch-callout: none) {
  @media (max-width: 860px) {
    html input:not([type="range"]):not([type="checkbox"]):not([type="radio"]),
    html textarea,
    html select,
    .composer-input {
      font-size: 16px;
    }
  }
}

/* --------------------------------------------------------------------------
   Social home, publishing, notes, explore, profile, and account surfaces
   -------------------------------------------------------------------------- */

:root {
  --social-violet: #7768ff;
  --social-violet-soft: rgba(119, 104, 255, 0.16);
  --social-teal: var(--accent-2);
  --social-icon-blue: var(--social-action);
  --social-icon-blue-soft: var(--social-action-soft);
  --social-surface: #0a0f18;
  --social-surface-raised: #101824;
  --social-hairline: rgba(244, 247, 251, 0.09);
}

#app,
.app-shell,
.sidebar,
.side-content,
.home-page,
.home-feed,
.feed-post,
.search-page,
.search-explore-section,
.explore-grid,
.profile-identity-layout,
.profile-identity-copy,
.profile-media-section,
.profile-post-grid,
.post-composer-page,
.post-editor-body,
.post-details-layout,
.post-details-fields,
.note-rail,
.settings-drawer,
.settings-menu-grid,
.settings-activity-list {
  min-width: 0;
  max-width: 100%;
}

#app,
.app-shell,
.side-content,
.home-page,
.search-page,
.profile-media-section,
.post-composer-overlay,
.note-composer-overlay,
.settings-drawer-overlay {
  overflow-x: hidden;
}

.home-story-avatar img,
.note-avatar img,
.note-preview-avatar img,
.post-media-frame img,
.post-media-frame video,
.post-composer-media img,
.post-composer-media video,
.post-filter-rail img,
.activity-thumb img,
.activity-thumb video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Six plain navigation icons, with Create placed at the far right. */
.bottom-tabs {
  height: calc(64px + env(safe-area-inset-bottom));
  min-height: calc(64px + env(safe-area-inset-bottom));
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 2px;
  padding: 6px 8px max(6px, env(safe-area-inset-bottom));
  border-top-color: var(--social-hairline);
  background: rgba(5, 7, 11, 0.97);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.bottom-tab {
  min-width: 44px;
  min-height: 44px;
  justify-self: stretch;
  border-radius: 8px;
}

.bottom-tab-create {
  order: 0;
  width: auto;
  height: auto;
  min-width: 44px;
  min-height: 44px;
  align-self: center;
  justify-self: stretch;
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  box-shadow: none;
  transition: color 150ms ease, transform 150ms ease, background 150ms ease;
}

.bottom-tab-create:is(:hover, :focus-visible) {
  color: var(--text);
  background: rgba(255, 255, 255, .06);
  filter: none;
  box-shadow: none;
}

.bottom-tab-create:active {
  transform: scale(0.94);
}

.bottom-tab-create .ui-icon {
  width: 23px;
  height: 23px;
}

.bottom-tab-create svg {
  stroke-width: 2.35;
}

.bottom-tab[data-tab="home"].active svg {
  fill: currentColor;
  stroke-width: 2.2;
}

/* Home shell, feed switcher, story rail, and post cards. */
.side-content[data-tab="home"] {
  padding: 0;
  scrollbar-gutter: stable;
}

.home-page {
  width: 100%;
  min-height: 100%;
  background:
    radial-gradient(circle at 14% -12%, rgba(119, 104, 255, 0.1), transparent 28%),
    var(--bg);
}

.home-topbar {
  position: sticky;
  top: 0;
  z-index: 24;
  min-height: calc(58px + env(safe-area-inset-top));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: env(safe-area-inset-top) 14px 0;
  border-bottom: 1px solid var(--social-hairline);
  background: rgba(5, 7, 11, 0.9);
  backdrop-filter: blur(22px) saturate(1.2);
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
}

.feed-picker-wrap {
  position: relative;
  min-width: 0;
}

.feed-picker {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 8px;
  border-radius: 7px;
  color: var(--text);
  background: transparent;
  font-size: 19px;
  font-weight: 780;
  letter-spacing: -0.025em;
}

.feed-picker .ui-icon {
  width: 16px;
  height: 16px;
  color: var(--social-icon-blue);
  transition: transform 150ms ease;
}

.feed-picker[aria-expanded="true"] .ui-icon {
  transform: rotate(180deg);
}

.feed-picker-menu {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  z-index: 30;
  width: 190px;
  overflow: hidden;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(15, 22, 33, 0.98);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.46);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.feed-picker-menu button {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 12px;
  border-radius: 6px;
  color: var(--soft);
  background: transparent;
  text-align: left;
}

.feed-picker-menu button:is(:hover, :focus-visible),
.feed-picker-menu button.active {
  color: #fff;
  background: var(--social-violet-soft);
}

.feed-picker-menu .ui-icon {
  width: 17px;
  height: 17px;
  color: var(--social-icon-blue);
}

.home-head-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 3px;
}

.home-head-actions .icon-btn {
  width: 44px;
  height: 44px;
  min-height: 44px;
}

.home-story-rail {
  width: 100%;
  display: flex;
  align-items: start;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 15px 14px 13px;
  border-bottom: 1px solid var(--social-hairline);
  overscroll-behavior-inline: contain;
  scroll-snap-type: inline proximity;
  scrollbar-width: none;
}

.home-story-rail::-webkit-scrollbar,
.note-rail::-webkit-scrollbar,
.post-filter-rail::-webkit-scrollbar,
.post-adjust-tabs::-webkit-scrollbar,
.post-aspect-row::-webkit-scrollbar,
.profile-media-tabs::-webkit-scrollbar {
  display: none;
}

.home-story {
  flex: 0 0 72px;
  min-width: 72px;
  min-height: 94px;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 7px;
  padding: 0;
  color: var(--soft);
  background: transparent;
  scroll-snap-align: start;
}

.home-story-avatar {
  position: relative;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  overflow: visible;
  border: 2px solid var(--panel-3);
  border-radius: 50%;
  color: #071016;
  background: linear-gradient(140deg, #d9d8ff, var(--social-teal));
  font-size: 13px;
  font-weight: 850;
}

.home-story-avatar.has-story {
  padding: 3px;
  border: 2px solid transparent;
  background:
    linear-gradient(var(--bg), var(--bg)) padding-box,
    linear-gradient(145deg, var(--social-violet), #c45aa2 48%, var(--social-teal)) border-box;
  box-shadow: 0 0 18px rgba(119, 104, 255, 0.16);
}

.home-story-avatar img {
  border: 2px solid var(--bg);
  border-radius: inherit;
}

.home-story-avatar i {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 2px solid var(--bg);
  border-radius: 50%;
  color: #f7f9fc;
  background: var(--social-icon-blue);
  font-size: 16px;
  font-style: normal;
  font-weight: 900;
}

.home-story small {
  width: 100%;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-feed {
  width: 100%;
  display: grid;
  align-content: start;
}

.home-page > .notification-permission {
  margin: 10px 14px;
}

.feed-post {
  width: 100%;
  overflow: hidden;
  border-bottom: 1px solid var(--social-hairline);
  background: rgba(8, 12, 19, 0.78);
}

.post-head {
  min-width: 0;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
}

.post-head > a {
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}

.post-head .avatar {
  width: 42px;
  height: 42px;
}

.post-head > a > span:last-child,
.post-head strong,
.post-head small {
  min-width: 0;
  display: block;
}

.post-head strong,
.post-head small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-head strong {
  font-size: 13px;
}

.post-head small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.post-head > button {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  color: var(--soft);
  background: transparent;
}

.post-media-frame,
.post-composer-media {
  position: relative;
  width: 100%;
  overflow: hidden;
  isolation: isolate;
  background: #020407;
}

.post-media-frame {
  aspect-ratio: 1 / 1;
}

.post-media-frame img,
.post-media-frame video,
.post-composer-media img,
.post-composer-media video {
  max-width: none;
  transform-origin: center;
}

.post-media-missing {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: linear-gradient(135deg, #0b111a, #111827);
}

.post-person-tag,
.post-tag-draft {
  position: absolute;
  z-index: 3;
  min-height: 40px;
  max-width: min(190px, 68%);
  padding: 0 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: #fff;
  background: rgba(5, 8, 13, 0.8);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
  font-size: 11px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
  transform: translate(-50%, -50%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.post-video-mark {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 0, 0, 0.52);
}

.post-video-mark .ui-icon {
  width: 15px;
  height: 15px;
}

.post-action-row {
  min-height: 53px;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px 8px 1px;
}

.post-action-row button {
  position: relative;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  color: var(--text);
  background: transparent;
  transition: color 140ms ease, transform 140ms ease, background-color 140ms ease;
}

.post-action-row button:is(:hover, :focus-visible) {
  background: rgba(255, 255, 255, 0.06);
}

.post-action-row button:active {
  transform: scale(0.88);
}

.post-action-row button.active {
  color: var(--social-icon-blue);
}

.post-action-row button:first-child.active {
  color: var(--danger);
}

.post-action-row button:first-child.active svg,
.post-action-row .post-save.active svg {
  fill: currentColor;
}

.post-action-row .post-save {
  margin-left: auto;
}

.post-action-row .post-save.active {
  color: var(--social-violet);
}

.post-copy {
  min-width: 0;
  padding: 0 13px 13px;
}

.post-copy > strong,
.post-copy > h3,
.post-copy > p,
.post-copy > small,
.post-comments p {
  overflow-wrap: anywhere;
}

.post-copy > strong {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
}

.post-copy h3 {
  margin: 5px 0 2px;
  font-size: 14px;
  line-height: 1.35;
}

.post-copy p {
  margin: 3px 0;
  color: var(--soft);
  font-size: 13px;
  line-height: 1.48;
}

.post-copy p button,
.post-comments button {
  min-height: 32px;
  padding: 0 3px;
  color: var(--muted);
  background: transparent;
  font-size: inherit;
}

.post-copy > small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
}

.post-copy .post-hashtags {
  color: var(--social-link-hover);
}

.post-comments {
  display: grid;
  gap: 5px;
  margin-top: 7px;
}

.post-comment-preview {
  width: 100%;
  min-height: 44px !important;
  display: block;
  padding: 0 !important;
  border: 0;
  color: var(--text) !important;
  background: transparent;
  text-align: left;
}

.post-comment-preview .highlight-comment-preview-card {
  width: 100%;
  min-height: 44px;
  border-radius: 8px;
  background: rgba(17, 23, 32, 0.92);
  box-shadow: none;
  animation: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition: background-color 140ms ease, transform 140ms ease;
}

.post-comment-preview:is(:hover, :focus-visible) .highlight-comment-preview-card {
  background: #171f2a;
}

.post-comment-preview:active .highlight-comment-preview-card {
  transform: scale(0.985);
}

.post-counts {
  display: flex !important;
  align-items: center;
  gap: 5px;
}

.post-counts button {
  min-height: 28px;
  padding: 0;
  color: inherit;
  background: transparent;
  font: inherit;
}

.post-comments-more {
  justify-self: start;
  min-height: 28px !important;
  padding: 0 !important;
}

.post-action-row button.is-pending {
  opacity: 0.5;
  pointer-events: none;
}

.post-action-row button.post-action-pop .ui-icon {
  animation: postActionPop 300ms cubic-bezier(.18, .89, .32, 1.28);
}

@keyframes postActionPop {
  0% { transform: scale(.82); }
  55% { transform: scale(1.22); }
  100% { transform: scale(1); }
}

.post-comment-form {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  margin-top: 9px;
  border-top: 1px solid var(--social-hairline);
}

.post-comment-form input {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
}

.post-comment-form button {
  min-width: 52px;
  min-height: 44px;
  padding: 0 4px;
  color: var(--social-teal);
  background: transparent;
  font-size: 12px;
  font-weight: 800;
}

.feed-loading {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.feed-loading i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--social-teal);
  animation: socialFeedPulse 900ms ease-in-out infinite alternate;
}

.feed-loading i:nth-child(2) {
  animation-delay: 140ms;
}

.feed-loading i:nth-child(3) {
  animation-delay: 280ms;
}

.feed-empty {
  min-height: 330px;
  align-content: center;
  gap: 8px;
}

.feed-empty .ui-icon {
  width: 36px;
  height: 36px;
  color: var(--social-violet);
}

.feed-empty strong,
.feed-empty small {
  display: block;
}

.feed-empty .primary {
  min-height: 44px;
  margin-top: 7px;
}

@keyframes socialFeedPulse {
  from { opacity: 0.32; transform: translateY(2px) scale(0.88); }
  to { opacity: 1; transform: translateY(-2px) scale(1); }
}

/* Three-column discovery and reusable square media grids. */
.search-explore-section {
  width: calc(100% + 28px);
  max-width: none;
  display: grid;
  gap: 6px;
  margin: 0 -14px 18px;
}

.search-explore-section > .section-heading {
  margin: 0;
  padding: 0 16px 5px;
}

.explore-grid,
.profile-post-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px;
}

.explore-grid > button,
.profile-post-grid > button {
  position: relative;
  width: 100%;
  min-width: 0;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  padding: 0;
  color: #fff;
  background: #0a1018;
}

.explore-grid .post-media-frame,
.profile-post-grid .post-media-frame,
.activity-thumb .post-media-frame {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
}

.explore-grid > button > span {
  position: absolute;
  inset: auto 0 0;
  z-index: 3;
  min-height: 34px;
  display: flex;
  align-items: end;
  justify-content: flex-end;
  padding: 5px 7px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.68));
  pointer-events: none;
}

.explore-grid > button > span b {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
}

.explore-grid > button > span .ui-icon {
  width: 12px;
  height: 12px;
  fill: currentColor;
}

.explore-loading > i {
  aspect-ratio: 1 / 1;
  background: linear-gradient(110deg, #0e1520 20%, #182332 45%, #0e1520 70%);
  background-size: 220% 100%;
  animation: socialGridShimmer 1.25s linear infinite;
}

@keyframes socialGridShimmer {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

/* Profile identity, note bubble, actions, four media tabs, and privacy state. */
.profile-hero,
.search-profile-hero {
  display: block;
  padding: 16px 4px 10px;
}

.profile-hero:has(.profile-note-bubble) {
  padding-top: 50px;
}

.profile-identity-layout {
  width: 100%;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
}

.profile-avatar-column {
  min-width: 0;
}

.profile-identity-copy {
  display: grid;
  align-content: center;
  gap: 2px;
}

.profile-identity-copy h1 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-size: clamp(19px, 4.8vw, 25px);
  line-height: 1.12;
  letter-spacing: -0.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-identity-copy > small {
  min-width: 0;
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-identity-copy .profile-stat-grid {
  margin-top: 9px;
}

.profile-stat-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}

.profile-stat {
  min-height: 44px;
  padding: 4px 2px;
  border-radius: 9px;
}

button.profile-stat:is(:hover, :focus-visible) {
  background: rgba(255, 255, 255, 0.05);
}

.profile-stat strong {
  font-size: 14px !important;
}

.profile-stat span {
  font-size: 10px;
}

.private-social-note {
  grid-column: 2 / -1;
  align-self: center;
}

.profile-avatar-wrap {
  width: 84px;
  height: 84px;
  flex-basis: 84px;
}

.profile-avatar-wrap .profile-avatar-btn {
  width: 84px;
  height: 84px;
}

.profile-link-icon {
  width: 44px;
  height: 44px;
  min-height: 44px;
  margin-top: 2px;
  background: rgba(255, 255, 255, 0.055);
}

.profile-avatar-add,
.profile-avatar-wrap .profile-story-view {
  width: 28px;
  height: 28px;
  min-height: 28px;
}

.profile-note-bubble {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  z-index: 6;
  width: max-content;
  max-width: min(190px, 62vw);
  min-height: 40px;
  padding: 8px 11px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 15px 15px 15px 5px;
  overflow: hidden;
  color: var(--text);
  background: linear-gradient(145deg, rgba(119, 104, 255, 0.23), rgba(14, 28, 35, 0.96));
  box-shadow: 0 9px 24px rgba(0, 0, 0, 0.34);
  font-size: 11px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
  transform: translateX(-34%);
}

.profile-note-bubble::after {
  content: "";
  position: absolute;
  left: 18px;
  bottom: -6px;
  width: 11px;
  height: 11px;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: #17202a;
  transform: rotate(45deg);
}

.profile-details {
  margin-top: 13px;
}

.profile-details > a {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin-top: 5px;
  overflow: hidden;
  color: var(--social-teal);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-optional-meta,
.search-profile-copy > small {
  display: inline-block;
  margin-top: 5px;
  margin-right: 8px;
  color: var(--muted);
  font-size: 11px;
}

.profile-owner-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.profile-owner-actions button {
  min-width: 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  color: var(--text);
  background: var(--panel-2);
  font-size: 12px;
  font-weight: 750;
}

.profile-owner-actions .ui-icon {
  width: 17px;
  height: 17px;
  color: var(--social-icon-blue);
}

.highlight-strip {
  padding-inline: 4px;
}

.profile-media-section {
  width: calc(100% + 28px);
  max-width: none;
  min-height: calc(var(--visual-height) - 64px);
  margin: 16px -14px 0;
  border-top: 1px solid var(--social-hairline);
}

.searched-profile-scroll .profile-media-section {
  width: 100%;
  max-width: 100%;
  margin-right: 0;
  margin-left: 0;
}

.profile-media-tabs {
  width: 100%;
  min-height: 52px;
  display: grid;
  grid-template-columns: repeat(4, minmax(54px, 1fr));
  overflow-x: auto;
  border-bottom: 1px solid var(--social-hairline);
  scrollbar-width: none;
}

.profile-media-tabs button {
  position: relative;
  min-width: 54px;
  min-height: 52px;
  display: grid;
  place-items: center;
  padding: 0;
  color: #687586;
  background: transparent;
}

.profile-media-tabs button::after {
  content: "";
  position: absolute;
  right: 22%;
  bottom: -1px;
  left: 22%;
  height: 2px;
  border-radius: 999px 999px 0 0;
  background: transparent;
}

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

.profile-media-tabs button.active::after {
  background: linear-gradient(90deg, var(--social-violet), var(--social-teal));
}

.profile-media-tabs .ui-icon {
  width: 21px;
  height: 21px;
}

.profile-media-empty,
.profile-private-media {
  min-height: 230px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  padding: 28px 18px;
  color: var(--muted);
  text-align: center;
}

.profile-media-empty .ui-icon,
.profile-private-media .ui-icon {
  width: 34px;
  height: 34px;
  margin-bottom: 4px;
  color: var(--social-violet);
}

.profile-media-empty strong,
.profile-private-media strong {
  color: var(--text);
}

.profile-media-empty small,
.profile-private-media small {
  max-width: 320px;
}

.search-profile-page {
  min-width: 0;
}

.search-profile-copy {
  margin-top: 13px;
}

.search-profile-actions {
  gap: 8px;
  padding: 0 4px;
}

.search-profile-actions .mini-btn {
  min-height: 44px;
  border-radius: 7px;
}

/* Full visual-viewport, three-stage publishing flow. */
.post-composer-overlay {
  position: fixed;
  inset: auto 0 auto;
  top: var(--visual-top);
  z-index: 160;
  width: 100%;
  height: var(--visual-height);
  display: grid;
  overflow: hidden;
  overscroll-behavior: none;
  color: var(--text);
  background: rgba(2, 4, 8, 0.98);
}

.post-composer-page {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
  background:
    radial-gradient(circle at 88% -18%, rgba(47, 139, 131, 0.08), transparent 30%),
    radial-gradient(circle at 8% 12%, rgba(119, 104, 255, 0.1), transparent 32%),
    #060910;
}

.post-composer-head {
  z-index: 4;
  min-height: calc(58px + env(safe-area-inset-top));
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 64px;
  align-items: center;
  gap: 6px;
  padding: env(safe-area-inset-top) max(8px, env(safe-area-inset-right)) 0 max(8px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--social-hairline);
  background: rgba(7, 10, 16, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.post-composer-head > button {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  border-radius: 7px;
  color: var(--text);
  background: transparent;
}

.post-composer-head > button:first-child {
  width: 44px;
  padding: 0;
}

.post-composer-head > span {
  min-width: 0;
  display: grid;
  justify-items: center;
  line-height: 1.15;
}

.post-composer-head strong,
.post-composer-head small {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-composer-head strong {
  font-size: 16px;
}

.post-composer-head small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.post-composer-head .post-next {
  justify-self: end;
  color: var(--social-teal);
  font-size: 13px;
  font-weight: 820;
}

.post-stage-meta {
  background: #080c13;
}

.post-stage-dots {
  min-height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  background: #080c13;
}

.post-stage-dots i {
  width: 18px;
  height: 3px;
  border-radius: 999px;
  background: #263141;
  transition: background-color 160ms ease, transform 160ms ease;
}

.post-stage-dots i.active {
  background: linear-gradient(90deg, var(--social-violet), var(--social-teal));
  transform: scaleX(1.06);
}

.post-media-warning {
  width: min(calc(100% - 24px), 720px);
  margin: 8px auto 10px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 177, 79, 0.42);
  border-radius: 12px;
  color: #ffd7a3;
  font-size: 12px;
  line-height: 1.4;
  background: rgba(112, 62, 8, 0.24);
}

.post-editor-body,
.post-details-layout {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
}

.post-editor-body {
  width: min(100%, 980px);
  margin: 0 auto;
  padding: 18px 18px max(24px, env(safe-area-inset-bottom));
}

.post-editor-body:has(.post-crop-controls) {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(260px, 330px);
  align-items: start;
  gap: 24px;
}

.post-editor-body:has(.post-filter-rail) {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 16px;
}

.post-composer-media {
  width: min(100%, 580px);
  aspect-ratio: 1 / 1;
  margin-inline: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  box-shadow: 0 22px 52px rgba(0, 0, 0, 0.34);
  touch-action: manipulation;
}

.post-composer-media.taggable {
  cursor: crosshair;
}

.post-tag-target {
  position: absolute;
  z-index: 4;
  width: 28px;
  height: 28px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: rgba(119, 104, 255, 0.3);
  box-shadow: 0 0 0 6px rgba(119, 104, 255, 0.14);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.post-crop-controls {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 15px;
  padding: 18px;
  border: 1px solid var(--social-hairline);
  border-radius: 18px;
  background: rgba(16, 24, 36, 0.8);
}

.post-crop-controls > label,
.post-adjust-slider {
  min-width: 0;
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 44px;
  color: var(--soft);
  font-size: 11px;
  font-weight: 700;
  text-transform: capitalize;
}

.post-crop-controls input[type="range"],
.post-adjust-slider input[type="range"] {
  width: 100%;
  min-width: 0;
  height: 28px;
  accent-color: var(--social-teal);
  cursor: pointer;
}

.post-aspect-row,
.post-adjust-tabs {
  width: 100%;
  display: flex;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
}

.post-aspect-row button,
.post-adjust-tabs button {
  flex: 1 0 auto;
  min-width: 72px;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  color: var(--muted);
  background: #111927;
  font-size: 11px;
  text-transform: capitalize;
}

.post-aspect-row button.active,
.post-adjust-tabs button.active {
  border-color: rgba(47, 139, 131, 0.46);
  color: #fff;
  background: linear-gradient(145deg, rgba(119, 104, 255, 0.16), rgba(47, 139, 131, 0.12));
}

.post-crop-controls > .secondary {
  min-height: 44px;
  margin-top: 2px;
}

.post-filter-rail {
  width: min(100%, 760px);
  display: flex;
  gap: 11px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  overscroll-behavior-inline: contain;
  scroll-snap-type: inline proximity;
  scrollbar-width: none;
}

.post-filter-rail button {
  flex: 0 0 88px;
  min-width: 88px;
  min-height: 116px;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 7px;
  padding: 5px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  scroll-snap-align: start;
}

.post-filter-rail button.active {
  border-color: rgba(119, 104, 255, 0.48);
  color: var(--text);
  background: var(--social-violet-soft);
}

.post-filter-rail button > span {
  position: relative;
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 12px;
  background: #080b10;
}

.post-video-filter-poster[hidden],
.post-video-filter-placeholder[hidden] {
  display: none;
}

.post-video-filter-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.82);
  background: radial-gradient(circle at 50% 42%, rgba(119, 104, 255, 0.34), rgba(5, 8, 13, 0.96));
}

.post-video-filter-placeholder .ui-icon {
  width: 24px;
  height: 24px;
}

.post-filter-rail small {
  font-size: 10px;
}

.post-adjust-tabs {
  width: min(100%, 560px);
}

.post-adjust-slider {
  width: min(100%, 560px);
  grid-template-columns: 82px minmax(0, 1fr) 40px;
  padding: 10px 13px;
  border: 1px solid var(--social-hairline);
  border-radius: 13px;
  background: rgba(16, 24, 36, 0.72);
}

.post-adjust-slider output {
  color: var(--social-teal);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.post-details-layout {
  width: min(100%, 980px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 0.9fr);
  align-items: start;
  gap: 24px;
  padding: 18px 18px max(28px, env(safe-area-inset-bottom));
}

.post-details-layout > div {
  min-width: 0;
}

.post-tag-help {
  display: block;
  margin: 9px 4px 0;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.post-tag-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 12px;
}

.post-tag-picker input,
.post-details-fields input,
.post-details-fields textarea,
.note-text-field textarea,
.note-audio-editor input,
.settings-account-form input {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 11px;
  outline: 0;
  color: var(--text);
  background: #101010;
}

.post-tag-picker input,
.post-details-fields input,
.note-audio-editor input,
.settings-account-form input {
  height: 44px;
  padding: 0 12px;
}

.post-tag-picker button {
  min-height: 44px;
  padding: 0 15px;
  border-radius: 7px;
  color: #f7f9fc;
  background: var(--social-icon-blue);
  font-size: 12px;
  font-weight: 800;
}

.post-details-fields {
  display: grid;
  gap: 13px;
  padding: 18px;
  border: 1px solid var(--social-hairline);
  border-radius: 18px;
  background: rgba(16, 24, 36, 0.76);
}

.post-details-fields > label:not(.switch-row),
.note-audio-editor > label {
  min-width: 0;
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.post-details-fields textarea {
  min-height: 132px;
  padding: 11px 12px;
  resize: vertical;
}

.post-details-fields .switch-row.compact {
  min-height: 58px;
  padding: 4px 0 0;
}

/* Notes rail and compact audio-note composer. */
.note-rail {
  width: calc(100% + 28px);
  max-width: none;
  display: flex;
  align-items: end;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  margin: -2px -14px 13px;
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--social-hairline);
  overscroll-behavior-inline: contain;
  scroll-snap-type: inline proximity;
  scrollbar-width: none;
}

.note-item,
.note-main {
  min-width: 0;
}

.note-item {
  position: relative;
  flex: 0 0 92px;
  width: 92px;
  display: grid;
  justify-items: center;
  align-content: end;
  margin: 0;
  scroll-snap-align: start;
}

button.note-item,
.note-main {
  min-height: 132px;
  padding: 0;
  color: var(--text);
  background: transparent;
}

.note-main {
  width: 100%;
  display: grid;
  justify-items: center;
  align-content: end;
}

.note-bubble {
  position: relative;
  z-index: 2;
  width: 92px;
  min-height: 45px;
  max-height: 68px;
  display: block;
  overflow: hidden;
  padding: 7px 8px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 14px 14px 14px 5px;
  color: var(--soft);
  background: linear-gradient(150deg, rgba(119, 104, 255, 0.17), rgba(15, 24, 34, 0.96));
  box-shadow: 0 7px 20px rgba(0, 0, 0, 0.24);
  font-size: 9px;
  line-height: 1.28;
  text-align: left;
  overflow-wrap: anywhere;
}

.note-bubble::after {
  content: "";
  position: absolute;
  left: 13px;
  bottom: -5px;
  width: 9px;
  height: 9px;
  background: #161f2a;
  transform: rotate(45deg);
}

.note-bubble b,
.note-bubble em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note-bubble b {
  color: var(--social-teal);
  font-size: 10px;
}

.note-bubble em {
  margin: 1px 0 3px;
  color: #798696;
  font-size: 8px;
  font-style: normal;
}

.note-avatar {
  position: relative;
  z-index: 1;
  width: 55px;
  height: 55px;
  display: grid;
  place-items: center;
  overflow: visible;
  margin-top: -1px;
  border: 2px solid #202c3a;
  border-radius: 50%;
  color: #081016;
  background: linear-gradient(145deg, #d8d4ff, var(--social-teal));
  font-size: 11px;
  font-weight: 850;
}

.note-avatar img {
  border-radius: inherit;
}

.note-avatar i {
  position: absolute;
  right: -4px;
  bottom: -2px;
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  border: 2px solid var(--bg);
  border-radius: 50%;
  color: #f7f9fc;
  background: var(--social-icon-blue);
  font-size: 14px;
  font-style: normal;
}

.note-item > small,
.note-main > small {
  width: 100%;
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note-composer-overlay {
  inset: auto 0 auto;
  top: var(--visual-top);
  z-index: 155;
  width: 100%;
  height: var(--visual-height);
  overflow: hidden;
  overscroll-behavior: none;
}

.note-composer {
  width: min(460px, 100%);
  max-height: calc(var(--visual-height) - 36px);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 16px;
  border-radius: 20px;
  background: linear-gradient(155deg, #101725, #080c13 72%);
  overscroll-behavior: contain;
}

.note-composer .modal-head .icon-btn {
  width: 44px;
  height: 44px;
  min-height: 44px;
}

.note-composer-preview {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 17px 12px 13px;
}

.note-composer-preview > span {
  position: relative;
  max-width: 230px;
  min-height: 48px;
  padding: 10px 13px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px 16px 16px 6px;
  color: var(--soft);
  background: var(--social-violet-soft);
  overflow-wrap: anywhere;
}

.note-preview-avatar {
  width: 64px;
  height: 64px;
}

.note-text-field {
  position: relative;
  display: block;
}

.note-text-field textarea {
  min-height: 92px;
  padding: 12px 12px 28px;
  resize: vertical;
}

.note-text-field output {
  position: absolute;
  right: 11px;
  bottom: 8px;
  color: var(--muted);
  font-size: 10px;
}

.note-audio-editor {
  display: grid;
  gap: 11px;
  margin-top: 13px;
  padding: 14px;
  border: 1px solid var(--social-hairline);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.025);
}

.note-audio-editor > div:first-child strong,
.note-audio-editor > div:first-child small {
  display: block;
}

.note-audio-editor > div:first-child strong {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--social-teal);
}

.note-audio-editor > div:first-child small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.note-audio-editor audio {
  width: 100%;
  min-width: 0;
  height: 42px;
}

.note-audio-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.note-audio-actions button {
  min-width: 0;
  min-height: 44px;
}

.note-composer-footer {
  min-height: 54px;
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

.note-composer-footer button {
  min-height: 44px;
}

.note-share {
  min-width: 104px;
  background: linear-gradient(135deg, var(--social-violet), var(--social-teal));
}

/* Settings index, subpages, blocked accounts, and account activity. */
.settings-drawer-overlay {
  inset: auto 0 auto;
  top: var(--visual-top);
  width: 100%;
  height: var(--visual-height);
  overflow: hidden;
}

.settings-drawer {
  width: min(480px, 100%);
  height: 100%;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: calc(12px + env(safe-area-inset-top)) 14px max(20px, env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 100% 0, rgba(119, 104, 255, 0.1), transparent 26%),
    #080c13;
}

.settings-drawer-head {
  min-height: 58px;
}

.settings-drawer-head .icon-btn {
  width: 44px;
  height: 44px;
  min-height: 44px;
}

.settings-menu-grid {
  display: grid;
  gap: 7px;
  margin: 5px 0 8px;
}

.settings-menu-grid > button {
  width: 100%;
  min-width: 0;
  min-height: 64px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  text-align: left;
  transition: background-color 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.settings-menu-grid > button:is(:hover, :focus-visible) {
  border-color: rgba(40, 95, 136, 0.42);
  background: rgba(40, 95, 136, 0.12);
}

.settings-menu-grid > button:active {
  transform: scale(0.985);
}

.settings-menu-grid > button > .ui-icon:first-child {
  width: 38px;
  height: 38px;
  padding: 9px;
  border-radius: 7px;
  color: var(--social-icon-blue);
  background: var(--social-icon-blue-soft);
}

.settings-menu-grid > button > .ui-icon:last-child {
  width: 17px;
  height: 17px;
  color: #647185;
  transform: rotate(-90deg);
}

.settings-menu-grid span,
.settings-menu-grid strong,
.settings-menu-grid small {
  min-width: 0;
  display: block;
}

.settings-menu-grid strong,
.settings-menu-grid small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-menu-grid strong {
  font-size: 13px;
}

.settings-menu-grid small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.settings-subpage {
  margin-top: 5px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.026);
}

.settings-account-form {
  margin-top: 0;
}

.settings-account-form .primary,
.settings-account-form .secondary {
  min-height: 44px;
}

.profile-edit-field > span i {
  margin-left: 5px;
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
  font-weight: 650;
}

.profile-edit-field > span .verified-mark {
  color: var(--ok);
}

.profile-edit-split {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.profile-visibility-fields {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 2px 0 0;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.022);
}

.profile-visibility-fields legend {
  padding: 0 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.profile-visibility-fields label {
  min-width: 0;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 9px;
  border-radius: 9px;
  color: var(--soft);
  background: rgba(255, 255, 255, 0.035);
  font-size: 11px;
}

.profile-visibility-fields input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  accent-color: var(--social-teal);
}

.profile-edit-save {
  min-height: 44px;
  border-radius: 7px;
  background: linear-gradient(135deg, #514db8, var(--social-icon-blue));
}

.profile-empty-bio {
  color: var(--muted) !important;
  font-style: italic;
}

.settings-user-list {
  display: grid;
}

.settings-user-list .account-row {
  min-height: 66px;
}

.settings-user-list .mini-btn {
  min-height: 44px;
  border-radius: 7px;
}

.settings-activity-list {
  display: grid;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 13px;
}

.settings-activity-list > button {
  width: 100%;
  min-width: 0;
  min-height: 70px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  padding: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.02);
  text-align: left;
}

.settings-activity-list > button + button {
  border-top: 1px solid var(--social-hairline);
}

.settings-activity-list > button:is(:hover, :focus-visible) {
  background: rgba(255, 255, 255, 0.055);
}

.activity-thumb {
  width: 54px;
  height: 54px;
  overflow: hidden;
  border-radius: 10px;
  background: #101722;
}

.settings-activity-list > button > span:nth-child(2),
.settings-activity-list strong,
.settings-activity-list small {
  min-width: 0;
  display: block;
}

.settings-activity-list strong,
.settings-activity-list small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-activity-list strong {
  font-size: 12px;
}

.settings-activity-list small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.settings-activity-list > button > .ui-icon {
  width: 16px;
  height: 16px;
  color: #667284;
  transform: rotate(-90deg);
}

.settings-empty-state {
  min-height: 130px;
  display: grid;
  place-items: center;
  padding: 22px;
  color: var(--muted);
  text-align: center;
}

.highlight-target-body {
  min-width: 0;
}

.highlight-target-list {
  display: grid;
}

.highlight-archive-row {
  grid-template-columns: 46px minmax(0, 1fr) 44px 44px;
  padding-right: 7px;
}

.highlight-archive-row > span {
  min-width: 0;
}

.highlight-archive-row > span strong,
.highlight-archive-row > span small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.highlight-archive-row > button:not(.highlight-target-cover) {
  width: 44px;
  height: 44px;
  min-height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  color: var(--soft);
  background: transparent;
}

.highlight-archive-row > button:not(.highlight-target-cover):is(:hover, :focus-visible) {
  background: rgba(255, 255, 255, 0.07);
}

.highlight-archive-row > button.danger-text {
  color: var(--danger);
}

.highlight-archive-row > button .ui-icon {
  width: 18px;
  height: 18px;
}

.notification-suggestion-list {
  border-top: 0;
}

.notification-suggestions-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 2px 5px;
  border-top: 1px solid var(--social-hairline);
}

.notification-suggestions-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  text-transform: none;
}

.notification-suggestions-head small {
  color: var(--muted);
  font-size: 10px;
  text-align: right;
}

/* Optional signup labels share one compact line with their field name. */
.auth-card .field:has(> small) {
  grid-template-columns: minmax(0, 1fr) auto;
}

.auth-card .field:has(> small) > small {
  align-self: center;
  color: #687687;
  font-size: 10px;
}

.auth-card .field:has(> small) > input,
.auth-card .field:has(> small) > textarea {
  grid-column: 1 / -1;
}

/* Desktop home is a centered reading column; mobile keeps the route shell. */
@media (min-width: 861px) {
  .app-shell > .sidebar > .bottom-tabs {
    width: 360px;
  }

  .app-shell.home-root {
    grid-template-columns: 360px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    background:
      radial-gradient(circle at 50% -22%, rgba(119, 104, 255, 0.15), transparent 38%),
      #020305;
  }

  .app-shell.home-root > .sidebar {
    display: contents;
  }

  .app-shell.home-root > .sidebar > .side-content {
    grid-column: 2;
    grid-row: 1 / 3;
    width: min(680px, 100%);
    justify-self: center;
    border-right: 1px solid var(--social-hairline);
    border-left: 1px solid var(--social-hairline);
    background: var(--bg);
    box-shadow: 0 0 70px rgba(0, 0, 0, 0.36);
  }

  .app-shell.home-root > .sidebar > .bottom-tabs {
    grid-column: 1;
    grid-row: 2;
    width: 360px;
  }

  .app-shell.home-root > .chat-pane {
    display: none;
  }

  .app-shell.home-root .feed-post {
    width: calc(100% - 32px);
    margin: 14px 16px 0;
    border: 1px solid var(--social-hairline);
    border-radius: 18px;
    background: rgba(9, 14, 22, 0.92);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.18);
  }

  .app-shell.home-root .home-feed {
    padding-bottom: 22px;
  }

  .post-composer-head {
    padding-right: 20px;
    padding-left: 20px;
  }
}

@media (max-width: 860px) {
  .side-content[data-tab="home"] {
    padding: 0;
  }

  .post-editor-body,
  .post-details-layout {
    scrollbar-gutter: auto;
  }

  .post-editor-body:has(.post-crop-controls),
  .post-details-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .post-editor-body {
    padding: 12px 12px max(20px, env(safe-area-inset-bottom));
  }

  .post-details-layout {
    padding: 12px 12px max(24px, env(safe-area-inset-bottom));
  }

  .post-editor-body:has(.post-crop-controls) .post-composer-media {
    width: min(100%, calc(var(--visual-height) * 0.54));
  }

  .post-crop-controls,
  .post-details-fields {
    padding: 14px;
    border-radius: 15px;
  }

  .post-composer-media {
    border-radius: 14px;
  }

  .post-filter-rail {
    width: calc(100% + 24px);
    margin-inline: -12px;
    padding-inline: 12px;
  }

  .post-adjust-tabs,
  .post-adjust-slider {
    width: 100%;
  }

  .settings-drawer {
    border-left: 0;
  }

  .post-comment-form input,
  .post-tag-picker input,
  .post-details-fields input,
  .post-details-fields textarea,
  .note-text-field textarea,
  .note-audio-editor input,
  .settings-account-form input,
  .auth-card input,
  .auth-card textarea,
  .profile-edit-field input,
  .profile-edit-field textarea {
    font-size: 16px;
  }
}

@media (max-width: 560px) {
  .bottom-tabs {
    padding-right: max(5px, env(safe-area-inset-right));
    padding-left: max(5px, env(safe-area-inset-left));
  }

  .home-topbar {
    padding-right: max(8px, env(safe-area-inset-right));
    padding-left: max(8px, env(safe-area-inset-left));
  }

  .feed-picker {
    font-size: 18px;
  }

  .home-story-rail {
    gap: 9px;
    padding-right: 10px;
    padding-left: 10px;
  }

  .feed-post {
    background: var(--bg);
  }

  .profile-identity-layout {
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 11px;
  }

  .profile-avatar-wrap,
  .profile-avatar-wrap .profile-avatar-btn {
    width: 78px;
    height: 78px;
  }

  .profile-stat-grid {
    gap: 1px;
  }

  .profile-stat {
    padding-inline: 0;
  }

  .profile-stat strong {
    font-size: 13px !important;
  }

  .profile-stat span {
    font-size: 9px;
  }

  .profile-owner-actions button {
    padding: 0 7px;
    font-size: 11px;
  }

  .post-composer-head {
    grid-template-columns: 54px minmax(0, 1fr) 54px;
  }

  .post-crop-controls > label {
    grid-template-columns: 70px minmax(0, 1fr);
  }

  .post-adjust-slider {
    grid-template-columns: 70px minmax(0, 1fr) 34px;
  }

  .post-adjust-tabs button {
    min-width: 92px;
  }

  .post-tag-picker {
    grid-template-columns: minmax(0, 1fr);
  }

  .post-tag-picker button {
    width: 100%;
  }

  .note-composer-overlay {
    place-items: end center;
    padding: 0;
  }

  .note-composer {
    width: 100%;
    max-height: calc(var(--visual-height) - max(8px, env(safe-area-inset-top)));
    padding: 14px max(12px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 22px 22px 0 0;
  }

  .note-audio-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .profile-edit-split,
  .profile-visibility-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .highlight-archive-row {
    grid-template-columns: 44px minmax(0, 1fr) 42px 42px;
    gap: 6px;
    padding-inline: 9px 4px;
  }
}

@media (max-width: 360px) {
  .bottom-tabs {
    gap: 0;
  }

  .bottom-tab-create {
    width: auto;
    height: auto;
    min-width: 40px;
    min-height: 40px;
  }

  .profile-identity-layout {
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 8px;
  }

  .profile-avatar-wrap,
  .profile-avatar-wrap .profile-avatar-btn {
    width: 70px;
    height: 70px;
  }

  .profile-owner-actions {
    gap: 5px;
  }

  .profile-owner-actions button {
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .feed-loading i,
  .explore-loading > i,
  .bottom-tab-create,
  .feed-picker .ui-icon,
  .post-action-row button,
  .post-stage-dots i,
  .settings-menu-grid > button {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Final cascade guard: legacy shell rules must not flatten media aspect ratios
   or replace the Instagram-style desktop navigation rail. */
.post-media-frame {
  aspect-ratio: var(--post-aspect, 1);
}

.post-media-frame.post-media-grid {
  aspect-ratio: 1;
}

.post-composer-media {
  aspect-ratio: var(--post-aspect, 1);
  touch-action: manipulation;
}

.post-composer-media[data-post-crop-surface] {
  touch-action: none;
}

.post-crop-actions.single {
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 861px) {
  .app-shell:not(.social-root) > .sidebar > .bottom-tabs {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .app-shell.home-root.social-root {
    grid-template-columns: 245px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    background: #000;
  }

  .app-shell.home-root.social-root > .sidebar > .side-content {
    grid-column: 2;
    grid-row: 1;
    width: 100%;
    max-width: none;
    justify-self: stretch;
    border: 0;
    background: #000;
    box-shadow: none;
  }

  .app-shell.home-root.social-root > .sidebar > .bottom-tabs {
    grid-column: 1;
    grid-row: 1;
    width: 245px;
  }
}

@media (min-width: 861px) and (max-width: 1239px) {
  .app-shell.home-root.social-root {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .app-shell.home-root.social-root > .sidebar > .bottom-tabs {
    width: 76px;
  }
}

@media (min-width: 600px) and (max-width: 860px) {
  .app-shell.social-root .home-primary {
    width: min(100%, 630px);
    margin-inline: auto;
  }

  .app-shell.social-root .home-feed .feed-post {
    width: min(470px, calc(100% - 28px));
    margin: 14px auto 0;
    border: 0;
    border-bottom: 1px solid #262626;
  }

  .app-shell.social-root .home-story-rail {
    width: min(630px, 100%);
    margin-inline: auto;
  }
}

@media (max-width: 860px) {
  .post-editor-body:has(.post-crop-controls) {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: max-content max-content max-content;
    align-content: start;
  }

  .post-editor-body:has(.post-crop-controls) .post-composer-media {
    z-index: 1;
    grid-column: 1;
    grid-row: 1;
  }

  .post-editor-body:has(.post-crop-controls) .post-selection-rail {
    grid-column: 1;
    grid-row: 2;
  }

  .post-editor-body:has(.post-crop-controls) .post-crop-controls {
    position: relative;
    z-index: 2;
    grid-column: 1;
    grid-row: 3;
  }
}

@media (max-width: 1000px) and (max-height: 520px) and (orientation: landscape) {
  .clip-actions {
    right: max(6px, env(safe-area-inset-right));
    bottom: max(6px, env(safe-area-inset-bottom));
    gap: 1px;
  }

  .clip-actions button {
    width: 40px;
    min-height: 35px;
  }

  .clip-actions button .ui-icon {
    width: 22px;
    height: 22px;
  }

  .clip-actions small,
  .clip-actions .clip-audio-cover,
  .clip-audio-line {
    display: none;
  }

  .clip-copy {
    right: 58px;
    bottom: max(8px, env(safe-area-inset-bottom));
  }
}

/* Direct-share sheet and first-class shared post messages. */
.overlay:has(.post-share-sheet) {
  background: rgba(0, 0, 0, .56);
}

.action-sheet.compact-sheet.post-share-sheet {
  width: min(560px, 100%);
  height: min(76vh, 700px);
  max-height: calc(var(--visual-height) - max(18px, env(safe-area-inset-top)));
  display: block;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 24px 24px 0 0;
  color: #f5f5f5;
  background: #101010;
  box-shadow: 0 -14px 46px rgba(0, 0, 0, .38);
}

.post-share-shell {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.post-share-head {
  position: relative;
  min-height: 58px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  padding: 8px 10px 0;
  border-bottom: 1px solid #262626;
  text-align: center;
}

.post-share-head .story-sheet-grabber {
  position: absolute;
  top: 6px;
  left: 50%;
  width: 40px;
  height: 4px;
  border-radius: 99px;
  background: #737373;
  transform: translateX(-50%);
}

.post-share-head strong {
  grid-column: 2;
  font-size: 16px;
}

.action-sheet .post-share-head button {
  grid-column: 3;
  width: 40px;
  min-height: 40px;
  justify-self: end;
  padding: 9px;
  border: 0;
  border-radius: 50%;
  background: transparent;
}

.post-share-search {
  min-height: 40px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin: 12px 16px 5px;
  padding: 0 12px;
  border-radius: 10px;
  color: #a8a8a8;
  background: #262626;
}

.post-share-search .ui-icon {
  width: 18px;
  height: 18px;
}

.post-share-search input {
  width: 100%;
  height: 40px;
  padding: 0;
  border: 0;
  outline: 0;
  color: #f5f5f5;
  background: transparent;
}

.post-share-people {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-content: start;
  gap: 14px 6px;
  overflow-y: auto;
  padding: 13px 12px 18px;
  overscroll-behavior: contain;
}

.action-sheet .post-share-person {
  min-width: 0;
  min-height: 94px;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 3px;
  padding: 0 2px;
  border: 0;
  border-radius: 8px;
  color: #f5f5f5;
  background: transparent;
}

.post-share-avatar {
  position: relative;
  width: 64px;
  height: 64px;
  display: block;
  margin-bottom: 3px;
}

.post-share-avatar > .avatar {
  width: 64px;
  height: 64px;
  font-size: 15px;
}

.post-share-avatar > i {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 22px;
  height: 22px;
  display: none;
  place-items: center;
  border: 2px solid #101010;
  border-radius: 50%;
  color: #fff;
  background: var(--social-action);
}

.post-share-person.selected .post-share-avatar > i {
  display: grid;
}

.post-share-avatar > i .ui-icon {
  width: 12px;
  height: 12px;
}

.post-share-person strong,
.post-share-person small {
  width: 100%;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-share-person strong {
  font-size: 12px;
}

.post-share-person small {
  color: #8e8e8e;
  font-size: 10px;
}

.post-share-empty {
  grid-column: 1 / -1;
  margin: 28px 0;
  color: #8e8e8e;
  text-align: center;
}

.post-share-footer {
  display: grid;
  gap: 10px;
  padding: 11px 16px max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid #262626;
  background: #101010;
}

.post-share-quick {
  display: flex;
  gap: 18px;
}

.action-sheet .post-share-quick button {
  width: 58px;
  min-height: 66px;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 5px;
  padding: 0;
  border: 0;
  color: #f5f5f5;
  background: transparent;
}

.post-share-quick button > span {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #262626;
}

.post-share-quick button > span .ui-icon {
  width: 21px;
  height: 21px;
}

.post-share-quick small {
  font-size: 10px;
  white-space: nowrap;
}

.action-sheet .post-share-send {
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  font-weight: 750;
  background: var(--social-action);
}

.message.shared-post-message {
  width: min(286px, 82vw);
  max-width: min(286px, 82vw);
}

.message.shared-post-message .bubble,
.chat-pane.active-chat .message.shared-post-message .bubble {
  width: 100%;
  padding: 0;
  border: 0;
  color: #f5f5f5;
  background: transparent;
  box-shadow: none;
}

.shared-post-card {
  width: 100%;
  display: grid;
  overflow: hidden;
  padding: 0;
  border: 1px solid #2b2b2b;
  border-radius: 17px;
  color: #f5f5f5;
  text-align: left;
  background: #121212;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
}

.shared-post-author {
  min-width: 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
}

.shared-post-author > .avatar {
  width: 34px;
  height: 34px;
  font-size: 9px;
}

.shared-post-author > span,
.shared-post-author strong,
.shared-post-author small {
  min-width: 0;
  display: block;
}

.shared-post-author strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shared-post-author small {
  margin-top: 1px;
  color: #a8a8a8;
  font-size: 10px;
}

.shared-post-media {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  display: block;
  overflow: hidden;
  background: #000;
}

.shared-post-media img,
.shared-post-media video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  pointer-events: none;
}

.shared-post-play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, .52);
}

.shared-post-play .ui-icon {
  width: 22px;
  height: 22px;
  margin-left: 2px;
}

.shared-post-copy {
  display: grid;
  gap: 2px;
  padding: 10px;
}

.shared-post-copy strong {
  font-size: 12px;
}

.shared-post-copy small {
  overflow: hidden;
  color: #a8a8a8;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shared-post-unavailable {
  min-width: 230px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid #333;
  border-radius: 16px;
  background: #171717;
}

.shared-post-unavailable > .ui-icon {
  width: 30px;
  height: 30px;
}

.shared-post-unavailable strong,
.shared-post-unavailable small {
  display: block;
}

.shared-post-unavailable small {
  margin-top: 2px;
  color: #8e8e8e;
  font-size: 10px;
}

@media (max-width: 560px) {
  .action-sheet.compact-sheet.post-share-sheet {
    height: min(82vh, 720px);
  }

  .post-share-people {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .post-share-avatar,
  .post-share-avatar > .avatar {
    width: 58px;
    height: 58px;
  }
}

.post-video-sound {
  position: absolute;
  z-index: 5;
  right: 11px;
  bottom: 11px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 0, 0, .54);
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .4));
}

.post-video-sound .ui-icon {
  width: 18px;
  height: 18px;
}

/* Darker chrome, open-media pickers, and the compact mobile publishing flow. */
.post-composer-page {
  background: #000;
}

.post-composer-head {
  min-height: calc(54px + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
  border-bottom-color: #262626;
  background: rgba(0, 0, 0, .96);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.post-composer-head small,
.post-stage-dots {
  display: none;
}

.post-stage-meta:empty {
  display: none;
}

.post-composer-head .post-next {
  color: var(--social-link);
}

.post-editor-body,
.post-details-layout {
  background: #000;
}

.post-composer-media {
  border-color: #262626;
  border-radius: 12px;
  background: #050505;
  box-shadow: none;
}

.post-preview-controls {
  position: absolute;
  z-index: 7;
  right: 10px;
  bottom: 10px;
  left: 10px;
  min-height: 48px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 8px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 999px;
  background: rgba(0, 0, 0, .66);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.post-preview-controls button {
  width: 44px;
  height: 44px;
  min-height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, .08);
}

.post-preview-controls .ui-icon {
  width: 18px;
  height: 18px;
}

.post-preview-progress {
  width: 100%;
  min-width: 0;
  accent-color: #fff;
  cursor: pointer;
}

.post-crop-controls,
.post-details-fields {
  border-color: #262626;
  border-radius: 12px;
  background: #0b0b0b;
}

.post-aspect-row button,
.post-adjust-tabs button {
  border-color: #2b2b2b;
  border-radius: 8px;
  background: #171717;
}

.post-aspect-row button.active,
.post-adjust-tabs button.active {
  border-color: #29465a;
  color: #fff;
  background: var(--social-action-soft);
}

.post-crop-controls input[type="range"],
.post-adjust-slider input[type="range"],
.music-segment-slider input[type="range"] {
  accent-color: var(--social-action);
}

.post-music-control,
.note-selected-music {
  min-width: 0;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 42px 42px;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid #292929;
  border-radius: 12px;
  color: var(--text);
  background: #111;
}

.post-music-control:not(:has(.music-artwork)) {
  grid-template-columns: 46px minmax(0, 1fr) 42px;
}

.post-music-control:not(.compact) {
  width: min(100%, 560px);
}

.post-music-control > span:nth-child(2),
.note-selected-music > span:nth-child(2) {
  min-width: 0;
}

.post-music-control strong,
.post-music-control small,
.note-selected-music strong,
.note-selected-music small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-music-control small,
.note-selected-music small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.post-music-control > button,
.note-selected-music > button {
  width: 42px;
  height: 42px;
  min-height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  color: var(--soft);
  background: #222;
}

.post-music-control .ui-icon,
.note-selected-music .ui-icon {
  width: 18px;
  height: 18px;
}

.post-music-icon,
.music-artwork {
  position: relative;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 7px;
  color: #e8edf2;
  background: linear-gradient(145deg, #253648, #17202b);
}

.music-artwork.large {
  width: 76px;
  height: 76px;
  border-radius: 10px;
}

.music-artwork img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.music-artwork .ui-icon,
.post-music-icon .ui-icon {
  width: 23px;
  height: 23px;
}

.post-music-control.compact {
  margin-bottom: 2px;
}

.note-audio-editor {
  background: #0b0b0b;
}

.note-audio-editor > div:first-child strong {
  color: var(--social-link-hover);
}

.note-audio-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.note-audio-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.note-audio-actions .ui-icon {
  width: 17px;
  height: 17px;
}

.note-share {
  background: var(--social-action);
}

.music-picker-overlay {
  position: fixed;
  inset: auto 0 auto;
  top: var(--visual-top);
  z-index: 190;
  width: 100%;
  height: var(--visual-height);
  display: grid;
  place-items: center;
  padding: 18px;
  overflow: hidden;
  overscroll-behavior: none;
  background: rgba(0, 0, 0, .72);
  animation: messageFocusFade .18s ease both;
}

.music-picker-sheet {
  width: min(520px, 100%);
  height: min(760px, calc(var(--visual-height) - 36px));
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid #2a2a2a;
  border-radius: 16px;
  color: var(--text);
  background: #080808;
  box-shadow: 0 26px 70px rgba(0, 0, 0, .58);
}

.music-picker-head {
  min-height: 58px;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 64px;
  align-items: center;
  padding: 0 5px;
  border-bottom: 1px solid #262626;
  background: rgba(0, 0, 0, .96);
}

.music-picker-head > button {
  min-height: 44px;
  padding: 0 8px;
  color: var(--text);
  background: transparent;
}

.music-picker-head > button:first-child {
  width: 44px;
  padding: 0;
}

.music-picker-head > span {
  min-width: 0;
  display: grid;
  justify-items: center;
  line-height: 1.15;
}

.music-picker-head strong,
.music-picker-head small {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.music-picker-head strong {
  font-size: 16px;
}

.music-picker-head small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.music-picker-head .music-picker-done {
  color: var(--social-link);
  font-size: 12px;
  font-weight: 800;
}

.music-search-view,
.music-segment-editor {
  min-height: 0;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.music-search-view {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.music-segment-editor {
  overflow-y: auto;
}

.music-search-field {
  position: relative;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 7px;
  margin: 12px 12px 8px;
  padding: 0 7px 0 12px;
  border: 1px solid #292929;
  border-radius: 12px;
  color: var(--muted);
  background: #171717;
}

.music-search-field > .ui-icon {
  width: 18px;
  height: 18px;
}

.music-search-field input {
  width: 100%;
  height: 46px;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 16px;
}

.music-search-field button {
  width: 32px;
  height: 32px;
  min-height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  color: var(--muted);
  background: #282828;
}

.music-search-field button[hidden] {
  display: none;
}

.music-category-rail {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 0 12px 10px;
  scrollbar-width: none;
}

.music-category-rail button,
.music-duration-options button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid #303030;
  border-radius: 999px;
  color: var(--soft);
  background: #171717;
  font-size: 11px;
  font-weight: 700;
}

.music-results {
  min-height: 0;
  overflow-y: auto;
  border-top: 1px solid #1f1f1f;
}

.music-result-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 50px;
  align-items: center;
  border-bottom: 1px solid #1f1f1f;
}

.music-result-main {
  min-width: 0;
  min-height: 66px;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 9px 7px 9px 12px;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.music-result-main > span:last-child {
  min-width: 0;
}

.music-result-main strong,
.music-result-main small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.music-result-main strong {
  font-size: 12px;
}

.music-result-main small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.music-result-play,
.music-preview-toggle {
  width: 42px;
  height: 42px;
  min-height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #303030;
  border-radius: 50%;
  color: #fff;
  background: #1c1c1c;
}

.music-result-play .ui-icon,
.music-preview-toggle .ui-icon {
  width: 18px;
  height: 18px;
}

.music-results-loading,
.music-results-empty {
  min-height: 180px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 24px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.music-results-loading i,
.chat-gif-loading i {
  width: 22px;
  height: 22px;
  border: 2px solid rgba(57, 125, 180, .24);
  border-top-color: var(--social-link);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

.music-provider-credit {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 9px 12px max(9px, env(safe-area-inset-bottom));
  border-top: 1px solid #222;
  color: var(--muted);
  background: #080808;
  font-size: 9px;
}

.music-provider-credit a,
.music-license-copy a,
.chat-gif-provider a,
.chat-gif-credit {
  color: var(--social-link);
}

.music-segment-editor {
  padding: 24px 18px max(24px, env(safe-area-inset-bottom));
}

.music-segment-track {
  min-width: 0;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 13px;
}

.music-segment-track > span:nth-child(2) {
  min-width: 0;
}

.music-segment-track strong,
.music-segment-track small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.music-segment-track small {
  margin-top: 5px;
  color: var(--muted);
}

.music-segment-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 30px 2px 10px;
}

.music-segment-summary span {
  color: var(--muted);
  font-size: 10px;
}

.music-waveform-window {
  position: relative;
  height: 96px;
  overflow: hidden;
  padding: 13px 10px;
  border: 1px solid #303030;
  border-radius: 12px;
  background: #111;
  touch-action: pan-y;
}

.music-waveform-bars {
  width: 140%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
  transform: translateX(calc(var(--music-position, 0) * -28.57%));
  transition: transform .08s linear;
}

.music-waveform-bars i {
  flex: 1 1 auto;
  max-width: 4px;
  height: var(--music-peak);
  border-radius: 999px;
  background: #7f8994;
}

.music-window-edge {
  position: absolute;
  top: 7px;
  bottom: 7px;
  width: 3px;
  border-radius: 999px;
  background: var(--social-link);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .5);
}

.music-window-edge.start { left: 8px; }
.music-window-edge.end { right: 8px; }

.music-waveform-range {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
}

.music-segment-slider {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 8px;
  margin-top: 13px;
  color: var(--muted);
  font-size: 10px;
}

.music-segment-slider input {
  width: 100%;
  min-width: 0;
}

.music-segment-slider output {
  color: var(--soft);
  text-align: right;
}

.music-duration-options {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}

.music-duration-options button.active {
  border-color: var(--social-action);
  color: #fff;
  background: var(--social-action);
}

.music-license-copy {
  margin: 24px 2px 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.clip-music {
  display: none;
}

.chat-gif-provider {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px max(7px, env(safe-area-inset-bottom));
  border-top: 1px solid #292929;
  color: var(--muted);
  font-size: 8px;
}

.chat-gif-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 124px;
}

.chat-gif-grid button {
  position: relative;
  height: 124px;
  border-radius: 5px;
}

.chat-gif-grid button small {
  position: absolute;
  right: 5px;
  bottom: 5px;
  left: 5px;
  overflow: hidden;
  padding: 3px 5px;
  border-radius: 5px;
  color: #fff;
  background: rgba(0, 0, 0, .68);
  font-size: 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-gif-loading {
  grid-column: 1 / -1;
  min-height: 80px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  color: var(--muted);
  font-size: 9px;
}

.chat-gif-credit {
  display: block;
  max-width: 100%;
  overflow: hidden;
  padding: 3px 4px 1px;
  font-size: 7px;
  line-height: 1.2;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 860px) {
  .post-editor-body,
  .post-details-layout {
    padding: 0 0 max(22px, env(safe-area-inset-bottom));
  }

  .post-editor-body:has(.post-crop-controls),
  .post-editor-body:has(.post-filter-rail),
  .post-details-layout {
    gap: 0;
  }

  .post-editor-body:has(.post-crop-controls) .post-composer-media,
  .post-editor-body .post-composer-media,
  .post-details-layout .post-composer-media {
    width: 100%;
    max-width: none;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .post-selection-rail {
    width: 100%;
    margin: 0;
    padding: 10px 12px;
    border-bottom: 1px solid #222;
  }

  .post-crop-controls,
  .post-details-fields {
    margin: 12px;
    padding: 12px;
  }

  .post-filter-rail {
    width: 100%;
    margin: 0;
    padding: 14px 12px;
    border-bottom: 1px solid #222;
  }

  .post-adjust-tabs,
  .post-adjust-slider,
  .post-music-control:not(.compact) {
    width: calc(100% - 24px);
    margin-right: 12px;
    margin-left: 12px;
  }

  .post-adjust-tabs {
    margin-top: 12px;
  }

  .post-adjust-slider {
    margin-top: 8px;
  }

  .post-music-control:not(.compact) {
    margin-top: 14px;
  }

  .post-tag-help {
    margin: 10px 12px 0;
  }
}

@media (max-width: 560px) {
  .music-picker-overlay {
    place-items: end center;
    padding: 0;
    background: #000;
  }

  .music-picker-sheet {
    width: 100%;
    height: var(--visual-height);
    max-height: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .music-picker-head {
    min-height: calc(54px + env(safe-area-inset-top));
    padding-top: env(safe-area-inset-top);
  }

  .music-segment-editor {
    padding: 22px 14px max(22px, env(safe-area-inset-bottom));
  }

  .note-audio-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .note-audio-actions button {
    padding: 0 5px;
    font-size: 9px;
  }

  .post-composer-head {
    grid-template-columns: 52px minmax(0, 1fr) 58px;
  }
}

@media (max-width: 360px) {
  .music-result-main {
    grid-template-columns: 42px minmax(0, 1fr);
    padding-left: 8px;
  }

  .music-result-main .music-artwork {
    width: 42px;
    height: 42px;
  }

  .post-music-control,
  .note-selected-music {
    grid-template-columns: 42px minmax(0, 1fr) 38px 38px;
    gap: 5px;
  }
}
