/* Star Student Builder on phones — an app, not a long web page.
   Loaded last. A bottom tab bar (Home · Study · Guru · Tests · Me) replaces the long footer menus;
   headers and heroes are slimmer; groups of cards become swipe rows instead of tall stacks; long
   introductions step aside so the useful thing is always within a thumb's reach. */

.m-only{display:none}
.tabbar{display:none}

@media(max-width:760px){
  .m-only{display:block}
  .m-hide{display:none!important}
  body{font-size:16px;padding-bottom:calc(70px + env(safe-area-inset-bottom,0px))}
  body.reader,body.printpage{padding-bottom:0}
  .wrap{width:min(1120px,100% - 28px)}

  /* header: slim */
  .top .wrap{height:56px;gap:10px}
  .brand img{width:36px;height:36px}.brand{font-size:.98rem}
  .theme-btn,.burger{width:38px;height:38px;border-radius:12px;font-size:1.05rem}
  .stbar{top:56px}.guru-side{top:56px!important}
  .libbar{top:56px}

  /* bottom tab bar */
  .tabbar{display:flex;position:fixed;left:0;right:0;bottom:0;z-index:60;background:var(--topbg);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);border-top:1px solid rgba(27,42,87,.1);padding:4px 6px calc(4px + env(safe-area-inset-bottom,0px));box-shadow:0 -6px 20px rgba(27,42,87,.08)}
  .tabbar a{flex:1;display:flex;flex-direction:column;align-items:center;gap:1px;padding:5px 2px;text-decoration:none;color:var(--muted);font-weight:800;font-size:.66rem;border-radius:12px;min-width:0}
  .tabbar a i{font-style:normal;font-size:1.25rem;line-height:1.2;filter:grayscale(.6);opacity:.8;transition:.2s}
  .tabbar a span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
  .tabbar a.on{color:var(--grape)}.tabbar a.on i{filter:none;opacity:1;transform:translateY(-1px) scale(1.1)}
  .tabbar .tb-guru b{display:grid;place-items:center;width:52px;height:52px;margin-top:-22px;border-radius:50%;background:#fff6d5;box-shadow:0 0 0 3px var(--card),0 0 0 5px #ffb703,0 8px 18px rgba(226,109,0,.35);animation:tbGuru 3.4s ease-in-out infinite}
  .tabbar .tb-guru img{width:44px;height:44px}
  .tabbar .tb-guru span{color:#e26d00}
  @keyframes tbGuru{50%{transform:translateY(-2px) rotate(-4deg)}}
  [data-theme=dark] .tabbar{border-top-color:rgba(255,255,255,.08)}
  .guru-fab{display:none!important}
  body.guru-page .tabbar{display:none}
  body.guru-page{padding-bottom:0}

  /* heroes: short, no big picture, one clear action */
  .hero .wrap{padding:18px 0 20px;gap:10px}
  .hero img{display:none}
  .hero .kicker{font-size:.66rem;padding:4px 10px}
  .hero h1{font-size:clamp(1.55rem,7vw,2rem);margin:.25em 0 .25em}
  .hero p{font-size:.96rem;line-height:1.5;margin:0 0 12px;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
  .btn{padding:10px 16px;font-size:.9rem}
  .hero .btn.ghost{padding:8px 14px}

  /* sections: tighter, calmer */
  .sec{padding:18px 0 2px}
  .sec h2{font-size:1.3rem;gap:10px}.sec h2 .n{width:34px;height:34px;border-radius:11px;font-size:.9rem}
  .lead{font-size:.98rem;padding-left:12px;margin:4px 0 14px}
  .chips{padding:10px 0 2px}.chips a{padding:7px 12px;font-size:.8rem}
  .call{padding:14px 14px 14px 50px;font-size:.93rem}.call::before{left:14px;top:13px;font-size:1.3rem}
  .quote{padding:18px;font-size:1rem}
  .steps div{padding:12px 14px 12px 56px}.steps div::before{left:12px;top:11px;width:32px;height:32px}

  /* groups of cards become swipe rows */
  .grid,.stcards,.tests,.buzzes,.bplist,.links{display:flex!important;overflow-x:auto;scroll-snap-type:x mandatory;gap:12px;margin-left:-14px;margin-right:-14px;padding:4px 14px 10px;scrollbar-width:none}
  .grid::-webkit-scrollbar,.stcards::-webkit-scrollbar,.tests::-webkit-scrollbar,.buzzes::-webkit-scrollbar,.bplist::-webkit-scrollbar,.links::-webkit-scrollbar{display:none}
  .grid>*,.stcards>*,.tests>*,.buzzes>*,.bplist>*{flex:0 0 80%;scroll-snap-align:start}
  .links>*{flex:0 0 72%;scroll-snap-align:start}
  .card{padding:16px 16px}.card h3{font-size:1.05rem}

  /* bands and "read next": compact */
  .band{padding:16px 16px;border-radius:20px;margin:20px 0;gap:10px}
  .band h2{font-size:1.1rem;margin:0}.band p{display:none}
  .next{margin:14px 0 6px;gap:8px}.next a{flex:1 1 45%;padding:10px 12px;font-size:.88rem}

  /* footer: the tab bar carries navigation, so only the essentials remain */
  footer{margin-top:24px;padding:18px 0 22px;font-size:.84rem}
  footer .wrap>div:nth-child(2),footer .wrap>div:nth-child(3){display:none}
  footer .wrap>div:first-child p:first-of-type{display:none}
  footer .copy{padding-top:10px}

  /* home */
  body.home-page #how,body.home-page #promise{display:none}
  .quick{padding:14px 0 2px}
  .qa-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}
  .qa-grid a{display:flex;flex-direction:column;align-items:center;gap:4px;background:var(--card);border-radius:16px;padding:10px 4px;text-decoration:none;color:var(--head);font-weight:800;font-size:.7rem;text-align:center;line-height:1.2;box-shadow:0 4px 12px rgba(27,42,87,.07)}
  .qa-grid a span{font-size:1.5rem}
  .guruhome{padding:14px 0 4px}
  .gh-in{padding:16px 14px;border-radius:24px;gap:12px}
  .gh-stage{grid-template-columns:104px 1fr}
  .gh-demo{min-height:118px;padding-bottom:8px}.ghb{font-size:.8rem;padding:7px 10px}
  .gh-text h2{font-size:1.4rem;margin:8px 0 6px}
  .gh-lead{font-size:.92rem;margin:0 0 10px}
  .gh-chips{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;margin:8px -14px 10px;padding:0 14px}.gh-chips::-webkit-scrollbar{display:none}
  .gh-chips a{white-space:nowrap}
  .gh-feats li{font-size:.74rem;padding:6px 8px}
  .studycta{padding:16px;margin:16px 0;border-radius:22px;gap:10px}.studycta h2{font-size:1.15rem}
  .studycta .bpills{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none}.studycta .bpills button{white-space:nowrap;padding:7px 12px;font-size:.84rem}
  .spot{padding:18px 0 4px}
  .spot-in{gap:12px}
  .spot-logo{display:flex;align-items:center;gap:14px;max-width:none}
  .spot-ring{width:92px;padding:5px;box-shadow:0 0 0 4px var(--card),0 10px 26px rgba(123,92,255,.3)}
  .spot .tw{display:none}.spot-motto{margin:0;font-size:.8rem;letter-spacing:.2em;text-align:left}
  .spot-kick{display:none}.spot h2{font-size:1.3rem;margin:0 0 8px}.spot h3{font-size:1.05rem;margin:8px 0 8px}
  .marks{display:flex;overflow-x:auto;scroll-snap-type:x mandatory;margin:0 -14px;padding:2px 14px 10px;gap:10px;scrollbar-width:none}.marks::-webkit-scrollbar{display:none}
  .mark{flex:0 0 78%;scroll-snap-align:start;font-size:.86rem}
  .spot-note{font-size:.88rem}
  .tiles-h{font-size:1.25rem;margin:0 0 10px}
  .tiles{grid-template-columns:repeat(2,1fr)!important;gap:8px;margin:0 0 10px}
  .tile{display:flex;align-items:center;border-radius:14px;box-shadow:0 4px 12px rgba(27,42,87,.07)}
  .tile img,.tile p,.tile span{display:none}
  .tile div{padding:11px 12px}.tile h3{font-size:.86rem;margin:0}
  .tile:hover{transform:none}

  /* study screens */
  .stbar-top{padding:8px 0 4px;gap:8px}.stboard{padding:5px 12px 5px 7px}.stboard small{display:none}
  .sttabs a{padding:6px 10px;font-size:.8rem}
  .stgrades{padding-bottom:8px}.stgrades a{min-width:34px;padding:4px 8px;font-size:.82rem}
  .sthead{padding-top:14px}.sthead h1{font-size:1.45rem}.sthead .lead{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
  .stcard p{display:none}.stcard{padding:14px}.stcards>*{flex-basis:44%}
  .subjgrid{grid-template-columns:repeat(2,1fr);gap:8px}.subj{padding:10px 12px}
  .chapters a{padding:10px 12px;gap:10px}.chn{width:32px;height:32px}.cht small{display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden}
  .topic h1{font-size:1.6rem}.notes{padding:14px 16px;border-radius:18px}
  .quizrow{padding:10px 12px}.bcard{padding:16px}

  /* forms and cards */
  .tr-card,.authcard,.msgcard{padding:18px 16px;border-radius:20px}
  .tablewrap table{font-size:.86rem}th,td{padding:9px 10px}

  /* the account bar */
  .statrow{margin-top:-18px;gap:8px}.stat{padding:10px}.stat b{font-size:1.4rem}.stat span{font-size:.74rem}
}
@media(max-width:760px){.guru-side{margin:0 -14px!important}}
/* Grid children default to min-width:auto, so one nowrap swipe row inside them (board pills,
   "extra marks", Guru chips) would stretch the whole page wider than the phone. */
.hero .wrap>*,.studycta>*,.spot-in>*,.gh-in>*,.band>*,.tr-card>*{min-width:0}
@media(max-width:760px){.hero .btn{margin:0 4px 6px 0}}

/* Install-the-app bar (top of the phone screen) */
.pwabar{position:sticky;top:0;z-index:60;display:flex;align-items:center;gap:10px;padding:8px 12px;background:linear-gradient(135deg,#1b2a57,#4c3bcf);color:#fff;box-shadow:0 6px 18px rgba(27,42,87,.35)}
.pwabar img{border-radius:10px;background:#fff;padding:2px;flex:none}
.pwabar span{display:flex;flex-direction:column;min-width:0;line-height:1.25}
.pwabar b{font-size:.92rem}
.pwabar small{opacity:.85;font-size:.74rem}
.pwabar .pw-go{margin-left:auto;flex:none;background:#ffd166;color:#1b2a57;border:0;border-radius:999px;padding:8px 14px;font:inherit;font-weight:900;cursor:pointer}
.pwabar .pw-x{flex:none;background:transparent;border:0;color:#fff;opacity:.8;font-size:1.05rem;cursor:pointer;padding:6px}
.pwabar .pw-go+.pw-x{margin-left:2px}
.pwabar:has(.pw-x:only-of-type) .pw-x{margin-left:auto}
