/* Vetra v0.2.6a - final targeted mobile theme, developer-listing, and bottom-clearance stabilization. */

@media(max-width:650px){
  :root{
    --mobile-content-clearance:calc(var(--mobile-dock-height,72px) + env(safe-area-inset-bottom) + 18px);
    --wizard-action-clearance:calc(108px + env(safe-area-inset-bottom));
  }

  /* Mobile content sheets inherit Vetra theme colors instead of native dialog CanvasText. */
  .vetra-mobile-sheet-panel,
  .vetra-mobile-sheet-content{
    color:var(--text);
  }
  .vetra-mobile-sheet-content :where(h1,h2,h3,h4,p,li,dd,dt,legend,strong){
    color:inherit;
  }
  .vetra-mobile-sheet-content :where(.muted,small,.help-result p){
    color:var(--muted);
  }
  .vetra-mobile-sheet-content :where(.help-center,.help-article){
    color:var(--text);
  }

  /* First Developer Hub listing section reflows as mobile cards; no sideways action strip. */
  .developer-listing-row{
    display:grid;
    grid-template-columns:minmax(0,1fr)!important;
    width:100%;
    min-width:0;
    max-width:100%;
    align-items:stretch;
  }
  .developer-listing-row > div{
    min-width:0;
    max-width:100%;
  }
  .developer-listing-row :where(strong,span,small){
    overflow-wrap:anywhere;
    word-break:break-word;
  }
  .developer-listing-row .developer-row-actions{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    width:100%;
    max-width:100%;
    gap:7px;
    justify-content:stretch;
  }
  .developer-listing-row .developer-row-actions button{
    width:100%;
    min-width:0;
    max-width:100%;
    white-space:normal;
    overflow-wrap:anywhere;
  }

  /* Sell wizard content must always clear its fixed action bar. */
  #sellModal .wizard-modal{
    scroll-padding-bottom:var(--wizard-action-clearance);
    padding-bottom:var(--wizard-action-clearance)!important;
  }
  #sellModal .wizard-step{
    padding-bottom:var(--wizard-action-clearance)!important;
    scroll-margin-bottom:var(--wizard-action-clearance);
  }

  /* Marketplace filter drawer stops above the permanent global dock. */
  .sidebar.mobile-open,
  .sidebar{
    bottom:calc(var(--mobile-dock-height,72px) + env(safe-area-inset-bottom))!important;
    max-height:calc(86dvh - var(--mobile-dock-height,72px) - env(safe-area-inset-bottom))!important;
    padding-bottom:18px!important;
    scroll-padding-bottom:18px;
  }

  /* Shared mobile scroll surfaces retain a final reachable area above the global dock. */
  .vetra-mobile-sheet-content,
  .message-center-modal,
  .storefront-public-modal,
  .developer-hub-modal,
  .dashboard-modal{
    scroll-padding-bottom:var(--mobile-content-clearance);
  }
}

@media(max-width:360px){
  .developer-listing-row .developer-row-actions{
    grid-template-columns:1fr;
  }
}
