/* Missões no computador (>= 1024px). No celular os blocos .ms-only ficam escondidos e nada muda. */
.ms-only { display: none; }
.ms-tab { display: none; }
@media (min-width: 0px) {
  .ms-only { display: block; }
  .ms-desk { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; max-width: 1400px; margin: 0 auto; padding: 20px 24px 48px; align-items: start; }
  .ms-main { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
  .ms-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 16px; }

  /* cabeçalho + filtros */
  .ms-main .student-header { max-width: none !important; width: auto !important; margin: 0 !important; border-radius: 20px; border: 1px solid rgba(80,110,230,.4); padding: 18px 24px 16px;
    background: linear-gradient(135deg, #0a1030 0%, #0d1648 100%); box-shadow: 0 0 30px rgba(60,90,230,.12); }
  .ms-main .student-header .ms-sub { display: block; font-size: 14px; color: rgba(190,200,240,.8); margin: 2px 0 0 34px; }
  .ms-nivel { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 800; color: #1a1205; padding: 9px 18px; border-radius: 999px; background: linear-gradient(135deg, #fbbf24, #d99200); box-shadow: 0 0 18px rgba(245,168,0,.4); }
  .ms-nivel small { font-weight: 500; font-size: 13px; opacity: .85; }
  .ms-main .tabs { max-width: none !important; width: auto !important; margin: 0 !important; padding: 0 !important; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; background: none; border: 0; overflow: visible; }
  .ms-main .tab-btn { flex: none; padding: 11px 20px; border-radius: 999px; font-size: 14px; font-weight: 700; background: var(--bg-card); border: 1px solid var(--surface-3); color: var(--text-soft); }
  .ms-main .tab-btn.active { background: linear-gradient(135deg, #fbbf24, #e09a00); color: #1a1205; border-color: transparent; box-shadow: 0 0 18px rgba(245,168,0,.35); }
  .ms-main .tab-btn[onclick*="evolucao"] { display: none; }
  .ms-main .tab-btn.ms-tab { display: inline-block; }
  .ms-sep { width: 1px; height: 28px; background: var(--surface-3); margin: 0 6px; }
  .ms-fil { font: inherit; font-size: 14px; font-weight: 700; padding: 11px 20px; border-radius: 999px; cursor: pointer; background: var(--bg-card); border: 1px solid var(--surface-3); color: var(--text-soft); }
  .ms-fil.on { border-color: #3b82f6; color: #cfe0ff; background: rgba(59,130,246,.14); box-shadow: 0 0 14px rgba(59,130,246,.3); }

  /* conteúdo antigo: a lista em coluna única some; as missões aparecem nos cards novos */
  .ms-main #missionsList, .ms-main #xpMesContador { display: none !important; }
  .ms-main .safe-bottom { max-width: none !important; width: auto !important; margin: 0 !important; padding: 0 !important; }
  .ms-main #ofertaXPBanner { margin: 0 !important; max-width: none !important; width: auto !important; }

  /* blocos */
  .ms-resumo { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; padding: 14px; border-radius: 20px; background: var(--bg-card); border: 1px solid rgba(80,110,230,.28); }
  .ms-kpi { display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: 16px; background: var(--bg-elevated); border: 1px solid var(--surface-2); min-width: 0; }
  .ms-kpi b { font-size: 24px; font-weight: 900; color: var(--text-strong); line-height: 1.1; }
  .ms-kpi b.ouro { color: #f5a800; }
  .ms-kpi > span:not(.ic) { font-size: 14px; font-weight: 700; color: var(--text-strong); }
  .ms-kpi small { font-size: 12px; color: var(--text-dim); }
  .ms-kpi small.verde { color: #34d399; font-weight: 700; } .ms-kpi small.verm { color: #f87171; font-weight: 700; }
  .ms-desk .ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; font-size: 21px; margin-bottom: 6px; border: 1px solid; flex: none; }
  .ic-rosa { background: rgba(236,72,153,.14); border-color: rgba(236,72,153,.4); } .ic-ouro { background: rgba(245,168,0,.14); border-color: rgba(245,168,0,.45); }
  .ic-azul { background: rgba(59,110,255,.16); border-color: rgba(59,110,255,.45); } .ic-roxo { background: rgba(139,92,246,.18); border-color: rgba(139,92,246,.45); }
  .ic-fogo { background: rgba(239,68,68,.14); border-color: rgba(239,68,68,.4); }

  .ms-prio { display: grid; grid-template-columns: 150px minmax(0, 1fr) 270px; gap: 22px; align-items: center; padding: 22px 24px; border-radius: 22px; border: 1.5px solid rgba(245,168,0,.7);
    background: radial-gradient(ellipse at 0% 0%, rgba(245,168,0,.22), transparent 55%), linear-gradient(135deg, #1a1410, #0b0f26 70%); box-shadow: 0 0 28px rgba(245,168,0,.18); }
  .ms-prio-arte { display: grid; place-items: center; }
  .ms-prio-arte img { width: 150px; height: 150px; object-fit: cover; border-radius: 50%; mix-blend-mode: lighten; }
  .ms-prio-arte > span { display: grid; place-items: center; width: 110px; height: 110px; font-size: 54px; border-radius: 50%; background: rgba(245,168,0,.12); border: 1px solid rgba(245,168,0,.4); }
  .ms-prio-sel { font-size: 12px; font-weight: 800; letter-spacing: .06em; color: #f5a800; margin-bottom: 8px; }
  .ms-prio-txt h3 { font-size: 24px; font-weight: 900; color: var(--text-strong); line-height: 1.2; margin-bottom: 8px; }
  .ms-prio-txt p { font-size: 15px; line-height: 1.5; color: var(--text-soft); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 14px; }
  .ms-tags { display: flex; flex-wrap: wrap; gap: 8px; }
  .ms-tag { font-size: 12px; font-weight: 700; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--surface-3); background: rgba(10,16,48,.7); color: var(--text-soft); }
  .ms-tag.t-hab { color: #7fc4ff; border-color: rgba(59,130,246,.4); } .ms-tag.t-na { color: #c4b0ff; border-color: rgba(139,92,246,.45); }
  .ms-prio-lado { border-left: 1px solid var(--surface-2); padding-left: 22px; display: flex; flex-direction: column; gap: 10px; }
  .ms-prio-xp { font-size: 28px; font-weight: 900; color: #f5a800; padding-bottom: 10px; border-bottom: 1px solid var(--surface-2); }
  .ms-prio-lin { font-size: 14px; color: var(--text-soft); padding-bottom: 10px; border-bottom: 1px solid var(--surface-2); } .ms-prio-lin b { color: var(--text-strong); }
  .ms-btn-ouro { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-size: 15px; font-weight: 800; cursor: pointer; border: 0; color: #1a1205; padding: 14px 18px; border-radius: 14px; background: linear-gradient(90deg, #fbbf24, #f59e0b 60%, #a855f7); box-shadow: 0 0 18px rgba(245,168,0,.35); }
  .ms-btn-ouro.peq { font-size: 13px; padding: 11px 12px; flex: 1; background: linear-gradient(135deg, #fbbf24, #e09a00); }
  .ms-btn-linha { display: inline-flex; align-items: center; justify-content: center; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; padding: 11px 12px; border-radius: 12px; background: rgba(15,24,70,.7); border: 1px solid rgba(80,110,230,.5); color: var(--text-strong); flex: 1; }
  .ms-btn-linha:disabled { opacity: .7; cursor: default; }

  .ms-outras, .ms-hist { padding: 20px 22px; border-radius: 22px; background: var(--bg-card); border: 1px solid rgba(80,110,230,.28); }
  .ms-cab { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
  .ms-tit { display: flex; align-items: center; gap: 12px; }
  .ms-raio { font-size: 26px; }
  .ms-tit h3 { font-size: 20px; font-weight: 800; color: var(--text-strong); }
  .ms-tit p { font-size: 13px; color: var(--text-dim); margin-top: 2px; }
  .ms-link { font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; color: var(--text-strong); background: rgba(15,24,70,.7); border: 1px solid rgba(80,110,230,.5); padding: 10px 16px; border-radius: 999px; }
  .ms-link i { font-style: normal; color: #fbbf24; }
  .ms-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
  .ms-card { display: flex; flex-direction: column; padding: 16px; border-radius: 18px; background: var(--bg-elevated); border: 1px solid var(--surface-2); min-width: 0; }
  .ms-card-ic { display: grid; place-items: center; width: 52px; height: 52px; font-size: 26px; border-radius: 14px; background: rgba(139,92,246,.18); border: 1px solid rgba(139,92,246,.35); margin-bottom: 12px; }
  .ms-card h4 { font-size: 16px; font-weight: 800; color: var(--text-strong); line-height: 1.25; margin-bottom: 6px; }
  .ms-card p { font-size: 13px; line-height: 1.45; color: var(--text-dim); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 10px; min-height: 38px; }
  .ms-card .ms-tags { margin-bottom: 12px; } .ms-card .ms-tag { font-size: 11px; padding: 5px 9px; }
  .ms-meta { display: flex; align-items: center; justify-content: space-between; font-size: 14px; color: var(--text-soft); padding: 10px 0; margin-top: auto; border-top: 1px solid var(--surface-2); }
  .ms-meta .xp { font-weight: 800; color: #f5a800; }
  .ms-acoes { display: flex; gap: 8px; }
  .ms-vazio { grid-column: 1 / -1; padding: 28px; text-align: center; font-size: 14px; color: var(--text-dim); }

  .ms-hist-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
  .ms-h { display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: 18px; background: var(--bg-elevated); border: 1px solid var(--surface-2); min-width: 0; }
  .ms-h b { font-size: 28px; font-weight: 900; color: var(--text-strong); line-height: 1.1; } .ms-h b.m { font-size: 19px; }
  .ms-h > span:not(.ic) { font-size: 14px; font-weight: 700; color: var(--text-strong); } .ms-h small { font-size: 12px; color: var(--text-dim); }
  .ms-barra { height: 8px; border-radius: 6px; background: var(--surface-2); overflow: hidden; margin-top: 8px; } .ms-barra i { display: block; height: 100%; border-radius: 6px; }
  .ms-barra.az i { background: linear-gradient(90deg, #38bdf8, #8b5cf6); } .ms-barra.ou i { background: linear-gradient(90deg, #f5a800, #fbbf24); }

  /* coluna lateral */
  .ms-instr, .ms-como { padding: 20px; border-radius: 22px; background: var(--bg-card); border: 1px solid rgba(80,110,230,.28); }
  .ms-instr h3, .ms-como h3 { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 800; color: var(--text-strong); margin-bottom: 16px; }
  .ms-prof { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 16px; background: var(--bg-elevated); border: 1px solid var(--surface-2); margin-bottom: 10px; }
  .ms-prof .av { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; font-size: 18px; font-weight: 900; color: #fff; background: linear-gradient(135deg, #8b5cf6, #3b82f6); flex: none; }
  .ms-prof b { display: block; font-size: 17px; color: var(--text-strong); } .ms-prof small { font-size: 13px; color: var(--text-dim); }
  .ms-instr .ms-btn-linha { width: 100%; margin-bottom: 14px; }
  .ms-prof .av { position: relative; border: 2px solid rgba(139,92,246,.7); }
  .ms-prof .av.on::after { content: ''; position: absolute; right: -2px; bottom: -2px; width: 14px; height: 14px; border-radius: 50%; background: #22c55e; border: 2px solid var(--bg-elevated); }
  .ms-online { display: block; margin-top: 3px; font-size: 12px; font-weight: 700; color: #34d399; }
  .ms-li { display: flex; align-items: center; gap: 14px; padding: 12px; margin-bottom: 10px; border-radius: 16px; background: var(--bg-elevated); border: 1px solid var(--surface-2); }
  .ms-li .ic { margin: 0; border-radius: 12px; }
  .ms-li small { display: block; font-size: 12px; color: var(--text-dim); } .ms-li b { font-size: 15px; color: var(--text-strong); } .ms-li b.ouro { color: #fbbf24; } .ms-li b.roxo { color: #b69cff; }
  .ms-li.ou { border-color: rgba(245,168,0,.4); } .ms-li.ro { border-color: rgba(139,92,246,.4); }
  .ms-como ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
  .ms-como li { position: relative; display: flex; align-items: center; gap: 12px; }
  .ms-como li::before { content: ''; position: absolute; left: 13px; top: 30px; bottom: -18px; border-left: 2px dashed var(--surface-3); }
  .ms-como li:last-child::before { display: none; }
  .ms-como .n { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-style: normal; font-size: 13px; font-weight: 900; color: #fff; flex: none; position: relative; z-index: 1; }
  .ms-como .n1 { background: #f5a800; color: #1a1205; } .ms-como .n2 { background: #4f46e5; } .ms-como .n3 { background: #10b981; }
  .ms-como img { width: 56px; height: 56px; border-radius: 14px; flex: none; }
  .ms-como b { display: block; font-size: 14px; color: var(--text-strong); } .ms-como small { font-size: 12px; line-height: 1.35; color: var(--text-dim); }
  .ms-ida { padding: 20px; border-radius: 22px; background: var(--bg-card); border: 1px solid rgba(80,110,230,.28); }
  .ms-ida-top { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
  .ms-ida-top .ic { margin: 0; border-radius: 14px; width: 54px; height: 54px; font-size: 26px; }
  .ms-ida-top h3 { font-size: 20px; font-weight: 900; color: var(--text-strong); line-height: 1.15; }
  .ms-ida-top p { font-size: 13px; color: var(--text-dim); margin-top: 4px; line-height: 1.4; }
  .ms-ida-data { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 16px; border: 1.5px solid rgba(245,168,0,.7); background: linear-gradient(135deg, rgba(245,168,0,.18), rgba(245,168,0,.04)); box-shadow: 0 0 18px rgba(245,168,0,.18); margin-bottom: 16px; }
  .ms-ida-data .ic { margin: 0; border-radius: 12px; }
  .ms-ida-data b { display: block; font-size: 17px; color: var(--text-strong); } .ms-ida-data small { font-size: 14px; color: var(--text-soft); }
  .ms-ida h4 { font-size: 15px; font-weight: 800; color: var(--text-strong); margin: 4px 0 10px; padding-top: 14px; border-top: 1px solid var(--surface-2); }
  .ms-ida-itens { display: flex; flex-direction: column; gap: 8px; }
  .ms-ida-it { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: var(--bg-elevated); border: 1px solid var(--surface-2); cursor: pointer; }
  .ms-ida-it input { position: absolute; opacity: 0; pointer-events: none; }
  .ms-ida-it i { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--surface-3); flex: none; display: grid; place-items: center; }
  .ms-ida-it.on i { background: #22c55e; border-color: #22c55e; } .ms-ida-it.on i::after { content: '✓'; color: #fff; font-size: 15px; font-style: normal; font-weight: 900; }
  .ms-ida-it b { display: block; font-size: 14px; color: var(--text-strong); } .ms-ida-it small { font-size: 12px; color: var(--text-dim); }
}
@media (max-width: 1399px) {
  .ms-desk { grid-template-columns: minmax(0, 1fr); }
  .ms-side { position: static; display: grid; grid-template-columns: 1fr 1fr; }
  .ms-grid, .ms-hist-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ms-prio { grid-template-columns: 110px minmax(0, 1fr); } .ms-prio-lado { grid-column: 1 / -1; border-left: 0; padding-left: 0; }
}

/* ===== celular ===== */
@media (max-width: 767px) {
  .ms-desk { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 10px 12px calc(92px + env(safe-area-inset-bottom)); }
  .ms-main { gap: 12px; } .ms-side { display: flex; flex-direction: column; position: static; }
  .ms-main .student-header { padding: 14px 16px 12px; border-radius: 18px; } .ms-main .student-header .ms-sub { margin-left: 0; font-size: 12px; }
  .ms-nivel { padding: 7px 14px; font-size: 12px; white-space: nowrap; }
  .ms-main .tabs { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; } .ms-main .tabs::-webkit-scrollbar { display: none; } .ms-main .tab-btn { flex: none; padding: 10px 16px; font-size: 13px; }
  .ms-resumo { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 10px; } .ms-kpi { padding: 12px; } .ms-kpi b { font-size: 20px; }
  .ms-prio { grid-template-columns: 96px minmax(0, 1fr); gap: 14px; padding: 16px; } .ms-prio-lado { grid-column: 1 / -1; border-left: 0; padding-left: 0; }
  .ms-grid, .ms-hist-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .ms-cab { flex-wrap: wrap; }
  .ms-ida { padding: 16px; } .ms-ida-top h3 { font-size: 17px; }
}
