/* FPC Wire v2.3.2a — Hardened UI Reliability Styles */

/* Consolidated post/profile overlay foundation */
/* FPC Wire v2.3.1b — Post & Profile Overlay Experience */
.wire-overlay-shell[hidden] {
  display: none !important;
}

.wire-overlay-shell {
  position: fixed;
  inset: 0;
  z-index: 11000;
  display: grid;
  place-items: center;
}

.wire-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .66);
  opacity: 0;
  backdrop-filter: blur(4px);
  transition: opacity .2s ease;
}

.wire-overlay-panel {
  position: relative;
  z-index: 1;
  width: min(720px, calc(100vw - 32px));
  max-height: min(88dvh, 920px);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(110, 139, 173, .34);
  border-radius: 18px;
  background: #07111d;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .62);
  opacity: 0;
  transform: translateY(12px) scale(.985);
  transition: opacity .2s ease, transform .22s ease;
  overflow: hidden;
}

.wire-overlay-profile {
  width: min(520px, calc(100vw - 32px));
  justify-self: end;
  height: 100dvh;
  max-height: 100dvh;
  border-radius: 18px 0 0 18px;
  transform: translateX(28px);
}

.wire-overlay-shell.is-open .wire-overlay-backdrop {
  opacity: 1;
}

.wire-overlay-shell.is-open .wire-overlay-panel {
  opacity: 1;
  transform: none;
}

.wire-overlay-header {
  min-height: 54px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(110, 139, 173, .22);
  background: rgba(7, 17, 29, .96);
}

.wire-overlay-header strong {
  font-size: 16px;
}

.wire-overlay-close {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(110, 139, 173, .35);
  border-radius: 50%;
  background: #101c2a;
  color: #fff;
  font-size: 24px;
  line-height: 1;
}

.wire-overlay-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.wire-overlay-extracted-content {
  min-height: 100%;
}

.wire-overlay-body .content-header,
.wire-overlay-body .page-header {
  position: static !important;
}

.wire-overlay-body .post-card,
.wire-overlay-body .profile-page,
.wire-overlay-body .profile-shell {
  border-left: 0;
  border-right: 0;
  border-radius: 0;
}

.wire-overlay-post-nav {
  min-height: 48px;
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid rgba(110, 139, 173, .22);
  background: #07111d;
}

.wire-overlay-post-nav[hidden] {
  display: none;
}

.wire-overlay-post-nav button {
  flex: 1;
  min-height: 34px;
  border: 1px solid rgba(110, 139, 173, .32);
  border-radius: 999px;
  background: #101c2a;
  color: #e8f0fa;
}

.wire-overlay-post-nav button:disabled {
  opacity: .35;
}

.wire-overlay-skeleton {
  padding: 20px;
  display: grid;
  gap: 12px;
}

.wire-overlay-skeleton-line,
.wire-overlay-skeleton-block {
  border-radius: 10px;
  background: linear-gradient(90deg, #0e1926 25%, #17283b 50%, #0e1926 75%);
  background-size: 200% 100%;
  animation: wire-overlay-shimmer 1.15s linear infinite;
}

.wire-overlay-skeleton-line {
  height: 16px;
}

.wire-overlay-skeleton-line-short {
  width: 42%;
}

.wire-overlay-skeleton-block {
  height: 230px;
}

@keyframes wire-overlay-shimmer {
  to { background-position: -200% 0; }
}

body.wire-overlay-open {
  overflow: hidden;
}

@media (max-width: 799px) {
  .wire-overlay-shell {
    place-items: end stretch;
  }

  .wire-overlay-panel {
    width: 100%;
    max-height: 92dvh;
    border-radius: 18px 18px 0 0;
    transform: translateY(100%);
  }

  .wire-overlay-profile {
    width: min(92vw, 430px);
    height: 100dvh;
    max-height: 100dvh;
    justify-self: end;
    border-radius: 18px 0 0 18px;
    transform: translateX(100%);
  }

  .wire-overlay-header {
    padding-top: max(10px, env(safe-area-inset-top));
  }

  .wire-overlay-body {
    padding-bottom: env(safe-area-inset-bottom);
  }

  .wire-overlay-post-nav {
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  .wire-overlay-backdrop,
  .wire-overlay-panel,
  .wire-overlay-skeleton-line,
  .wire-overlay-skeleton-block {
    transition: none;
    animation: none;
  }
}

/* Reliability and consistency overrides */
/* FPC Wire v2.3.2 — UI Reliability & Consistency */

/* Global interaction consistency */
:where(a,button,input,textarea,select,summary,[tabindex]):focus-visible{
  outline:2px solid rgba(255,55,85,.92)!important;
  outline-offset:2px!important;
}

button,
[role="button"],
summary{
  touch-action:manipulation;
}

/* Keep overlays and dialogs above rails, menus, and mobile navigation. */
.wire-overlay-shell{
  z-index:11000!important;
}

dialog[open]{
  z-index:12000!important;
}

dialog::backdrop{
  z-index:11999!important;
}

/* Post menus remain usable regardless of card height. */
.post-card,
.post-main,
.post-main > header{
  overflow:visible!important;
}

.post-safety-menu{
  position:relative!important;
}

.post-safety-menu[open]{
  z-index:2600!important;
}

.post-safety-menu > div{
  max-width:min(250px,calc(100vw - 24px))!important;
  max-height:min(70dvh,460px)!important;
  overflow-y:auto!important;
  overscroll-behavior:contain!important;
}

/* Overlay scrolling and safe-area reliability. */
.wire-overlay-body{
  overscroll-behavior:contain!important;
  scrollbar-gutter:stable;
}

.wire-overlay-panel{
  max-height:min(90dvh,920px)!important;
}

.wire-overlay-close,
[data-close-embed],
[data-close-report],
[data-close-quote]{
  min-width:36px!important;
  min-height:36px!important;
}

/* Reply thread consistency. */
.wire-overlay-replies-list > .post-card,
.wire-overlay-replies-list > [data-wire-post-id]{
  overflow:visible!important;
}

/* Embed modal layout reliability. */
.wire-embed-modal-body,
.wire-embed-modal-body > label{
  min-width:0!important;
}

.wire-embed-code{
  display:block!important;
  width:100%!important;
  max-width:100%!important;
  box-sizing:border-box!important;
}

/* Right rail cards cannot overlap one another. */
.right-rail{
  align-content:start!important;
}

.right-rail > *{
  position:relative;
  min-width:0;
}

.wire-sidebar-news,
.radio-card{
  clear:both;
  isolation:isolate;
}

/* Sidebar navigation controls remain compact and predictable. */
.wire-sidebar-news-controls button{
  flex:0 0 auto!important;
}

.rss-network-media img{
  object-fit:cover!important;
}

/* Motion reduction without disabling functionality. */
@media(prefers-reduced-motion:reduce){
  .wire-overlay-backdrop,
  .wire-overlay-panel,
  dialog,
  .post-card{
    animation:none!important;
    transition:none!important;
    scroll-behavior:auto!important;
  }
}

@media(max-width:799px){
  .wire-overlay-panel{
    max-height:100dvh!important;
    padding-bottom:env(safe-area-inset-bottom);
  }

  .post-safety-menu > div{
    max-height:min(58dvh,430px)!important;
  }

  dialog[open]{
    max-height:92dvh!important;
    margin:auto!important;
  }

  .wire-embed-modal footer,
  .report-modal footer,
  .quote-modal footer{
    padding-bottom:calc(12px + env(safe-area-inset-bottom))!important;
  }
}

/* Final release guards */
.wire-overlay-shell[hidden],
[data-wire-overlay-shell][hidden]{
  display:none!important;
}

.post-safety-menu > div{
  z-index:2700!important;
}

.wire-sidebar-news > header{
  min-width:0;
}

.wire-sidebar-news-tools{
  margin-left:auto;
}

.wire-sidebar-news-controls button{
  appearance:none;
  -webkit-appearance:none;
}

@media(max-width:799px){
  .wire-overlay-panel{
    width:100%!important;
  }

  .wire-overlay-profile{
    width:min(92vw,430px)!important;
  }
}
