
/* v1.0.0-beta.5.7.2 — mobile recovery + full-page star scatter */
body.mobile-layout .mobile-tools-toggle{
  display:inline-flex!important;visibility:visible!important;opacity:1!important;pointer-events:auto!important;
}
body.mobile-layout .topbar{position:sticky!important;top:0!important;z-index:400!important}
body.mobile-layout .topbar-inner{min-width:0!important}
body.mobile-layout .brand-wrap{flex:1 1 auto!important;min-width:0!important}
body.mobile-layout #brandTitle{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body.mobile-layout .toolbar{
  z-index:520!important;
  max-width:min(520px,calc(100vw - 20px))!important;
  max-height:calc(100dvh - var(--mobile-header-height,64px) - 14px)!important;
  overflow:auto!important;
  overscroll-behavior:contain;
  padding-bottom:calc(16px + env(safe-area-inset-bottom))!important;
}
body.mobile-layout .mobile-tools-backdrop{z-index:515!important}
body.mobile-layout.mobile-recovery-forced #layoutModeBtn::after{content:' · авто-восстановление';font-size:9px}

/* A single, explicit scroll container for the character dossier. */
body.mobile-layout #profileModal{
  padding:0!important;overflow:hidden!important;align-items:stretch!important;background:rgba(5,6,10,.96)!important;
}
body.mobile-layout #profileModal>.modal{
  display:grid!important;grid-template-rows:auto minmax(0,1fr)!important;
  width:100%!important;height:100dvh!important;max-height:100dvh!important;
  margin:0!important;border:0!important;border-radius:0!important;overflow:hidden!important;
}
body.mobile-layout #profileModal .modal-head{
  position:relative!important;top:auto!important;z-index:30!important;
  min-height:64px!important;padding:10px 12px!important;border-radius:0!important;
  background:rgba(16,17,23,.985)!important;box-shadow:0 1px 0 rgba(210,177,116,.18),0 8px 24px rgba(0,0,0,.22)!important;
}
body.mobile-layout #profileModal .modal-head h3{font-size:clamp(19px,5.4vw,23px)!important}
body.mobile-layout #profileModal .modal-head .btn{min-height:42px!important}
body.mobile-layout #profileContent{
  min-width:0!important;min-height:0!important;height:100%!important;
  overflow-y:auto!important;overflow-x:hidden!important;-webkit-overflow-scrolling:touch;
  overscroll-behavior:contain;scroll-behavior:smooth;scroll-padding-top:68px;
  padding:0 0 calc(28px + env(safe-area-inset-bottom))!important;
}
body.mobile-layout #profileContent .preview-profile{
  display:block!important;width:100%!important;min-width:0!important;min-height:100%!important;
  border:0!important;border-radius:0!important;overflow:visible!important;box-shadow:none!important;
}
body.mobile-layout #profileContent .preview-profile[class*="frame-"] .profile-image{
  position:relative!important;inset:auto!important;
  width:calc(100% - 16px)!important;height:auto!important;min-height:220px!important;max-height:none!important;
  margin:8px!important;border-radius:16px!important;overflow:hidden!important;
  display:grid!important;place-items:center!important;
  background:linear-gradient(145deg,rgba(27,28,37,.98),rgba(14,15,20,.98))!important;
}
body.mobile-layout #profileContent .profile-image img{
  display:block!important;width:auto!important;max-width:100%!important;height:auto!important;min-height:0!important;max-height:72dvh!important;
  object-fit:contain!important;object-position:center top!important;background:rgba(10,11,16,.36)!important;
}
body.mobile-layout #profileContent .profile-image>.initials{width:100%;min-height:240px!important;height:auto!important}
body.mobile-layout #profileContent .profile-image-overlay{left:10px!important;right:10px!important;bottom:10px!important}
body.mobile-layout #profileContent .profile-copy{
  width:100%!important;min-width:0!important;padding:12px 14px calc(40px + env(safe-area-inset-bottom))!important;
  overflow:visible!important;
}
body.mobile-layout #profileContent .profile-nav{
  position:sticky!important;top:0!important;z-index:24!important;
  width:100%!important;max-width:100%!important;margin:0 0 14px!important;padding:6px!important;
  overflow-x:auto!important;overflow-y:hidden!important;scrollbar-width:none;
  background:rgba(16,17,23,.97)!important;box-shadow:0 8px 18px rgba(0,0,0,.2)!important;
}
body.mobile-layout #profileContent .profile-nav::-webkit-scrollbar{display:none}
body.mobile-layout #profileContent .profile-nav button{flex:0 0 auto!important;min-height:42px!important}
body.mobile-layout #profileContent .profile-section-anchor{scroll-margin-top:64px!important}
body.mobile-layout #profileContent .profile-title-row{grid-template-columns:minmax(0,1fr) auto!important;gap:10px!important}
body.mobile-layout #profileContent .profile-title-row>div{min-width:0!important}
body.mobile-layout #profileContent .profile-copy h3{font-size:clamp(31px,10vw,42px)!important;overflow-wrap:anywhere}
body.mobile-layout #profileContent .profile-copy h5{overflow-wrap:anywhere}
body.mobile-layout #profileContent .profile-register{grid-template-columns:repeat(2,minmax(0,1fr))!important}
body.mobile-layout #profileContent .profile-columns{grid-template-columns:minmax(0,1fr)!important}
body.mobile-layout #profileContent .profile-panel,body.mobile-layout #profileContent .profile-lore-box,body.mobile-layout #profileContent .profile-secret-wrap{min-width:0!important;overflow-wrap:anywhere}
body.mobile-layout #profileContent .profile-link{width:100%!important;min-width:0!important;text-align:left!important}
body.mobile-layout #profileContent .quick-actions{display:grid!important;grid-template-columns:minmax(0,1fr)!important;padding-bottom:12px!important}
body.mobile-layout #profileContent .quick-actions .btn{width:100%!important;min-height:46px!important}

/* Compact mobile character list without hiding content. */
body.mobile-layout #characterGrid{grid-template-columns:minmax(0,1fr)!important;gap:14px!important}
body.mobile-layout .character-card{min-width:0!important;height:auto!important;max-height:none!important}
body.mobile-layout .character-card .portrait{height:clamp(170px,48vw,214px)!important;min-height:170px!important}
body.mobile-layout .character-card .card-body{min-width:0!important}
body.mobile-layout .character-card .card-top{align-items:flex-start!important;gap:8px!important}
body.mobile-layout .character-card h4,body.mobile-layout .character-card .subtitle{overflow-wrap:anywhere}
body.mobile-layout .character-card .card-actions{grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important}
body.mobile-layout .character-card .card-actions .edit-only{grid-column:1/-1!important}

/* New stars use real page coordinates, not shared corner slots. */
.beta31-star-canvas.beta32-star-page,.beta32-star-page{position:relative!important;overflow:visible!important;isolation:auto!important;z-index:auto!important}
.beta32-star-scroll-space{display:block;width:1px;height:calc(118px + env(safe-area-inset-bottom));pointer-events:none;visibility:hidden}
.beta3-hidden-star{scroll-margin-block:110px 132px}
.beta3-hidden-star{
  left:var(--beta32-star-left,50%)!important;top:var(--beta32-star-top,120px)!important;
  right:auto!important;bottom:auto!important;z-index:340!important;
  width:48px!important;height:48px!important;opacity:.68!important;
  transform:translate(-50%,-50%)!important;
  background:radial-gradient(circle,rgba(255,249,222,.22),rgba(210,177,116,.08) 42%,transparent 72%)!important;
  filter:drop-shadow(0 0 7px color-mix(in srgb,var(--star-color) 52%,transparent));
}
.beta3-hidden-star::before{inset:5px!important}
.beta3-hidden-star:hover,.beta3-hidden-star:focus-visible{
  opacity:1!important;transform:translate(-50%,-50%) scale(1.16) rotate(16deg)!important;z-index:350!important;
}
.beta3-hidden-star.is-found{animation:beta32StarFound .9s ease forwards!important}
@keyframes beta32StarFound{
  0%{opacity:1;transform:translate(-50%,-50%) scale(1)}
  45%{opacity:1;transform:translate(-50%,-50%) scale(1.75) rotate(90deg)}
  100%{opacity:0;transform:translate(-50%,calc(-50% - 28px)) scale(.42) rotate(180deg)}
}
@media(max-width:760px){
  .beta3-hidden-star{width:52px!important;height:52px!important;font-size:22px!important;opacity:.76!important}
  body.mobile-layout #profileContent .profile-kicker{margin-top:0!important}
}
@media(max-width:420px){
  body.mobile-layout #profileModal .modal-head{gap:8px!important;align-items:center!important}
  body.mobile-layout #profileModal .modal-head h3{font-size:19px!important}
  body.mobile-layout #profileContent .profile-title-row{grid-template-columns:minmax(0,1fr)!important}
  body.mobile-layout #profileContent .profile-title-row>div:last-child{justify-items:start!important;grid-template-columns:auto minmax(0,1fr)!important;align-items:center!important}
}
@media(orientation:landscape) and (max-height:600px){
  body.mobile-layout #profileContent .preview-profile[class*="frame-"] .profile-image{min-height:180px!important}
  body.mobile-layout #profileContent .profile-image img{max-height:58dvh!important}
}
