/* Draw the cross geometrically; font glyph baselines do not center visually. */
.modal-close-btn {
  box-sizing: border-box;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  gap: 0 !important;
  font-size: 0 !important;
  line-height: 0 !important;
  letter-spacing: 0 !important;
  text-indent: 0 !important;
}
.modal-close-btn::before {
  content: "";
  display: block;
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  margin: 0;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 4 8 8m0-8-8 8' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 4 8 8m0-8-8 8' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.modal-close-btn > svg,
.modal-close-btn > span { display: none !important; }
.primary-nav .nav-link svg{width:21px;height:21px;flex-shrink:0}.primary-nav [hidden]{display:none!important}.more-toggle{width:100%;border:0;background:transparent;font:inherit;text-align:left;cursor:pointer}.menu-count,.notification-badge{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 4px;border-radius:20px;background:var(--primary,#2d6a4f);color:white;font-size:10px;line-height:1}.menu-count{margin-left:auto}.unread-dot{width:7px;height:7px;flex-shrink:0;border-radius:50%;background:#52b788;margin-left:auto}.notification-badge{width:auto;top:1px;right:0;border:2px solid var(--bg-card,#fff)}
.author-details,.comm-details,.dropdown-user-header,.modal-user-info>div{display:flex;flex-direction:column;gap:2px!important}.author-name,.comm-title,.trend-title{margin-bottom:0!important;line-height:1.25}.author-bio,.comm-stats{margin-top:0!important;line-height:1.3}.author-bio{display:flex;gap:6px;align-items:center}.author-bio a{color:inherit;text-decoration:none}.author-name{cursor:pointer}.author-name:hover,.author-bio a:hover{text-decoration:underline}.feed-tabs-row,.feed-tabs{justify-content:center!important}.feed-tabs{margin:auto}.post-tags a,.post-tags span,.post-tag,.hashtag{background:transparent!important;color:var(--text-secondary,#7b8580)!important;padding-left:0!important;padding-right:0!important;border:0!important}
.feed-post{aspect-ratio:auto;display:flex;flex-direction:column;overflow:hidden}.feed-post>.post-content{flex:1;min-height:0;overflow:visible}.feed-post .single-image-wrapper,.feed-post .post-slider-wrapper,.feed-post .video-post-media{max-height:65%;min-height:0}.feed-post .single-image-wrapper img,.published-media{width:100%;max-height:420px;object-fit:cover}.feed-post>.post-footer,.feed-post>.post-actions{flex-shrink:0}.post-header-right{max-width:44%}.badge-category-pill{white-space:normal!important;text-align:center}.post-header{flex-shrink:0}.community-overflow,.community-picker{position:relative}.community-overflow summary{cursor:pointer;list-style:none;color:var(--primary,#2d6a4f);font-weight:600}.community-options{position:absolute;top:calc(100% + 8px);left:0;z-index:40;min-width:230px;padding:10px;background:var(--bg-card,#fff);color:var(--text-main,#20382c);border:1px solid var(--border-light,#dce5df);border-radius:12px;box-shadow:0 8px 30px #0002;max-height:260px;overflow:auto}.community-options a,.community-options label{display:flex;gap:9px;padding:9px;text-decoration:none;font-size:13px}.community-search{width:100%;box-sizing:border-box;padding:9px;border:1px solid #cddbd2;border-radius:8px;margin-bottom:5px}
.modal-close-btn,[class*="close-btn"],[class*="close-button"]{display:inline-flex!important;align-items:center!important;justify-content:center!important;padding:0!important;line-height:1!important;flex-shrink:0}.modal-close-btn svg,[class*="close-btn"] svg{display:block;margin:0!important;width:18px;height:18px}.modal-close-btn{width:32px;height:32px}.comment-modal-dialog{border:0!important;outline:0!important;box-shadow:0 20px 80px #0005}.comment-text-box{line-height:1.5}.comment-text-box strong{display:block;margin-bottom:3px}.comment-item-row{margin-bottom:18px}.comment-item-row.is-reply{margin-left:42px;padding-left:14px;border-left:2px solid var(--border-light,#dce5df)}
#repostModal{align-items:flex-end;padding:0}.repost-modal-card{width:min(100%,560px);margin:0 auto;border-radius:22px 22px 0 0;transform:translateY(100%);transition:transform .25s ease;padding-bottom:max(20px,env(safe-area-inset-bottom))}#repostModal.show .repost-modal-card{transform:translateY(0)}
#fakePostInput{display:block;cursor:text;padding:12px 14px;flex:1;min-width:0}#inlinePostEditor{min-height:40px;outline:none;overflow-wrap:anywhere}#inlinePostEditor:empty:before{content:attr(data-placeholder);color:var(--text-secondary,#7b8580)}.expanded #inlinePostEditor{min-height:110px}.format-toolbar{display:flex;gap:5px;border-bottom:1px solid var(--border-light,#dce5df);padding-bottom:7px;margin-bottom:10px}.format-toolbar[hidden],.composer-settings[hidden],.poll-editor[hidden]{display:none}.format-toolbar button{border:0;background:transparent;color:inherit;cursor:pointer;padding:5px 9px;border-radius:5px}.format-toolbar button:hover{background:#52b78822}.composer-settings{padding:0 20px 14px;display:flex;gap:12px;align-items:center;flex-wrap:wrap}.community-picker summary{cursor:pointer;border:1px solid var(--border-light,#dce5df);border-radius:8px;padding:8px 10px;font-size:12px}.category-select{display:flex;gap:6px;align-items:center;font-size:12px}.category-select select{max-width:190px;border:1px solid var(--border-light,#dce5df);border-radius:8px;background:var(--bg-card,#fff);color:inherit;padding:8px}.post-type-btn svg{width:19px;height:19px}.post-type-btn{gap:6px}.attachment-preview{width:100%;font-size:12px;overflow-wrap:anywhere}.poll-editor{width:100%;display:flex;flex-wrap:wrap;gap:8px}.poll-editor input{border:1px solid #cddbd2;border-radius:7px;padding:9px;background:var(--bg-card,#fff);color:inherit}.published-poll{display:grid;gap:8px;margin:15px 0}.published-poll button{padding:12px;border:1px solid #52b788;border-radius:8px;background:transparent;color:inherit;text-align:left;cursor:pointer}.published-poll .active{background:#52b78822}
/* ================= INSTAGRAM-STYLE FULL-SCREEN STORY VIEWER ================= */
#storyModal {
  position: fixed;
  inset: 0;
  background: #090e0b;
  z-index: 99999;
  display: none;
  flex-direction: column;
  overflow: hidden;
  user-select: none;
  padding: 0;
  margin: 0;
}
#storyModal.show {
  display: flex !important;
}
.story-screen-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 100;
  background: linear-gradient(to bottom, rgba(0,0,0,0.65) 0%, transparent 100%);
  box-sizing: border-box;
}
.story-brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #ffffff;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.3px;
}
.story-screen-close-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.story-brand-logo .brand-text { color:#fff; }
.story-screen-close-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.06);
}
.story-screen-close-btn svg {
  width: 20px;
  height: 20px;
}
.story-stage-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  width: 100%;
  height: 100%;
  padding: 60px 20px 20px;
  box-sizing: border-box;
  position: relative;
}
.story-adjacent-card {
  width: 240px;
  height: 426px;
  border-radius: 18px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  opacity: 0.42;
  filter: brightness(0.65) blur(1px);
  transform: scale(0.9);
  transition: all 0.25s cubic-bezier(0.2, 0, 0, 1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  flex-shrink: 0;
  background: #1a261f;
}
.story-adjacent-card:hover {
  opacity: 0.75;
  filter: brightness(0.85);
  transform: scale(0.93);
}
.story-adjacent-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.story-adjacent-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.65) 0%, transparent 60%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.story-adjacent-user-bubble {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #ffffff;
}
.story-adjacent-user-bubble img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid #52b788;
  object-fit: cover;
}
.story-adjacent-user-bubble span {
  font-size: 13px;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}
.story-stage-arrow {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0,0,0,0.4);
  transition: all 0.18s ease;
  flex-shrink: 0;
  z-index: 10;
}
.story-stage-arrow:hover {
  background: rgba(255, 255, 255, 0.4);
  transform: scale(1.1);
}
.story-stage-arrow svg {
  width: 18px;
  height: 18px;
}
.story-modal-content {
  width: min(420px, calc((100vh - 120px) * 0.5625)) !important;
  height: min(740px, calc(100vh - 120px)) !important;
  max-height: 820px !important;
  border-radius: 20px !important;
  overflow: hidden !important;
  position: relative !important;
  display: flex !important;
  flex-direction: column !important;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.85) !important;
  background: #111e17 !important;
  flex-shrink: 0 !important;
  margin: 0 !important;
}
.story-progress-bar {
  position: absolute;
  top: 12px;
  left: 14px;
  right: 14px;
  display: flex;
  gap: 4px;
  z-index: 20;
  height: 2.5px;
}
.story-progress-seg {
  flex: 1;
  height: 100%;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.35);
  overflow: hidden;
  position: relative;
}
.story-progress-seg-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background: #ffffff;
}
.story-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 24px 16px 28px !important;
  background: linear-gradient(to bottom, rgba(0,0,0,0.72) 0%, transparent 100%) !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 15;
  color: #ffffff;
}
.story-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.modal-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid rgba(255, 255, 255, 0.8);
}
.story-header-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.story-header-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.2;
}
.story-author-name {
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
}
.story-verified-badge {
  font-size: 11px;
  color: #52b788;
  font-weight: 800;
}
.story-time-ago {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}
.story-audio-info {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.85) !important;
}
.audio-waves-icon {
  font-size: 10px;
  letter-spacing: -1px;
  color: #52b788;
}
#storyModalTitle {
  color: rgba(255, 255, 255, 0.85) !important;
  text-decoration: none !important;
}
.story-header-right {
  display: flex;
  align-items: center;
  gap: 6px;
}
.story-ctrl-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  padding: 6px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.9;
  transition: opacity 0.15s, transform 0.15s;
}
.story-ctrl-btn:hover {
  opacity: 1;
  transform: scale(1.1);
}
.story-ctrl-btn svg {
  width: 18px;
  height: 18px;
}
.story-media-view {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 1;
  background: #0d1a14;
}
.story-media-view img,
.story-media-view video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.story-response {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 34px 16px 18px !important;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 60%, transparent 100%) !important;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 15;
  margin: 0;
}
.story-response::before {
  display: none !important;
}
.story-input-container {
  flex: 1;
  min-width: 0;
}
.story-input-container input {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.42) !important;
  border-radius: 28px !important;
  padding: 11px 18px !important;
  font-size: 13.5px !important;
  color: #ffffff !important;
  outline: none !important;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: border-color 0.2s, background 0.2s;
}
.story-input-container input:focus {
  border-color: rgba(255, 255, 255, 0.85) !important;
  background: rgba(255, 255, 255, 0.14) !important;
}
.story-input-container input::placeholder {
  color: rgba(255, 255, 255, 0.65) !important;
}
.story-actions-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.story-react,
.story-send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: transparent !important;
  border: none !important;
  color: #ffffff !important;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0 !important;
  transition: transform 0.15s, color 0.15s;
}
.story-send:hover {
  transform: scale(1.15);
}
.story-react svg {
  width: 18px;
  height: 18px;
}
.story-send svg {
  width: 22px;
  height: 22px;
}
@media (max-width: 900px) {
  .story-adjacent-card {
    display: none;
  }
  .story-stage-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
  }
  .btn-stage-prev {
    left: 12px;
  }
  .btn-stage-next {
    right: 12px;
  }
}
@media (max-width: 500px) {
  .story-modal-content {
    width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
  }
  .story-stage-container {
    padding: 0;
  }
  .story-stage-arrow {
    display: none;
  }
  .story-screen-header {
    background: linear-gradient(to bottom, rgba(0,0,0,0.8) 0%, transparent 100%);
  }
}
.create-story-card{width:min(880px,96vw);max-height:94vh;overflow-y:auto;padding:28px 32px;border-radius:26px;background:var(--bg-card,#fbf9f5);color:var(--text-main,#20382c);box-shadow:0 24px 64px rgba(0,0,0,0.28);border:1px solid var(--border-light,#e4ece7)}
[data-theme="dark"] .create-story-card{background:#17241d;color:#e5ece8;border-color:#27382f}
.story-create-heading{display:flex;align-items:flex-start;justify-content:space-between;border-bottom:1px solid var(--border-light,#e5ede8);padding-bottom:16px;gap:16px}
.story-create-heading-left h2{font-size:22px;font-weight:800;margin:0;display:inline-flex;align-items:center;gap:10px;color:inherit}
.network-badge{font-size:10px;font-weight:800;letter-spacing:0.6px;padding:3px 9px;border-radius:20px;border:1px solid var(--border-light,#cfdad3);color:var(--text-secondary,#52665b);background:rgba(0,0,0,0.03);vertical-align:middle}
[data-theme="dark"] .network-badge{background:rgba(255,255,255,0.06);border-color:#384d41;color:#a4b8ad}
.story-create-heading-left p{font-size:13px;margin:6px 0 0 0;color:var(--text-secondary,#6b7c72)}
.story-create-heading .modal-close-btn{position:static!important;width:32px;height:32px;border-radius:50%;background:rgba(0,0,0,0.05);border:1px solid var(--border-light,#dce4df);cursor:pointer;transition:background 0.15s}
.story-create-heading .modal-close-btn:hover{background:rgba(0,0,0,0.1)}
[data-theme="dark"] .story-create-heading .modal-close-btn{background:rgba(255,255,255,0.08);border-color:#2e4136}
.story-create-layout{display:grid;grid-template-columns:290px 1fr;gap:36px;padding:24px 0 20px 0;align-items:start}
.story-preview-column{display:flex;flex-direction:column;align-items:center}
.story-preview-stage{display:flex;align-items:center;justify-content:center;gap:10px;width:100%}
.preview-nav-arrow{width:34px;height:34px;border-radius:8px;border:1px solid var(--border-light,#dce5df);background:var(--bg-card,#ffffff);color:var(--text-main,#20382c);display:flex;align-items:center;justify-content:center;cursor:pointer;box-shadow:0 2px 6px rgba(0,0,0,0.04);transition:transform 0.15s,background 0.15s;flex-shrink:0}
.preview-nav-arrow:hover{transform:scale(1.05);background:#f0f5f2}
[data-theme="dark"] .preview-nav-arrow{background:#203027;border-color:#314438;color:#e5ece8}
.preview-nav-arrow svg{width:16px;height:16px}
.create-story-preview{position:relative;width:216px;height:384px;border-radius:24px;overflow:hidden;background:#112018;box-shadow:0 14px 34px rgba(12,28,20,0.22);flex-shrink:0}
.create-story-preview img,.create-story-preview video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.preview-progress-bars{position:absolute;top:10px;left:12px;right:12px;display:flex;gap:4px;z-index:4}
.preview-progress-bar{height:2.5px;flex:1;border-radius:2px;background:rgba(255,255,255,0.4);transition:background 0.2s}
.preview-progress-bar.active{background:#ea580c}
.preview-author-header{position:absolute;top:18px;left:12px;right:12px;display:flex;align-items:center;gap:8px;z-index:4;color:#ffffff;text-shadow:0 1px 3px rgba(0,0,0,0.6)}
.preview-avatar-circle{width:26px;height:26px;border-radius:50%;border:1.5px solid rgba(255,255,255,0.8);object-fit:cover}
.preview-author-meta{display:flex;flex-direction:column;line-height:1.15}
.preview-author-meta strong{font-size:11.5px;font-weight:700;color:#ffffff}
.preview-author-meta span{font-size:9.5px;color:rgba(255,255,255,0.85)}
.preview-bottom-actions{position:absolute;bottom:0;left:0;right:0;padding:26px 12px 12px;background:linear-gradient(to top,rgba(0,0,0,0.7) 0%,rgba(0,0,0,0) 100%);display:flex;align-items:center;gap:8px;z-index:4}
.preview-fake-reply{flex:1;background:rgba(255,255,255,0.16);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);border:1px solid rgba(255,255,255,0.28);border-radius:20px;padding:6px 12px;font-size:10.5px;color:rgba(255,255,255,0.85);white-space:nowrap}
.preview-reaction-mushroom{width:30px;height:30px;border-radius:8px;border:1px solid rgba(255,255,255,0.3);background:rgba(255,255,255,0.16);backdrop-filter:blur(8px);display:flex;align-items:center;justify-content:center;color:#ffffff;flex-shrink:0}
.preview-reaction-mushroom svg{width:17px;height:17px}
.preview-footer-label{text-align:center;margin-top:10px;line-height:1.35}
.preview-footer-label .title{display:block;font-size:12.5px;color:var(--text-secondary,#6b7c72)}
.preview-footer-label .counter{font-size:12.5px;font-weight:700;color:var(--text-main,#20382c)}
.story-edit-column{display:flex;flex-direction:column;gap:16px}
.story-upload-box{display:flex;flex-direction:column;align-items:center;text-align:center;border:2px dashed var(--border-light,#cfdad3);border-radius:18px;background:rgba(255,255,255,0.5);padding:24px 18px;cursor:pointer;transition:border-color 0.15s,background 0.15s}
.story-upload-box:hover{border-color:#52b788;background:rgba(82,183,136,0.04)}
[data-theme="dark"] .story-upload-box{background:rgba(255,255,255,0.02);border-color:#2e4236}
.story-upload-box .upload-cloud-icon{width:38px;height:38px;color:var(--text-main,#20382c);margin-bottom:6px}
.story-upload-box strong{font-size:14.5px;font-weight:700;color:var(--text-main,#20382c)}
.story-upload-box span.hint{font-size:11.5px;color:var(--text-secondary,#73847a);margin:3px 0 10px 0}
.btn-select-files-pill{display:inline-flex;align-items:center;gap:8px;background:#1e4a38;color:#ffffff;padding:8px 20px;border-radius:24px;font-size:12.5px;font-weight:700;box-shadow:0 3px 10px rgba(30,74,56,0.2)}
.btn-select-files-pill svg{width:15px;height:15px}
.story-thumbnails-strip{display:flex;gap:10px;align-items:center;overflow-x:auto;padding:4px 2px}
.story-thumb-card{width:76px;height:76px;border-radius:14px;overflow:hidden;position:relative;cursor:pointer;border:2px solid transparent;flex-shrink:0;background:#1b2e23;transition:transform 0.15s,border-color 0.15s;padding:0}
.story-thumb-card:hover{transform:translateY(-2px)}
.story-thumb-card.active{border-color:#ea580c!important;box-shadow:0 0 0 2px #ea580c,0 4px 12px rgba(234,88,12,0.28)}
.story-thumb-card img,.story-thumb-card video{width:100%;height:100%;object-fit:cover;display:block}
.story-thumb-card .thumb-remove-btn{position:absolute;top:3px;right:3px;width:18px;height:18px;border-radius:50%;background:rgba(0,0,0,0.7);color:#fff;border:none;font-size:10px;display:none;align-items:center;justify-content:center;cursor:pointer}
.story-thumb-card:hover .thumb-remove-btn{display:flex}
.story-thumb-frame { position: relative; flex: 0 0 76px; width: 76px; height: 90px; }
.story-thumb-frame > .thumb-remove-btn { position: absolute; z-index: 2; top: 2px; right: 2px; display: flex; align-items: center; justify-content: center; width: 26px; height: 26px; padding: 5px; border: 1px solid #ffffff80; border-radius: 50%; background: #000b; color: #fff; cursor: pointer; }
.story-thumb-frame > .thumb-remove-btn:hover { background: #000; }
.story-thumb-frame > .thumb-remove-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.story-options-menu { position: absolute; top: 70px; right: 12px; z-index: 150; width: min(235px,calc(100% - 24px)); padding: 6px; border: 1px solid var(--border-light); border-radius: 12px; background: var(--bg-card); color: var(--text-main); box-shadow: var(--shadow-modal); }
.story-options-menu button { display: block; width: 100%; min-height: 44px; padding: 10px 12px; border: 0; border-radius: 7px; background: transparent; color: inherit; font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.story-options-menu button:hover,.story-options-menu button:focus-visible { background: var(--bg-hover); }
#storyModal .story-ctrl-btn { min-width: 36px; min-height: 44px; }
#storyModal .story-header-left { min-width: 0; }
#storyModal .story-header-meta { min-width: 0; }
#storyModal .story-header-right { flex-shrink: 0; gap: 2px; }
#storyModalUsername,#storyModalAvatar { cursor: pointer; }
.toast-container { z-index: 100001 !important; pointer-events: none; }
.story-add-thumb-card{width:76px;height:76px;border-radius:14px;border:1.5px solid var(--border-light,#cfdad3);background:rgba(255,255,255,0.6);display:flex;align-items:center;justify-content:center;cursor:pointer;flex-shrink:0;color:var(--text-main,#20382c);transition:background 0.15s,border-color 0.15s;font-size:26px;line-height:1}
.story-add-thumb-card:hover{background:#eef5f1;border-color:#52b788}
[data-theme="dark"] .story-add-thumb-card{background:rgba(255,255,255,0.03);border-color:#2e4236}
.story-music-group{margin-top:4px}
.story-music-title{font-size:12.5px;font-weight:700;color:var(--text-main,#20382c);margin-bottom:7px;display:flex;align-items:center;gap:6px}
.story-music-pill-trigger{width:100%;box-sizing:border-box;display:flex;align-items:center;justify-content:space-between;padding:10px 14px;border-radius:20px;border:1px solid var(--border-light,#cfdad3);background:var(--bg-card,#ffffff);cursor:pointer;transition:border-color 0.15s,box-shadow 0.15s}
.story-music-pill-trigger:hover{border-color:#52b788;box-shadow:0 2px 8px rgba(0,0,0,0.04)}
[data-theme="dark"] .story-music-pill-trigger{background:#1d2d24;border-color:#2c4033}
.music-pill-left{display:flex;align-items:center;gap:8px;font-size:12.5px;color:var(--text-main,#20382c);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.music-pill-left .music-glyph{font-size:14px;color:#2d6a4f}
[data-theme="dark"] .music-pill-left .music-glyph{color:#74c69d}
.music-pill-right{display:flex;align-items:center;gap:6px;flex-shrink:0}
.btn-music-mini{background:none;border:none;cursor:pointer;color:var(--text-secondary,#6b7c72);padding:2px 6px;border-radius:4px;font-size:13px;display:flex;align-items:center;justify-content:center}
.btn-music-mini:hover{background:rgba(0,0,0,0.06);color:var(--text-main,#20382c)}
.music-chevron-arrow{font-size:16px;color:var(--text-secondary,#7c8e84);line-height:1}
.music-library-drawer{margin-top:8px;border:1px solid var(--border-light,#cfdad3);border-radius:16px;background:var(--bg-card,#ffffff);box-shadow:0 8px 24px rgba(0,0,0,0.08);overflow:hidden}
[data-theme="dark"] .music-library-drawer{background:#192720;border-color:#2b3e32}
.music-search-wrap{padding:10px 12px;border-bottom:1px solid var(--border-light,#e2eae5)}
.music-search-wrap input{width:100%;box-sizing:border-box;padding:8px 12px;border-radius:10px;border:1px solid var(--border-light,#cfdad3);font-size:12px;background:rgba(0,0,0,0.02);color:inherit;outline:none}
.music-search-wrap input:focus{border-color:#52b788}
.music-tracks-scroll{max-height:190px;overflow-y:auto;padding:4px 0}
.music-track-item{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;cursor:pointer;transition:background 0.12s;border-bottom:1px solid rgba(0,0,0,0.03)}
.music-track-item:hover{background:rgba(82,183,136,0.08)}
.music-track-item.selected{background:rgba(82,183,136,0.14)}
.track-item-left{display:flex;align-items:center;gap:10px}
.btn-play-preview{width:26px;height:26px;border-radius:50%;background:#2d6a4f;color:#ffffff;border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:11px;flex-shrink:0}
.btn-play-preview.playing{background:#ea580c}
.track-item-info{display:flex;flex-direction:column}
.track-item-title{font-size:12px;font-weight:700;color:var(--text-main,#20382c)}
.track-item-genre{font-size:10.5px;color:var(--text-secondary,#6b7c72)}
.btn-select-track{padding:4px 10px;font-size:11px;font-weight:600;border-radius:12px;border:1px solid #52b788;background:transparent;color:#2d6a4f;cursor:pointer}
.music-track-item.selected .btn-select-track{background:#2d6a4f;color:#fff}
[data-theme="dark"] .btn-select-track{color:#74c69d;border-color:#74c69d}
[data-theme="dark"] .music-track-item.selected .btn-select-track{background:#52b788;color:#0d1e15}
.story-create-footer{border-top:1px solid var(--border-light,#e4ede8);padding-top:16px;display:flex;gap:10px;justify-content:flex-end;align-items:center}
.btn-cancel-story{border:1px solid var(--border-light,#cfdad3);background:var(--bg-card,#ffffff);color:var(--text-main,#20382c);padding:9px 22px;border-radius:20px;font-size:13px;font-weight:600;cursor:pointer}
.btn-submit-story{border:none;background:#1e4a38;color:#ffffff;padding:9px 24px;border-radius:20px;font-size:13px;font-weight:700;cursor:pointer;box-shadow:0 4px 12px rgba(30,74,56,0.22);transition:opacity 0.15s,transform 0.15s}
.btn-submit-story:hover{opacity:0.95;transform:translateY(-1px)}
@media(max-width:650px){.create-story-card{padding:18px 14px;border-radius:20px}.story-create-layout{grid-template-columns:1fr;gap:20px}.create-story-preview{width:170px;height:300px}.story-upload-box{padding:16px}.story-neighbor{display:none}.story-prev{left:5px}.story-next{right:5px}.story-arrow{background:#0008}.composer-settings{padding:0 12px 12px}.create-post-actions{gap:6px}.post-type-btn{padding:6px;font-size:11px}.feed-post{aspect-ratio:auto}.post-header-right{max-width:38%}.author-name{font-size:12px!important}.badge-category-pill{font-size:9px!important}.story-create-heading-left h2{font-size:18px}.network-badge{display:inline-block;margin-top:5px}}

/* Inline composer: a rectangular writing surface with an aligned control row. */
.create-post-card .create-post-top { align-items: flex-start; margin-bottom: 14px; }
.create-post-card .create-post-top > .user-avatar,
.create-post-card .create-post-top > .guest-avatar-placeholder { margin-top: 8px; }
.create-post-card #fakePostInput {
  border-radius: 14px;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  padding: 12px 14px;
  color: var(--text-main);
  background: var(--bg-input);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.create-post-card #fakePostInput:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-tint);
}
.create-post-card #inlinePostEditor {
  min-height: 28px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  padding: 2px 0;
}
.create-post-card.expanded #inlinePostEditor { min-height: 116px; padding: 10px 2px 4px; }
.create-post-card .format-toolbar {
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 0 0 9px;
  margin: 0;
}
.create-post-card .format-toolbar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 9px;
  font-size: 13px;
  line-height: 1;
  color: var(--text-secondary);
}
.create-post-card .format-toolbar button b { font-weight: 700; }
.create-post-card .format-toolbar button i { font-style: italic; }
.create-post-card .format-toolbar button:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }
.create-post-card .composer-settings {
  margin-left: 54px;
  padding: 0 0 16px;
  gap: 10px;
  align-items: flex-start;
}
.create-post-card .community-picker { flex: 1 1 205px; min-width: 0; }
.create-post-card .community-picker summary {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 8px 11px;
  list-style: none;
  background: var(--bg-card);
  font-size: 12px;
}
.create-post-card .community-picker summary::-webkit-details-marker { display: none; }
.create-post-card .community-picker summary::after {
  content: '';
  width: 6px;
  height: 6px;
  margin-left: auto;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}
.create-post-card .community-picker[open] summary::after { transform: translateY(2px) rotate(225deg); }
.create-post-card .category-select { flex: 1 1 220px; align-items: center; min-height: 38px; gap: 8px; color: var(--text-secondary); }
.create-post-card .category-select select { flex: 1; min-width: 0; max-width: none; min-height: 38px; font: inherit; color: var(--text-main); padding: 8px 10px; }
.create-post-card .community-options { min-width: 100%; width: max-content; max-width: min(320px,calc(100vw - 70px)); }
.create-post-card .community-options label { align-items: center; line-height: 1.4; }
.create-post-card .community-options input[type='checkbox'] { width: 15px; height: 15px; flex-shrink: 0; accent-color: var(--primary); }
.create-post-card .attachment-preview:empty { display: none; }
.create-post-card .create-post-actions { gap: 12px; }
.create-post-card .media-type-buttons { gap: 8px; }
.create-post-card .post-type-btn { padding: 8px; white-space: nowrap; }
.create-post-card .btn-post-submit { min-height: 38px; white-space: nowrap; }
@media(max-width:650px) {
  .create-post-card { padding: 14px; }
  .create-post-card .composer-settings { margin-left: 0; gap: 10px; }
  .create-post-card .community-picker,
  .create-post-card .category-select { flex: 1 1 100%; }
  .create-post-card .create-post-actions { flex-wrap: wrap; gap: 10px; }
  .create-post-card .media-type-buttons { gap: 3px; flex-wrap: nowrap; }
  .create-post-card .post-type-btn { padding: 7px 5px; font-size: 12px; }
  .create-post-card .btn-post-submit { padding: 8px 14px; margin-left: auto; }
  .create-post-card .community-options { width: 100%; max-width: 100%; }
}

/* Posting destinations sit above the title and writing surface. */
.create-post-card .composer-writing-stack { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.create-post-card .composer-title-input,
.create-post-card .composer-hashtags-input {
  box-sizing: border-box;
  display: block;
  width: 100%;
  min-height: 40px;
  padding: 10px 13px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  background: var(--bg-input);
  color: var(--text-main);
  font: inherit;
  font-size: 13px;
  line-height: 1.4;
  outline: none;
}
.create-post-card .composer-title-input { font-weight: 600; }
.create-post-card .composer-title-input::placeholder,
.create-post-card .composer-hashtags-input::placeholder { color: var(--text-muted); font-weight: 400; }
.create-post-card .composer-title-input:focus,
.create-post-card .composer-hashtags-input:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--primary-tint); }
.create-post-card .composer-title-input[hidden],
.create-post-card .composer-hashtags-input[hidden] { display: none; }
.create-post-card .composer-settings { padding-bottom: 12px; align-items: center; }
.create-post-card .community-picker summary,
.create-post-card .category-select select {
  box-sizing: border-box;
  height: 40px;
  min-height: 40px;
  border-radius: 9px;
  border: 1px solid var(--border-light);
  background-color: var(--bg-card);
  color: var(--text-main);
  font-size: 12px;
  line-height: 18px;
}
.create-post-card .community-picker summary { padding: 10px 34px 10px 12px; position: relative; }
.create-post-card .community-picker summary::after { display: none; }
.create-post-card .community-picker summary::before,
.create-post-card .category-select::after {
  content: '';
  position: absolute;
  right: 13px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--text-secondary);
  border-bottom: 1.5px solid var(--text-secondary);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
.create-post-card .category-select { position: relative; }
.create-post-card .category-select select { appearance: none; -webkit-appearance: none; padding: 10px 34px 10px 12px; }
.create-post-card .community-picker[open] summary::before { transform: translateY(-25%) rotate(225deg); }
.create-post-card .selection-count:empty { display: none; }
.create-post-card .attachment-preview { order: 3; }
.create-post-card .poll-editor { order: 4; }

/* Apply the square ratio to media, while allowing post cards to fit their content. */
.feed-post {
  aspect-ratio: auto;
  height: auto;
  min-height: 0;
  overflow: visible;
}
.feed-post > .post-content {
  flex: 0 0 auto;
  min-height: 0;
  overflow: visible;
}
.feed-post .single-image-wrapper,
.feed-post .post-slider-wrapper,
.feed-post .video-media-card,
.feed-post .video-post-media {
  position: relative;
  width: 100%;
  height: 290px;
  min-height: 0;
  max-height: 290px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  flex-shrink: 0;
  border-radius: var(--radius-md, 12px);
  margin-bottom: 10px;
}
.feed-post .single-image-wrapper > img,
.feed-post .single-image-wrapper > video,
.feed-post .video-media-card > img,
.feed-post .video-media-card > video,
.feed-post .video-post-media > img,
.feed-post .video-post-media > video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-height: 290px;
  object-fit: cover;
  object-position: center;
}
.feed-post .post-slider-wrapper .slider-track-wrap { position: absolute; inset: 0; width: 100%; height: 100%; }
.feed-post .slider-slide-item { width: 100%; min-width: 100%; height: 100%; }
.feed-post .slider-slide-item img,
.feed-post .slider-slide-item video { display: block; width: 100%; height: 100%; max-height: none; object-fit: cover; object-position: center; }
.feed-post .published-media {
  display: block;
  width: 100%;
  height: auto;
  min-height: 0;
  max-height: none;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center;
  border-radius: var(--radius-md);
  margin: 14px 0;
}

/* Author header followed by full-width publishing controls. */
.create-post-card .composer-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.create-post-card .composer-identity .user-avatar,
.create-post-card .composer-identity .guest-avatar-placeholder { margin: 0; }
.create-post-card .composer-identity-name { min-width: 0; font-size: 14px; line-height: 1.3; color: var(--text-main); }
.create-post-card .composer-identity-name strong { font-weight: 600; }
.create-post-card .composer-settings { margin-left: 0; width: 100%; }
.create-post-card .create-post-top { display: block; width: 100%; }
.create-post-card .composer-writing-stack { width: 100%; }


/* Compact reference-inspired composer, retaining the Shrooms theme. */
.create-post-card .composer-identity { gap: 10px; flex-wrap: wrap; }
.create-post-card.expanded .composer-identity { padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--border-light); }
.create-post-card .composer-identity .community-picker { display: none; flex: 0 1 245px; margin-left: 2px; }
.create-post-card.expanded .composer-identity .community-picker { display: block; }
.create-post-card .composer-identity .community-picker summary { height: 32px; min-height: 32px; padding: 6px 30px 6px 10px; background-color: var(--primary-tint); border-color: var(--border-light); }
.create-post-card .selected-community-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.create-post-card .selection-count { flex-shrink: 0; font-size: 11px; font-weight: 600; color: var(--primary-light); }
.create-post-card .composer-dismiss { position: static; margin-left: auto; background: transparent; border-color: transparent; }
.create-post-card:not(.expanded) .composer-dismiss,
.create-post-card:not(.expanded) .composer-cancel { display: none !important; }
.create-post-card .composer-settings { padding-bottom: 12px; }
.create-post-card .category-select { flex: 0 1 auto; gap: 10px; font-size: 12px; }
.create-post-card .category-select select { flex: 0 1 auto; width: 210px; height: 34px; min-height: 34px; padding-top: 7px; padding-bottom: 7px; background-color: var(--bg-input); }
.create-post-card .composer-writing-stack { gap: 8px; }
.create-post-card .composer-title-input,
.create-post-card .composer-hashtags-input { min-height: 36px; padding: 8px 12px; border-radius: 8px; }
.create-post-card.expanded #fakePostInput { padding: 0; border-radius: 10px; background: transparent; border-color: transparent; box-shadow: none; }
.create-post-card .format-toolbar { padding: 0 0 7px; gap: 5px; }
.create-post-card .format-toolbar button { min-width: 32px; height: 30px; font-size: 14px; }
.create-post-card.expanded #inlinePostEditor { min-height: 100px; max-height: 300px; overflow-y: auto; margin-top: 8px; padding: 11px 12px; background: var(--bg-input); border: 1px solid var(--border-light); border-radius: 8px; }
.create-post-card.expanded #inlinePostEditor:focus { border-color: var(--border-focus); }
.create-post-card .media-type-buttons { margin-right: auto; }
.create-post-card .composer-cancel { padding: 8px 10px; font: inherit; font-size: 13px; font-weight: 600; color: var(--text-secondary); background: transparent; border: none; border-radius: 8px; cursor: pointer; }
.create-post-card .composer-cancel:hover { color: var(--text-main); background: var(--bg-hover); }
.create-post-card .btn-post-submit { border-radius: 10px; }
@media(max-width:650px) {
  .create-post-card .composer-identity { gap: 8px; }
  .create-post-card .composer-identity-name { font-size: 13px; }
  .create-post-card .composer-identity .community-picker { flex-basis: calc(100% - 42px); order: 4; margin-left: 0; }
  .create-post-card .composer-identity .community-picker summary { max-width: 100%; }
  .create-post-card .category-select { width: 100%; }
  .create-post-card .category-select select { width: auto; flex: 1; }
  .create-post-card .create-post-actions { column-gap: 6px; row-gap: 8px; }
  .create-post-card .composer-cancel { margin-left: auto; }
  .create-post-card .btn-post-submit { margin-left: 0; }
}

/* Keep the story preview clean and the music picker out of modal layout flow. */
.create-story-preview > #previewMediaImg,
.create-story-preview > #previewMediaVideo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#createStoryModal .story-music-group { position: relative; }
#createStoryModal .music-library-drawer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  margin: 0;
  z-index: 20;
  max-height: min(290px, 55dvh);
  overflow: hidden;
  box-shadow: 0 10px 32px rgba(0,0,0,.18);
  transform: none;
}
#createStoryModal .music-tracks-scroll { max-height: min(220px, calc(55dvh - 60px)); overscroll-behavior: contain; }
#createStoryModal .create-story-card { transition: none; }

/* Compact composer before opening: avatar and prompt on one row. */
.create-post-card:not(.expanded) {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  column-gap: 12px;
  row-gap: 12px;
}
.create-post-card:not(.expanded) .composer-identity {
  grid-column: 1;
  grid-row: 1;
  align-self: center;
  margin: 0;
}
.create-post-card:not(.expanded) .composer-identity-name { display: none; }
.create-post-card:not(.expanded) .create-post-top {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  align-self: center;
}
.create-post-card:not(.expanded) #fakePostInput { padding: 10px 14px; border-radius: 12px; }
.create-post-card:not(.expanded) #inlinePostEditor { min-height: 22px; padding: 0; line-height: 22px; }
.create-post-card:not(.expanded) .create-post-actions { grid-column: 1 / -1; }

/* Keep destination and category together below the author header. */
.create-post-card .composer-settings {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px 14px;
  align-items: center;
}
.create-post-card .composer-settings[hidden] { display: none; }
.create-post-card .composer-settings > .community-picker { display: block; min-width: 0; margin: 0; }
.create-post-card .composer-settings .community-picker summary { height: 38px; min-height: 38px; padding-top: 9px; padding-bottom: 9px; }
.create-post-card .composer-settings > .category-select { width: 100%; min-width: 0; min-height: 38px; }
.create-post-card .composer-settings .category-select select { width: 100%; min-width: 0; flex: 1; height: 38px; min-height: 38px; padding-top: 9px; padding-bottom: 9px; }
.create-post-card .composer-settings > .attachment-preview,
.create-post-card .composer-settings > .poll-editor { grid-column: 1 / -1; }
@media(max-width:450px) {
  .create-post-card .composer-settings { gap: 8px; }
  .create-post-card .composer-settings > .category-select { gap: 5px; }
  .create-post-card .composer-settings .community-picker summary,
  .create-post-card .composer-settings .category-select select { font-size: 11px; padding-left: 8px; padding-right: 25px; }
  .create-post-card .composer-settings .community-picker summary::before,
  .create-post-card .composer-settings .category-select::after { right: 10px; }
}

/* Persistent field labels explain each posting choice. */
.create-post-card .composer-destination-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.create-post-card .composer-field-label { display: block; color: var(--text-secondary); font-size: 12px; font-weight: 600; line-height: 16px; }
.create-post-card .composer-settings > .category-select { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 7px; }
.create-post-card .composer-settings .category-select select { flex: none; }
.create-post-card .composer-settings .category-select::after { top: auto; bottom: 16px; transform: rotate(45deg); }
.create-post-card .composer-destination-field .community-picker { width: 100%; min-width: 0; }

/* Insights and recent notifications slide in from the right. */
.activity-panel-backdrop,
#postAnalyticsModal.activity-panel-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
  padding: 0;
  background: rgba(8,20,13,.25);
  backdrop-filter: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .2s ease, visibility .2s ease;
}
.activity-panel-backdrop.show { opacity: 1; visibility: visible; pointer-events: auto; }
.activity-panel-card,
#postAnalyticsModal .analytics-modal-card {
  box-sizing: border-box;
  width: min(460px,100%);
  max-width: 100%;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  padding: 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: none;
  border-left: 1px solid var(--border-light);
  border-radius: 0;
  background: var(--bg-card);
  color: var(--text-main);
  box-shadow: -12px 0 40px #0002;
  animation: none;
  transform: translateX(100%);
  transition: transform .22s ease;
}
.activity-panel-backdrop.show .activity-panel-card,
#postAnalyticsModal.show .analytics-modal-card { transform: translateX(0); }
#postAnalyticsModal .analytics-modal-card { width: min(540px,100%); }
#postAnalyticsModal .analytics-modal-header { align-items: flex-start; gap: 12px; }
#postAnalyticsModal .analytics-modal-header h3 { font-size: 18px; line-height: 1.4; }
#postAnalyticsModal .analytics-header-pill { font-size: 10px; }
#postAnalyticsModal .analytics-kpi-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
#postAnalyticsModal .analytics-kpi-card { min-width: 0; }
.activity-panel-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 20px; border-bottom: 1px solid var(--border-light); }
.activity-panel-header h2 { font-size: 21px; margin: 0; line-height: 1.3; }
.activity-panel-header p { margin: 5px 0 0; color: var(--text-secondary); font-size: 13px; }
.activity-panel-actions { display: flex; gap: 8px; align-items: center; }
.activity-panel-actions .modal-close-btn { position: static; }
.notification-actions-menu { position: relative; }
.notification-actions-menu > summary { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; list-style: none; border-radius: 50%; cursor: pointer; color: var(--text-secondary); }
.notification-actions-menu > summary::-webkit-details-marker { display: none; }
.notification-actions-menu > summary:hover { background: var(--bg-hover); }
.notification-actions-menu svg { width: 20px; height: 20px; }
.notification-actions-list { position: absolute; top: calc(100% + 8px); right: 0; z-index: 5; min-width: 180px; padding: 6px; border: 1px solid var(--border-light); border-radius: 12px; background: var(--bg-card); box-shadow: 0 8px 25px #0002; }
.notification-actions-list button { display: block; width: 100%; padding: 11px 12px; background: transparent; border: 0; border-radius: 7px; text-align: left; color: var(--text-main); font: inherit; font-size: 13px; cursor: pointer; }
.notification-actions-list button:hover { background: var(--bg-hover); }
.notification-actions-list [data-notification-action='delete'] { color: #cc4444; }
.notification-period { padding: 18px 0 10px; font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.recent-notification { display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 15px 10px; margin-bottom: 5px; border: 0; border-radius: 12px; background: transparent; color: var(--text-main); font: inherit; text-align: left; cursor: pointer; }
.recent-notification.unread { background: var(--primary-tint); }
.recent-notification:hover { background: var(--bg-hover); }
.recent-notification img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.recent-notification-content { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; font-size: 13px; line-height: 1.5; }
.recent-notification-content time { font-size: 11px; color: var(--text-muted); }
.notification-unread-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary-light); flex-shrink: 0; margin-top: 7px; }
.notifications-empty { padding: 65px 15px; text-align: center; }
.notifications-empty strong { font-size: 16px; }
.notifications-empty p { margin-top: 8px; color: var(--text-secondary); font-size: 13px; }
@media(max-width:450px) { .activity-panel-card,#postAnalyticsModal .analytics-modal-card { padding: 20px 16px; } }
@media(prefers-reduced-motion:reduce) { .activity-panel-backdrop,.activity-panel-card,#postAnalyticsModal.activity-panel-backdrop,#postAnalyticsModal .analytics-modal-card { transition: none; } }
#postAnalyticsModal.activity-panel-backdrop.show { opacity: 1; visibility: visible; pointer-events: auto; }

/* Explicit placement prevents field order and inherited sizing from creating empty rows. */
.create-post-card.expanded .composer-settings {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0,1fr);
  grid-template-rows: auto;
  grid-auto-rows: min-content;
  align-items: start;
  align-content: start;
  height: auto;
  min-height: 0;
  margin: 0;
  padding: 0 0 12px;
  gap: 10px 14px;
}
.create-post-card .composer-settings > .composer-destination-field {
  grid-column: 1;
  grid-row: 1;
  order: 0;
  margin: 0;
  padding: 0;
}
.create-post-card .composer-settings > .category-select {
  grid-column: 2;
  grid-row: 1;
  order: 0;
  margin: 0;
  padding: 0;
  height: auto;
  min-height: 0;
  gap: 7px;
}
.create-post-card .composer-settings .composer-field-label { margin: 0; line-height: 16px; }
.create-post-card .composer-settings .community-picker summary,
.create-post-card .composer-settings .category-select select { box-sizing: border-box; margin: 0; width: 100%; height: 38px; min-height: 38px; max-height: 38px; }
.create-post-card .composer-settings > .attachment-preview:empty,
.create-post-card .composer-settings > .poll-editor[hidden] { display: none !important; }
.create-post-card .composer-settings > .attachment-preview,
.create-post-card .composer-settings > .poll-editor { height: auto; min-height: 0; margin: 0; }
@media(max-width:450px) { .create-post-card.expanded .composer-settings { gap: 10px 8px; } }

/* App-wide pill buttons, including controls created dynamically in panels. */
button,
a.btn,
a.icon-button,
[role="button"],
input[type="button"],
input[type="submit"],
input[type="reset"],
.story-upload-box .btn,
.story-upload .btn {
  border-radius: 9999px !important;
}
.create-post-card:not(.expanded) #fakePostInput {
  border-radius: 9999px !important;
  padding-left: 18px;
  padding-right: 18px;
}

/* Shared post popup corners keep create and edit consistent. */
:root { --post-popup-radius: 22px; }

/* The feed keeps a compact launcher while the complete editor opens in a popup. */
.composer-dialog { z-index: 10010; }
.composer-dialog > .create-post-card {
  width: min(680px,100%);
  max-height: min(90dvh,850px);
  margin: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: var(--post-popup-radius);
  box-shadow: var(--shadow-modal);
}
.composer-dialog .composer-identity { flex-wrap: nowrap; }
.composer-dialog .composer-dismiss { position: static; margin-left: auto; }
.create-post-launcher .composer-launch-prompt {
  display: block;
  width: 100%;
  padding: 12px 18px;
  min-height: 44px;
  border: 1px solid var(--border-light);
  background: var(--bg-input);
  color: var(--text-secondary);
  text-align: left;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.create-post-launcher .composer-launch-prompt:hover { background: var(--bg-hover); }
.composer-dialog .composer-cancel { margin-left: auto; }
@media(max-width:450px) { .composer-dialog { padding: 12px; } .composer-dialog > .create-post-card { max-height: 94dvh; padding: 16px; } }

/* Story media stays rectangular; the add tile is the only thumbnail action. */
#createStoryModal .preview-author-header .preview-avatar-circle { display: none !important; }
#createStoryModal .story-thumb-card,
#createStoryModal .story-add-thumb-card {
  width: 76px;
  height: 90px;
  border-radius: 10px !important;
  border: 1px solid var(--border-light) !important;
  box-shadow: none !important;
  flex-shrink: 0;
}
#createStoryModal .story-thumb-card.active {
  border-color: var(--primary-light) !important;
  box-shadow: none !important;
}
#createStoryModal .story-thumb-card img,
#createStoryModal .story-thumb-card video { border-radius: 0; width: 100%; height: 100%; object-fit: cover; }
#createStoryModal .thumb-remove-btn { display: flex !important; }
#createStoryModal .preview-progress-bar.active { background: #74c69d; }

/* A dropdown's old horizontal flex basis must not reserve vertical space in its label stack. */
.create-post-card .composer-destination-field > .community-picker {
  flex: none;
  height: auto;
  min-height: 0;
  margin: 0;
}

/* Match the header's center column to the feed between the two sidebars. */
@media(min-width:1101px) {
  .top-nav .nav-container {
    display: grid;
    grid-template-columns: 310px minmax(0,1fr) var(--sidebar-right-width);
    gap: 0;
    padding: 0;
  }
  .top-nav .header-left { min-width: 0; padding-left: 24px; }
  .top-nav .search-wrapper {
    width: calc(100% - 48px);
    max-width: 680px;
    min-width: 0;
    justify-self: center;
  }
  .top-nav .nav-actions { justify-self: end; padding-right: 24px; gap: 10px; }
}

/* Use the same surface for both post destination controls. */
.create-post-card .composer-settings .category-select select {
  background-color: var(--bg-card);
}

/* Quiet dividers and topic-specific line icons keep trending hashtags tidy. */
.trending-list .trending-item {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 12px 0;
  border-radius: 0;
}
.trending-list .trending-item + .trending-item { border-top: 1px solid var(--border-light); }
.trending-list .trend-info { flex: 1; min-width: 0; }
.trending-list .trend-topic-icon { display: flex; align-items: center; justify-content: center; flex: 0 0 28px; width: 28px; height: 28px; margin-left: auto; color: var(--text-muted); opacity: .7; }
.trending-list .trend-topic-icon svg { display: block; width: 23px; height: 23px; }

/* Compact hashtag rows below Suggested People. */
.trending-list { gap: 0; }
.trending-list .trending-item { padding: 7px 0; }
.trending-list .trend-info { gap: 1px; line-height: 1.25; }
.trending-list .trend-count { font-size: 11px; }
.trending-list .trend-topic-icon { width: 24px; height: 24px; flex-basis: 24px; }
.trending-list .trend-topic-icon svg { width: 20px; height: 20px; }

/* Cross-post destinations stay compact and easy to scan. */
.community-overflow > summary { display: inline-flex; align-items: center; min-height: 22px; padding: 0 3px; font-size: 12px; }
.community-overflow > summary::-webkit-details-marker { display: none; }
.community-overflow .community-options { min-width: 230px; max-width: min(300px,calc(100vw - 48px)); }
.community-overflow .community-options a { line-height: 1.4; border-radius: 6px; }
.community-overflow .community-options a:hover { background: var(--bg-hover); text-decoration: none; }
.communities-grid.selected-community-grid { grid-template-columns: minmax(0,1fr); }
.communities-grid .community-card-hero[hidden] { display: none; }

/* Balance the home feed with equal sidebars when both columns are visible. */
@media(min-width:1101px) {
  body { --sidebar-left-width: 310px; }
}

/* Consistent icon spacing for feed post menu actions. */
.post-dropdown-menu .report-post,
.post-dropdown-menu .hide-post { display: flex; align-items: center; gap: 10px; }
.post-dropdown-menu .report-post svg,
.post-dropdown-menu .hide-post svg { width: 17px; height: 17px; flex: 0 0 17px; color: var(--text-secondary); }

.btn-join.requested,
.btn-join.requested:disabled {
  opacity: 1;
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-light);
  font-weight: 600;
  cursor: default;
  white-space: nowrap;
  animation: join-request-feedback .3s cubic-bezier(.2,.7,.3,1);
}
.infeed-comm-card .btn-join.requested,
.infeed-comm-card .btn-join.requested:disabled {
  opacity: 1;
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-light);
}
[data-theme="dark"] .btn-join.requested,
[data-theme="dark"] .btn-join.requested:disabled {
  background: var(--bg-card);
  color: var(--text-main);
  border-color: var(--border-light);
}
.infeed-comm-card:has(.btn-join.requested),
.infeed-comm-card:has(.btn-join.requested):hover {
  background:var(--bg-card);
  border-color:var(--border-light);
  transform:none;
}
@keyframes join-request-feedback {
  0%,100% { transform:scale(1); }
  45% { transform:scale(.95); }
}
@media (prefers-reduced-motion:reduce) {
  .btn-join.requested { animation:none; }
}

.left-sidebar .category-list > li[hidden] { display: none; }
.category-list-toggle { background: transparent; border: 0; padding: 0; font-family: inherit; cursor: pointer; }

/* Separate story segments instead of a continuous background rail. */
#storyProgressBarTrack {
  left: 14px;
  right: 14px;
  width: auto;
  height: 3px;
  display: flex;
  gap: 6px;
  background: transparent;
  padding: 0;
}
#storyProgressBarTrack .story-progress-seg {
  flex: 1 1 0;
  min-width: 0;
  height: 3px;
  border-radius: 999px;
  background: rgba(255,255,255,.3);
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
#storyProgressBarTrack .story-progress-seg-fill { border-radius: inherit; }
.story-react.upvote-btn { overflow: visible; transition: transform .2s cubic-bezier(.175,.885,.32,1.275),color .2s ease,background-color .2s ease; }

#postAnalyticsModal.activity-panel-backdrop,
#boostPostModal.activity-panel-backdrop {
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  padding: 0;
  background: rgba(8,20,13,.25);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
#postAnalyticsModal .analytics-modal-card {
  box-sizing: border-box;
  width: min(540px,100%);
  max-width: 100%;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  padding: 24px;
  border: 0;
  border-left: 1px solid var(--border-light);
  border-radius: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  animation: none;
  transform: translateX(100%);
  transition: transform .22s ease;
}
#boostPostModal .boost-modal-card {
  box-sizing: border-box;
  width: min(640px,100%) !important;
  max-width: 100%;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  padding: 24px;
  border: 0;
  border-left: 1px solid var(--border-light);
  border-radius: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  animation: none;
  transform: translateX(100%);
  transition: transform .22s ease;
}
#postAnalyticsModal.show .analytics-modal-card,
#boostPostModal.show .boost-modal-card { transform: translateX(0); }
#boostPostModal .boost-modal-header { gap: 12px; align-items: center; }
#boostPostModal .boost-modal-header h3 { font-size: 18px; line-height: 1.4; }
#boostPostModal .modal-close-btn { position: static; }
@media(max-width:450px) { #postAnalyticsModal .analytics-modal-card,#boostPostModal .boost-modal-card { padding: 20px 16px; } }
@media(prefers-reduced-motion:reduce) { #postAnalyticsModal .analytics-modal-card,#boostPostModal .boost-modal-card { transition: none; } }

/* Send sits inside the reply frame; both story actions use equal icon sizes. */
.story-response .story-input-container { position: relative; }
.story-response .story-input-container input { padding-right: 48px !important; min-height: 42px; }
.story-response .story-input-container .story-send {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
}
.story-response .story-input-container .story-send:hover { transform: translateY(-50%); }
.story-response .story-send svg,
.story-response .story-react .action-icon svg { width: 24px; height: 24px; }
.story-response .story-react { width: 38px; height: 42px; }
.story-response .story-actions-group { gap: 0; }

/* Keep read notifications plain and give unread activity a quiet green tint. */
#recentNotificationsPanel .recent-notification,
#recentNotificationsPanel .recent-notification:hover { background: transparent; }
#recentNotificationsPanel .recent-notification.unread,
.notification-row-item.unread { background:var(--primary-tint); }
#recentNotificationsPanel .recent-notification.unread:hover,
.notification-row-item.unread:hover { background:var(--bg-active-pill); }
#recentNotificationsPanel .recent-notification + .recent-notification { border-top: 1px solid var(--border-light); }
.notification-actions-list .all-notifications-link {
  display: block;
  width: 100%;
  padding: 11px 12px;
  border-radius: 7px;
  color: var(--text-main);
  font: inherit;
  font-size: 13px;
  text-decoration: none;
}
.notification-actions-list .all-notifications-link:hover { background: var(--bg-hover); }

/* Compact panel headings with consistently sized symbols. */
#postAnalyticsModal .analytics-modal-header,
#boostPostModal .boost-modal-header { align-items: center; gap: 12px; }
#postAnalyticsModal .analytics-modal-header h3,
#boostPostModal .boost-modal-header h3 { margin: 0; min-width: 0; gap: 8px; font-size: 16px; line-height: 1.35; }
#postAnalyticsModal .analytics-modal-header h3 svg,
#boostPostModal .boost-modal-header h3 svg { width: 20px; height: 20px; flex: 0 0 20px; }
#postAnalyticsModal .analytics-modal-header { position: static; padding-bottom: 14px; margin-bottom: 16px; }
#postAnalyticsModal .analytics-header-pill { white-space: nowrap; font-size: 10px; padding: 4px 8px; }
#postAnalyticsModal .analytics-modal-header > div { flex-shrink: 0; }
#boostPostModal .boost-modal-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}
#boostPostModal .boost-modal-header {
  flex: 0 0 auto;
  padding: 18px 24px;
  margin: 0;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
}
#boostPostModal .boost-panel-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 20px 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
#boostPostModal .boost-panel-footer {
  flex: 0 0 auto;
  gap: 12px;
  padding: 16px 24px max(16px,env(safe-area-inset-bottom));
  background: var(--bg-card);
  border-top: 1px solid var(--border-light);
}
@media(max-width:450px) {
  #boostPostModal .boost-modal-card { padding: 0; }
  #boostPostModal .boost-modal-header,#boostPostModal .boost-panel-footer { padding-left: 16px; padding-right: 16px; }
  #boostPostModal .boost-panel-body { padding: 16px; }
  #postAnalyticsModal .analytics-modal-header { flex-wrap: wrap; }
}

/* Notification dividers stay straight and understated rather than following pill corners. */
#recentNotificationsPanel .recent-notification {
  border-radius: 0 !important;
  border: 0;
  margin: 0;
  padding: 14px 10px;
}
#recentNotificationsPanel .recent-notification + .recent-notification {
  border-top: 1px solid color-mix(in srgb, var(--border-light) 55%, transparent);
}
#recentNotificationsPanel .notification-period { padding-top: 20px; padding-bottom: 8px; }

/* Pin insights heading within the scrolling side panel. */
#postAnalyticsModal .analytics-modal-header {
  position: sticky;
  top: -24px;
  z-index: 10;
  margin: -24px -24px 16px;
  padding: 18px 24px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
}
@media(max-width:450px) {
  #postAnalyticsModal .analytics-modal-header {
    top: -20px;
    margin: -20px -16px 16px;
    padding: 18px 16px;
  }
}

/* Shared refinements, using the site's existing theme. */
#commentThreadModal .comment-modal-dialog { display: grid; grid-template-columns: minmax(0,1fr) minmax(320px,1fr); width: min(920px,calc(100vw - 64px)); max-width: 920px; height: min(640px,calc(100dvh - 96px)); max-height: calc(100dvh - 96px); overflow: hidden; background: var(--bg-card); border-radius: var(--radius-lg); }
#commentThreadModal .comment-media-column { min-width: 0; min-height: 0; max-height: none; background: var(--bg-card) !important; position: relative; overflow: hidden; }
#commentThreadModal .comment-media-column img,#commentThreadModal .comment-media-column video { width: 100%; height: 100%; object-fit: cover !important; display: block; }

/* Comment Modal Carousel & Slider Navigation Arrows */
#commentThreadModal .comment-media-column {
  min-width: 0;
  min-height: 0;
  max-height: none;
  background: var(--bg-card) !important;
  position: relative;
  overflow: hidden;
  user-select: none;
}
#commentThreadModal .comment-modal-slider-track {
  width: 100%;
  height: 100%;
  display: flex;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}
#commentThreadModal .comment-modal-slide {
  min-width: 100%;
  width: 100%;
  height: 100%;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  background: var(--bg-card);
}
#commentThreadModal .comment-modal-slide img,
#commentThreadModal .comment-modal-slide video,
#commentThreadModal .comment-media-column img,
#commentThreadModal .comment-media-column video {
  width: 100%;
  height: 100%;
  object-fit: cover !important;
  display: block;
}

#commentThreadModal .comment-modal-slider-prev,
#commentThreadModal .comment-modal-slider-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 25;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0;
}
#commentThreadModal .comment-modal-slider-prev {
  left: 14px;
}
#commentThreadModal .comment-modal-slider-next {
  right: 14px;
}
#commentThreadModal .comment-modal-slider-prev:hover,
#commentThreadModal .comment-modal-slider-next:hover {
  background: rgba(0, 0, 0, 0.9);
  border-color: rgba(255, 255, 255, 0.6);
  transform: translateY(-50%) scale(1.08);
}
#commentThreadModal .comment-modal-slider-prev:active,
#commentThreadModal .comment-modal-slider-next:active {
  transform: translateY(-50%) scale(0.95);
}
#commentThreadModal .comment-modal-slider-prev svg,
#commentThreadModal .comment-modal-slider-next svg {
  width: 18px;
  height: 18px;
  stroke: #ffffff;
  stroke-width: 2.5;
  fill: none;
  pointer-events: none;
}

#commentThreadModal .comment-modal-slider-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 25;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  letter-spacing: 0.5px;
  user-select: none;
}

#commentThreadModal .comment-modal-slider-dots {
  position: absolute;
  bottom: 14px;
  left: 0;
  right: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  pointer-events: auto;
}
#commentThreadModal .comment-modal-slider-dots .slider-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: all 0.25s ease;
  outline: none;
}
#commentThreadModal .comment-modal-slider-dots .slider-dot:hover {
  background: rgba(255, 255, 255, 0.85);
}
#commentThreadModal .comment-modal-slider-dots .slider-dot.active {
  width: 20px;
  border-radius: 4px;
  background: #ffffff;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.6);
}
#commentThreadModal .comment-thread-column { min-width: 0; min-height: 0; overflow: hidden; background: var(--bg-card); }
#commentThreadModal .comment-list-scroll { flex: 1; min-height: 0; overflow-y: auto; }
#commentThreadModal .comment-thread-header,#commentThreadModal .comment-input-form { flex-shrink: 0; }
#editPostModal .edit-modal-card { width: 100% !important; max-width: 560px !important; border-radius: var(--post-popup-radius) !important; padding: 24px !important; overflow-y: auto; overscroll-behavior: contain; box-shadow: var(--shadow-modal); }
.sponsored-ad-card { margin-bottom: 0 !important; }
.sponsored-ad-card .ad-banner-box { width: 100%; aspect-ratio: 1 / 1 !important; height: auto !important; overflow: hidden; }
.sponsored-ad-card .ad-banner-box img { width: 100%; height: 100%; object-fit: cover !important; display: block; }
.right-sidebar.reel-comment-sidebar, .watch-page .reel-comment-sidebar { background: #ffffff !important; }
@media(max-width:680px) {
 #commentThreadModal { padding: 12px; }
 #commentThreadModal .comment-modal-dialog { width: min(480px,calc(100vw - 24px)); height: min(740px,calc(100dvh - 24px)); max-height: calc(100dvh - 24px); grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(100px,26dvh) minmax(0,1fr); }
 #commentThreadModal .comment-thread-column { border-left: 0; border-top: 1px solid var(--border-light); }
}
@media(max-height:520px) {
 #commentThreadModal .comment-modal-dialog { height: calc(100dvh - 24px); max-height: calc(100dvh - 24px); }
}
@media(max-width:680px) and (max-height:600px) {
 #commentThreadModal .comment-modal-dialog { grid-template-rows: minmax(0,1fr); }
 #commentThreadModal .comment-media-column { display: none; }
}
/* Shared layout safeguards and accessible motion. */
:root { --bg-main: var(--bg-app); --primary-accent: var(--primary-light); }
[hidden] { display: none !important; }
.feed-main,.feed-main-inner,.post-content,.chat-main-window,.page-title-group { min-width: 0; }
.post-description,.chat-msg-bubble,.settings-item-desc { overflow-wrap: anywhere; }
input,textarea,select { color: var(--text-main); }
button,a,input,textarea,select { touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 3px; }
button:disabled,[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
body.dialog-open { overflow: hidden; }
.modal-backdrop:not(#authPromptModal) > * { max-width: calc(100vw - 24px); max-height: 94dvh; overflow-y: auto; }
#authPromptModal .auth-modal-card { width: 100% !important; max-width: 440px !important; margin: auto !important; }
.load-more-section { position: relative; isolation: isolate; text-align: center; padding: 48px 20px 64px; margin-top: 12px; }
.load-more-section::before { content: ''; position: absolute; inset: -20px 0; z-index: -1; pointer-events: none; background: radial-gradient(ellipse at center,rgba(82,183,136,.19),rgba(82,183,136,.06) 40%,transparent 72%); }
[data-theme="dark"] .load-more-section::before { background: radial-gradient(ellipse at center,rgba(116,198,157,.18),rgba(82,183,136,.05) 45%,transparent 72%); }
.feed-result-status { color: var(--text-secondary); font-size: 13px; margin-bottom: 14px; }
.load-more-section button { display: none !important; }
.chat-back { display: none; }
.compact-feed .feed-post { padding: 12px; }
.compact-feed .feed-post .single-image-wrapper img { max-height: 180px; }
.story-adjacent-card { cursor: pointer; }
.story-media-view { touch-action: pan-y; }
.story-media-view img { animation: story-reveal .18s ease-out; }
.story-stage-arrow { z-index: 20; min-width: 44px; min-height: 44px; }
.story-stage-arrow:disabled { pointer-events: none; }
@keyframes story-reveal { from { opacity: .6; } to { opacity: 1; } }
@media (max-width: 900px) {
  .nav-container { flex-wrap: wrap; height: auto; gap: 8px; }
  .top-nav { height: auto; min-height: var(--header-height); }
  .nav-actions { gap: 6px; margin-left: auto; flex-shrink: 0; }
  #themeToggleBtn { display: inline-flex !important; flex-shrink: 0; width: 44px; height: 44px; }
  .left-sidebar { max-width: 85vw; height: calc(100dvh - var(--header-height) - 70px); overflow-y: auto; }
  .search-wrapper { order: 3; flex-basis: 100%; margin-bottom: 6px; }
  .full-width-layout { padding-top: 0; }
  .page-title-row,.settings-item-row { gap: 12px; }
  .switch-toggle { flex-shrink: 0; }
  .page-nav-pills { flex-wrap: wrap; }
  .chat-container-card { height: calc(100dvh - 200px); min-height: 350px; }
  .chat-thread-list-sidebar { width: 38%; min-width: 0; }
  .story-modal-content { max-height: calc(100dvh - 80px); }
}
@media (max-width: 600px) {
  .brand-text { font-size: 15px; }
  .header-left { gap: 5px; }
  .header-guest-box { gap: 4px; }
  .btn-signup-nav { display: none; }
  .nav-container.full-width-container { padding-inline: 8px; }
  .feed-main { padding: 12px 10px 80px; width: 100%; }
  .page-main-heading { font-size: 18px; }
  .page-title-row { flex-wrap: wrap; }
  .communities-grid,.people-grid,.topics-grid,.explore-grid { grid-template-columns: minmax(0,1fr); }
  .post-footer,.left-actions,.right-actions { flex-wrap: wrap; gap: 8px; }
  .post-action-btn,.mobile-nav-item,.pill-btn { min-height: 44px; }
  .chat-thread-list-sidebar { width: 100%; }
  .chat-main-window { display: none; width: 100%; }
  .conversation-open .chat-thread-list-sidebar { display: none; }
  .conversation-open .chat-main-window { display: flex; }
  .chat-back { display: inline-flex; }
  .chat-active-header { gap: 8px; padding: 10px; }
  .chat-msg-bubble { max-width: 90%; }
  #storyModal > * { max-width: 100%; }
  #storyModal .story-stage-arrow { display: flex; top: 55%; width: 44px; height: 44px; background: #0008; }
  #storyModal .story-header { padding-right: 48px; }
  .story-screen-header { pointer-events: none; padding: 10px; }
  .story-screen-close-btn { pointer-events: auto; min-width: 44px; min-height: 44px; }
  .story-brand-logo { visibility: hidden; }
  .story-response { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .load-more-section { padding-block: 32px 48px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  #storyModal .story-modal-content { height: 100dvh !important; max-height: 100dvh !important; }
  .story-header { padding-block: 6px; }
  .story-response { padding-block: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
/* Story controls stay in the same places as the media changes. */
#storyModal #storySoundToggleBtn svg,#storyModal #storyMoreBtn svg { width: 16px; height: 16px; }
html:has(#storyModal.show),body:has(#storyModal.show) { overflow:hidden; }
#storyModal { width: 100vw; max-width: none; height:100dvh; max-height:100dvh; overflow:hidden; overscroll-behavior:none; }
#storyModal .story-screen-header { overflow:hidden; }
#storyModal .story-stage-container { max-width: 100%; max-height:100%; min-height:0; overflow: hidden; }
#storyModal .story-stage-container { --story-card-width: min(420px,calc((100dvh - 100px)*.5625)); display: grid; grid-template-columns: minmax(0,1fr) var(--story-card-width) minmax(0,1fr); gap: 64px; padding: 60px 24px 24px; }
#storyModal .story-modal-content { grid-column: 2; grid-row: 1; width: var(--story-card-width) !important; height: min(740px,calc(100dvh - 100px)) !important; max-height: calc(100dvh - 100px) !important; border-radius: 12px !important; }
#storyModal .story-adjacent-card { grid-row: 1; width: min(210px,17vw); height: min(360px,calc((100dvh - 100px)*.6)); }
#storyModal .story-adjacent-prev { grid-column: 1; justify-self: end; }
#storyModal .story-adjacent-next { grid-column: 3; justify-self: start; }
#storyModal .story-stage-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; min-width: 44px; min-height:44px; padding:0; border-radius:50%; display:flex; align-items:center; justify-content:center; background: #ffffff26; }
#storyModal .btn-stage-prev { left: calc(50% - var(--story-card-width)/2 - 48px); }
#storyModal .btn-stage-next { right: calc(50% - var(--story-card-width)/2 - 48px); }
#storyModal .story-header { padding: 24px 12px 20px !important; gap: 6px; }
#storyModal .story-header-left { gap: 7px; flex: 1; overflow: hidden; }
#storyModal .story-header-meta { overflow: hidden; }
#storyModal .story-author-name { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
#storyModal .story-audio-info { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 10px; }
#storyModal .story-ctrl-btn { width: 30px; min-width: 30px; padding: 5px; }
#storyModal .story-response { padding: 30px 12px 14px !important; gap: 5px; }
#storyModal .story-actions-group { gap: 2px; }
#storyModal .story-share { display: grid; place-items: center; width: 36px; height: 44px; padding: 5px; color: #fff; background: transparent; border: 0; }
#storyModal .story-share svg { width: 24px; height: 24px; }
#storyModal #storyReactBtn,#storyModal #storyReactBtn.active,#storyModal #storyReactBtn .action-icon,#storyModal #storyReactBtn.active .action-icon { background: transparent !important; background-color: transparent !important; box-shadow: none !important; border: 0 !important; }
#storyModal #storyReactBtn.active { color: #ff6b35 !important; }
#storyModal .story-options-menu > button { display: flex; align-items: center; gap: 10px; }
#storyModal .story-options-menu > button > svg { width: 19px; height: 19px; flex-shrink: 0; }
.story-option-details h3 { font-size: 15px; margin: 8px; }
.story-option-details p { font-size: 12px; line-height: 1.5; padding: 4px 8px; color: var(--text-secondary); }
.story-report-form label { display: flex; align-items: center; gap: 8px; padding: 10px 8px; font-size: 12px; cursor: pointer; }
.story-report-form input { accent-color: var(--primary-light); }
.story-options-menu:has(.story-option-details:not([hidden])) { width: min(290px,calc(100% - 24px)); }
@media(min-width:700px) { #storyModal .story-adjacent-card:not([hidden]) { display: block; } }
@media(max-width:699px) {
 #storyModal .story-stage-container { grid-template-columns: minmax(0,1fr); padding: 50px 0 0; gap: 0; }
 #storyModal .story-modal-content { grid-column: 1; justify-self: center; width: min(100vw,var(--story-card-width)) !important; }
 #storyModal .story-adjacent-card { display: none; }
 #storyModal .btn-stage-prev { left: 4px; }
 #storyModal .btn-stage-next { right: 4px; }
}
@media(max-width:500px) {
 #storyModal .story-stage-container { padding: 0; }
 #storyModal .story-modal-content { width: 100vw !important; height: 100dvh !important; max-height: 100dvh !important; border-radius: 0 !important; }
 #storyModal .story-header { padding-right: 45px !important; }
 #storyModal .story-ctrl-btn { min-width: 28px; width: 28px; }
}

/* Mobile stories fill the visible viewport without inheriting modal scrolling. */
@media (max-width: 699px) {
  #storyModal {
    height: 100dvh;
    max-height: 100dvh;
    overscroll-behavior: none;
  }
  #storyModal .story-stage-container {
    height: 100%;
    max-height: 100%;
    min-height: 0;
    padding: 0;
    overflow: hidden;
  }
  #storyModal .story-modal-content {
    width: 100% !important;
    max-width: 100%;
    height: 100% !important;
    max-height: 100% !important;
    min-height: 0;
    border-radius: 0 !important;
  }
  #storyModal .story-stage-arrow { display: none !important; }
  #storyModal .story-screen-header {
    height: auto;
    max-height: none;
    padding: 0;
    overflow: visible;
    background: transparent;
    pointer-events: none;
  }
  #storyModal .story-brand-logo { display: none; }
  #storyModal .story-screen-close-btn {
    position: absolute;
    top: calc(28px + env(safe-area-inset-top, 0px));
    right: 8px;
    width: 32px;
    height: 36px;
    min-width: 32px;
    min-height: 36px;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
    pointer-events: auto;
  }
  #storyModal .story-screen-close-btn svg {
    width: 14px;
    height: 14px;
  }
  #storyModal .story-header {
    padding: calc(24px + env(safe-area-inset-top, 0px)) 42px 20px 12px !important;
  }
  #storyModal .story-header-right { gap: 2px; flex-shrink: 0; }
  #storyModal .story-progress-bar { top: calc(12px + env(safe-area-inset-top, 0px)); }
  #storyModal .story-response {
    bottom: 0;
    padding: 30px 12px calc(32px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

/* Mobile feed: keep creation in the bottom navigation and actions on one line. */
.mobile-action-count { display:none; }
@media(max-width:768px) {
  .top-nav .nav-container { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:6px; padding-top:6px; }
  .top-nav .header-left { min-width:0; gap:4px; }
  .top-nav .brand-logo { gap:4px; white-space:nowrap; }
  .top-nav .brand-text { font-size:14px; }
  .top-nav .brand-icon { width:25px;height:25px; }
  .top-nav .nav-actions { grid-column:2;grid-row:1;gap:2px; }
  .top-nav .search-wrapper { grid-column:1/-1;grid-row:2;width:100%; }
  .top-nav #headerNewPostBtn,.top-nav #userProfileMenu,.top-nav .header-guest-box { display:none!important; }
  .top-nav #headerUserBox { display:flex!important;gap:0; }
  .top-nav #themeToggleBtn,.top-nav #notificationBtn { width:40px;height:44px;min-width:40px; }
  .top-nav .mobile-drawer-toggle { width:30px;min-width:30px; }
  .home-page .create-post-launcher { display:none!important; }
  .feed-post .badge-category-pill { display:none!important; }
  .feed-post .post-header { gap:4px;align-items:flex-start; }
  .feed-post .author-info-group,.feed-post .author-details { min-width:0;flex:1; }
  .feed-post .author-name-line { flex-wrap:nowrap;gap:4px; }
  .feed-post .author-name { min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
  .feed-post .post-time { flex-shrink:0;white-space:nowrap;font-size:10px; }
  .feed-post .post-owner-badge { font-size:9px;padding:2px 4px; }
  .feed-post .post-header-right { flex-shrink:0;gap:0; }
  .feed-post .post-tags { row-gap:2px;column-gap:7px;line-height:1.35; }
  .feed-post .post-tags .tag { line-height:1.35;padding-block:1px; }
  .post-owner-insights-bar { display:flex;flex-wrap:nowrap;gap:8px;padding:8px; }
  .post-owner-insights-bar .insights-preview-info { flex-shrink:0; }
  .post-owner-insights-bar .insights-growth-pill { display:none; }
  .post-owner-insights-bar .insights-badge-chip>span { font-size:0; }
  .post-owner-insights-bar .insights-badge-chip strong { font-size:12px; }
  .post-owner-insights-bar .insights-actions-row { margin-left:auto;gap:5px; }
  .post-owner-insights-bar .btn-owner-tool { padding:6px 8px;min-height:40px;gap:4px; }
  .post-owner-insights-bar .btn-owner-tool span[data-mobile-label] { font-size:0; }
  .post-owner-insights-bar .btn-owner-tool span[data-mobile-label]::after { content:attr(data-mobile-label);font-size:11px; }
  .feed-post:not(.reel-card) .post-footer { display:flex;flex-wrap:nowrap;gap:4px; }
  .feed-post:not(.reel-card) .post-footer .left-actions,.feed-post:not(.reel-card) .post-footer .right-actions { display:contents; }
  .feed-post:not(.reel-card) .post-footer .post-action-btn { padding:6px;gap:4px;min-height:44px;font-size:11px;flex-shrink:0; }
  .feed-post:not(.reel-card) .post-footer .share-btn { order:4; }
  .feed-post:not(.reel-card) .post-footer .save-btn { order:5;margin-left:auto; }
  .feed-post:not(.reel-card) .post-footer .share-btn .action-label,.feed-post:not(.reel-card) .post-footer .save-btn .action-label { display:none; }
  .mobile-action-count { display:inline; }
  .mobile-compose-page .feed-main-inner>* { display:none!important; }
  .mobile-compose-page .right-sidebar { display:none; }
  .mobile-compose-page #createPostDialog { position:static;display:block;background:none;padding:12px 10px 90px;backdrop-filter:none; }
  .mobile-compose-page #createPostDialog>.create-post-card { width:100%;max-width:640px;max-height:none;margin:0 auto;overflow:visible;box-shadow:none; }
  .mobile-compose-page .composer-identity-name::before { content:'Create post';font-size:18px;font-weight:700; }
  .mobile-compose-page .composer-identity-name>strong { display:none!important; }
}

.mobile-search-button { display:none; }
.mobile-search-dialog { border:1px solid var(--border-card);border-radius:16px;padding:20px;background:var(--bg-card);color:var(--text-main);width:calc(100% - 24px);max-width:480px;margin:70px auto auto;box-shadow:var(--shadow-modal); }
.mobile-search-dialog::backdrop { background:rgba(0,0,0,.4); }
.mobile-search-dialog form { position:relative; }
.mobile-search-dialog label { display:block;font-weight:700;margin-bottom:16px; }
.mobile-search-close { position:absolute;right:0;top:-8px;width:44px;height:44px;color:var(--text-main);font-size:24px; }
.mobile-search-field { display:flex;gap:8px; }
.mobile-search-field input { min-width:0;flex:1;background:var(--bg-subtle);border:1px solid var(--border-card);border-radius:10px;padding:10px;min-height:44px; }
.mobile-search-field button { background:var(--primary);color:var(--bg-card);border-radius:10px;padding:10px;min-height:44px; }
@media (max-width: 768px) {
 .mobile-search-dialog {
   position:fixed;inset:0;box-sizing:border-box;width:100%;max-width:none;
   height:100dvh;max-height:100dvh;margin:0;padding:0;border:0;border-radius:0;
   background:var(--bg-card);box-shadow:none;overflow-y:auto;overscroll-behavior:contain;
 }
 .mobile-search-dialog .mobile-search-top {
   position:sticky;top:0;z-index:1;display:flex;align-items:center;gap:8px;
   padding:calc(18px + env(safe-area-inset-top,0px)) 16px 18px;
   background:var(--bg-card);border-bottom:1px solid var(--border-light);
 }
 .mobile-search-dialog .mobile-search-field {
   flex:1;min-width:0;align-items:center;gap:8px;padding:0 12px;
   background:var(--bg-input);border:1px solid var(--border-light);border-radius:999px;
   transition:border-color .15s;
 }
 .mobile-search-dialog .mobile-search-field:focus-within { border-color:var(--primary-light); }
 .mobile-search-dialog .mobile-search-field>svg { width:19px;height:19px;flex-shrink:0;color:var(--text-muted); }
 .mobile-search-dialog .mobile-search-field input {
   width:100%;min-height:46px;padding:10px 0;border:0;border-radius:0;
   background:transparent;color:var(--text-main);font:inherit;font-size:16px;outline:none;box-shadow:none;
 }
 .mobile-search-dialog .mobile-search-field input::placeholder { color:var(--text-muted);font-size:12px; }
 .mobile-search-dialog .mobile-search-cancel {
   flex-shrink:0;min-height:44px;padding:0 4px;background:transparent;color:var(--primary-light);font:inherit;font-size:12px;font-weight:600;
 }
 .mobile-search-content { padding:4px 20px calc(24px + env(safe-area-inset-bottom,0px)); }
 .mobile-search-content section { padding:20px 0; }
 .mobile-search-content section+section { border-top:1px solid var(--border-light); }
 .mobile-search-section-heading { display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:14px;flex-wrap:wrap; }
 .mobile-search-section-heading h2 { margin:0;color:var(--text-main);font-size:13px;font-weight:700;letter-spacing:.02em; }
 .mobile-search-clear { display:grid;place-items:center;min-width:36px;min-height:36px;margin:-8px -6px -8px 0;background:transparent;color:var(--text-muted); }
 .mobile-search-clear svg { width:18px;height:18px; }
 .mobile-search-clear:disabled { opacity:.35; }
 .mobile-search-chips { display:flex;flex-wrap:wrap;gap:6px; }
 .mobile-search-chips button {
   max-width:100%;min-height:32px;padding:6px 12px;border:1px solid var(--border-light);line-height:18px;
   border-radius:10px;background:var(--bg-subtle);color:var(--text-secondary);font:inherit;font-size:12px;font-weight:600;text-align:left;overflow-wrap:anywhere;
 }
 .mobile-search-chips button:hover,.mobile-search-chips button:focus-visible { background:var(--bg-active-pill);color:var(--primary-light);border-color:var(--primary-light); }
 .mobile-search-empty { margin:0;color:var(--text-muted);font-size:12px;line-height:1.6; }
 .mobile-search-discover { color:var(--text-muted);font-size:10px; }
 .mobile-search-announcement { position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%); }
}
@media(max-width:768px) {
 .top-nav .search-wrapper { display:none!important; }
 .top-nav .nav-container { padding-block:5px;gap:0; }
 .top-nav #themeToggleBtn,.top-nav #notificationBtn,.top-nav .mobile-search-button { background:transparent!important;border:0;box-shadow:none; }
 .top-nav .mobile-search-button { display:inline-flex;align-items:center;justify-content:center;width:34px;height:44px; }
 .top-nav .mobile-search-button svg { width:19px;height:19px; }
 .top-nav #themeToggleBtn,.top-nav #notificationBtn { width:34px;min-width:34px; }
 .top-nav .brand-text { font-size:13px; }
 .stories-section { background:transparent;border:0;box-shadow:none;border-radius:0;min-height:0;padding:2px 0; }
 .stories-track { padding-block:4px; }
 .feed-post:not(.reel-card) .post-footer .upvote-btn,.feed-post:not(.reel-card) .post-footer .upvote-btn.active,.feed-post:not(.reel-card) .post-footer .upvote-btn:hover { background:transparent!important; }
 .feed-post:not(.reel-card) .post-footer .upvote-btn { padding-left:0; }
 .feed-post:not(.reel-card) .post-footer .upvote-btn .action-icon { width:30px;height:30px;border-radius:50%;flex-shrink:0; }
 .feed-post:not(.reel-card) .post-footer .upvote-btn.active .action-icon { background:var(--accent-orange-bg); }
 .feed-post:not(.reel-card) .post-footer .upvote-btn:not(.active):hover .action-icon { background:var(--bg-hover); }
}

.post-description-toggle {
  display: none;
  background: transparent;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 12.5px;
  line-height: 18px;
  font-weight: 700;
  color: var(--primary-light, #52b788);
  cursor: pointer;
  text-align: left;
}
@media(max-width:768px) {
 .feed-post .post-description-collapsible:not(.description-expanded) { display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden; }
 .feed-post .post-description-collapsible { margin-bottom:0; }
 .feed-post .post-description-toggle { display:block;min-height:22px;margin:0 0 4px;padding:0;color:var(--primary-light);font:inherit;font-size:12px;line-height:20px;font-weight:700;text-align:left; }
 .feed-post .post-description-toggle:hover { text-decoration:underline; }
 .feed-post .post-description-collapsible:has(+.post-description-toggle[hidden]) { margin-bottom:12px; }
}
@media(max-width:768px) {
 .feed-post .post-content:has(.post-description-collapsible:not(.description-expanded)) .post-tags { display:none; }
}

/* In image and video posts: show max 2 lines of content, truncate rest so post is visible without scroll */
.feed-post.has-media-post .post-description:not(.description-expanded),
.feed-post:has(.single-image-wrapper, .post-slider-wrapper, .video-media-card, .video-post-media, .post-media, video) .post-description:not(.description-expanded) {
  display: -webkit-box !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 2 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  line-height: 1.45 !important;
  font-size: 13.5px !important;
  margin-bottom: 2px !important;
  max-height: calc(1.45em * 2) !important;
}

.feed-post.has-media-post .post-description.description-expanded,
.feed-post:has(.single-image-wrapper, .post-slider-wrapper, .video-media-card, .video-post-media, .post-media, video) .post-description.description-expanded {
  display: block !important;
  -webkit-line-clamp: unset !important;
  overflow: visible !important;
  max-height: none !important;
  margin-bottom: 6px !important;
}

.feed-post.has-media-post .post-description-toggle:not([hidden]),
.feed-post:has(.single-image-wrapper, .post-slider-wrapper, .video-media-card, .video-post-media, .post-media, video) .post-description-toggle:not([hidden]) {
  display: inline-block !important;
  min-height: 18px;
  margin: 0 0 6px;
  background: transparent;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 12.5px;
  line-height: 18px;
  font-weight: 700;
  color: var(--primary-light, #52b788);
  cursor: pointer;
  text-align: left;
}

.feed-post.has-media-post .post-description-toggle:hover,
.feed-post:has(.single-image-wrapper, .post-slider-wrapper, .video-media-card, .video-post-media, .post-media, video) .post-description-toggle:hover {
  text-decoration: underline;
}

.feed-post.has-media-post .post-title,
.feed-post:has(.single-image-wrapper, .post-slider-wrapper, .video-media-card, .video-post-media, .post-media, video) .post-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 15.5px;
  line-height: 1.32;
  margin-bottom: 6px;
}

.feed-post.has-media-post .post-tags,
.feed-post:has(.single-image-wrapper, .post-slider-wrapper, .video-media-card, .video-post-media, .post-media, video) .post-tags {
  margin-bottom: 8px;
  gap: 4px;
}

.feed-post.has-media-post .post-tags .tag,
.feed-post:has(.single-image-wrapper, .post-slider-wrapper, .video-media-card, .video-post-media, .post-media, video) .post-tags .tag {
  font-size: 11.5px;
  padding: 2px 8px;
}

/* Consistent vector icons in legacy labels, controls, and reaction pickers. */
.ui-svg-icon { display:inline-block;width:1.15em;height:1.15em;min-width:1.15em;vertical-align:-.18em;flex-shrink:0;overflow:visible; }
.modal-close-btn .ui-svg-icon,.mobile-search-close .ui-svg-icon { width:18px;height:18px; }
.emoji-pill-btn .ui-svg-icon { width:20px;height:20px; }
.pill-btn .ui-svg-icon { margin-right:5px; }

/* Let conversations use the available center column without pill-shaped rows. */
.messages-page .feed-main { padding:12px 12px 20px; }
.messages-page .feed-container-wide { width:100%;max-width:none; }
.messages-page .chat-thread-item,.messages-page .chat-thread-item.active { border-radius:0!important; }
@media(min-width:901px) {
 .messages-page .chat-thread-list-sidebar { width:clamp(230px,28%,280px); }
}
@media(max-width:600px) {
 .messages-page .feed-main { padding:8px 8px 80px; }
}
.comment-replies-toggle { align-self:flex-start;min-height:36px;padding:2px 0;color:var(--text-muted);font-size:12px;font-weight:600;text-align:left; }
.comment-replies-toggle:hover { color:var(--primary-light); }

/* Keep a reply toggle visually attached to its parent comment. */
.comment-list-scroll>.comment-item-row { flex-shrink:0; }
.comment-list-scroll>.comment-item-row+.comment-replies-toggle { margin-top:-12px;min-height:28px; }
.comment-item-row:has(+.comment-replies-toggle) { margin-bottom:0; }
.comment-list-scroll>.comment-item-row+.comment-replies-toggle { margin-top:0;transition:none; }

/* Home shows a compact category preview; the full directory remains under See all. */
.left-sidebar .category-list>li:nth-child(n+4) { display:none; }

/* Keep search calm on click, with a neutral focus cue for keyboard navigation. */
.search-wrapper input:focus { border-color:var(--border-light);box-shadow:none;outline:none;background-color:var(--bg-input); }
.keyboard-navigation .search-wrapper input:focus-visible { outline:2px solid var(--text-muted);outline-offset:2px; }

/* Keep the sidebar community preview compact on every page. */
.left-sidebar .community-list>li:nth-child(n+4) { display:none; }


.infeed-comm-card { position:relative; }
.infeed-comm-card .community-card-link { position:absolute;inset:0;z-index:1;border-radius:inherit; }
.infeed-comm-card .btn-join { position:relative;z-index:2; }
.infeed-comm-card:has(.community-card-link:focus-visible) { outline:2px solid var(--primary-light);outline-offset:2px; }

/* Mobile community suggestions stay in one swipeable row. */
@media (max-width: 768px) {
 .home-page .feed-main { --mobile-feed-gutter:24px; }
 .infeed-suggestion-widget:has(.infeed-comm-card) {
   width:calc(100% + 2 * var(--mobile-feed-gutter, 10px));
   margin-inline:calc(-1 * var(--mobile-feed-gutter, 10px));
   padding:8px 0;
   border:0;
   border-radius:0;
   background:transparent;
   box-shadow:none;
 }
 .infeed-suggestion-widget:has(.infeed-comm-card) .infeed-widget-header {
   margin-inline:16px;
   border-bottom:0;
   padding-bottom:0;
 }
 .home-page .stories-section {
   width:calc(100% + 2 * var(--mobile-feed-gutter, 10px));
   margin-inline:calc(-1 * var(--mobile-feed-gutter, 10px));
 }
 .home-page .stories-track { padding-inline:10px; }
 .infeed-grid-row:has(> .infeed-comm-card) {
   grid-template-columns:none;
   grid-auto-flow:column;
   grid-auto-columns:max-content;
   gap:10px;
   overflow-x:auto;
   overscroll-behavior-x:contain;
   scroll-snap-type:x proximity;
   padding:2px 16px 8px;
   scroll-padding-left:16px;
   scrollbar-width:none;
 }
 .infeed-grid-row:has(> .infeed-comm-card)::-webkit-scrollbar { display:none; }
 .infeed-grid-row > .infeed-comm-card {
   background:var(--bg-card);
   min-width:156px;
   scroll-snap-align:start;
   height:190px;
   padding:0 0 10px;
   display:grid;
   grid-template-rows:45% 34px 16px 30px;
   gap:4px;
   justify-items:center;
   align-items:center;
   text-align:center;
   overflow:hidden;
 }
 .infeed-grid-row > .infeed-comm-card .infeed-comm-icon {
   width:100%;
   height:100%;
   object-fit:cover;
   border-radius:0;
 }
 .infeed-grid-row > .infeed-comm-card .btn-join {
   width:calc(100% - 20px);
   margin:0 10px;
   align-self:stretch;
 }
 .infeed-grid-row > .infeed-comm-card .infeed-comm-members { width:calc(100% - 20px);margin:0;text-align:center; }
 .infeed-grid-row > .infeed-comm-card .infeed-comm-name { width:max-content;max-width:none;margin:0 12px; }
 .infeed-grid-row > .infeed-comm-card .infeed-comm-name {
   white-space:nowrap;
   min-height:34px;
   line-height:17px;
   font-size:13.5px;
   display:flex;
   align-items:center;
   justify-content:center;
 }
}
@media (max-width:600px) {
 .home-page .feed-main { --mobile-feed-gutter:10px; }
}

/* Keep suggestion identity and follower totals close together. */
.suggested-people-list .person-details { gap:2px; }
.suggested-people-list .person-name { line-height:1.3;margin:0; }
.suggested-people-list .person-handle { display:block;line-height:1.3;margin-top:2px; }

/* Post media keeps its square frame; only account avatars use circular masks. */
.feed-post .single-image-wrapper>img,.feed-post .slider-slide-item>img,.feed-post .post-content>img { border-radius:0!important;cursor:default; }

/* The composer category menu shares the app's token-based dropdown treatment. */
.create-post-card .category-select::after { display:none; }
.composer-category-menu { position:relative;width:100%; }
.create-post-card .composer-category-trigger { display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;min-height:38px;padding:9px 12px;border:1px solid var(--border-light);border-radius:10px!important;background:var(--bg-card);color:var(--text-main);font:inherit;font-size:12px;text-align:left; }
.composer-category-trigger svg { width:16px;height:16px;flex-shrink:0;transition:transform .15s; }
.composer-category-trigger[aria-expanded="true"] svg { transform:rotate(180deg); }
.composer-category-options { position:absolute;top:calc(100% + 6px);left:0;right:0;z-index:50;max-height:240px;overflow-y:auto;padding:6px;border:1px solid var(--border-light);border-radius:12px;background:var(--bg-card);box-shadow:var(--shadow-modal); }
.create-post-card .composer-category-options button { display:block;width:100%;min-height:40px;border-radius:7px!important;padding:9px 10px;color:var(--text-main);font:inherit;font-size:12px;text-align:left; }
.composer-category-options button:hover,.composer-category-options button:focus-visible { background:var(--bg-hover); }
.composer-category-options button[aria-selected="true"] { background:var(--bg-active-pill);color:var(--primary-light);font-weight:600; }

/* A continuous guide connects all replies in the same flat thread. */
.comment-item-row.is-reply { border-left:0;position:relative; }
.comment-item-row.is-reply::before { content:'';position:absolute;left:0;top:0;bottom:0;width:2px;background:var(--border-light);pointer-events:none; }
.comment-item-row.is-reply+.comment-item-row.is-reply::before { top:-18px; }
.comment-mention { font-weight:600; }

.mobile-menu-header,.mobile-menu-backdrop { display:none; }
@media(max-width:900px) {
 .mobile-menu-backdrop:not([hidden]) { display:block;position:fixed;inset:0;z-index:1080;background:rgba(0,0,0,.42);animation:story-reveal .18s ease-out; }
 .left-sidebar,
 body.guest-mode .left-sidebar { position:fixed!important;top:0;bottom:0;left:0;width:min(320px,86vw);max-width:86vw;height:100dvh!important;max-height:100dvh;padding:0 16px max(20px,env(safe-area-inset-bottom));z-index:1090!important;transform:translateX(-105%);transition:transform .25s ease;overflow-y:auto;overscroll-behavior:contain;visibility:hidden; }
 .left-sidebar.open,
 body.guest-mode .left-sidebar.open { left:0;transform:translateX(0);visibility:visible; }
 .mobile-menu-header { display:flex;align-items:center;justify-content:space-between;position:sticky;top:0;z-index:2;min-height:64px;padding-top:env(safe-area-inset-top);margin-bottom:12px;background:var(--bg-card);border-bottom:1px solid var(--border-light); }
 .mobile-menu-header .brand-logo { gap:6px; white-space:nowrap; }
 .mobile-menu-header .brand-text { font-size:16px; }
 .mobile-menu-header .brand-icon { width:28px; height:28px; }
 .mobile-menu-header .brand-icon svg { width:100%; height:100%; }
 .mobile-menu-header button { display:grid;place-items:center;width:44px;height:44px;color:var(--text-main); }
 .mobile-menu-header svg { width:22px;height:22px; }
 body.mobile-menu-open { overflow:hidden; }
}
@media(max-width:900px) {
 .left-sidebar { transition:transform .25s ease,visibility 0s .25s; }
 .left-sidebar.open { transition:transform .25s ease,visibility 0s; }
}

.create-choice-dialog { width:min(380px,calc(100vw - 32px));padding:22px;border:1px solid var(--border-light);border-radius:18px;background:var(--bg-card);color:var(--text-main);box-shadow:var(--shadow-modal); }
.create-choice-dialog::backdrop { background:#07110b80;backdrop-filter:blur(3px); }
.create-choice-dialog header { display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px; }
.create-choice-dialog h2 { font-size:16px;margin:0; }
.create-choice-dialog header button { width:36px;height:36px;font-size:23px;color:var(--text-secondary); }
.create-choice-dialog>a,.create-choice-dialog>button { display:block;width:100%;text-align:left;border:1px solid var(--border-light);border-radius:12px;padding:16px;margin-top:10px;background:var(--bg-subtle);color:var(--text-main); }
.create-choice-dialog strong { display:block;font-size:14px; }
.create-choice-dialog span { display:block;color:var(--text-muted);font-size:12px;margin-top:6px; }

/* Shared inner-page headers and quiet, underlined navigation. */
.page-header-card.explore-intro,.page-header-card.events-intro { padding:22px 24px 18px; }
.page-header-card .page-main-heading { margin:0;font-size:22px;line-height:1.25;letter-spacing:normal;font-weight:800; }
.page-header-card .page-subtitle-text { font-size:14px;line-height:1.55;margin:0 0 16px; }
.page-header-card .explore-demo-note,.page-header-card .events-demo-note { margin:0 0 14px;color:var(--text-muted);font-size:11px; }
.page-header-card>.page-nav-pills,.page-header-card>.explore-tabs,.page-header-card>.events-filters {
 display:flex;align-items:stretch;flex-wrap:nowrap;gap:8px;margin:0;padding:0;border:0;border-top:1px solid var(--border-light);
 overflow-x:auto;overflow-y:hidden;scrollbar-width:none;
}
.page-header-card>.page-nav-pills::-webkit-scrollbar,.page-header-card>.events-filters::-webkit-scrollbar { display:none; }
.page-header-card>.page-nav-pills>.pill-btn,.page-header-card>.explore-tabs>button,.page-header-card>.events-filters>button {
 position:relative;flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;gap:6px;
 min-height:44px;padding:12px 10px;border:0;border-radius:0!important;background:transparent;box-shadow:none;color:var(--text-secondary);white-space:nowrap;
}
.page-header-card>.page-nav-pills>.pill-btn.active,.page-header-card>.explore-tabs>button[aria-selected="true"],.page-header-card>.events-filters>button[aria-pressed="true"] { color:var(--primary-light);background:transparent;font-weight:700;box-shadow:none; }
.page-header-card>.page-nav-pills>.pill-btn.active::after,.page-header-card>.explore-tabs>button[aria-selected="true"]::after,.page-header-card>.events-filters>button[aria-pressed="true"]::after { content:'';position:absolute;left:0;right:0;bottom:0;height:2px;background:var(--primary-light); }
.page-header-card>.community-tabs { gap:6px; }
.page-header-card>.community-tabs>.pill-btn { font-size:12px;font-weight:400; }
.page-header-card>.community-tabs>.pill-btn.active { font-weight:700; }
.community-tabs .community-tab-icon,.community-tabs .ui-svg-icon { width:14px;height:14px;flex-shrink:0;margin:0; }
@media(max-width:600px) {
 .page-header-card,.page-header-card.explore-intro,.page-header-card.events-intro { padding:18px 16px 12px; }
 .page-header-card .page-main-heading { font-size:18px; }
 .page-header-card .page-subtitle-text { font-size:12px; }
 .page-header-card .page-title-group { gap:10px; }
 .page-header-card .page-title-icon { width:38px;height:38px;min-width:38px;max-width:38px; }
}

/* Center modal popups explicitly; the global margin reset overrides browser defaults. */
dialog:modal:not(.reel-comments-sheet):not(.mobile-search-dialog) {
 position:fixed;
 inset:0;
 margin:auto;
 max-height:calc(100dvh - 32px);
 overflow-y:auto;
}

/* Shared dropdown controls for every page and dynamically created form. */
.rc-select { width:100%;min-width:0;position:relative; }
.rc-select .rc-select-trigger {
 width:100%;min-height:42px;display:flex;align-items:center;justify-content:space-between;gap:12px;
 padding:10px 12px;border:1px solid var(--border-light);border-radius:9px!important;
 background:var(--bg-input);color:var(--text-main);font:inherit;font-size:13px;font-weight:400;text-align:left;
}
.rc-select-trigger>span { min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.rc-select-trigger>svg { width:16px;height:16px;flex-shrink:0;transition:transform .15s; }
.rc-select-trigger[aria-expanded="true"] { border-color:var(--primary-light); }
.rc-select-trigger[aria-expanded="true"]>svg { transform:rotate(180deg); }
.rc-select-menu {
 position:fixed;inset:auto;box-sizing:border-box;margin:0;padding:6px;max-height:240px;overflow-y:auto;
 border:1px solid var(--border-light);border-radius:12px;background:var(--bg-card);color:var(--text-main);
 box-shadow:var(--shadow-modal);z-index:100010;
}
.rc-select-menu button {
 display:block;width:100%;min-height:40px;padding:10px;border:0;border-radius:7px!important;
 background:transparent;color:var(--text-main);font:inherit;font-size:12px;text-align:left;
}
.rc-select-menu button:hover,.rc-select-menu button:focus-visible { background:var(--bg-hover); }
.rc-select-menu button[aria-selected="true"] { background:var(--bg-active-pill);color:var(--primary-light);font-weight:600; }
.rc-select-menu button:disabled { opacity:.45; }

.explore-sort .rc-select { width:125px; }
.explore-sort .rc-select-trigger { min-height:32px;padding:6px 9px;font-size:11px; }
@media(max-width:600px) { .rc-select .rc-select-trigger { min-height:40px; } }

/* One vertical rhythm for mobile feeds and card lists. */
@media (max-width:768px) {
 :root { --mobile-card-gap:16px; }
 .posts-stream,
 .explore-page .discovery-posts,
 .communities-grid,
 .people-grid,
 .topics-grid,
 .events-main .events-grid,
 .explore-page .discovery-directory,
 .explore-page .discovery-recommendations {
  row-gap:var(--mobile-card-gap);
 }
 .posts-stream>.feed-post,
 .posts-stream>.infeed-suggestion-widget,
 .explore-page .discovery-posts>.discovery-post,
 .communities-grid>.community-card-hero,
 .people-grid>.person-card,
 .topics-grid>.topic-card-large,
 .events-main .events-grid>.event-card,
 .explore-page .discovery-directory>.discovery-directory-card,
 .explore-page .discovery-recommendations>.discovery-recommend-card {
  margin-block:0;
 }
}

/* People suggestions use the same swipeable card treatment as communities. */
@media(max-width:768px) {
 .infeed-suggestion-widget:has(.infeed-people-list) {
  width:calc(100% + 2 * var(--mobile-feed-gutter,10px));
  margin-inline:calc(-1 * var(--mobile-feed-gutter,10px));
  padding:8px 0;border:0;border-radius:0;background:transparent;box-shadow:none;
 }
 .infeed-suggestion-widget:has(.infeed-people-list) .infeed-widget-header {
  margin-inline:16px;padding-bottom:0;border-bottom:0;gap:12px;align-items:center;
 }
 .infeed-suggestion-widget:has(.infeed-people-list) .infeed-widget-header h4 { min-width:0;font-size:13px;line-height:1.4; }
 .infeed-suggestion-widget:has(.infeed-people-list) .infeed-widget-header h4 svg { flex-shrink:0; }
 .infeed-suggestion-widget:has(.infeed-people-list) .see-all-link { flex-shrink:0;white-space:nowrap; }
 .infeed-people-list {
  display:grid;grid-auto-flow:column;grid-auto-columns:168px;gap:10px;
  overflow-x:auto;overscroll-behavior-x:contain;scroll-snap-type:x proximity;
  scroll-padding-left:16px;padding:2px 16px 8px;scrollbar-width:none;
 }
 .infeed-people-list::-webkit-scrollbar { display:none; }
 .infeed-people-list>.infeed-people-row {
  display:grid;grid-template-rows:minmax(0,1fr) 32px;gap:12px;height:232px;
  min-width:0;padding:16px 12px;border:1px solid var(--border-light);
  border-radius:var(--radius-md);background:var(--bg-card);text-align:center;scroll-snap-align:start;
 }
 .infeed-people-row .infeed-user-meta { flex-direction:column;justify-content:center;gap:10px;width:100%;min-width:0; }
 .infeed-people-row .infeed-user-meta>div { width:100%;min-width:0; }
 .infeed-people-row .infeed-user-avatar { width:72px;height:72px;min-width:72px;max-width:72px;border-radius:50%; }
 .infeed-people-row .infeed-user-name { justify-content:center;font-size:13.5px;line-height:18px; }
 .infeed-people-row .infeed-user-bio { display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;white-space:normal;overflow:hidden;min-height:32px;margin-top:4px;font-size:11px;line-height:16px; }
 .infeed-people-row .btn-follow { width:100%;min-width:0;min-height:32px;margin:0;padding:5px 10px; }
}

/* Let the feed gap supply all spacing around posts and suggestion sections. */
@media(max-width:768px) {
 .feed-main .feed-post:not(.reel-card) { margin-top:0;margin-bottom:0; }
 .posts-stream { gap:var(--mobile-card-gap,16px); }
 .posts-stream>.infeed-suggestion-widget { margin-block:0;padding-block:0; }
 .posts-stream>.infeed-suggestion-widget>.infeed-grid-row:has(>.infeed-comm-card),
 .posts-stream>.infeed-suggestion-widget>.infeed-people-list { padding-bottom:0; }
}

@media(max-width:768px) {
 .posts-stream>.sponsored-ad-card { margin-block:0; }
}

/* Small dismissal controls stay above card links and leave the row free to reflow. */
.infeed-comm-card,.infeed-people-row,.community-card-hero,.person-card,.person-card-full,.discovery-directory-card { position:relative; }
.suggestion-dismiss {
 position:absolute;top:6px;right:6px;z-index:4;display:grid;place-items:center;
 width:24px;height:24px;min-width:24px;min-height:24px;padding:4px;
 border:1px solid var(--border-light);border-radius:50%;background:var(--bg-card);color:var(--text-muted);opacity:.9;
}
.suggestion-dismiss svg { width:12px;height:12px; }
.suggestion-dismiss:hover,.suggestion-dismiss:focus-visible { color:var(--text-main);opacity:1; }
.btn-follow.requested,.btn-follow.requested:disabled {
 opacity:1;background:var(--bg-card);color:var(--text-secondary);border:1px solid var(--border-light);
 font-weight:600;cursor:default;animation:join-request-feedback .3s cubic-bezier(.2,.7,.3,1);
}
@media(max-width:768px) {
 .infeed-people-list>.infeed-people-row { padding-top:22px; }
}

.share-channel-btn { transition:transform .22s ease; }
.share-channel-btn:hover,.share-channel-btn:focus-visible { background:transparent;transform:translateY(-2px); }
.share-channel-btn>span { position:relative; }
.share-channel-btn>span::after {
 content:'';position:absolute;left:0;right:0;bottom:-3px;height:1px;background:currentColor;
 transform:scaleX(0);transform-origin:left;transition:transform .22s ease;
}
.share-channel-btn:hover>span::after,.share-channel-btn:focus-visible>span::after { transform:scaleX(1); }
@media(prefers-reduced-motion:reduce) {
 .share-channel-btn:hover,.share-channel-btn:focus-visible { transform:none; }
}

/* Report Modal Fixes: Flag Icon & Top-Right Cross Button */
#reportPostModal .report-modal-card {
  position: relative !important;
}
#reportPostModal .report-modal-header {
  padding-right: 42px !important;
}
#reportPostModal .report-header-text {
  flex: 1 !important;
  min-width: 0 !important;
}
#reportPostModal .report-icon-circle {
  width: 44px !important;
  height: 44px !important;
  border-radius: 50% !important;
  background: rgba(239, 68, 68, 0.12) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.15) !important;
}
#reportPostModal .report-icon-circle svg {
  width: 22px !important;
  height: 22px !important;
  stroke: #ef4444 !important;
  fill: rgba(239, 68, 68, 0.18) !important;
  stroke-width: 2.2 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
  display: block !important;
}
#reportPostModal .modal-close-btn {
  position: absolute !important;
  top: 14px !important;
  right: 14px !important;
  z-index: 20 !important;
}

/* Sidebar Sponsored Section Compact Refinement */
.sidebar-sponsored-section .section-header { padding: 2px 4px 6px !important; }
.sidebar-sponsored-section .section-header h3 { font-size: 13px !important; font-weight: 700 !important; }
.sidebar-sponsored-section .sponsored-sidebar-pill { font-size: 9.5px !important; padding: 1.5px 6px !important; }
.sidebar-sponsored-section .sponsored-item-link { padding: 5px 6px !important; gap: 10px !important; }
.sidebar-sponsored-section .sponsored-thumb { width: 38px !important; height: 38px !important; border-radius: 6px !important; }
.sidebar-sponsored-section .sponsored-title { font-size: 12px !important; font-weight: 600 !important; margin-bottom: 2px !important; }
.sidebar-sponsored-section .sponsored-desc { font-size: 11px !important; line-height: 1.3 !important; }
.sidebar-sponsored-section .sponsored-domain { font-size: 10.5px !important; }

/* Real feed video uses the browser's accessible playback controls. */
#videoPostMedia { margin-bottom:0; }
#videoPostMedia video { display:block;width:100%;height:100%;object-fit:cover;object-position:center;background:#0b0f0d; }
#videoPostMedia .video-play-overlay { width:100%;height:100%;padding:0;border:0;border-radius:0!important;background:transparent; color:white;cursor:pointer; }
#videoPostMedia .video-play-overlay[hidden] { display:none; }
.video-sample-note { margin:6px 0 0;color:var(--text-muted);font-size:11px; }

/* Desktop people rows reserve a separate slot for dismissal. */
@media(min-width:769px) {
 .infeed-people-row>.suggestion-dismiss { position:static;flex:0 0 24px;align-self:center; }
 .infeed-people-row>.btn-follow { flex-shrink:0;margin-left:0; }
}

/* Feed video controls use the same rounded menu surface as post actions. */
.feed-video-controls { position:absolute;inset:auto 0 0;z-index:3;padding:28px 12px 10px;color:#fff;background:linear-gradient(transparent,#000b); }
.feed-video-control-row { display:flex;align-items:center;gap:6px; }
.feed-video-control-row>button { display:grid;place-items:center;width:34px;height:34px;min-width:34px;padding:7px;border-radius:50%;color:#fff;background:transparent; }
.feed-video-control-row>button:hover { background:#ffffff20; }
.feed-video-control-row svg { width:20px;height:20px; }
.feed-video-time { font-size:12px;font-variant-numeric:tabular-nums;white-space:nowrap; }
.feed-video-spacer { flex:1; }
.feed-video-seek { display:block;width:100%;height:16px;margin:3px 0 0;accent-color:var(--primary-light);cursor:pointer; }
.feed-video-menu { position:absolute;bottom:70px;right:12px;min-width:228px;max-width:calc(100% - 24px);padding:6px;border:1px solid var(--border-card);border-radius:var(--radius-md);background:var(--bg-card);box-shadow:0 10px 30px #0003;color:var(--text-main);opacity:0;visibility:hidden;transform:translateY(6px) scale(.97);transform-origin:bottom right;transition:opacity .2s ease,transform .2s cubic-bezier(.16,1,.3,1),visibility .2s;pointer-events:none; }
.feed-video-menu.show { opacity:1;visibility:visible;transform:translateY(0) scale(1);pointer-events:auto; }
.feed-video-menu small { margin-left:auto;color:var(--text-muted); }
.feed-video-speeds { display:grid;grid-template-columns:repeat(3,1fr);gap:4px;padding:5px 8px 10px; }
.feed-video-speeds[hidden],.feed-video-menu button[hidden],.feed-video-control-row>button[hidden] { display:none; }
.feed-video-speeds button { padding:8px;border-radius:7px;color:var(--text-main);font-size:12px; }
.feed-video-speeds button:hover,.feed-video-speeds button[aria-checked="true"] { background:var(--primary-tint);color:var(--primary-light); }
.feed-video-control-row .is-muted { opacity:.55; }
/* Fullscreen must override feed thumbnail dimensions and cropping. */
:root body #videoPostMedia:fullscreen,
:root body #videoPostMedia:-webkit-full-screen {
  position: fixed !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: none !important;
  max-height: none !important;
  aspect-ratio: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #000 !important;
}
:root body #videoPostMedia:fullscreen video,
:root body #videoPostMedia:-webkit-full-screen video,
:root body #feedPostVideo:fullscreen,
:root body #feedPostVideo:-webkit-full-screen,
:root body .feed-post:has(video) video:fullscreen {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  max-width: none !important;
  max-height: none !important;
  aspect-ratio: auto !important;
  margin: 0 !important;
  object-fit: contain !important;
  object-position: center !important;
  background: #000 !important;
  border-radius: 0 !important;
}
@media(prefers-reduced-motion:reduce) { .feed-video-menu { transition:none; } }

/* Matching pill corners for both creation choices. */
.create-choice-dialog>[data-create-post],.create-choice-dialog>a { border-radius:999px!important; }

/* Keep dismissal at the end of desktop suggestion rows. */
@media(min-width:769px) {
 .infeed-people-row>.infeed-user-meta { order:0; }
 .infeed-people-row>.btn-follow { order:1; }
 .infeed-people-row>.suggestion-dismiss { order:2;position:static;flex:0 0 24px;margin-left:0;align-self:center; }
}


/* ==========================================================================
   FACEBOOK & INSTAGRAM STYLE POST CARDS (SIZE-WISE & STYLE-WISE)
   ========================================================================== */

/* 1. Feed Post Card Container */
.posts-stream > .feed-post,
.feed-post:not(.reel-card) {
  padding: 0 !important;
  border-radius: 10px !important;
  border: 1px solid var(--border-card, #e4e6eb) !important;
  background: var(--bg-card, #ffffff) !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08) !important;
  overflow: hidden !important;
  margin-bottom: 16px !important;
  width: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  transition: box-shadow 0.2s ease, border-color 0.2s ease !important;
}

.posts-stream > .feed-post:hover,
.feed-post:not(.reel-card):hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
}

/* 2. FB/Instagram Post Header */
.feed-post .post-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 12px 16px 8px !important;
  margin-bottom: 0 !important;
  flex-shrink: 0 !important;
  gap: 12px !important;
}

.feed-post .author-info-group {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  min-width: 0 !important;
  flex: 1 !important;
}

/* Hide awkward top-left dropdown before avatar if present */
.feed-post .post-options-top-left {
  display: none !important;
}

.feed-post .author-avatar {
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  flex-shrink: 0 !important;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08) !important;
}

.feed-post .author-details {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  min-width: 0 !important;
  gap: 1px !important;
}

.feed-post .author-name-line {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  flex-wrap: nowrap !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.feed-post .author-name {
  font-size: 14.5px !important;
  font-weight: 700 !important;
  color: var(--text-main, #050505) !important;
  line-height: 1.25 !important;
  margin: 0 !important;
  cursor: pointer;
}

.feed-post .author-name:hover {
  text-decoration: underline !important;
}

.feed-post .post-owner-badge {
  font-size: 10px !important;
  font-weight: 700 !important;
  padding: 1px 5px !important;
  border-radius: 4px !important;
  background: var(--primary-tint, #eaf4ee) !important;
  color: var(--primary-light, #2d6a4f) !important;
}

.feed-post .author-handle,
.feed-post .post-time {
  font-size: 12.5px !important;
  color: var(--text-muted, #65676b) !important;
  font-weight: 400 !important;
}

.feed-post .dot-separator {
  color: var(--text-muted, #8a8d91) !important;
  font-size: 12px !important;
}

.feed-post .author-bio {
  font-size: 12px !important;
  color: var(--text-muted, #65676b) !important;
  margin-top: 1px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  line-height: 1.3 !important;
}

.feed-post .post-header-right {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-shrink: 0 !important;
}

.feed-post .badge-category-pill {
  background-color: var(--bg-hover, #f0f2f5) !important;
  color: var(--text-secondary, #65676b) !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  padding: 3px 9px !important;
  border-radius: 6px !important;
  border: 1px solid var(--border-light, #e4e6eb) !important;
}

.feed-post .post-options-btn {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 50% !important;
  color: var(--text-secondary, #65676b) !important;
  background: transparent !important;
  border: none !important;
  cursor: pointer !important;
  transition: background 0.15s ease, color 0.15s ease !important;
}

.feed-post .post-options-btn:hover {
  background-color: var(--bg-hover, rgba(0, 0, 0, 0.05)) !important;
  color: var(--text-main, #050505) !important;
}

/* 3. Post Caption & Content */
.feed-post > .post-content {
  padding: 0 !important;
  overflow: visible !important;
  display: flex !important;
  flex-direction: column !important;
}

.feed-post .post-title {
  padding: 4px 16px 2px !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
  color: var(--text-main, #050505) !important;
  margin: 0 0 4px 0 !important;
}

.feed-post .post-description {
  padding: 0 16px !important;
  font-size: 14px !important;
  line-height: 1.48 !important;
  color: var(--text-main, #1c1e21) !important;
  margin: 0 0 6px 0 !important;
}

.feed-post .post-description-toggle {
  margin: 0 16px 8px !important;
  padding: 0 !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: var(--text-muted, #65676b) !important;
  cursor: pointer !important;
  background: transparent !important;
  border: none !important;
}

.feed-post .post-description-toggle:hover {
  text-decoration: underline !important;
}

.feed-post .post-tags {
  padding: 0 16px !important;
  margin: 0 0 10px 0 !important;
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
}

.feed-post .post-tags .tag {
  background: transparent !important;
  color: var(--primary-light, #2d6a4f) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  padding: 0 !important;
  border-radius: 0 !important;
  cursor: pointer !important;
}

.feed-post .post-tags .tag:hover {
  text-decoration: underline !important;
}

/* Text-only posts retain comfortable padding */
.feed-post:not(.has-media-post):not(:has(.single-image-wrapper, .post-slider-wrapper, .video-media-card, .video-post-media, .post-gallery-layout, .post-image-strip, .link-preview-box)) > .post-content {
  padding: 0 16px 14px !important;
}

/* 4. Flush Edge-to-Edge Media & FB/IG Dimensions */
.feed-post .single-image-wrapper,
.feed-post .post-slider-wrapper,
.feed-post .video-media-card,
.feed-post .video-post-media,
.feed-post #videoPostMedia,
.feed-post .post-gallery-layout,
.feed-post .post-image-strip {
  width: 100% !important;
  margin: 0 !important;
  border-radius: 0 !important;
  border-left: none !important;
  border-right: none !important;
  overflow: hidden !important;
  position: relative !important;
  flex-shrink: 0 !important;
}

/* Single Image Post */
.feed-post .single-image-wrapper {
  max-height: 540px !important;
  min-height: 280px !important;
  height: auto !important;
  background: #000000 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
}

.feed-post .single-image-wrapper > img {
  position: static !important;
  width: 100% !important;
  height: auto !important;
  max-height: 540px !important;
  object-fit: cover !important;
  display: block !important;
  border-radius: 0 !important;
  transition: transform 0.3s ease !important;
}

.feed-post .single-image-wrapper:hover > img {
  transform: scale(1.015) !important;
}

/* Instagram-style Carousel Slider */
.feed-post .post-slider-wrapper {
  height: 420px !important;
  max-height: 440px !important;
  background: #050505 !important;
}

.feed-post .post-slider-wrapper .slider-track-wrap {
  position: relative !important;
  height: 100% !important;
}

.feed-post .slider-slide-item {
  height: 100% !important;
  min-width: 100% !important;
}

.feed-post .slider-slide-item img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  border-radius: 0 !important;
}

/* Video Post */
.feed-post .video-media-card,
.feed-post .video-post-media,
.feed-post #videoPostMedia {
  aspect-ratio: 16 / 9 !important;
  height: auto !important;
  max-height: 520px !important;
  min-height: 280px !important;
  background: #000000 !important;
}

.feed-post .video-media-card video,
.feed-post .video-post-media video,
.feed-post #videoPostMedia video {
  position: static !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
  border-radius: 0 !important;
}

/* Gallery & Strip: 2px clean gap, flush */
.feed-post .post-gallery-layout {
  height: 320px !important;
  gap: 2px !important;
  border-radius: 0 !important;
  background: #000 !important;
}

.feed-post .gallery-main,
.feed-post .gallery-thumbs,
.feed-post .thumb-box,
.feed-post .strip-item {
  border-radius: 0 !important;
}

.feed-post .post-image-strip {
  gap: 2px !important;
  border-radius: 0 !important;
  margin-bottom: 0 !important;
}

.feed-post .strip-item {
  height: 160px !important;
}

/* Link Preview Box */
.feed-post .link-preview-box {
  margin: 0 !important;
  border-radius: 0 !important;
  border-left: none !important;
  border-right: none !important;
  border-top: 1px solid var(--border-light, #e4e6eb) !important;
  border-bottom: 1px solid var(--border-light, #e4e6eb) !important;
}

/* 5. Post Owner Insights Bar (Single Row, Inset with Gap from Left & Right Lines) */
.feed-post .post-owner-insights-bar {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin: 10px 16px 12px !important;
  padding: 8px 12px !important;
  background: var(--bg-subtle, #f7f9fa) !important;
  border: 1px solid var(--border-light, #e4e6eb) !important;
  border-radius: 10px !important;
  font-size: 13px !important;
  gap: 10px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

.feed-post .post-owner-insights-bar .insights-preview-info {
  display: flex !important;
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  align-items: flex-start !important;
  gap: 4px !important;
  min-width: 0 !important;
  flex: 1 0 auto !important;
}

.feed-post .post-owner-insights-bar .insights-badge-chip {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: var(--text-main, #050505) !important;
  white-space: nowrap !important;
  min-width: 0 !important;
}

.feed-post .post-owner-insights-bar .insights-badge-chip svg {
  width: 16px !important;
  height: 16px !important;
  flex-shrink: 0 !important;
  color: #10b981 !important;
}

.feed-post .post-owner-insights-bar .insights-growth-pill {
  display: inline-flex !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  color: #059669 !important;
  background: rgba(5, 150, 105, 0.12) !important;
  padding: 2px 7px !important;
  border-radius: 9999px !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

.feed-post .post-owner-insights-bar .insights-actions-row {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 8px !important;
  flex-shrink: 0 !important;
  margin-left: auto !important;
}

.feed-post .post-owner-insights-bar .btn-owner-tool {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  padding: 6px 12px !important;
  border-radius: 9999px !important;
  white-space: nowrap !important;
  cursor: pointer !important;
  min-height: 32px !important;
  transition: all 0.15s ease !important;
}

.feed-post .post-owner-insights-bar .btn-insights-trigger {
  background: var(--bg-card, #ffffff) !important;
  color: var(--text-main, #050505) !important;
  border: 1px solid var(--border-light, #e4e6eb) !important;
}

.feed-post .post-owner-insights-bar .btn-insights-trigger:hover {
  background: var(--bg-hover, #f0f2f5) !important;
}

.feed-post .post-owner-insights-bar .btn-boost-trigger {
  background: #1b4332 !important;
  color: #ffffff !important;
  border: 1px solid transparent !important;
}

.feed-post .post-owner-insights-bar .btn-boost-trigger:hover {
  background: #2d6a4f !important;
}

@media (max-width: 500px) {
  .feed-post .post-owner-insights-bar {
    margin: 8px 12px 10px !important;
    padding: 6px 10px !important;
    gap: 6px !important;
  }

  .feed-post .post-owner-insights-bar .btn-owner-tool {
    padding: 5px 9px !important;
    font-size: 11.5px !important;
    min-height: 30px !important;
    gap: 4px !important;
  }
}

/* 6. FB/Instagram Post Footer & Action Buttons */
.feed-post .post-footer {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 4px 12px 6px !important;
  border-top: 1px solid var(--border-light, #e4e6eb) !important;
  margin-top: 0 !important;
  background: var(--bg-card, #ffffff) !important;
  flex-shrink: 0 !important;
}

.feed-post .left-actions,
.feed-post .right-actions {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}

.feed-post .post-action-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  height: 36px !important;
  padding: 0 10px !important;
  border-radius: 6px !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  color: var(--text-secondary, #65676b) !important;
  background: transparent !important;
  border: none !important;
  cursor: pointer !important;
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease !important;
  user-select: none !important;
}

.feed-post .post-action-btn:hover {
  background-color: var(--bg-hover, rgba(0, 0, 0, 0.05)) !important;
  color: var(--text-main, #050505) !important;
}

.feed-post .post-action-btn:active {
  transform: scale(0.96) !important;
}

.feed-post .post-action-btn svg {
  width: 19px !important;
  height: 19px !important;
}

/* Like / Upvote Active State */
.feed-post .upvote-btn.active {
  color: #208b58 !important;
  background-color: rgba(45, 106, 79, 0.08) !important;
}

.feed-post .upvote-btn.active svg {
  fill: currentColor !important;
}

/* Save Active State */
.feed-post .save-btn.active {
  color: var(--primary-light, #2d6a4f) !important;
}

.feed-post .save-btn.active svg {
  fill: currentColor !important;
}

/* Refinements for rich content body and link preview */
.feed-post .rich-content-body {
  padding: 0 16px !important;
}

.feed-post .link-preview-box {
  margin: 0 16px 12px !important;
  border-radius: 8px !important;
  border: 1px solid var(--border-light, #e4e6eb) !important;
}

/* Hide top header new post (+) button on mobile */
@media (max-width: 900px) {
  #headerNewPostBtn,
  .btn-new-post,
  .top-nav #headerNewPostBtn,
  .top-nav .btn-new-post,
  body #headerNewPostBtn,
  body.logged-in #headerNewPostBtn,
  body.logged-in .btn-new-post,
  body.logged-in .top-nav #headerNewPostBtn {
    display: none !important;
  }
}

/* Mobile Stories Carousel: remove left and right space on mobile view */
@media (max-width: 900px) {
  .home-page .feed-main,
  .feed-main:has(.stories-section) {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .stories-section,
  .home-page .stories-section {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-inline: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    padding-inline: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  .stories-track,
  .home-page .stories-track {
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    padding-inline: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-inline: 0 !important;
    gap: 12px !important;
  }
}

/* ==========================================================================
   CENTERED MIDDLE SHARE POST & REPOST MODAL POPUP (NOT A DRAWER)
   ========================================================================== */

/* 1. Backdrop centered vertically and horizontally */
.share-drawer-backdrop,
#shareBottomDrawer,
#repostModal.modal-backdrop,
#repostModal {
  position: fixed !important;
  inset: 0 !important;
  background: rgba(8, 14, 10, 0.68) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  z-index: 2100 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 16px !important;
  box-sizing: border-box !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transition: opacity 0.22s ease, visibility 0.22s ease !important;
}

.share-drawer-backdrop.show,
#shareBottomDrawer.show,
#repostModal.show {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

/* 2. Middle Popup Modal Card */
.share-bottom-drawer,
.repost-modal-card {
  width: 100% !important;
  max-width: 480px !important;
  max-height: min(88vh, 620px) !important;
  background: var(--bg-card, #ffffff) !important;
  border-radius: 20px !important;
  border: 1px solid var(--border-card, #e4e6eb) !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28), 0 4px 16px rgba(0, 0, 0, 0.1) !important;
  padding: 22px 24px 26px !important;
  margin: auto !important;
  position: relative !important;
  overflow-y: auto !important;
  transform: scale(0.92) !important;
  opacity: 0 !important;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease !important;
  box-sizing: border-box !important;
}

.share-drawer-backdrop.show .share-bottom-drawer,
#shareBottomDrawer.show .share-bottom-drawer,
#repostModal.show .repost-modal-card {
  transform: scale(1) !important;
  opacity: 1 !important;
  animation: modalScaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* Hide drawer pull handle / drag pill */
.drawer-drag-pill {
  display: none !important;
}

/* Header */
.drawer-header-row,
.repost-modal-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin-bottom: 16px !important;
  padding: 0 !important;
  border-bottom: none !important;
}

.drawer-header-row h3,
.repost-modal-header h3 {
  font-size: 18px !important;
  font-weight: 700 !important;
  color: var(--text-main, #050505) !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

/* Close Button */
#closeShareDrawerBtn,
#closeRepostModal {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  border-radius: 50% !important;
  background: var(--bg-hover, rgba(0, 0, 0, 0.05)) !important;
  color: var(--text-secondary, #65676b) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: none !important;
  cursor: pointer !important;
  font-size: 20px !important;
  line-height: 1 !important;
  transition: background 0.15s ease, color 0.15s ease !important;
}

#closeShareDrawerBtn:hover,
#closeRepostModal:hover {
  background: var(--bg-active-pill, rgba(0, 0, 0, 0.1)) !important;
  color: var(--text-main, #050505) !important;
}

/* Post community lists escape card clipping and stay within the viewport. */
.post-community-popover[popover], .community-overflow .post-community-popover {
  position: fixed; inset: auto; margin: 0; box-sizing: border-box;
  min-width: 0; max-width: calc(100vw - 24px); padding: 8px;
  overflow-y: auto; overscroll-behavior: contain; z-index: 10000;
}
.post-community-popover a { display: block; padding: 9px 10px; line-height: 1.4; border-radius: 6px; overflow-wrap: anywhere; text-decoration: none; color: var(--text-main); font-size: 13px; }
.post-community-popover a:hover, .post-community-popover a:focus-visible { background: var(--bg-hover); outline-offset: -2px; }

/* Fit desktop community suggestions to the available feed column. */
@media (min-width: 769px) {
  .infeed-grid-row:has(> .infeed-comm-card) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
  }
  .infeed-grid-row > .infeed-comm-card {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }
  .infeed-grid-row > .infeed-comm-card .infeed-comm-name {
    width: 100%;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.4;
    min-height: 2.8em;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .infeed-grid-row > .infeed-comm-card .btn-join {
    min-width: 0;
    box-sizing: border-box;
    margin-top: auto;
  }
}

/* Keep suggestion text within its flex column, clear of Follow and dismiss. */
.infeed-people-row > .infeed-user-meta { min-width: 0; }
.infeed-people-row .infeed-user-meta > div { min-width: 0; flex: 1; }
.infeed-people-row .infeed-user-bio { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.infeed-people-row > .btn-follow { flex-shrink: 0; }

.community-rules-dialog { box-sizing: border-box; width: min(540px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); overflow-y: auto; padding: 0; border: 1px solid var(--border-light); border-radius: 20px; background: var(--bg-card, white); color: var(--text-main); box-shadow: 0 24px 80px #0003; }
.community-rules-dialog::backdrop { background: #10271d99; backdrop-filter: blur(3px); }
.community-rules-header { padding: 24px 26px 18px; border-bottom: 1px solid var(--border-light); }
.community-rules-dialog .community-rules-name { margin: 0 0 6px; color: var(--primary-light, #2d6a4f); font-size: 12px; font-weight: 700; letter-spacing: .3px; }
.community-rules-dialog h2 { font-size: 23px; line-height: 1.3; margin: 0 0 8px; }
.community-rules-dialog p { margin: 0; font-size: 13px; line-height: 1.6; color: var(--text-secondary); }
.community-rules-dialog .community-rules-list { list-style: none; counter-reset: community-rule; margin: 0; padding: 6px 26px; }
.community-rules-list > li { counter-increment: community-rule; display: flex; align-items: flex-start; gap: 12px; padding: 14px 0; }
.community-rules-list > li + li { border-top: 1px solid var(--border-light); }
.community-rules-list > li::before { content: counter(community-rule); display: grid; place-items: center; flex: 0 0 28px; height: 28px; border-radius: 50%; background: var(--primary-tint, #eaf3ed); color: var(--primary-light, #2d6a4f); font-size: 12px; font-weight: 700; }
.community-rules-list strong { display: block; margin: 1px 0 3px; font-size: 14px; line-height: 1.4; }
.community-rules-footer { padding: 16px 26px 22px; border-top: 1px solid var(--border-light); background: var(--bg-subtle, #f7faf8); }
.community-rules-footer > p { font-size: 12px; margin-bottom: 14px; }
.community-rules-actions { display: flex; justify-content: flex-end; gap: 10px; }
.community-rules-actions .btn { min-height: 40px; padding: 10px 20px; }
@media (max-width: 480px) { .community-rules-header { padding: 20px; } .community-rules-dialog .community-rules-list { padding-inline: 20px; } .community-rules-footer { padding: 16px 20px 20px; } .community-rules-actions .btn { flex: 1; padding-inline: 12px; } }


/* Compact desktop composer: avatar beside the prompt, actions below. */
@media (min-width: 769px) {
  .home-page .create-post-card.create-post-launcher {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 16px 20px;
  }
  .create-post-launcher > .composer-identity { grid-column: 1; grid-row: 1; margin: 0; padding: 0; }
  .create-post-launcher .composer-identity-name { display: none; }
  .create-post-launcher > .create-post-top { grid-column: 2; grid-row: 1; min-width: 0; margin: 0; width: 100%; }
  .create-post-launcher .composer-writing-stack { min-width: 0; width: 100%; }
  .create-post-launcher .composer-launch-prompt { width: 100%; box-sizing: border-box; min-height: 46px; }
  .create-post-launcher > .create-post-actions { grid-column: 1 / -1; width: 100%; box-sizing: border-box; margin: 0; }
  /* Also keep the initial markup aligned while the composer initializes. */
  .home-page .create-post-card:not(.expanded):not(.create-post-launcher) .create-post-top { display: flex; align-items: center; gap: 12px; }
  .home-page .create-post-card:not(.expanded) .create-post-top > .user-avatar { margin-top: 0; flex-shrink: 0; }
}
.posts-stream > .infeed-suggestion-widget[hidden] { display: none !important; }

/* Restore the compact feed composer shown in the reference. */
.create-post-card.create-post-launcher { box-sizing: border-box; border-radius: 16px; }
.create-post-launcher .composer-launch-prompt {
  display: block;
  height: 48px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--border-light);
  background: var(--bg-input);
  font-size: 14px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.create-post-launcher .create-post-actions { padding-top: 12px; border-top: 1px solid var(--border-light); gap: 12px; }
.create-post-launcher .media-type-buttons { display: flex; align-items: center; gap: 16px; min-width: 0; }
.create-post-launcher .post-type-btn { padding: 6px 0; font-size: 14px; color: var(--text-secondary); background: transparent; }
.create-post-launcher .post-type-btn svg { color: var(--text-secondary); width: 18px; height: 18px; }
.create-post-launcher .btn-post-submit { flex-shrink: 0; margin-left: auto; min-height: 38px; padding: 9px 24px; border-radius: 999px; font-size: 14px; line-height: 20px; }

/* Feed filtering must override the cards' explicit display:flex rules. */
.posts-stream > .feed-post[hidden],
.posts-stream > .infeed-suggestion-widget[hidden],
.feed-scroll-sentinel [hidden] { display: none !important; }

/* The source composer matches the launcher before enhancement loads. */
@media (min-width: 769px) {
  .home-page .create-post-card:not(.create-post-launcher):not(.expanded) { display: block; padding: 16px 20px; box-sizing: border-box; border-radius: 16px; }
  .home-page .create-post-card:not(.create-post-launcher):not(.expanded) > .create-post-top { display: flex; align-items: center; margin: 0 0 12px; gap: 12px; }
  .home-page .create-post-card:not(.expanded) #fakePostInput { box-sizing: border-box; min-width: 0; min-height: 48px; display: flex; align-items: center; padding: 0 18px; border-radius: 999px; font-size: 14px; }
  .home-page .create-post-card:not(.expanded) .media-type-buttons { display: flex; gap: 16px; }
  .home-page .create-post-card:not(.expanded) .post-type-btn { color: var(--text-secondary); padding: 6px 0; }
  .home-page .create-post-card:not(.expanded) .post-type-btn svg { color: var(--text-secondary); }
}

.posts-stream > .sponsored-ad-card[hidden] { display: none !important; }

/* Compact rules popup with a close icon and no visible scrollbar. */
.community-rules-dialog { scrollbar-width: none; max-height: calc(100dvh - 24px); }
.community-rules-dialog::-webkit-scrollbar { display: none; width: 0; height: 0; }
.community-rules-header { position: relative; padding: 20px 24px 16px; }
.community-rules-dialog .community-rules-name { padding-right: 40px; }
.community-rules-close { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; color: var(--text-secondary); cursor: pointer; }
.community-rules-close:hover { background: var(--bg-hover); color: var(--text-main); }
.community-rules-close:focus-visible { outline: 2px solid var(--primary-light); outline-offset: 2px; }
.community-rules-list > li { padding-block: 11px; }
.community-rules-footer { padding: 14px 24px 18px; }
@media (max-height: 760px) {
  .community-rules-header { padding: 16px 24px 12px; }
  .community-rules-dialog h2 { font-size: 21px; margin-bottom: 6px; }
  .community-rules-list > li { padding-block: 8px; }
  .community-rules-dialog p { line-height: 1.45; }
  .community-rules-footer { padding: 12px 24px 14px; }
  .community-rules-footer > p { margin-bottom: 10px; }
}

/* This feed video uses a landscape crop in both preview and fullscreen. */
:root body #videoPostMedia:not(:fullscreen):not(:-webkit-full-screen) {
  aspect-ratio: 16 / 9 !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
}
:root body #videoPostMedia:not(:fullscreen):not(:-webkit-full-screen) #feedPostVideo {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  object-fit: cover !important;
  object-position: center !important;
}
:root body #videoPostMedia:fullscreen #feedPostVideo,
:root body #videoPostMedia:-webkit-full-screen #feedPostVideo,
:root body #feedPostVideo:fullscreen,
:root body #feedPostVideo:-webkit-full-screen {
  position: absolute !important;
  inset: 0 !important;
  margin: auto !important;
  width: min(100vw, 177.7778vh) !important;
  height: min(100vh, 56.25vw) !important;
  max-height: none !important;
  aspect-ratio: 16 / 9 !important;
  object-fit: cover !important;
  object-position: center !important;
}
