/* Final responsive safety layer. Keep this stylesheet last in the cascade. */
[hidden]{display:none!important}
html,body{max-width:100%;overflow-x:clip}
img,video,canvas,svg{max-width:100%}
main,.page,.feed-column,.standard-page{min-width:0}
button,input,textarea,select{max-width:100%}
.danger-zone{grid-column:1/-1;border-color:#efcaca;background:#fff8f8}
.danger-zone h2{color:#a51f1f}
.danger-delete-account,.delete-account-confirm{border:0;border-radius:12px;background:#b42323;color:#fff;padding:11px 16px;font-weight:700;cursor:pointer}
.delete-account-dialog{width:min(500px,calc(100vw - 24px));border:0;padding:0;background:transparent}
.delete-account-dialog::backdrop{background:#000b;backdrop-filter:blur(6px)}
.delete-account-card{background:#fff;border-radius:20px;overflow:hidden}
.delete-account-body{padding:22px}
.delete-account-body>p{color:#555;line-height:1.5}
.delete-account-body label{display:block;margin:16px 0;font-size:13px;font-weight:700}
.delete-account-body input{display:block;width:100%;margin-top:7px;padding:12px;border:1px solid #ccc;border-radius:10px;font-size:16px}
.delete-account-error{padding:10px;border-radius:8px;background:#fff0f0;color:#981b1b!important}
.delete-account-confirm{width:100%;min-height:46px}
.delete-account-confirm:disabled{opacity:.6;cursor:wait}

@media (min-width:721px) and (max-width:900px){
  .auth-shell{grid-template-columns:minmax(0,1fr) minmax(360px,.9fr)}
  .auth-hero{padding:6vw}
  .auth-hero h1{font-size:clamp(44px,7vw,64px);letter-spacing:-3px}
  .auth-panel{padding:24px}
}

@media (min-width:721px) and (max-width:1050px){
  .standard-page{width:auto;max-width:none;padding:32px clamp(20px,4vw,44px) 80px}
  #profilePage{width:calc(100vw - 284px);margin:24px 20px 100px}
  .create-page{width:calc(100vw - 284px);padding-inline:20px}
  .messages-page{width:auto}
  .page-head{gap:20px}
}

/* Tablets e telemóveis em modo horizontal: nunca comprimir a interface de desktop. */
@media (max-width:900px){
  .sidebar{display:none!important}
  .app-shell main{margin-left:0!important;width:100%;min-height:100dvh}
  .mobile-header{height:64px;display:flex!important;align-items:center;justify-content:space-between;padding:0 15px;background:#0d0d0d;color:#fff;position:sticky;top:0;z-index:30}
  .mobile-header .brand{padding:0}
  .mobile-nav{position:fixed;display:flex!important;bottom:0;left:0;right:0;height:68px;background:#0d0d0d;z-index:30;justify-content:space-around;padding-bottom:env(safe-area-inset-bottom)}
  .mobile-nav>button{border:0;background:transparent;color:#aaa;width:20%;min-width:44px;font-size:23px}
  .mobile-nav>button.active{color:#fff}
  .mobile-nav .mobile-create{background:#fff;color:#111;border-radius:10px;width:48px;height:48px;align-self:center}
  .page.active{width:100%;max-width:100%}
  .feed-column{width:100%;margin:0;padding-bottom:88px}
  .standard-page{width:100%;max-width:none;padding:25px 14px 96px}
  #profilePage{width:100%;margin:0 0 88px}
  .create-page{width:100%;padding-inline:14px}
  .right-rail{display:none!important}
}

/* A barra inferior pode ter atalhos extra (Privacidade e Administração). */
@media (max-width:900px){
  .mobile-nav{justify-content:flex-start!important;overflow-x:auto;scrollbar-width:none;overscroll-behavior-x:contain}
  .mobile-nav>button,.mobile-nav .mobile-privacy,.mobile-nav .mobile-admin{display:grid!important;place-items:center;align-content:center;gap:3px;flex:0 0 72px;width:72px!important;height:64px!important;min-height:64px!important;font-size:10px!important;line-height:1.1!important;color:#aaa}
  .mobile-nav>button span{display:block!important;font-size:10px!important;line-height:1.1!important;white-space:nowrap}
  .mobile-nav>button .ui-icon{width:23px;height:23px}
  .mobile-nav .mobile-create{flex-basis:56px;width:56px!important;height:56px!important;min-height:56px!important;margin-inline:3px;color:#111}
}

@media (max-width:720px){
  html{scroll-padding-top:calc(136px + env(safe-area-inset-top))}
  body{min-height:100dvh}
  .app-shell main{width:100%;min-height:100dvh}
  .page.active{width:100%;max-width:100%}
  .mobile-nav>button{width:100%!important;min-width:44px}
  .post-menu{width:44px!important;height:44px!important}
  .mobile-header{padding-top:max(8px,env(safe-area-inset-top))!important}
  .feed-tabs,.content-filters{-webkit-overflow-scrolling:touch}
  .post-copy,.bio,.notification-copy,.chat-bubble{overflow-wrap:anywhere}
  dialog[open]{max-width:100vw;max-height:100dvh}
  .modal-card{max-width:100vw}
  .modern-card .post-actions{overscroll-behavior-inline:contain}
}

@media (max-width:360px){
  .mobile-wordmark span{font-size:20px}
  .mobile-header{padding-inline:10px!important}
  .mobile-head-actions{gap:0}
  .modern-card{width:calc(100% - 12px)!important;margin-inline:6px!important}
  .type-picker{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
