#app-container {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

.sidebar {
  width: 260px;
  background-color: var(--card-dark);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 24px;
}

.home-app-logo { display: block; width: 28px; height: 28px; border-radius: 8px; margin: auto; }
.icon-btn .theme-emoji { display: none; }

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
}

.logo .brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex: none;
}

.logo h2 {
  color: var(--primary);
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 0;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.nav-item {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 10px 12px;
  border-radius: 8px;
  transition: var(--transition-speed);
}

.nav-item:hover, .nav-item.active {
  color: var(--text-dark);
  background-color: rgba(255, 51, 102, 0.1);
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  background-color: inherit;
  position: sticky;
  top: 0;
  z-index: 10;
}

.account-search {
  display: flex;
  width: min(100%, 340px);
  min-width: 180px;
  gap: 6px;
  margin-left: auto;
}

.account-search-link {
  margin-left: auto;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 8px 14px;
  color: var(--text-dark);
  background: var(--card-dark);
  font-size: 13px;
  font-weight: 600;
}

.account-search-link:hover {
  border-color: var(--secondary);
}

.account-search input {
  min-width: 0;
  flex: 1;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 9px 13px;
  color: var(--text-dark);
  background: var(--card-dark);
}

.account-search button,
.account-follow-button {
  border: 0;
  border-radius: 20px;
  padding: 8px 14px;
  color: #fff;
  background: var(--primary);
  font-weight: 600;
  cursor: pointer;
}

.account-search-results {
  position: sticky;
  top: 72px;
  z-index: 9;
  width: min(calc(100% - 32px), 500px);
  max-height: 50vh;
  overflow-y: auto;
  align-self: center;
  margin: 8px auto 0;
  padding: 8px;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: var(--card-dark);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
}

.account-search-results[hidden] {
  display: none;
}

.account-search-result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--card-dark);
}

.account-search-result:last-child {
  border-bottom: 0;
}

.account-search-avatar {
  width: 40px;
  height: 40px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  color: #fff;
  background: var(--primary);
  font-weight: 700;
}

.account-search-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.account-search-identity {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.account-search-identity strong,
.account-search-identity small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-search-identity small,
.account-search-message {
  color: var(--text-muted);
}

.account-search-message {
  margin: 8px;
  font-size: 13px;
}

.account-follow-button,
.account-message-button {
  flex: 0 0 auto;
  min-width: 82px;
  font-size: 12px;
}

.account-message-button {
  border: 1px solid rgba(89, 226, 255, 0.6);
  border-radius: 20px;
  padding: 8px 14px;
  color: #d7fbff;
  background: linear-gradient(120deg, rgba(16, 145, 255, 0.35), rgba(188, 63, 255, 0.35));
  box-shadow: 0 0 14px rgba(89, 226, 255, 0.2);
  cursor: pointer;
}

.account-message-button:hover {
  border-color: var(--secondary);
  box-shadow: 0 0 18px rgba(89, 226, 255, 0.4);
}

.account-message-button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.account-follow-button.is-following {
  color: var(--text-dark);
  border: 1px solid var(--border-color);
  background: transparent;
}

.account-follow-button.is-friend {
  color: #b7ffe3;
  border-color: rgba(57, 214, 154, 0.55);
  background: rgba(57, 214, 154, 0.12);
}

.account-follow-button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.account-profile-button {
  flex: 0 0 auto;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 7px 10px;
  color: var(--text-dark);
  background: transparent;
  font-size: 12px;
  cursor: pointer;
}

.account-profile-button:hover {
  border-color: var(--secondary);
}

.account-search-avatar,
.account-search-identity {
  cursor: pointer;
}

.account-search-avatar:focus-visible,
.account-search-identity:focus-visible,
.account-profile-button:focus-visible {
  outline: 2px solid var(--secondary);
  outline-offset: 2px;
}

.account-profile-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.78);
}

.account-profile-modal.active {
  display: flex;
}

.account-profile-dialog {
  position: relative;
  width: min(100%, 680px);
  max-height: min(90vh, 850px);
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 26px;
  color: var(--text-dark);
  background: var(--bg-dark);
}

.post-viewer-modal {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.88);
}

.post-viewer-modal.active {
  display: flex;
}

.post-viewer-content {
  position: relative;
  display: flex;
  width: min(100%, 1000px);
  max-height: 92vh;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #383838;
  border-radius: 14px;
  background: #111;
}

.post-viewer-close {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 0, 0, 0.65);
  font-size: 27px;
  line-height: 1;
  cursor: pointer;
}

.post-viewer-media {
  display: flex;
  min-height: 0;
  flex: 1;
  align-items: center;
  justify-content: center;
  background: #050505;
}

.post-viewer-media img,
.post-viewer-media video {
  display: block;
  width: 100%;
  max-height: 52vh;
  object-fit: contain;
}

.post-viewer-content {
  overflow-y: auto;
}

.post-viewer-social {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 16px 14px;
}

.post-viewer-like {
  align-self: flex-start;
  padding: 7px 16px;
  border: 1px solid rgba(255, 79, 163, 0.6);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.post-viewer-like.liked {
  background: linear-gradient(120deg, #ff3caa, #885cff);
  box-shadow: 0 0 14px rgba(255, 60, 170, 0.6);
}

.post-viewer-comments {
  display: flex;
  max-height: 140px;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  color: #ddd;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.post-viewer-comments strong {
  color: #ff8ccf;
}

.post-viewer-comment-form {
  display: flex;
  gap: 8px;
}

.post-viewer-comment-form input {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  border: 1px solid #444;
  border-radius: 999px;
  background: #1b1b1b;
  color: #fff;
}

.post-viewer-comment-form button {
  padding: 8px 16px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(120deg, #ff3caa, #885cff);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.post-viewer-comment-form button:disabled,
.post-viewer-comment-form input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.post-viewer-details {
  padding: 12px 16px;
  color: #fff;
}

.post-viewer-details p {
  margin-top: 4px;
  color: #c6c6c6;
  overflow-wrap: anywhere;
}

.account-profile-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  color: var(--text-dark);
  background: var(--card-dark);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.account-profile-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding-right: 34px;
}

.account-profile-avatar.has-story {
  box-shadow: 0 0 0 3px #0b0b14, 0 0 0 6px #f5c451, 0 0 16px 6px rgba(245, 196, 81, 0.55);
}

.account-story-button {
  margin: 10px 0 0;
  padding: 8px 16px;
  border: 1px solid #f5c451;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff4fa3, #7a5cff);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.account-profile-avatar {
  width: 68px;
  height: 68px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border: 2px solid var(--secondary);
  border-radius: 50%;
  color: #fff;
  background: var(--primary);
  font-size: 25px;
  font-weight: 700;
}

.account-profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.account-profile-identity {
  min-width: min(150px, 100%);
  flex: 1 1 150px;
}

.account-profile-identity h2 {
  overflow-wrap: break-word;
  word-break: normal;
  font-size: 20px;
}

.account-profile-identity p {
  color: var(--text-muted);
}

.account-profile-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  margin: 20px 0 12px;
  padding: 12px 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 13px;
}

.account-profile-stats strong {
  color: var(--text-dark);
}

.account-profile-bio {
  margin: 12px 0 18px;
  overflow-wrap: anywhere;
}

.account-profile-posts-heading {
  margin: 18px 0 10px;
  font-size: 16px;
}

.account-profile-status,
.account-profile-private-note {
  padding: 18px 0;
  color: var(--text-muted);
  font-size: 13px;
}

.account-profile-post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}

.account-profile-post {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 8px;
  background: #080808;
  cursor: zoom-in;
}

.account-profile-post-media {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.account-profile-video-indicator {
  position: absolute;
  top: 8px;
  right: 8px;
  color: #fff;
  text-shadow: 0 1px 5px #000;
}

.mobile-nav {
  display: none;
}

.people-page {
  align-items: center;
}

.people-page-header {
  width: 100%;
  align-items: center;
  flex-wrap: wrap;
}

.people-page-header h1 {
  font-size: 23px;
}

.people-page-header p {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 13px;
}

.people-page .account-search {
  width: min(100%, 470px);
}

.people-search-results {
  position: static;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr));
  align-content: start;
  gap: 12px;
  width: min(calc(100% - 48px), 900px);
  max-height: none;
  margin: 20px auto;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.people-search-results .account-search-result {
  min-width: 0;
  min-height: 76px;
  padding: 12px;
}

.people-search-results .account-search-message {
  grid-column: 1 / -1;
  margin: 14px 0;
  text-align: center;
}
.has-emoji-picker {
  flex-wrap: wrap;
}

.emoji-toggle {
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 1px solid rgba(190, 120, 255, 0.5);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.emoji-panel {
  flex: 0 0 100%;
  overflow: hidden;
  border: 1px solid rgba(190, 120, 255, 0.45);
  border-radius: 12px;
  background: #1a1030;
  box-shadow: 0 0 16px rgba(168, 72, 255, 0.35);
}

.emoji-panel[hidden] {
  display: none;
}

.emoji-tabs {
  display: flex;
  overflow-x: auto;
  border-bottom: 1px solid rgba(190, 120, 255, 0.3);
}

.emoji-tabs button {
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 0;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
}

.emoji-tabs button.active {
  background: rgba(168, 72, 255, 0.35);
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(34px, 1fr));
  max-height: 150px;
  overflow-y: auto;
  padding: 6px;
}

.emoji-grid button {
  padding: 4px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 21px;
  cursor: pointer;
}

.emoji-grid button:hover {
  background: rgba(255, 255, 255, 0.14);
}
