/* Mobile-only polish layer. Keep desktop presentation untouched. */
@media (max-width:760px){
  .portal-top{
    height:72px;
    min-height:72px;
    padding:0 14px;
    justify-content:flex-start;
    gap:12px;
  }

  .portal-top .portal-menu{
    display:grid;
    place-items:center;
    width:40px;
    height:40px;
    flex:0 0 40px;
    padding:0;
    border-radius:10px;
  }

  .portal-top>div:first-of-type{
    min-width:0;
    flex:1 1 auto;
  }

  .portal-top .portal-eyebrow{
    display:none;
  }

  .portal-top h1{
    margin:0;
    font-size:21px;
    line-height:1.15;
    font-weight:600;
    white-space:normal;
    overflow-wrap:anywhere;
  }

  .portal-top .portal-user{
    display:none;
  }

  /* Home: combine the four user progress cards into one compact 2x2 panel. */
  .dash-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:0;
    margin-bottom:12px;
    background:#fff;
    border:1px solid var(--line,#d7e1dc);
    border-radius:14px;
    overflow:hidden;
  }

  .dash-grid::before{
    content:'МІЙ ПРОГРЕС';
    grid-column:1/-1;
    display:block;
    padding:12px 13px 9px;
    border-bottom:1px solid #e3ebe7;
    color:#5d786e;
    font-size:10px;
    line-height:1;
    font-weight:900;
    letter-spacing:.16em;
  }

  .dash-stat{
    min-width:0;
    min-height:90px;
    padding:12px 11px;
    gap:9px;
    border:0;
    border-radius:0;
    background:#fff;
    box-shadow:none;
    align-items:center;
  }

  .dash-stat:nth-child(odd){border-right:1px solid #e3ebe7}
  .dash-stat:nth-child(-n+2){border-bottom:1px solid #e3ebe7}

  .dash-stat-icon{
    width:34px;
    height:34px;
    flex:0 0 34px;
    border-radius:8px;
    font-size:17px;
  }

  .dash-stat>div:last-child{min-width:0}
  .dash-stat span{font-size:10px;line-height:1.2}
  .dash-stat b{
    margin:3px 0 2px;
    font-size:19px;
    line-height:1.06;
    overflow-wrap:anywhere;
  }
  .dash-stat small{
    font-size:9px;
    line-height:1.3;
    overflow-wrap:anywhere;
  }
  .dash-stat.mobile-rank-stat small{display:none}

  /* Home course card: compact, but keep progress visible. */
  .home-layout{gap:12px}
  .home-route{padding:15px 14px}
  .home-route .section-kicker{font-size:9px}
  .home-route .section-head{gap:10px}
  .home-route .section-head h2{font-size:23px;line-height:1.1;margin:7px 0}
  .home-route .text-link{font-size:11px;white-space:nowrap}
  .home-course-list{gap:0}
  .home-course-row{
    grid-template-columns:44px minmax(0,1fr) 14px;
    gap:10px;
    padding:12px 0;
  }
  .home-course-row .course-mini-icon{
    width:40px;
    height:40px;
    border-radius:11px;
    font-size:13px;
  }
  .home-course-row b{font-size:13px;line-height:1.25}
  .home-course-row small{font-size:9px;line-height:1.3;margin-top:3px}
  .home-course-row strong{font-size:18px}
  .home-course-row .platform-course-progress{
    display:block;
    width:100%;
    height:5px;
    margin-top:7px;
    background:#dfe9e4;
    border-radius:999px;
  }
  .home-course-row .platform-course-progress i{background:#8bd33f}

  /* Quick training: one compact action card instead of a second screen. */
  .quick-card{
    min-height:0;
    padding:18px 16px;
    border-radius:13px;
  }
  .quick-kicker{font-size:9px;letter-spacing:.15em}
  .quick-card h2{
    font-size:21px;
    line-height:1.2;
    margin:9px 0 5px;
  }
  .quick-card p{
    margin:0;
    font-size:0;
    line-height:1.4;
  }
  .quick-card p::after{
    content:'20 запитань · без штрафу за помилки';
    font-size:11px;
    color:#b9cec6;
  }
  .quick-score{
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:0;
    margin:12px 0;
    border:1px solid rgba(220,235,228,.16);
    border-radius:9px;
    overflow:hidden;
  }
  .quick-score div{
    min-width:0;
    padding:8px 4px;
    border-radius:0;
    background:transparent;
  }
  .quick-score div:not(:last-child){border-right:1px solid rgba(220,235,228,.14)}
  .quick-score b{font-size:15px;line-height:1}
  .quick-score span{font-size:7px;line-height:1.15;margin-top:3px}
  .quick-card .green-btn{
    width:100%;
    padding:11px 14px;
    font-size:12px;
  }
}

@media (max-width:360px){
  .portal-top{padding-left:10px;padding-right:10px;gap:10px}
  .portal-top h1{font-size:19px}
  .dash-stat{min-height:86px;padding:10px 8px;gap:7px}
  .dash-stat-icon{width:30px;height:30px;flex-basis:30px;font-size:15px}
  .dash-stat span{font-size:9px}
  .dash-stat b{font-size:17px}
  .dash-stat small{font-size:8px}
  .home-route{padding:14px 12px}
  .quick-card{padding:16px 14px}
}
