/* Round 1: phone first. Loaded last, so it adjusts the older layered styles without rewriting them. */

/* ---------- home: the next step, then the whole path ---------- */
.mg-welcome-compact{display:block;margin:0 0 12px;padding:0;background:none;border:0;min-height:0}
.mg-welcome-compact h1{margin:0;font-size:clamp(1.5rem,5vw,2.1rem);line-height:1.2}
.mg-next-step .eyebrow{display:block;margin-bottom:4px}
.mg-next-step h2{margin:0 0 6px}
.mg-next-actions{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin:14px 0 0}
.mg-next-actions .button{min-height:48px}
.mg-journey{list-style:none;margin:18px 0;padding:0;display:grid;gap:8px;max-width:760px}
.mg-journey li{margin:0}
.mg-journey a{display:grid;grid-template-columns:40px 1fr auto;gap:12px;align-items:center;min-height:56px;padding:8px 14px;border:1px solid var(--line,#dfe3ea);border-radius:14px;background:#fff;color:inherit;text-decoration:none}
.mg-journey-step{display:grid;place-items:center;width:36px;height:36px;border-radius:50%;background:#eef0f4;font-weight:700}
.mg-journey li.done .mg-journey-step{background:#dff3e6;color:#1f6b3f}
.mg-journey li.current a{border-color:#6b4eff;box-shadow:0 0 0 2px #6b4eff22}
.mg-journey li.current .mg-journey-step{background:#6b4eff;color:#fff}
.mg-journey-status{font-weight:700;color:#4a5568;text-align:right;max-width:8.5em;line-height:1.3}
.mg-journey li.done .mg-journey-status{color:#1f6b3f}
.mg-home-intro{max-width:760px;margin:18px 0}
.mg-home-intro p{margin:0 0 10px}
.mg-home-listen{display:flex;flex-wrap:wrap;gap:10px}

/* ---------- practice market: compact figures, cards and grouped listening ---------- */
.sb-book{margin-top:16px}
.sb-header h1{margin-top:0}
.sb-balances{margin:14px 0 10px}
.sb-group-listen{min-height:44px;margin:4px 0 12px}
.sb-results{margin:18px 0}
.sb-results>h3{font-size:1.25rem;margin:0 0 10px}
.sb-results-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:8px 0}
.sb-results-grid>div{background:#fff;border:1px solid #d8e4da;border-radius:14px;padding:12px;min-width:0}
.sb-results-grid span{display:block;font-size:.9rem;line-height:1.4;color:#4a5a50}
.sb-results-grid strong{display:block;margin-top:4px;font-size:1.1rem;overflow-wrap:anywhere}
.sb-benchmark-name{margin:12px 0 4px;font-size:.95rem}
.sb-owned-list{display:grid;gap:10px}
.sb-owned-row{background:#fff;border:1px solid #d8e4da;border-radius:16px;padding:14px}
.sb-owned-head h4{margin:0 0 2px;font-size:1.05rem}
.sb-owned-head span{font-size:.9rem;color:#4a5a50}
.sb-owned-row dl{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:10px 0}
.sb-owned-row dl>div{min-width:0}
.sb-owned-row dt{font-size:.8rem;line-height:1.35;color:#4a5a50}
.sb-owned-row dd{margin:2px 0 0;font-weight:700;overflow-wrap:anywhere}
.sb-owned-row .sb-actions,.sb-instrument .sb-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.sb-owned-row .sb-actions .button,.sb-instrument .sb-actions .button{min-height:44px}
.sb-card-listen{min-width:44px;padding:8px 12px}
.sb-held{margin:4px 0}
.sb-time{margin:22px 0}
.sb-time-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.sb-time-actions .button{display:grid;gap:2px;min-height:56px;text-align:left;padding:10px 12px}
.sb-time-actions .button span{font-size:.85rem;font-weight:400}
.sb-more-results{margin:22px 0;background:#fff;border:1px solid #d3ded7;border-radius:16px;padding:10px 16px}
.sb-more-results>summary,.sb-receipts>summary{cursor:pointer;font-weight:700;min-height:44px;display:flex;align-items:center}
.sb-pagination{align-items:center}
.sb-page-count{font-weight:700;color:#4a5a50}
.sb-negative{color:#a12a2a}.sb-positive{color:#1f6b3f}

/* the phone menu's "More" tab exists only where the menu is a bottom bar */
.nav-more{display:none}

@media screen and (max-width:820px),screen and (max-height:520px) and (max-width:1100px){
  /* bottom menu: five fixed tabs, nothing slides sideways */
  .nav{overflow:hidden;justify-content:space-between;gap:2px}
  .nav a,.nav a:nth-child(n+5){display:none}
  .nav a:nth-child(1),.nav a:nth-child(2),.nav a:nth-child(3),.nav a:nth-child(8),.nav .nav-more{display:flex;flex:1 1 0;min-width:0;max-width:none;min-height:64px;flex-direction:column;justify-content:center;align-items:center;gap:4px;padding:6px 2px;text-align:center;font-size:.72rem;line-height:1.25;overflow-wrap:anywhere}
  .nav .nav-more{border:0;background:transparent;color:var(--muted,#5b6472);font-weight:600;border-radius:10px;cursor:pointer;font-family:inherit}
  .nav .nav-more svg{width:22px;height:22px}
}

@media(max-width:650px){
  /* one slim top row: name of the place, language, who is signed in */
  .topbar{min-height:56px;height:auto;padding:6px 12px;flex-wrap:nowrap;gap:8px;align-items:center}
  .topbar .mobile-logo{flex:0 1 auto;min-height:44px;align-items:center;min-width:0}
  .mobile-logo .brand{font-size:1.02rem;white-space:nowrap}
  .mobile-logo .logo-mark{display:inline-grid;width:30px;height:30px;flex:0 0 30px}
  .top-controls{width:auto;flex:0 0 auto;flex-wrap:nowrap;gap:6px;justify-content:flex-end}
  .all-sections-button{display:none}
  .lang-select{max-width:92px;min-height:44px;font-size:.95rem;padding:6px 2px}
  .account{max-width:112px;min-height:44px;padding:6px 10px;font-size:.9rem}
  .account>span:last-child{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block}
  .main{padding-top:12px}

  /* the listen bar: one row instead of a tall box */
  .page-audio-guide{display:flex;flex-wrap:nowrap;align-items:center;gap:6px;padding:6px;margin-bottom:12px;border-radius:14px}
  .page-audio-guide>span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
  .page-audio-guide>.button{flex:1 1 auto;width:auto;min-width:0;min-height:44px;padding:4px 10px;font-size:.9rem;line-height:1.15}
  .page-audio-guide .mg-audio-controls{display:flex;flex:0 0 auto;flex-wrap:nowrap;align-items:center;gap:4px;margin:0;width:auto}
  .page-audio-guide .mg-audio-controls label{font-size:0;display:flex;margin:0}
  .page-audio-guide .mg-audio-controls select{font-size:.85rem;min-height:44px;max-width:84px;padding:4px}
  .page-audio-guide .mg-control-word{display:none}

  /* less empty space above the heading of a screen */
  .main .back-link{margin-bottom:2px}
  .main .product-heading{margin-top:4px}
  .main .product-heading h1{margin-top:8px}
  /* the bottom menu hides what scrolls under it */
  .sidebar{background:#fff}

  .sb-book{padding:14px}
  .sb-balances{grid-template-columns:1fr;gap:6px}
  .sb-owned-row dl{grid-template-columns:1fr;gap:4px}
  .sb-owned-row dl>div{display:flex;justify-content:space-between;gap:12px;align-items:baseline}
  .sb-owned-row dd{margin:0;text-align:right}
  .mg-next-lesson.mg-next-step{display:block}
  .mg-next-step .mg-next-picture{display:none}
}
@media(max-width:360px){
  .mobile-logo .logo-mark{display:none}
  .sb-results-grid{grid-template-columns:1fr}
}

/* thumbs: small text links and listen links get a comfortable height everywhere */
.main .text-button,.main .number-listen{min-height:40px;display:inline-flex;align-items:center;gap:4px}
.footer-note a,.sidebar footer a{display:inline-block;padding:13px 6px;min-width:40px}
.mobile-logo,.logo{min-height:44px}

/* ---------- Round 2: a reason with every decision, looking back, spreading, words ---------- */
.sb-reasons{border:0;padding:0;margin:16px 0;display:grid;gap:8px;min-width:0}
.sb-reasons legend{font-weight:700;font-size:1.05rem;padding:0;margin-bottom:8px}
.sb-reasons .sb-reason{justify-content:flex-start;text-align:left;width:100%;min-height:48px;line-height:1.35;border:2px solid transparent}
.sb-reasons .sb-reason.selected{border-color:#6b4eff;background:#e7e1ff;color:#2d1f7a}
.sb-reasons .sb-reason.selected::before{content:"✓";font-weight:700;margin-right:4px}
.sb-reasons .sb-group-listen{justify-self:start;margin:2px 0 0}
.sb-why{margin:6px 0;font-size:.95rem;line-height:1.45;color:#3d4a43}
.sb-why span{font-weight:700}
.sb-my-reason{margin:14px 0;padding:12px 14px;border-radius:14px;background:#f3f0ff;border:1px solid #dcd3ff}
.sb-my-reason p{margin:0 0 6px}
.sb-my-reason .sb-feedback{color:#3b3470}
.sb-spread{margin:14px 0;padding:12px 14px;border-radius:14px;line-height:1.5}
.sb-spread p{margin:0 0 6px}
.sb-spread-warn{background:#fff5d8;border:1px solid #ecd58a}
.sb-spread-good{background:#eaf8ee;border:1px solid #bfe3c9}
.sb-stepper .button{white-space:nowrap;padding-left:14px;padding-right:14px}
.sb-words{margin:22px 0}
.sb-words>h3{font-size:1.15rem;margin:0 0 10px}
.sb-word-chips{display:flex;flex-wrap:wrap;gap:8px}
.sb-word-chips .sb-term{min-height:44px;padding:8px 14px;font-size:.92rem;text-align:left;line-height:1.25;border:2px solid transparent}
.sb-word-chips .sb-term[aria-expanded="true"]{border-color:#6b4eff;background:#e7e1ff;color:#2d1f7a}
.sb-word-meaning:empty{display:none}
.sb-word-meaning{margin-top:10px;padding:12px 14px;border-radius:14px;background:#fff;border:1px solid #d3ded7;line-height:1.5}
.sb-word-meaning p{margin:0 0 6px}
.sb-word-meaning .button{margin-top:4px;min-height:44px}
/* on the mentor's page a learner's name opens that learner's practice book */
.mh-card h3 .mh-name{color:inherit;text-decoration:underline;text-underline-offset:4px;display:inline-flex;align-items:center;min-height:44px;min-width:44px}
