/* Activity entry and read-only official elementary standards. */
#dashboard-section {
  overflow-y: auto !important;
  align-items: center !important;
  justify-content: flex-start !important;
  color: #203f57;
}
.math-entry-shell { width: min(920px, calc(100% - 40px)); margin: auto; padding: 36px 0 130px; text-align: center; flex-shrink: 0; }
.math-entry-logo { width: 230px; max-width: 65%; height: auto; margin: 0 auto 4px; }
.math-entry-shell h1 { margin: 0 0 30px; font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 900; color: #203f57; }
.math-entry-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.math-entry-card { --entry-color: #1688cf; display: flex; align-items: center; flex-direction: column; gap: 14px; padding: 38px 20px; min-height: 230px; background: linear-gradient(145deg, #fff, #eef9ff); border: 3px solid #8bd1ff; border-radius: 32px; color: #304c5f; box-shadow: 0 16px 36px #1688cf1c; transition: transform .18s, box-shadow .18s; }
.math-entry-card.practice { --entry-color: #0f8a76; background: linear-gradient(145deg, #fff, #ecfbf4); border-color: #87d9bf; }
.math-entry-card.shorts { --entry-color: #f6eaff; color: #e0dcf0; background: radial-gradient(ellipse at top right, #7443a654, transparent 70%), linear-gradient(145deg, #201d36, #101322); border-color: #8270b8; box-shadow: 0 16px 36px #35285026; }
.math-entry-card.shorts .math-entry-icon { color: #c7b1ff; text-shadow: 3px 0 #f05d9b, -3px 0 #56d9dc; }
.math-entry-card:hover { transform: translateY(-4px); box-shadow: 0 20px 40px #1688cf30; }
.math-entry-card:focus-visible, .math-standards-filters :is(input,select,button):focus-visible { outline: 3px solid #1688cf; outline-offset: 4px; }
.math-entry-icon { font-size: 3.5rem; line-height: 1; }
.math-entry-card strong { color: var(--entry-color); font-size: clamp(1.8rem, 4vw, 2.25rem); font-weight: 900; }
.math-entry-card > span:last-child { font-weight: 700; font-size: .95rem; word-break: keep-all; overflow-wrap: anywhere; }
#math-learning-section { flex-direction: column; }
.math-activity-view { overflow-y: auto; align-items: stretch; justify-content: flex-start; background: url('aiedu_math_bg.svg') center / cover; }
.math-learning-toolbar { display: flex; flex-shrink: 0; align-items: center; justify-content: space-between; gap: 16px; width: min(1040px, calc(100% - 32px)); margin: 16px auto 0; }
.math-home-logo { display: inline-flex; flex-shrink: 0; background: none; border: 0; padding: 0; box-shadow: none; cursor: pointer; border-radius: 12px; }
.math-home-logo:focus-visible { outline: 3px solid #1688cf; outline-offset: 4px; }
.math-home-logo img { display: block; width: 150px; height: auto; }
.math-learning-toolbar .btn-outline { width: auto; min-height: 44px; margin: 0; padding: 10px 16px; white-space: normal; }
.math-practice-shell, .math-bkt-shell { width: min(1040px, calc(100% - 32px)); min-width: 0; flex-shrink: 0; margin: 0 auto; padding-bottom: 175px; }
.math-learning-heading { width: min(1040px, calc(100% - 32px)); margin: 10px auto 0; color: #203f57; font-size: 1.6rem; font-weight: 900; }
#math-learning-section .math-domain-dashboard { margin-top: 20px; }
.math-practice-header { align-items: flex-start; flex-direction: row; }
.math-practice-header #math-standards-button { width: auto; margin-left: auto; white-space: nowrap; flex-shrink: 0; }
.math-practice-empty { min-height: 330px; }
.math-practice-empty :is(strong,p) { word-break: keep-all; overflow-wrap: anywhere; }
.math-practice-empty .btn-outline { margin-top: 18px; }
.math-standards-filters { display: grid; grid-template-columns: minmax(125px, .8fr) minmax(145px, 1fr) minmax(200px, 2fr) auto; align-items: end; gap: 14px; margin-top: 24px; padding: 18px; background: #f0f8fd; border-radius: 20px; }
.math-standards-filters label { display: flex; flex-direction: column; gap: 7px; color: #34576f; font-size: .88rem; font-weight: 800; min-width: 0; }
.math-standards-filters :is(select,input) { width: 100%; min-width: 0; min-height: 46px; border: 1px solid #b7d9ed; border-radius: 12px; padding: 9px 12px; background: #fff; color: #25445a; font: inherit; }
.math-standards-filters .btn-outline { min-height: 46px; padding: 9px 16px; white-space: nowrap; }
.math-standards-count { margin: 18px 0; color: #1688cf; font-weight: 900; }
.math-standards-band { margin-bottom: 26px; }
.math-standards-band h2 { background: #e7f6ff; color: #155f8b; padding: 13px 16px; border-radius: 14px; font-size: 1.3rem; font-weight: 900; }
.math-standards-band h3 { margin: 18px 0 10px; color: #304b60; font-size: 1.05rem; font-weight: 900; }
.math-standards-items { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.math-standard-item { padding: 16px 18px; border: 1px solid #d4e6f1; border-radius: 16px; background: #fff; overflow-wrap: anywhere; }
.math-standard-code { color: #1278b5; font-size: .95rem; font-weight: 900; }
.math-standard-item p { margin: 6px 0 0; line-height: 1.8; font-weight: 500; color: #304b60; word-break: keep-all; overflow-wrap: anywhere; }
.math-standards-no-results { padding: 30px 20px; background: #f5f9fc; border-radius: 16px; color: #526b7c; }
.math-standards-source { border-top: 1px solid #d4e6f1; margin-top: 24px; padding-top: 16px; font-size: .8rem; line-height: 1.7; color: #61788a; }
.math-standards-source a { color: #1278b5; text-decoration: underline; }
.math-standards-shell { padding-bottom: 110px; }
@media (max-width: 1024px) {
  /* Keep the signed-in HUD away from the new top-right controls. */
  body.rpg-hud-active:has(#dashboard-section:not(.hidden), #math-learning-section:not(.hidden), #math-practice-section:not(.hidden), #math-standards-section:not(.hidden), #math-bkt-section:not(.hidden)) .aiedue-rpg-hud {
    top: auto;
    right: auto;
    bottom: max(9px, env(safe-area-inset-bottom));
    left: max(9px, env(safe-area-inset-left));
    align-items: flex-start;
  }
  body.rpg-hud-active:has(#dashboard-section:not(.hidden), #math-learning-section:not(.hidden), #math-practice-section:not(.hidden), #math-standards-section:not(.hidden), #math-bkt-section:not(.hidden)) .math-rpg-hud .rpg-action-tray {
    top: auto;
    right: auto;
    bottom: calc(100% + 8px);
    left: 0;
    transform-origin: bottom left;
  }
}
@media (max-width: 900px) {
  .math-standards-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .math-standards-query-label { grid-column: 1 / 3; }
  .math-standards-filters .btn-outline { grid-column: 1 / 3; }
}
@media (max-width: 600px) {
  .math-entry-shell { width: calc(100% - 28px); padding: 24px 0 110px; }
  .math-entry-logo { width: 175px; }
  .math-entry-shell h1 { margin-bottom: 20px; }
  .math-entry-cards { grid-template-columns: 1fr; gap: 16px; }
  .math-entry-card { min-height: 165px; padding: 24px 14px; gap: 10px; border-radius: 24px; }
  .math-entry-icon { font-size: 2.5rem; }
  .math-entry-card strong { font-size: 1.7rem; }
  .math-home-logo img { width: 105px; }
  .math-learning-toolbar { gap: 10px; align-items: flex-start; }
  .math-learning-toolbar .btn-outline { padding: 10px 12px; font-size: .8rem; }
  .practice-header-actions { justify-content: flex-end; min-width: 0; }
  .math-practice-shell { width: calc(100% - 24px); }
  .math-learning-toolbar .btn-outline { padding: 10px 15px; }
  .math-practice-header { gap: 8px; }
  .math-practice-header h1 { font-size: 1.6rem; }
  .math-practice-header #math-standards-button { padding: 12px 10px; font-size: .85rem; }
  .math-standards-filters { padding: 12px; gap: 10px; }
  .math-standard-item { padding: 13px 14px; }
}
