:root {
  color-scheme: light;
  --bg: #f6f7f3;
  --surface: #ffffff;
  --surface-soft: #eef4f1;
  --text: #18201d;
  --muted: #62706a;
  --line: #d9e1dd;
  --ink: #10251f;
  --teal: #0f766e;
  --teal-dark: #0b534d;
  --coral: #e85d4f;
  --amber: #d99b23;
  --blue: #2563eb;
  --green: #17803d;
  --shadow: 0 18px 50px rgba(20, 35, 30, 0.12);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(246, 247, 243, 0.92)),
    var(--bg);
  color: var(--text);
}

body.booting .auth-screen,
body.booting .app-shell {
  display: none !important;
}

.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  place-items: center;
  align-content: center;
  gap: 10px;
  background: var(--bg);
  color: var(--ink);
  text-align: center;
}

body.booting .boot-screen {
  display: grid;
}

.boot-screen img {
  width: 72px;
  height: 72px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.boot-screen strong {
  font-size: 1.2rem;
}

.boot-screen span {
  color: var(--muted);
  font-weight: 700;
}

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

button {
  border: 0;
  cursor: pointer;
}

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

.hidden {
  display: none !important;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(360px, 520px);
  gap: 0;
}

.auth-visual {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background: #1b312d;
}

.auth-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.95) contrast(1.04);
}

.auth-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(25deg, rgba(10, 27, 24, 0.82), rgba(10, 27, 24, 0.08) 54%, rgba(232, 93, 79, 0.2));
}

.auth-badge {
  position: absolute;
  left: 32px;
  bottom: 32px;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  padding: 12px 14px;
  background: rgba(9, 23, 20, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
}

.auth-badge span {
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--coral);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
}

.auth-panel {
  align-self: center;
  width: min(100%, 520px);
  padding: 48px;
}

.auth-logo {
  display: block;
  width: min(190px, 58vw);
  height: auto;
  margin: 0 0 18px;
  border-radius: var(--radius);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 11ch;
  margin-bottom: 26px;
  font-size: clamp(2.15rem, 5vw, 4.8rem);
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.05rem;
  line-height: 1.2;
}

.auth-tabs,
.segmented-control {
  display: grid;
  grid-auto-flow: column;
  gap: 4px;
  width: fit-content;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #edf2ef;
}

.tab-button,
.segmented-control button {
  min-width: 86px;
  height: 38px;
  padding: 0 14px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 750;
}

.tab-button.active,
.segmented-control button.active {
  color: var(--text);
  background: #fff;
  box-shadow: 0 1px 8px rgba(20, 35, 30, 0.09);
}

.auth-form {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 760;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  outline: none;
  padding: 11px 12px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

textarea {
  resize: vertical;
  line-height: 1.5;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.primary-button,
.ghost-button,
.icon-button,
.topbar-profile,
.avatar-button,
.quick-nav button,
.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border-radius: var(--radius);
  font-weight: 800;
}

.primary-button {
  background: var(--teal);
  color: #fff;
  padding: 0 16px;
  text-decoration: none;
}

.primary-button:hover {
  background: var(--teal-dark);
}

.auth-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border-radius: var(--radius);
  background: #edf2ef;
  color: var(--ink);
  font-weight: 850;
}

.auth-link-button:hover {
  background: #e1ebe6;
  color: var(--teal-dark);
}

.auth-install-card {
  display: grid;
  gap: 10px;
  margin: 14px 0 18px;
  padding: 12px;
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: var(--radius);
  background: #e9f5f2;
}

.auth-install-card strong {
  display: block;
  color: var(--ink);
  font-size: 0.98rem;
}

.auth-install-card span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.auth-install-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.auth-install-actions .primary-button,
.auth-install-actions .ghost-button {
  min-height: 44px;
  text-decoration: none;
}

.apk-direct-link {
  display: block;
  overflow-wrap: anywhere;
  color: var(--teal-dark);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.35;
}

.ghost-button {
  background: #edf2ef;
  color: var(--ink);
  padding: 0 14px;
  text-decoration: none;
}

.icon-button {
  position: relative;
  width: 40px;
  padding: 0;
  background: #edf2ef;
  color: var(--ink);
}

.icon-button.primary {
  background: var(--teal);
  color: #fff;
}

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

.danger,
.small-button.danger {
  background: #ffe8e5;
  color: #b42318;
}

.topbar-profile,
.avatar-button,
.profile-link {
  background: transparent;
  color: inherit;
  padding: 0;
}

.topbar-profile {
  justify-content: flex-start;
  min-width: 0;
  border-radius: var(--radius);
}

.topbar-profile:hover,
.profile-link:hover {
  color: var(--teal);
}

.notification-area {
  position: relative;
}

.topbar-shortcuts {
  display: flex;
  align-items: center;
  gap: 6px;
}

.apk-download-mobile {
  display: none;
}

.notification-button {
  position: relative;
}

.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border: 2px solid var(--surface);
  border-radius: 999px;
  background: var(--coral);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 900;
}

.nav-dot {
  position: absolute;
  top: -5px;
  right: -5px;
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border: 2px solid var(--surface);
  border-radius: 999px;
  background: #e11d48;
  color: #fff;
  font-size: 0.66rem;
  font-weight: 950;
  line-height: 1;
}

.notification-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(380px, calc(100vw - 24px));
  max-height: 440px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.notification-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.notification-head button {
  min-height: 30px;
  padding: 0 8px;
  border-radius: 6px;
  background: #edf2ef;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 820;
}

.notification-list {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.notification-item {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.notification-item.unread {
  border-color: rgba(15, 118, 110, 0.45);
  background: #e7f3f0;
}

.notification-main {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.notification-main p {
  margin: 2px 0 3px;
  color: #33403b;
  line-height: 1.38;
}

.notification-main span {
  color: var(--muted);
  font-size: 0.78rem;
}

.notification-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.primary-button svg,
.ghost-button svg,
.icon-button svg,
.photo-picker svg,
.quick-nav svg,
.action-button svg,
.search-box svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
}

.auth-feedback {
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.auth-feedback.error {
  color: #b42318;
}

.auth-feedback.success {
  color: var(--green);
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(210px, 260px) minmax(220px, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(246, 247, 243, 0.88);
  backdrop-filter: blur(16px);
}

.brand-lockup,
.topbar-user,
.people-row,
.thread-button,
.post-author,
.comment-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-lockup strong,
.topbar-user span,
.thread-button strong,
.people-row strong,
.post-author strong {
  display: block;
}

.brand-lockup span,
.thread-button span,
.people-row span,
.post-meta,
.comment-row span,
.chat-header,
.profile-panel p {
  color: var(--muted);
  font-size: 0.86rem;
}

.topbar-user .avatar,
.people-row .avatar,
.thread-button .avatar,
.post-author .avatar,
.comment-row .avatar {
  color: #fff;
}

.brand-logo {
  width: 58px;
  height: 42px;
  object-fit: contain;
  border-radius: var(--radius);
  background: #fff;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 720px;
  color: var(--muted);
  font-size: 1rem;
}

.search-box svg {
  position: absolute;
  left: 12px;
}

.search-box input {
  padding-left: 40px;
  background: #fff;
}

.avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #fff;
  font-weight: 900;
  overflow: hidden;
}

.avatar.large {
  width: 68px;
  height: 68px;
  font-size: 1.6rem;
}

.avatar.small {
  width: 32px;
  height: 32px;
  font-size: 0.78rem;
}

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

.profile-photo-wrap {
  position: relative;
  width: 76px;
}

.avatar-button {
  border-radius: 50%;
}

.photo-picker {
  position: absolute;
  right: 0;
  bottom: 0;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  box-shadow: 0 4px 14px rgba(16, 37, 31, 0.22);
  cursor: pointer;
}

.photo-picker input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.layout {
  display: grid;
  grid-template-columns: minmax(220px, 270px) minmax(0, 1fr) minmax(300px, 380px);
  gap: 18px;
  width: min(1540px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.left-rail,
.right-rail {
  display: grid;
  align-content: start;
  gap: 14px;
}

.left-rail {
  position: sticky;
  top: 86px;
  height: fit-content;
}

.profile-panel,
.panel,
.composer-card,
.post-card,
.search-people-card,
.feed-tools {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 2px 14px rgba(20, 35, 30, 0.05);
}

.profile-panel,
.panel,
.composer-card {
  padding: 16px;
}

.profile-panel h2 {
  margin: 12px 0 4px;
}

.profile-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 16px;
}

.profile-stats span {
  padding: 10px;
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.86rem;
}

.profile-stats strong {
  display: block;
  color: var(--text);
  font-size: 1.2rem;
}

.profile-view-button {
  width: 100%;
  margin-top: 12px;
}

.quick-nav {
  display: grid;
  gap: 8px;
}

.quick-nav button {
  justify-content: flex-start;
  width: 100%;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}

.mobile-tabbar {
  display: none;
}

.feed-column {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
}

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

.section-heading.compact {
  margin-bottom: 12px;
}

.section-heading.compact svg {
  color: var(--teal);
}

.panel-search {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 1rem;
}

.panel-search svg {
  position: absolute;
  left: 12px;
  width: 17px;
  height: 17px;
}

.panel-search input {
  padding-left: 38px;
}

.status-pill,
.category-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #fff3d6;
  color: #7a4f00;
  font-size: 0.78rem;
  font-weight: 850;
}

.post-form {
  display: grid;
  gap: 12px;
}

.composer-modes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.composer-modes button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font-weight: 850;
}

.composer-modes button.active {
  border-color: rgba(15, 118, 110, 0.42);
  background: #e7f3f0;
  color: var(--teal-dark);
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(140px, 0.5fr) minmax(150px, 0.5fr) minmax(220px, 1fr);
  gap: 12px;
}

.form-wide {
  grid-column: 1 / -1;
}

.media-row {
  display: grid;
  grid-template-columns: minmax(220px, 0.55fr) minmax(220px, 1fr);
  gap: 12px;
  align-items: stretch;
}

.file-drop {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 92px;
  border: 1px dashed #9fb3ac;
  border-radius: var(--radius);
  background: #f8fbfa;
  color: var(--ink);
  text-align: center;
}

.file-drop input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.media-preview {
  display: grid;
  place-items: center;
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #111;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.88rem;
}

.media-preview img,
.media-preview video {
  width: 100%;
  height: 140px;
  object-fit: contain;
}

.composer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.feed-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
}

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

.feed-list {
  display: grid;
  gap: 14px;
}

.search-people-card {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.search-people-list {
  display: grid;
  gap: 8px;
}

.search-person-row {
  min-height: 54px;
}

.post-card {
  overflow: hidden;
  scroll-margin-top: 96px;
}

.post-card.post-highlight {
  border-color: rgba(15, 118, 110, 0.62);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.16), 0 10px 26px rgba(15, 118, 110, 0.12);
}

.post-content {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.post-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.post-title {
  margin: 0;
  font-size: 1.36rem;
  line-height: 1.2;
}

.post-body {
  margin: 0;
  color: #33403b;
  line-height: 1.62;
  white-space: pre-wrap;
}

.post-link-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  max-width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(15, 118, 110, 0.24);
  border-radius: var(--radius);
  background: #eef7f4;
  color: var(--teal-dark);
  text-decoration: none;
}

.post-link-card svg {
  width: 18px;
  height: 18px;
}

.post-link-card span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.post-link-card strong,
.post-link-card small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-link-card small {
  color: var(--muted);
  font-size: 0.78rem;
}

.post-media {
  width: 100%;
  max-height: 720px;
  object-fit: contain;
  background: #101715;
}

img.post-media {
  height: auto;
  object-fit: contain;
}

video.post-media {
  background: #000;
}

.media-missing {
  display: grid;
  min-height: 160px;
  place-items: center;
  padding: 18px;
  border: 1px dashed #afc4bd;
  background: #f4faf7;
  color: #50635d;
  font-weight: 800;
  text-align: center;
}

iframe.post-media {
  aspect-ratio: 16 / 9;
  height: auto;
  border: 0;
}

.post-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 8px;
  padding: 0 16px 14px;
}

.action-button {
  min-width: 0;
  padding: 0 10px;
  background: #edf2ef;
  color: var(--ink);
  transition: transform 0.14s ease, background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.action-button.liked {
  background: #fff0ee;
  color: #b42318;
  box-shadow: inset 0 0 0 1px rgba(180, 35, 24, 0.14);
}

.action-button.liked svg {
  fill: currentColor;
}

.action-button.like-pop {
  animation: likePop 0.24s ease;
}

@keyframes likePop {
  0% {
    transform: scale(1);
  }

  48% {
    transform: scale(1.06);
  }

  100% {
    transform: scale(1);
  }
}

.comments {
  display: grid;
  gap: 10px;
  padding: 14px 16px 16px;
  border-top: 1px solid var(--line);
  background: #fbfcfb;
}

.comment-thread {
  display: grid;
  gap: 8px;
}

.comment-row {
  align-items: flex-start;
}

.comment-row.is-hidden,
.comment-thread.is-hidden > .comment-row {
  opacity: 0.72;
}

.comment-row p {
  margin: 2px 0 0;
  color: #33403b;
  line-height: 1.45;
}

.mention-link {
  display: inline;
  height: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--teal);
  font: inherit;
  font-weight: 900;
  text-decoration: none;
}

.mention-link:hover {
  color: var(--teal-dark);
  text-decoration: underline;
}

.comment-form,
.reply-form,
.profile-post-comment-form,
.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  gap: 8px;
}

.comment-form,
.reply-form,
.profile-post-comment-form {
  align-items: start;
}

.comment-input-wrap {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.comment-input-wrap input {
  width: 100%;
}

.comment-emoji-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.comment-emoji-row button,
.comment-image-button {
  display: inline-grid;
  min-width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 6px;
  background: #edf2ef;
  color: var(--ink);
  font-weight: 800;
}

.comment-emoji-row button:hover,
.comment-image-button:hover,
.comment-form.has-image .comment-image-button,
.reply-form.has-image .comment-image-button,
.profile-post-comment-form.has-image .comment-image-button {
  background: #dcefeb;
  color: var(--teal-dark);
}

.comment-image-button input {
  display: none;
}

.comment-media {
  display: block;
  width: min(260px, 100%);
  max-height: 260px;
  margin-top: 8px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  object-fit: cover;
  background: #101715;
}

.comment-media-missing {
  width: min(260px, 100%);
  margin-top: 8px;
  padding: 10px;
  border: 1px dashed #afc4bd;
  border-radius: var(--radius);
  background: #f4faf7;
  color: var(--muted);
  font-weight: 800;
}

.comment-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.comment-tools button {
  min-height: 28px;
  padding: 0 8px;
  border-radius: 6px;
  background: #edf2ef;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 820;
}

.comment-tools button[data-action="delete-comment"] {
  background: #ffe8e5;
  color: #b42318;
}

.reply-list {
  display: grid;
  gap: 8px;
  margin-left: 42px;
  padding-left: 12px;
  border-left: 2px solid var(--line);
}

.reply-row {
  padding: 8px;
  border-radius: var(--radius);
  background: #fff;
}

.empty-state {
  padding: 22px;
  border: 1px dashed #aebdb7;
  border-radius: var(--radius);
  background: #fff;
  color: var(--muted);
  text-align: center;
}

.people-list,
.thread-list,
.group-list {
  display: grid;
  gap: 8px;
}

.group-form {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.group-photo-picker {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px dashed #9fb4ae;
  border-radius: var(--radius);
  background: #f8fbfa;
  color: var(--ink);
  font-weight: 850;
  cursor: pointer;
}

.group-photo-picker.compact {
  min-height: 38px;
  font-size: 0.86rem;
}

.group-photo-picker input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.group-row,
.group-card {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.group-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 58px;
  padding: 9px;
  color: var(--ink);
  text-align: left;
}

.group-row.active,
.group-card.active {
  border-color: rgba(15, 118, 110, 0.48);
  background: #e7f3f0;
}

.group-row strong,
.group-main strong {
  display: block;
}

.group-main-content {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.group-photo {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--teal);
  color: #fff;
  font-size: 1rem;
  font-weight: 900;
}

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

.group-row span,
.group-main span,
.group-meta,
.owner-note {
  color: var(--muted);
  font-size: 0.82rem;
}

.group-card {
  display: grid;
  gap: 8px;
  padding: 9px;
}

.group-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  background: transparent;
  color: var(--ink);
  padding: 0;
  text-align: left;
}

.group-meta {
  display: grid;
  gap: 3px;
}

.group-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--teal-dark);
  font-weight: 850;
  text-decoration: underline;
  overflow-wrap: anywhere;
}

.group-link svg {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
}

.group-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 8px;
}

.admin-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.group-control-panel {
  display: grid;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.group-settings-panel {
  margin-top: 2px;
  padding: 10px;
  border: 1px solid rgba(15, 118, 110, 0.28);
  border-radius: var(--radius);
  background: #eef8f5;
}

.group-settings-form {
  display: grid;
  gap: 8px;
}

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

.group-control-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--ink);
  font-size: 0.86rem;
}

.group-control-title span,
.group-empty {
  color: var(--muted);
  font-size: 0.78rem;
}

.group-member-list,
.group-request-list {
  display: grid;
  gap: 6px;
}

.group-member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding: 7px;
  border: 1px solid #e4ece8;
  border-radius: 7px;
  background: #f8fbfa;
}

.group-member-row .people-main {
  flex: 1 1 auto;
}

.group-member-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.group-empty {
  padding: 7px;
  border: 1px dashed #ccd8d3;
  border-radius: 7px;
  background: #fff;
}

.role-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: #fff3d6;
  color: #7a4f00;
  font-size: 0.72rem;
  font-weight: 850;
}

.people-row,
.thread-button {
  width: 100%;
  min-height: 58px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  text-align: left;
}

.people-row {
  justify-content: space-between;
  min-width: 0;
}

.people-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.people-row.is-banned {
  opacity: 0.72;
}

.people-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}

.profile-link {
  min-width: 0;
  text-align: left;
}

.people-row .avatar {
  flex: 0 0 auto;
}

.people-main div,
.thread-button div {
  min-width: 0;
}

.people-main strong,
.people-main span,
.thread-button strong,
.thread-button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.small-button {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 7px;
  background: var(--ink);
  color: #fff;
  font-weight: 820;
}

.small-button.secondary {
  background: #edf2ef;
  color: var(--ink);
}

.small-button.danger,
.ghost-button.danger {
  background: #ffe8e5;
  color: #b42318;
}

.message-group-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-bottom: 10px;
}

.message-group-form textarea,
.message-group-form select {
  grid-column: 1 / -1;
}

.message-group-form textarea {
  min-height: 58px;
  resize: vertical;
}

.message-group-form select {
  min-height: 78px;
  padding: 8px;
}

.message-layout {
  display: grid;
  gap: 10px;
}

.message-group-controls {
  display: grid;
  gap: 8px;
}

.message-group-admin-panel {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfb;
}

.message-group-toolbar,
.message-group-member-row,
.message-group-member-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.message-group-toolbar {
  justify-content: space-between;
}

.message-group-bio {
  display: grid;
  gap: 6px;
}

.message-group-bio textarea {
  min-height: 58px;
  resize: vertical;
}

.message-group-bio p {
  margin: 0;
  color: #33403b;
  line-height: 1.42;
}

.pinned-message {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 9px;
  border: 1px solid rgba(122, 79, 0, 0.2);
  border-radius: var(--radius);
  background: #fff7e4;
  color: #5c3d00;
}

.pinned-message p {
  margin: 2px 0 0;
  color: #594c33;
  font-size: 0.84rem;
}

.message-group-control-grid {
  display: grid;
  gap: 10px;
}

.message-group-member-list {
  display: grid;
  gap: 6px;
  margin-top: 6px;
}

.message-group-member-row {
  justify-content: space-between;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.message-group-member-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.message-group-member-actions:empty {
  display: none;
}

.message-group-member-row small,
.message-group-note {
  color: var(--muted);
  font-size: 0.78rem;
}

.thread-button.active {
  border-color: rgba(15, 118, 110, 0.48);
  background: #e7f3f0;
}

.thread-button.group-thread .avatar {
  color: #fff;
}

.chat-box {
  display: grid;
  gap: 10px;
  min-height: 360px;
}

.chat-header {
  min-height: 28px;
  font-weight: 800;
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 250px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbfa;
}

.chat-reply-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(15, 118, 110, 0.24);
  border-radius: var(--radius);
  background: #e7f3f0;
}

.chat-reply-preview p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.chat-emoji-row {
  grid-column: 1 / -1;
  display: flex;
  gap: 6px;
  overflow-x: auto;
}

.chat-emoji-row button {
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 999px;
  background: #edf2ef;
  font-size: 1rem;
}

.chat-attachment-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(110px, auto) minmax(0, 1fr);
  gap: 8px;
}

.chat-file-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbfa;
  color: var(--ink);
  font-weight: 850;
  overflow: hidden;
}

.chat-file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.message-group-invite-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 8px;
}

.bubble {
  max-width: 82%;
  padding: 9px 10px;
  border-radius: var(--radius);
  background: #fff;
  color: #2d3935;
  line-height: 1.38;
}

.bubble.pinned {
  border: 1px solid rgba(122, 79, 0, 0.28);
  background: #fff7e4;
}

.bubble p {
  margin: 0;
}

.message-attachment-media {
  display: block;
  width: min(320px, 100%);
  max-height: 280px;
  margin-top: 8px;
  border-radius: var(--radius);
  object-fit: cover;
  background: #101715;
}

.message-link-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 8px 9px;
  border-radius: 7px;
  background: rgba(15, 118, 110, 0.1);
  color: var(--teal-dark);
  text-decoration: none;
}

.bubble.mine .message-link-card {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.message-link-card span {
  display: grid;
  min-width: 0;
}

.message-link-card strong,
.message-link-card small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-link-card small {
  color: inherit;
  opacity: 0.76;
}

.message-attachment-missing {
  margin-top: 8px;
  padding: 8px;
  border: 1px dashed #afc4bd;
  border-radius: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.bubble-sender {
  display: block;
  margin-bottom: 3px;
  color: var(--teal-dark);
  font-size: 0.78rem;
}

.message-meta {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.25;
}

.bubble.mine {
  align-self: flex-end;
  background: var(--teal);
  color: #fff;
}

.message-reply-quote {
  display: grid;
  gap: 2px;
  margin-bottom: 6px;
  padding: 6px 8px;
  border-left: 3px solid rgba(15, 118, 110, 0.45);
  border-radius: 6px;
  background: rgba(15, 118, 110, 0.08);
  font-size: 0.8rem;
}

.bubble.mine .message-reply-quote {
  background: rgba(255, 255, 255, 0.16);
  border-left-color: rgba(255, 255, 255, 0.55);
}

.message-reply-quote span {
  color: var(--muted);
}

.bubble.mine .message-reply-quote span {
  color: rgba(255, 255, 255, 0.78);
}

.message-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.message-actions button {
  min-height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.1);
  color: var(--teal-dark);
  font-size: 0.72rem;
  font-weight: 800;
}

.bubble.mine .message-actions button {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.bubble.mine .message-meta {
  color: rgba(255, 255, 255, 0.76);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: min(360px, calc(100vw - 36px));
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow);
  transform: translateY(16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.update-banner {
  position: fixed;
  right: 14px;
  bottom: 14px;
  left: 14px;
  z-index: 45;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 520px;
  margin: 0 auto;
  padding: 12px;
  border: 1px solid rgba(15, 118, 110, 0.24);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 42px rgba(20, 35, 30, 0.18);
  backdrop-filter: blur(14px);
}

.update-banner.hidden {
  display: none;
}

.update-banner strong,
.update-banner span {
  display: block;
}

.update-banner strong {
  color: var(--ink);
  font-size: 0.98rem;
}

.update-banner span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 720;
}

.update-banner button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  background: var(--teal);
  color: #fff;
  font-weight: 900;
  white-space: nowrap;
}

.update-banner svg {
  width: 17px;
  height: 17px;
}

.install-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(246, 247, 243, 0.94)),
    var(--bg);
}

.install-card {
  width: min(100%, 440px);
  display: grid;
  gap: 14px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.install-card img {
  width: 92px;
  height: 92px;
  border-radius: var(--radius);
}

.install-card h1 {
  max-width: none;
  margin-bottom: 0;
  font-size: 2.2rem;
  line-height: 1;
}

.install-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.install-card small {
  color: var(--muted);
  line-height: 1.45;
}

.install-actions {
  display: grid;
  gap: 10px;
}

.install-actions a {
  text-decoration: none;
}

.profile-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
}

.share-modal {
  position: fixed;
  inset: 0;
  z-index: 34;
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 23, 20, 0.56);
  backdrop-filter: blur(7px);
}

.profile-dialog {
  position: relative;
  z-index: 1;
  width: min(900px, 100%);
  max-height: min(86vh, 900px);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.44);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.share-dialog {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.44);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.share-dialog-body {
  display: grid;
  gap: 12px;
  padding: 22px;
}

.share-dialog-body h2 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.2;
}

.share-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.share-link-preview {
  overflow-wrap: anywhere;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f4faf7;
  color: var(--teal-dark);
  font-weight: 800;
}

.share-actions {
  display: grid;
  gap: 8px;
}

.modal-close {
  position: sticky;
  top: 12px;
  float: right;
  z-index: 2;
  margin: 12px 12px 0 0;
}

.public-profile {
  display: grid;
  gap: 16px;
}

.public-profile-head {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: end;
  padding: 46px 22px 22px;
  background:
    linear-gradient(115deg, rgba(15, 118, 110, 0.95), rgba(23, 128, 61, 0.78)),
    #0f766e;
  background-position: center;
  background-size: cover;
  color: #fff;
}

.public-profile-head.has-background {
  background-image:
    linear-gradient(115deg, rgba(8, 48, 43, 0.9), rgba(15, 118, 110, 0.52)),
    var(--profile-bg);
}

.public-profile-head::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.22)),
    radial-gradient(circle at 85% 20%, rgba(255, 255, 255, 0.22), transparent 26%);
}

.public-profile-head > * {
  position: relative;
  z-index: 1;
}

.public-profile-head .avatar {
  width: 92px;
  height: 92px;
  border: 3px solid rgba(255, 255, 255, 0.72);
  font-size: 2rem;
}

.public-profile-head h2 {
  margin: 0 0 4px;
  font-size: clamp(1.5rem, 4vw, 2.4rem);
}

.public-profile-head p {
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  line-height: 1.5;
}

.profile-external-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  max-width: 100%;
  min-height: 34px;
  margin-top: 10px;
  padding: 0 10px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-weight: 820;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-external-link svg {
  width: 16px;
  height: 16px;
}

.profile-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.public-profile-body {
  display: grid;
  gap: 14px;
  padding: 0 18px 18px;
}

.public-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.public-stats span {
  min-height: 68px;
  padding: 10px;
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.84rem;
}

.public-stats strong {
  display: block;
  color: var(--text);
  font-size: 1.3rem;
}

.bio-form {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfb;
}

.bio-form .primary-button {
  justify-self: end;
}

.profile-follow-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.profile-follow-panel {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.profile-follow-head,
.profile-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.profile-follow-head span {
  color: var(--muted);
  font-size: 0.84rem;
}

.profile-user-list {
  display: grid;
  gap: 6px;
}

.profile-user-row {
  width: 100%;
  justify-content: flex-start;
  min-width: 0;
  padding: 7px;
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--ink);
  text-align: left;
}

.profile-user-row span {
  display: grid;
  min-width: 0;
}

.profile-user-row strong,
.profile-user-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-user-row small {
  color: var(--muted);
}

.profile-message-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

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

.profile-message-row {
  display: grid;
  gap: 3px;
  padding: 9px;
  border-radius: 7px;
  background: var(--surface-soft);
}

.profile-message-row.mine {
  background: #e7f3f0;
}

.profile-message-row p {
  margin: 0;
  color: #33403b;
  line-height: 1.42;
}

.profile-message-row span {
  color: var(--muted);
  font-size: 0.76rem;
}

.profile-feed {
  display: grid;
  gap: 12px;
}

.profile-post {
  display: grid;
  grid-template-columns: minmax(170px, 0.42fr) minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.profile-post.no-media {
  grid-template-columns: 1fr;
}

.profile-post-media {
  width: 100%;
  aspect-ratio: 16 / 10;
  height: 100%;
  min-height: 150px;
  object-fit: cover;
  border-radius: var(--radius);
  background: #101715;
}

iframe.profile-post-media {
  height: auto;
  border: 0;
}

.profile-post h3 {
  margin: 3px 0 7px;
  font-size: 1.05rem;
}

.profile-post p {
  margin: 0;
  color: #33403b;
  line-height: 1.48;
}

.profile-post-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 7px;
  margin-top: 10px;
}

.profile-post-comments {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.profile-post-comment {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.profile-post-comment p {
  margin: 0;
  line-height: 1.35;
}

@media (max-width: 1180px) {
  .layout {
    grid-template-columns: 230px minmax(0, 1fr);
  }

  .right-rail {
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  }
}

@media (max-width: 850px) {
  #composer-card,
  #friends-panel,
  #messages-panel,
  #groups-panel {
    scroll-margin-top: 66px;
  }

  .app-shell {
    padding-bottom: calc(112px + env(safe-area-inset-bottom, 0px));
  }

  .auth-screen {
    display: block;
  }

  .auth-visual {
    min-height: 220px;
  }

  .auth-badge {
    left: 18px;
    bottom: 18px;
  }

  .auth-panel {
    padding: 28px 18px;
  }

  .auth-install-actions {
    grid-template-columns: 1fr;
  }

  h1 {
    max-width: 12ch;
  }

  .topbar {
    position: sticky;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 8px 12px;
    padding-top: calc(8px + env(safe-area-inset-top, 0px));
  }

  .search-box {
    grid-column: 1 / -1;
    grid-row: 2;
    max-width: none;
  }

  .search-box input {
    min-height: 38px;
  }

  .topbar-user {
    grid-column: 2;
    grid-row: 1;
    justify-content: flex-end;
    gap: 6px;
  }

  .topbar-profile {
    gap: 6px;
  }

  .layout {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px;
  }

  .topbar-shortcuts {
    display: none;
  }

  .apk-download-mobile {
    display: inline-flex;
  }

  .mobile-tabbar {
    position: fixed;
    right: 10px;
    bottom: 10px;
    left: 10px;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    padding: 5px;
    border: 1px solid rgba(16, 37, 31, 0.12);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 14px 36px rgba(20, 35, 30, 0.16);
    backdrop-filter: blur(14px);
  }

  .mobile-tabbar button {
    position: relative;
    display: grid;
    place-items: center;
    gap: 2px;
    min-height: 44px;
    border-radius: 13px;
    background: transparent;
    color: var(--ink);
    font-size: 0.75rem;
    font-weight: 850;
  }

  .mobile-tabbar button:focus-visible,
  .mobile-tabbar button:hover {
    background: #e7f3f0;
    color: var(--teal-dark);
  }

  .mobile-tabbar svg {
    width: 19px;
    height: 19px;
  }

  .chat-attachment-row,
  .message-group-invite-box {
    grid-template-columns: 1fr;
  }

  .left-rail {
    position: static;
    gap: 10px;
  }

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

  .profile-photo-wrap {
    width: 64px;
    grid-row: span 2;
  }

  .avatar.large {
    width: 60px;
    height: 60px;
    font-size: 1.35rem;
  }

  .profile-panel h2 {
    margin: 0 0 3px;
  }

  .profile-panel p {
    margin: 0;
    line-height: 1.35;
  }

  .profile-stats {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-top: 2px;
  }

  .profile-stats span {
    min-height: 54px;
    padding: 8px;
  }

  .profile-view-button {
    grid-column: 1 / -1;
    margin-top: 0;
  }

  .quick-nav {
    display: none;
  }

  .right-rail {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .feed-column {
    gap: 10px;
  }

  .feed-list {
    padding-bottom: 18px;
  }

  .post-card {
    scroll-margin-top: calc(112px + env(safe-area-inset-top, 0px));
  }

  .post-media {
    display: block;
    width: 100%;
    height: auto;
    max-height: min(70vh, 680px);
    object-fit: contain;
  }

  iframe.post-media {
    max-height: none;
  }

  .profile-panel,
  .panel,
  .composer-card {
    padding: 12px;
  }

  .form-grid,
  .media-row,
  .post-actions,
  .profile-post {
    grid-template-columns: 1fr;
  }

  .feed-tools {
    align-items: stretch;
    flex-direction: column;
    padding: 10px;
  }

  .segmented-control {
    grid-auto-flow: row;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .composer-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .public-profile-head,
  .public-stats,
  .profile-follow-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 520px) {
  .auth-panel {
    padding-inline: 14px;
  }

  .brand-lockup span,
  #top-name {
    display: none;
  }

  .brand-logo,
  .topbar-user .avatar {
    width: 30px;
    height: 30px;
    border-radius: 10px;
  }

  .brand-lockup {
    gap: 7px;
    min-width: 0;
  }

  .brand-lockup strong {
    font-size: 1.02rem;
    line-height: 1;
    white-space: nowrap;
  }

  .notification-panel {
    position: fixed;
    top: calc(50px + env(safe-area-inset-top, 0px));
    right: 8px;
    left: 8px;
    width: auto;
    max-height: min(70vh, 520px);
  }

  .topbar {
    min-height: auto;
    gap: 6px;
    padding: 6px 8px;
    padding-top: calc(6px + env(safe-area-inset-top, 0px));
  }

  .topbar-user {
    gap: 4px;
  }

  .topbar-shortcuts {
    gap: 4px;
  }

  .topbar-shortcuts .icon-button,
  .apk-download-mobile,
  .notification-button,
  .topbar-profile,
  #logout-button {
    width: 32px;
    height: 32px;
    min-height: 32px;
    border-radius: 10px;
  }

  .topbar .icon-button svg,
  .topbar-profile svg {
    width: 18px;
    height: 18px;
  }

  .notification-badge,
  .nav-dot {
    top: -6px;
    right: -5px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    font-size: 0.62rem;
  }

  .profile-panel {
    grid-template-columns: auto minmax(0, 1fr);
    padding: 10px;
  }

  .profile-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .quick-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quick-nav button {
    gap: 4px;
    font-size: 0.78rem;
  }

  .quick-nav svg {
    width: 16px;
    height: 16px;
  }

  .composer-actions {
    grid-template-columns: 1fr 1fr;
  }

  .update-banner {
    right: 10px;
    bottom: calc(82px + env(safe-area-inset-bottom, 0px));
    left: 10px;
    padding: 10px;
  }

  .update-banner strong {
    font-size: 0.92rem;
  }

  .update-banner span {
    font-size: 0.76rem;
  }

  .update-banner button {
    min-height: 34px;
    padding: 0 10px;
    font-size: 0.82rem;
  }

  .post-content,
  .comments {
    padding: 12px;
  }

  .post-card > video.post-media,
  .post-card > img.post-media {
    width: 100%;
    height: auto !important;
    max-height: min(64vh, 620px) !important;
    object-fit: contain;
  }

  .post-card > iframe.post-media {
    height: auto !important;
    max-height: none !important;
  }

  .post-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0 12px 12px;
  }

  .comments {
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  }

  .pinned-message,
  .message-group-member-row,
  .chat-reply-preview {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .message-group-member-row,
  .chat-reply-preview {
    flex-direction: column;
  }

  .message-group-member-actions {
    justify-content: flex-start;
  }

  .action-button {
    min-height: 38px;
    font-size: 0.84rem;
  }

  .post-title {
    font-size: 1.12rem;
  }

  .category-pill {
    display: none;
  }

  .public-profile-head {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 40px 16px 16px;
  }

  .public-profile-head .avatar {
    width: 74px;
    height: 74px;
  }

  .public-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-follow-grid {
    grid-template-columns: 1fr;
  }

  .public-stats span {
    min-height: 56px;
    padding: 8px;
  }

  .profile-actions-row .primary-button,
  .profile-actions-row .ghost-button,
  .people-actions .small-button {
    min-height: 34px;
    padding: 0 10px;
    font-size: 0.8rem;
  }

  .people-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
  }

  .people-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .people-main {
    width: 100%;
    gap: 12px;
  }

  .people-row .avatar {
    width: 44px;
    height: 44px;
    font-size: 1rem;
  }

  .people-actions .small-button {
    width: 100%;
    min-height: 42px;
    font-size: 0.92rem;
  }

  .group-actions,
  .group-member-row {
    align-items: flex-start;
  }

  .group-member-row {
    flex-direction: column;
  }

  .message-group-toolbar,
  .message-group-member-row {
    align-items: stretch;
    flex-direction: column;
  }

  .message-group-member-actions,
  .group-member-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .message-group-member-actions .small-button,
  .group-member-actions .small-button {
    min-height: 32px;
    padding: 0 8px;
    font-size: 0.78rem;
  }
}
