/* ==========================================================
   v75 Mobil Platform Sahnesi Düzeltmesi
   Amaç: Masaüstündeki 3 sütunlu AI araçları / kişisel merkez / eğitim yapısını
   mobilde yatay taşmadan tek akışa dönüştürmek.
   ========================================================== */

/* Genel taşma güvenliği */
html,
body{
  max-width:100%;
  overflow-x:hidden!important;
}

.v16-home-shell,
.v16-platform-stage,
.v16-platform-stage > *,
.v16-welcome-panel,
.v16-side-panel,
.v16-choice-card,
.v72-personalized{
  box-sizing:border-box;
  min-width:0!important;
}

/* Tablet: 3 sütunu tek akışa al */
@media(max-width:1180px){
  body.theme-original .v16-platform-stage,
  body.theme-light .v16-platform-stage,
  .v16-platform-stage{
    display:flex!important;
    flex-direction:column!important;
    grid-template-columns:1fr!important;
    width:100%!important;
    max-width:100%!important;
    gap:16px!important;
    overflow:visible!important;
  }
  .v16-platform-stage > *{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
  }
  .v16-welcome-panel{order:1!important;}
  .v16-tool-panel{order:2!important;}
  .v16-education-panel{order:3!important;}
}

/* Mobil: Safari/iPhone yatay taşma ve kart genişliği tamiri */
@media(max-width:900px){
  body{
    width:100%;
    position:relative;
    -webkit-text-size-adjust:100%;
  }
  main,
  .v16-home-shell,
  .section,
  .v16-section{
    width:100%!important;
    max-width:100%!important;
    overflow-x:clip!important;
  }
  .v16-home-shell{
    padding:16px 14px 0!important;
  }
  body.theme-original .v16-home-shell,
  body.theme-light .v16-home-shell{
    padding-left:14px!important;
    padding-right:14px!important;
  }
  .v16-platform-stage{
    margin:12px 0 0!important;
    gap:14px!important;
  }

  /* Orta panel mobilde tam genişlikte, panel dışına taşmayan kart */
  .v16-welcome-panel,
  .v72-welcome-panel,
  .v16-side-panel{
    width:100%!important;
    max-width:100%!important;
    min-height:0!important;
    border-radius:24px!important;
    overflow:hidden!important;
    transform:none!important;
  }
  .v16-welcome-panel{
    padding:18px!important;
  }
  .v72-personalized{
    padding:18px!important;
  }

  /* Guest hoş geldiniz ekranı: masaüstü kartları mobilde tek sütun */
  .v16-panel-top{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:14px!important;
    align-items:start!important;
  }
  .v16-mini-brand{
    min-width:0!important;
  }
  .v16-mini-stats{
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:8px!important;
    width:100%!important;
  }
  .v16-mini-stats div{
    min-width:0!important;
    text-align:center!important;
  }
  .v16-mini-stats b{
    font-size:clamp(22px,8vw,34px)!important;
    line-height:1!important;
  }
  .v16-mini-stats small{
    font-size:11px!important;
    line-height:1.2!important;
  }
  .v16-welcome-copy{
    text-align:center!important;
    max-width:100%!important;
  }
  .v16-welcome-copy h2{
    font-size:clamp(34px,11vw,48px)!important;
    line-height:1.04!important;
    margin-top:6px!important;
  }
  .v16-welcome-copy p{
    max-width:100%!important;
    font-size:clamp(15px,4.7vw,18px)!important;
    line-height:1.55!important;
    overflow-wrap:anywhere!important;
  }
  .v16-choice-grid{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:14px!important;
    width:100%!important;
  }
  .v16-choice-card{
    width:100%!important;
    min-height:auto!important;
    padding:22px 18px!important;
    text-align:center!important;
  }

  /* Kişisel panel mobilde kompakt ama bozulmayan yapı */
  .v72-personal-top{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:12px!important;
  }
  .v72-user-badge{
    width:100%!important;
  }
  .v72-user-badge b,
  .v72-user-badge em{
    max-width:calc(100vw - 112px)!important;
  }
  .v72-personal-hero{
    grid-template-columns:1fr!important;
    padding:16px!important;
    border-radius:22px!important;
  }
  .v72-hero-copy{
    padding-right:0!important;
  }
  .v72-hero-copy h2{
    font-size:clamp(26px,8vw,34px)!important;
  }
  .v72-profile-ring{
    position:relative!important;
    right:auto!important;
    top:auto!important;
    transform:none!important;
    margin-top:4px!important;
  }
  .v72-metric-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  .v72-workspace-grid{
    grid-template-columns:1fr!important;
  }

  /* Sol ve sağ paneller mobilde ayrı satır; kendi içinde yatay kaydırılabilir, sayfayı taşırmaz */
  .v16-side-panel{
    padding:15px!important;
  }
  .v16-panel-title{
    display:flex!important;
    align-items:flex-end!important;
    justify-content:space-between!important;
    gap:10px!important;
    margin-bottom:12px!important;
  }
  .v16-panel-title span{
    font-size:18px!important;
  }
  .v16-panel-title small{
    font-size:10.5px!important;
    text-align:right!important;
    max-width:48%;
  }
  .v16-category-list,
  .v16-module-list{
    width:100%!important;
    max-width:100%!important;
    display:flex!important;
    grid-template-columns:none!important;
    gap:8px!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    -webkit-overflow-scrolling:touch;
    overscroll-behavior-x:contain;
    scroll-snap-type:x proximity;
    padding:0 0 8px!important;
    margin:0!important;
    scrollbar-width:none;
  }
  .v16-category-list::-webkit-scrollbar,
  .v16-module-list::-webkit-scrollbar{
    display:none;
  }
  .v16-category-list a,
  .v16-module-list a,
  .v73-more-menu{
    flex:0 0 auto!important;
    max-width:82vw!important;
    scroll-snap-align:start;
  }
  .v16-category-list a{
    min-width:162px!important;
  }
  .v16-module-list a{
    min-width:236px!important;
    flex-basis:236px!important;
  }
  .v73-more-menu{
    min-width:184px!important;
  }
  .v73-more-menu[open]{
    flex-basis:min(88vw,340px)!important;
  }
  .v16-outline-btn,
  .v73-panel-mini-actions{
    width:100%!important;
  }

  /* Alt bölümler de mobilde taşma üretmesin */
  .v16-feature-strip,
  .v16-vip-band,
  .v16-metrics,
  .v21-method-grid,
  .tools-grid,
  .featured-grid,
  .content-grid,
  .prompt-strip,
  .v16-education-showcase-grid{
    max-width:100%!important;
    min-width:0!important;
  }
  .tools-grid,
  .featured-grid,
  .content-grid{
    grid-template-columns:1fr!important;
  }
  .tool-card,
  .content-card,
  .glass-card{
    max-width:100%!important;
    min-width:0!important;
  }

  /* Sabit canlı destek butonu Safari alt toolbar ile çakışmasın */
  .ai-fab{
    right:14px!important;
    bottom:calc(14px + env(safe-area-inset-bottom,0px))!important;
  }
}

@media(max-width:430px){
  .v16-home-shell{
    padding-left:12px!important;
    padding-right:12px!important;
  }
  .v16-welcome-panel,
  .v16-side-panel{
    border-radius:22px!important;
  }
  .v16-mini-stats b{
    font-size:28px!important;
  }
  .v16-mini-stats small{
    font-size:10px!important;
  }
  .v16-welcome-copy h2{
    font-size:38px!important;
  }
  .v16-choice-card{
    padding:20px 16px!important;
  }
  .v16-category-list a{
    min-width:154px!important;
  }
  .v16-module-list a{
    min-width:222px!important;
    flex-basis:222px!important;
  }
}
