/* MineHub V8 responsive + launch polish.
   Kept separate from the core theme so responsive behavior is easy to audit. */

html{overflow-x:hidden;-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{min-width:0;min-height:100%;overflow-x:hidden;overflow-y:auto;overscroll-behavior-y:auto;-webkit-overflow-scrolling:touch}
.shell{min-height:100vh;min-height:100dvh}
button,a,input,textarea,select,summary{-webkit-tap-highlight-color:transparent}
button,input,textarea,select{min-width:0}
textarea{resize:vertical}
:focus-visible{outline:3px solid color-mix(in srgb,var(--accent) 48%,transparent);outline-offset:2px}
.icon-btn,.btn,.nav-link,.category-tab,.version-filter,.dash-nav button{touch-action:manipulation}
.mobile-nav{display:none;position:relative}
.mobile-nav summary{list-style:none}
.mobile-nav summary::-webkit-details-marker{display:none}
.mobile-nav-popover{position:absolute;right:0;top:48px;z-index:100;width:230px;padding:7px;border:1px solid var(--line-strong);border-radius:14px;background:var(--surface);box-shadow:var(--shadow)}
.mobile-nav-popover button{width:100%;min-height:44px;border:0;border-radius:10px;background:transparent;color:var(--muted);display:flex;align-items:center;gap:10px;padding:10px 11px;text-align:left;font-weight:750}
.mobile-nav-popover button:hover,.mobile-nav-popover button:focus-visible{background:var(--surface-2);color:var(--text)}
.mobile-nav-popover .mobile-primary{color:var(--accent);background:var(--accent-soft)}
.user-chip{border:1px solid var(--line);min-height:42px}
.btn,.icon-btn{min-height:42px}
.icon-btn{width:42px}

/* smoother cards and clearer hierarchy */
.project-card,.feature-card,.dash-card,.filter-section,.side-card,.project-header-card,.project-content-card{contain:paint}
.project-card{will-change:transform}
.project-card h3,.feature-card h3,.project-title h1,.dash-main h1{overflow-wrap:anywhere}
.prose,.project-card .desc,.queue-item p,.community-item p{overflow-wrap:anywhere;word-break:break-word}
.empty-state{display:grid;place-items:center;align-content:center}
.empty-state>*{max-width:520px}
.results-head{min-width:0}
.results-head>div{min-width:0}

/* tables never break page width */
.dash-card-body{max-width:100%;overflow-x:auto;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}
.project-table{min-width:680px}
.project-table td,.project-table th{white-space:normal}
.table-actions{flex-wrap:wrap}

/* large desktop */
@media (min-width:1440px){
  :root{--max:1320px}
  .discover-grid{grid-template-columns:270px minmax(0,1fr);gap:28px}
  .project-card{grid-template-columns:82px minmax(0,1fr) 150px;padding:18px}
  .project-card .project-art{width:82px;height:82px}
  .dashboard-layout{grid-template-columns:240px minmax(0,1fr);gap:28px}
}

/* laptops and tablets */
@media (max-width:1100px){
  .container{width:min(var(--max),calc(100% - 32px))}
  .discover-grid{grid-template-columns:220px minmax(0,1fr);gap:18px}
  .filter-section{padding:14px}
  .project-card{grid-template-columns:68px minmax(0,1fr)}
  .project-card .project-art{width:68px;height:68px}
  .project-stats{grid-column:2;display:flex;flex-wrap:wrap;gap:8px 16px;min-width:0;text-align:left}
  .statline{justify-content:flex-start}
  .dashboard-layout{grid-template-columns:200px minmax(0,1fr);gap:18px}
}

@media (max-width:860px){
  .topbar-inner{height:64px;gap:12px}
  .primary-nav{display:none}
  .mobile-nav{display:block}
  .mobile-menu{display:inline-flex}
  .desktop-auth{display:none!important}
  .hero-inner{padding:58px 0 48px}
  .hero p{max-width:620px}
  .feature-grid{grid-template-columns:repeat(2,minmax(0,1fr))}

  .discover-hero{padding:30px 0 22px}
  .discover-grid{grid-template-columns:1fr}
  .filter-panel{display:block;position:static}
  .filter-heading,.filter-note{display:none}
  .version-section{padding:0;border:0;background:transparent;box-shadow:none;margin:0 0 12px}
  .version-section h3,.version-section .filter-help{display:none}
  .version-options{display:flex;gap:8px;overflow-x:auto;padding:1px 0 5px;scroll-snap-type:x proximity;scrollbar-width:none}
  .version-options::-webkit-scrollbar{display:none}
  .version-filter{width:auto;min-width:max-content;min-height:42px;padding:8px 10px;scroll-snap-align:start;background:var(--surface);border:1px solid var(--line)}
  .version-filter small{display:none}
  .discover-toolbar{position:sticky;top:64px;z-index:30;padding:10px 0;background:color-mix(in srgb,var(--bg) 92%,transparent);backdrop-filter:blur(12px)}
  .toolbar-search{height:46px}
  .sort-menu summary{height:46px;min-width:46px;width:46px;padding:0;justify-content:center}
  .sort-menu summary>span:not(.sort-chevron){display:none}
  .sort-chevron{display:none}
  .sort-popover{top:52px;max-width:calc(100vw - 28px)}

  .dashboard-layout{grid-template-columns:1fr}
  .dashboard-sidebar{position:static;min-width:0}
  .dash-user{margin-bottom:8px}
  .dash-nav{display:flex;gap:5px;overflow-x:auto;padding:2px 0 8px;scrollbar-width:none;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}
  .dash-nav::-webkit-scrollbar{display:none}
  .dash-nav button{min-width:max-content;min-height:42px;white-space:nowrap;border:1px solid var(--line);background:var(--surface)}
  .dash-nav button.active{border-color:color-mix(in srgb,var(--accent) 34%,var(--line));background:var(--accent-soft)}
  .dash-main{min-width:0}
  .stats-grid{grid-template-columns:repeat(2,minmax(0,1fr))}

  .project-layout{grid-template-columns:1fr}
  .project-sidebar{position:static;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
  .side-card{margin:0}
  .project-actions{flex-wrap:wrap}
  .project-actions .btn{min-height:44px}
}

/* phones: Android/iPhone */
@media (max-width:640px){
  .container{width:auto;margin-left:max(12px,env(safe-area-inset-left));margin-right:max(12px,env(safe-area-inset-right))}
  body{font-size:14px}
  input,textarea,select{font-size:16px} /* prevents mobile browser auto zoom */
  .topbar{padding-top:env(safe-area-inset-top)}
  .topbar-inner{height:60px}
  .brand{font-size:18px;gap:8px}
  .brand-mark{width:32px;height:32px;border-radius:9px}
  .brand-mark svg{width:18px;height:18px}
  .header-actions{gap:6px}
  .theme-toggle{display:none}
  .user-chip{width:42px;padding:5px;justify-content:center}
  .user-chip .avatar{width:30px;height:30px}
  .user-chip-name{display:none}
  .mobile-nav-popover{position:fixed;right:max(12px,env(safe-area-inset-right));top:calc(68px + env(safe-area-inset-top));width:min(300px,calc(100vw - 24px))}

  .hero-inner{padding:44px 0 38px}
  .hero-emblem{width:74px;height:74px;border-radius:21px;margin-bottom:19px}
  .hero-emblem svg{width:42px;height:42px}
  .hero h1{font-size:clamp(36px,11.5vw,50px);line-height:1.04;letter-spacing:-1.8px}
  .hero p{font-size:15px;line-height:1.65}
  .hero-search{flex-direction:column;padding:6px;border-radius:14px}
  .hero-search .btn{width:100%;min-height:46px}
  .quick-types{justify-content:flex-start;flex-wrap:nowrap;overflow-x:auto;padding-bottom:4px;scrollbar-width:none}
  .quick-types::-webkit-scrollbar{display:none}
  .pill{white-space:nowrap}
  .feature-grid{grid-template-columns:1fr}
  .feature-card{min-height:180px}
  .section-head{align-items:flex-start}

  .discover-hero h1{font-size:29px;letter-spacing:-1px}
  .discover-hero p{font-size:14px}
  .category-strip{gap:5px;margin-bottom:14px;padding-bottom:12px}
  .category-tab{min-height:40px;padding:8px 10px}
  .discover-page{padding-top:14px}
  .discover-toolbar{top:60px;gap:7px}
  .toolbar-search{min-width:0;padding:0 11px}
  .sort-popover{position:fixed;top:auto;right:12px;left:12px;bottom:calc(12px + env(safe-area-inset-bottom));width:auto;max-width:none;z-index:100;border-radius:16px;padding:8px}
  .sort-popover button{min-height:46px}
  .results-head{font-size:12px;gap:8px}
  .results-sub,.moderation-badge{display:none}

  .project-card{grid-template-columns:56px minmax(0,1fr);gap:11px;padding:12px;border-radius:14px}
  .project-card .project-art{width:56px;height:56px;border-radius:13px;font-size:22px}
  .project-card h3{font-size:16px;margin-top:0;line-height:1.28}
  .project-card h3 .owner{display:block;margin:2px 0 0;font-size:12px}
  .project-card .desc{font-size:12.5px;margin:5px 0 8px;-webkit-line-clamp:2}
  .project-stats{grid-column:1/-1;padding-top:0;gap:6px 14px}
  .tag{font-size:10.5px}
  .tag-row .tag:nth-child(n+4){display:none}
  .empty-state{min-height:250px;padding:40px 16px}

  .dashboard-page{padding:16px 0 44px}
  .dash-user{padding:10px}
  .dash-main h1{font-size:25px}
  .dash-lead{margin-bottom:15px}
  .stats-grid{grid-template-columns:1fr 1fr;gap:8px}
  .metric{padding:13px}
  .metric strong{font-size:21px}
  .dash-card-head{align-items:flex-start;flex-wrap:wrap;padding:13px}
  .dash-card-head .btn{width:100%}
  .dash-card-body{padding:13px}
  .create-grid{grid-template-columns:1fr}
  .create-grid .full{grid-column:auto}
  .queue-item{align-items:flex-start;flex-wrap:wrap}
  .queue-actions{width:100%;display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
  .queue-actions .btn{width:100%}
  .project-table{min-width:650px;font-size:12px}

  .project-page{padding-top:16px}
  .project-header-card,.project-content-card{padding:15px}
  .project-header{flex-direction:column;align-items:flex-start}
  .project-header .project-art{width:72px;height:72px}
  .project-title h1{font-size:26px}
  .project-actions{display:grid;grid-template-columns:1fr 1fr;width:100%}
  .project-actions .btn{width:100%}
  .project-sidebar{grid-template-columns:1fr}
  .community-grid{grid-template-columns:1fr}
  .comment-form,.review-form,.upload-inline{flex-direction:column}
  .comment-form .btn,.review-form .btn,.review-form .input,.upload-inline .btn,.upload-inline .input{width:100%;max-width:none}

  .auth-shell{grid-template-columns:1fr;min-height:calc(100dvh - 60px)}
  .auth-visual{display:none}
  .auth-panel{padding:24px 16px}
  .auth-card{max-width:100%}
  .form-row{grid-template-columns:1fr}

  .profile-hero{flex-direction:column;align-items:flex-start;padding:18px}
  .profile-avatar{width:68px;height:68px;border-radius:18px}
  .profile-meta{flex-direction:column;gap:7px}
  .footer-inner{align-items:flex-start;flex-direction:column;padding-bottom:max(20px,env(safe-area-inset-bottom))}
}

@media (max-width:420px){
  .header-actions{margin-left:auto}
  .stats-grid{grid-template-columns:1fr}
  .project-actions{grid-template-columns:1fr}
  .queue-actions{grid-template-columns:1fr}
  .hero h1{font-size:36px}
  .discover-hero h1{font-size:26px}
  .category-tab{font-size:12px}
  .project-card{grid-template-columns:50px minmax(0,1fr)}
  .project-card .project-art{width:50px;height:50px}
}

@media (max-width:340px){
  .brand span{display:none}
  .hero h1{font-size:32px}
  .mobile-nav-popover{right:8px;left:8px;width:auto}
}

@media (hover:none){
  .project-card:hover,.feature-card:hover{transform:none}
}

@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{scroll-behavior:auto!important;animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important}
}


/* V6 interaction/responsive hardening */
.nav-link,.btn{text-decoration:none}
.primary-nav .nav-link{display:inline-flex;align-items:center;justify-content:center}
@media (max-width:860px) and (orientation:landscape){
  .hero-inner{padding:30px 0}
  .auth-shell{min-height:auto}
  .auth-panel{padding-top:18px;padding-bottom:18px}
}
@media (max-width:560px){
  .dash-card,.project-header-card,.project-content-card,.filter-section,.side-card{border-radius:14px}
  .project-table{min-width:600px}
}
@media (max-width:380px){
  .container{margin-left:max(9px,env(safe-area-inset-left));margin-right:max(9px,env(safe-area-inset-right))}
  .category-tab{padding-inline:8px}
  .project-card{padding:10px}
}

@media(max-width:520px){.user-chip-name{max-width:92px}.user-chip{min-width:0}.header-actions{min-width:0}}

/* V9.3 account/community small-screen safeguards */
@media(max-width:760px){
  .community-card{border-radius:16px}
  .community-compose-grid,.community-panel{min-width:0}
  .community-composer,.community-entry-body,.admin-comment-main{min-width:0}
  .admin-comment-meta .text-link{max-width:100%;white-space:normal;text-align:left}
}

/* V9.7 — mobile alignment and dashboard navigation reset */
html,body,#app,.shell,main{max-width:100%;overflow-x:clip}
img,svg,video,canvas{max-width:100%}
@media(max-width:980px){
  .dashboard-layout{grid-template-columns:1fr;gap:13px}
  .dashboard-sidebar{position:static;width:100%;min-width:0}
  .dash-nav{display:none!important}
  .dash-mobile-switcher{display:block;position:relative}
  .dash-mobile-switcher>summary{list-style:none;width:100%;min-height:48px;padding:10px 12px;display:flex;align-items:center;gap:9px;border:1px solid var(--line);border-radius:12px;background:var(--surface);color:var(--text);font-weight:800;cursor:pointer}
  .dash-mobile-switcher>summary::-webkit-details-marker{display:none}
  .dash-mobile-switcher>summary>span:nth-child(2){flex:1;text-align:left;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .dash-switcher-chevron{color:var(--muted);transition:transform .18s ease}.dash-mobile-switcher[open] .dash-switcher-chevron{transform:rotate(180deg)}
  .dash-mobile-popover{position:absolute;z-index:45;left:0;right:0;top:55px;max-height:min(66dvh,520px);overflow-y:auto;padding:8px;border:1px solid var(--line-strong);border-radius:14px;background:var(--surface);box-shadow:0 20px 60px #0007;overscroll-behavior:contain}
  .dash-mobile-popover .dash-nav-group{margin-bottom:7px}.dash-mobile-popover .dash-nav-label{padding-top:6px}
  .dash-mobile-popover button{width:100%;min-height:43px;border:0;border-radius:9px;background:transparent;color:var(--muted);padding:9px 10px;display:flex;align-items:center;gap:9px;text-align:left;font-weight:700}
  .dash-mobile-popover button.active,.dash-mobile-popover button:hover{background:var(--surface-2);color:var(--text)}.dash-mobile-popover button.active{color:var(--accent)}
  .dash-mobile-legal{display:grid;gap:3px;border-top:1px solid var(--line);padding-top:7px;margin-top:6px}
  .dash-user{margin-bottom:8px}
  .dash-main{width:100%;min-width:0}
  .dash-card-body{overflow-x:auto;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}
  .stats-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
}
@media(max-width:860px){
  .primary-nav{display:none}
  .dashboard-cta{display:none!important}
  .footer-grid{grid-template-columns:1fr 1fr;gap:26px}.footer-brand-block{grid-column:1/-1}
  .legal-layout{grid-template-columns:1fr;padding-top:20px}.legal-toc{position:static;display:flex;overflow-x:auto;gap:5px;padding:8px;scrollbar-width:none}.legal-toc::-webkit-scrollbar{display:none}.legal-toc strong{display:none}.legal-toc a{min-width:max-content;background:var(--surface-2)}
}
@media(max-width:640px){
  .dashboard-page{padding-top:12px}
  .dashboard-layout{gap:10px}
  .dash-user{padding:9px 10px;border-radius:11px}
  .dash-main h1{font-size:23px;line-height:1.15;overflow-wrap:anywhere}.dash-lead{font-size:13px;line-height:1.5;margin-bottom:13px}
  .stats-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.metric{padding:12px;min-height:112px}.metric .metric-icon{margin-bottom:10px}.metric strong{font-size:20px}.metric span{line-height:1.3}
  .dash-card{border-radius:13px}.dash-card-head{padding:12px 13px;align-items:flex-start;flex-wrap:wrap}.dash-card-head>*{min-width:0}.dash-card-head .btn{max-width:100%}.dash-card-body{padding:13px}
  .queue-item,.account-pending{min-width:0}.queue-item-main{width:100%}.queue-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}.queue-actions .btn{width:100%;min-width:0}
  .create-grid{grid-template-columns:1fr}.field,.input,.select,textarea{min-width:0;max-width:100%}
  .project-table{min-width:620px}.project-table th,.project-table td{padding:9px 7px}
  .legal-hero-inner{padding:36px 0 29px}.legal-hero h1{font-size:32px}.legal-hero p{font-size:14px}.legal-card{padding:20px 16px;border-radius:14px}.legal-card h2{font-size:18px}.legal-card p{font-size:13px;line-height:1.7}
  .footer-grid{grid-template-columns:1fr;gap:22px;padding-top:28px}.footer-brand-block{grid-column:auto}.footer-bottom{align-items:flex-start;flex-direction:column;gap:6px;padding-bottom:max(20px,env(safe-area-inset-bottom))}
}
@media(max-width:420px){
  .stats-grid{grid-template-columns:1fr}.metric{min-height:0}
  .queue-actions{grid-template-columns:1fr}
  .dash-mobile-popover{max-height:68dvh}
}

/* V9.8 — mobile viewport/layout hardening */
html,body,#app,.shell,.shell>main{width:100%;min-width:0;max-width:none}
body{position:relative}
.shell{overflow-x:hidden}

@media (max-width:860px){
  /* Use padding instead of a calculated width so the app always fills the real phone viewport. */
  .container{
    width:100%!important;
    max-width:none!important;
    margin-left:0!important;
    margin-right:0!important;
    padding-left:max(16px,env(safe-area-inset-left))!important;
    padding-right:max(16px,env(safe-area-inset-right))!important;
  }
  .topbar,.topbar-inner,.discover-page,.discover-hero,.dashboard-page,.profile-page,.project-page,.footer{width:100%;max-width:100%}
  .topbar-inner{min-width:0}
  .header-actions{min-width:0;flex-shrink:0}
  .mobile-nav{flex:none}

  /* Discover: every row owns the available viewport width and scrolls only internally. */
  .discover-page{overflow:hidden}
  .category-strip{
    width:100%;max-width:100%;min-width:0;
    overflow-x:auto;overflow-y:hidden;
    scrollbar-width:none;-webkit-overflow-scrolling:touch;
    overscroll-behavior-x:contain;
  }
  .category-strip::-webkit-scrollbar{display:none}
  .category-tab{flex:0 0 auto}
  .discover-grid,.discover-main,.filter-panel,.version-section,.version-options,.discover-toolbar,.results-head,.project-list{width:100%;max-width:100%;min-width:0}
  .version-options{overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain}
  .version-filter{flex:0 0 auto}
  .discover-toolbar{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center}
  .toolbar-search{width:100%;min-width:0}
  .sort-menu{min-width:0}

  /* Dashboard: never allow a table/card to widen the whole document. */
  .dashboard-layout,.dashboard-sidebar,.dash-main,.dash-card,.dash-card-head,.dash-card-body{width:100%;max-width:100%;min-width:0}
  .dash-card-body{overflow-x:auto}

  /* Footer uses the real viewport width rather than preserving desktop columns. */
  .footer-grid{width:100%;grid-template-columns:minmax(0,1.35fr) minmax(120px,.65fr);gap:22px 18px}
  .footer-brand-block{grid-column:1/-1;min-width:0}
  .footer-brand-block p{max-width:100%}
  .footer-links{min-width:0}
  .footer-bottom{width:100%}
}

@media (max-width:640px){
  .container{
    padding-left:max(14px,env(safe-area-inset-left))!important;
    padding-right:max(14px,env(safe-area-inset-right))!important;
  }
  .discover-hero{padding-left:0;padding-right:0}
  .discover-hero h1{max-width:100%;overflow-wrap:anywhere}
  .discover-hero p{max-width:100%}
  .category-strip{margin-left:0;margin-right:0;padding:5px}
  .category-tab{font-size:12px;padding-inline:10px}
  .discover-toolbar{grid-template-columns:minmax(0,1fr) 46px;gap:8px}
  .sort-menu summary{width:46px;min-width:46px}
  .results-head{align-items:flex-start;gap:8px}
  .project-list{overflow:visible}
  .project-card{width:100%;max-width:100%;min-width:0}
  .project-card>div:nth-child(2){min-width:0}
  .project-card h3,.project-card .desc{max-width:100%;overflow-wrap:anywhere}

  .dashboard-page{padding-top:14px}
  .dash-mobile-switcher{width:100%}
  .dash-mobile-popover{left:0;right:0;width:100%;max-width:100%}

  .footer-grid{grid-template-columns:1fr;gap:22px;padding-top:28px}
  .footer-brand-block{grid-column:auto}
  .footer-links{width:100%}
  .footer-links a{width:auto;max-width:100%;overflow-wrap:anywhere}
  .footer-bottom{flex-direction:column;align-items:flex-start;gap:6px}
}

@media (max-width:420px){
  .container{
    padding-left:max(12px,env(safe-area-inset-left))!important;
    padding-right:max(12px,env(safe-area-inset-right))!important;
  }
  .topbar-inner{gap:8px}
  .brand{min-width:0}
  .brand span{overflow:hidden;text-overflow:ellipsis}
  .category-tab{padding-inline:9px}
  .version-filter{min-height:40px;padding:7px 9px}
  .stats-grid{grid-template-columns:1fr}
}


/* V10 control center mobile behavior */
@media(max-width:760px){
  .mh-select,.mh-select-compact,.project-table .mh-select{width:100%;min-width:0;max-width:100%}
  .mh-select-trigger{min-height:46px;font-size:16px}
  .mh-select-menu{position:fixed;left:max(12px,env(safe-area-inset-left));right:max(12px,env(safe-area-inset-right));top:auto;bottom:max(12px,env(safe-area-inset-bottom));max-height:min(52dvh,420px);border-radius:18px;padding:9px;transform:translateY(18px) scale(.99)}
  .mh-select.open .mh-select-menu{transform:none}
  .mh-select-option{min-height:46px;padding:11px 12px;font-size:14px}
  .dashboard-role-admin .dash-card,.dashboard-role-developer .dash-card{box-shadow:none}
}


/* V10.3 account security responsiveness */
@media (max-width: 820px){
  .password-grid{grid-template-columns:1fr}
  .account-security-card .dash-card-head{align-items:flex-start;gap:10px;flex-direction:column}
  .account-security-card .btn.primary{width:100%}
}

/* V10.4 — remove nested dashboard/form scrolling on narrow screens.
   The page owns vertical scrolling; cards/forms must expand naturally. */
@media (max-width:980px){
  .dashboard-page,
  .dashboard-layout,
  .dash-main,
  .dash-card,
  .dash-card-body,
  .create-grid,
  .create-grid > *,
  .account-settings-card,
  .account-security-card{
    min-width:0;
    max-width:100%;
  }

  /* Do not turn every dashboard card body into its own scroll container. */
  .dash-card-body{
    overflow:visible!important;
    max-height:none!important;
    height:auto!important;
    overscroll-behavior:auto!important;
    -webkit-overflow-scrolling:auto!important;
  }

  /* Forms should follow normal document flow and use the whole card width. */
  .dash-card-body form,
  .create-grid,
  .field,
  .input,
  textarea,
  .mh-select,
  .mh-select-trigger{
    width:100%;
    max-width:100%;
    min-width:0;
  }

  textarea{resize:vertical}

  /* Only data tables get horizontal scrolling, never the whole card/form. */
  #download-list,
  #my-projects,
  #admin-project-list,
  #developer-list,
  #users-list,
  .table-scroll{
    display:block;
    width:100%;
    max-width:100%;
    overflow-x:auto;
    overflow-y:hidden;
    overscroll-behavior-x:contain;
    -webkit-overflow-scrolling:touch;
  }
}

@media (max-width:640px){
  .dashboard-page{overflow:visible!important}
  .dash-card{overflow:visible}
  .dash-card-body{padding:12px!important}
  .create-grid{gap:10px}
  .field{margin:0}
}


/* V10.5 logo editor responsive */
@media (max-width:560px){
 .project-logo-edit{align-items:flex-start;flex-direction:column}
 .project-logo-preview,.project-logo-placeholder{width:72px;height:72px;flex-basis:72px}
 .project-logo-controls{width:100%}
}

/* V10.6 */
@media(max-width:420px){.developer-permission-card{padding:11px}.permission-toggle{padding:9px}.notification-item{padding:10px}.header-actions .notification-bell{width:36px;height:36px}}

/* V11: always show the selected Discover sort on touch devices.
   Must be after the existing mobile controls in this stylesheet. */
@media (max-width:760px){
  .discover-toolbar{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:center}
  .discover-toolbar .toolbar-search{min-width:0;width:100%}
  .discover-toolbar .sort-menu{min-width:0}
  .discover-toolbar .sort-menu summary{width:auto;min-width:148px;height:48px;justify-content:space-between;padding:0 12px;gap:7px}
  .discover-toolbar .sort-menu summary #discover-sort-label{display:inline!important;max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px}
  .discover-toolbar .sort-menu summary .sort-chevron{display:inline!important;margin-left:0}
  .discover-toolbar .sort-popover{right:0;min-width:210px;max-width:calc(100vw - 28px)}
}
@media (max-width:480px){
  .discover-toolbar{grid-template-columns:minmax(0,1fr);gap:8px}
  .discover-toolbar .sort-menu{width:100%}
  .discover-toolbar .sort-menu summary{width:100%;min-width:0;height:44px}
  .discover-toolbar .sort-menu summary #discover-sort-label{max-width:none;margin-right:auto}
  .discover-toolbar .sort-popover{width:100%;right:auto;left:0;top:48px}
}
