/* Mobile-only UI layer for the dedicated mobile experience.
   Scoped via body.is-mobile-view to avoid affecting desktop animation/layout. */

body.is-mobile-view {
  --mobile-content-inset: max(14px, calc((100vw - 920px) / 2));
  background: #ffffff;
  overflow-x: hidden;
}

body.is-mobile-view .site-header,
body.is-mobile-view .site-footer {
  background: #2c3076;
}

body.is-mobile-view .site-header {
  justify-content: flex-start;
  padding-left: calc(var(--mobile-content-inset) + 10px);
  padding-right: var(--mobile-content-inset);
}

body.is-mobile-view .mobile-notice {
  display: block;
  position: relative;
  padding: 10px 14px 84px;
  overflow-x: clip;
}

body.is-mobile-view .site-menu {
  top: 18px;
  right: 14px;
  z-index: 1260;
  transition: opacity 0.18s ease, visibility 0.18s ease;
}

body.is-mobile-view.mobile-sheet-open .site-menu,
body.is-mobile-view.menu-modal-open .site-menu {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

body.is-mobile-view .menu-toggle {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
}

body.is-mobile-view .menu-icon {
  width: 24px;
  height: 18px;
}

body.is-mobile-view .menu-bar {
  height: 2px;
  background: #ffffff;
}

body.is-mobile-view .footer-text,
body.is-mobile-view .footer-credit,
body.is-mobile-view .footer-credit a {
  color: #ffffff;
}

body.is-mobile-view .menu-toggle.is-open .menu-bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
body.is-mobile-view .menu-toggle.is-open .menu-bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

body.is-mobile-view .menu-panel {
  top: 50px;
  right: 0;
  width: min(330px, calc(100vw - 28px));
  max-height: min(78vh, 620px);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 14px 12px;
  border-radius: 16px;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.22);
}

body.is-mobile-view .menu-list {
  gap: 7px;
}

body.is-mobile-view .menu-item {
  min-height: 36px;
  padding: 7px 6px;
  font-size: 18px;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

body.is-mobile-view .menu-external {
  font-size: 15px;
}

body.is-mobile-view .menu-social {
  gap: 12px;
  margin-top: 8px;
  padding-top: 10px;
}

body.is-mobile-view .menu-social-link {
  width: 32px;
  height: 32px;
}

body.is-mobile-view .menu-social-icon {
  width: 22px;
  height: 22px;
}

body.is-mobile-view .menu-modal-overlay {
  padding: 68px 22px 44px;
  align-items: center;
}

body.is-mobile-view .menu-modal {
  width: min(100%, 360px);
  max-height: 74vh;
  max-height: 74dvh;
  padding: 22px 20px 24px;
  border-radius: 24px;
}

body.is-mobile-view .menu-modal-header {
  gap: 10px;
  margin-bottom: 16px;
  padding-right: 24px;
}

body.is-mobile-view .menu-modal-icon {
  width: 58px;
  height: 58px;
  margin-right: 0;
  transform: none;
}

body.is-mobile-view .menu-modal-icon img {
  width: 66px;
  height: 66px;
}

body.is-mobile-view .menu-modal-title {
  font-size: 22px;
}

body.is-mobile-view .menu-modal-subtitle {
  font-size: 16px;
}

body.is-mobile-view .menu-modal-body {
  font-size: 15px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

body.is-mobile-view .pwa-help-grid {
  grid-template-columns: 1fr;
}

body.is-mobile-view .pwa-help-card {
  padding: 12px 13px;
}

body.is-mobile-view .pwa-help-card h3 {
  font-size: 17px;
}

body.is-mobile-view .menu-modal-close {
  top: 8px;
  right: 8px;
  width: 34px;
  height: 34px;
  font-size: 26px;
}

body.is-mobile-view .mobile-app {
  width: min(920px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 8px;
  position: relative;
  z-index: 1;
}

body.is-mobile-view .mobile-intro {
  border: 1px solid rgba(44, 48, 118, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.08);
  padding: 16px 16px 14px;
}

body.is-mobile-view .mobile-kicker {
  font-family: "Cera GR", "Roboto", system-ui, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.85px;
  color: #2c3076;
  text-transform: uppercase;
  margin: 0 0 4px;
}

body.is-mobile-view .mobile-title {
  font-family: "Cera GR", "Roboto", system-ui, sans-serif;
  font-size: clamp(25px, 7vw, 36px);
  font-weight: 700;
  line-height: 1.05;
  color: #0b0f19;
  margin: 0;
}

body.is-mobile-view .mobile-lede {
  margin: 10px 0 0;
  color: #334155;
  font-size: clamp(15px, 4.2vw, 18px);
  line-height: 1.45;
}

body.is-mobile-view .mobile-cluster-stack {
  display: grid;
  gap: 8px;
}

body.is-mobile-view .mobile-cluster {
  --cluster-color: #2c3076;
  --cluster-soft: #f3f6fb;
  border-radius: 0;
  border: 0;
  background: transparent;
  overflow: visible;
  box-shadow: none;
  opacity: 0;
  transform: translateY(18px);
  animation: mobile-cluster-enter 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  animation-delay: var(--cluster-delay, 0s);
}

body.is-mobile-view .mobile-cluster-header {
  width: 100%;
  border: 0;
  min-height: 74px;
  padding: 10px 12px;
  cursor: pointer;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  color: #0b0f19;
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.11);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.16), transparent 55%), var(--cluster-color);
  transition: transform 0.24s ease, box-shadow 0.24s ease, border-radius 0.24s ease;
}

body.is-mobile-view .mobile-cluster.is-open .mobile-cluster-header {
  transform: translateY(-4px);
  border-radius: 10px 10px 4px 4px;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.16);
}

body.is-mobile-view .mobile-cluster-heading {
  display: flex;
  align-items: baseline;
  gap: 9px;
  min-width: 0;
}

body.is-mobile-view .mobile-cluster-index {
  display: none;
  font-family: "Cera GR", "Roboto", system-ui, sans-serif;
  font-size: 20px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.86);
  font-weight: 700;
  opacity: 0.95;
}

body.is-mobile-view .mobile-cluster-title {
  font-family: "Cera GR", "Roboto", system-ui, sans-serif;
  font-size: clamp(22px, 6vw, 30px);
  line-height: 1.05;
  font-weight: 700;
  color: #ffffff;
  text-align: left;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

body.is-mobile-view .mobile-cluster-icon {
  width: 42px;
  height: 42px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  margin-left: 1px;
}

body.is-mobile-view .mobile-cluster-icon-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

body.is-mobile-view .mobile-cluster-chevron {
  font-size: 20px;
  color: rgba(255, 255, 255, 0.92);
  transform: rotate(0deg);
  transition: transform 0.2s ease;
  margin-left: 0;
}

body.is-mobile-view .mobile-cluster.is-open .mobile-cluster-chevron {
  transform: rotate(-90deg);
}

body.is-mobile-view .mobile-cluster-summary {
  margin: 0;
  padding: 10px 14px 12px;
  background: var(--cluster-soft);
  color: #1f2937;
  line-height: 1.45;
  font-size: 14px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

body.is-mobile-view .mobile-cluster-panel {
  max-height: 0;
  overflow: hidden;
  background: transparent;
  transition: max-height 0.3s ease;
}

body.is-mobile-view .mobile-cluster-panel-inner {
  padding: 7px 0 8px;
}

body.is-mobile-view .mobile-competency-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
}

body.is-mobile-view .mobile-competency-button {
  width: 100%;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 5px;
  padding: 12px 7px;
  min-height: 74px;
  background: var(--competency-bg, var(--cluster-soft));
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  justify-items: center;
  gap: 0;
  color: #0b0f19;
  text-align: center;
  cursor: pointer;
  font-family: "Cera GR", "Roboto", system-ui, sans-serif;
  font-size: clamp(10.5px, 3vw, 13px);
  line-height: 1.14;
  font-weight: 700;
  opacity: 0;
  transform: translateY(8px);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

body.is-mobile-view .mobile-cluster.is-open .mobile-competency-button {
  opacity: 1;
  transform: translateY(0);
  transition-delay: var(--tile-delay, 0s);
}

body.is-mobile-view .mobile-competency-button:hover,
body.is-mobile-view .mobile-competency-button:focus-visible {
  border-color: var(--cluster-color);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.1);
}

body.is-mobile-view .mobile-competency-icon {
  display: none;
  width: clamp(28px, 8.8vw, 38px);
  height: clamp(28px, 8.8vw, 38px);
  border-radius: 9px;
  object-fit: contain;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

body.is-mobile-view .mobile-competency-label {
  min-width: 0;
  overflow-wrap: anywhere;
  display: block;
}

body.is-mobile-view .mobile-competency-arrow {
  display: none;
  font-size: 17px;
  color: #334155;
}

body.is-mobile-view .mobile-sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 1199;
  background: rgba(15, 23, 42, 0.52);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease;
}

body.is-mobile-view .mobile-sheet-overlay[hidden] {
  display: none !important;
}

body.is-mobile-view .mobile-sheet-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

body.is-mobile-view .mobile-sheet {
  position: fixed;
  z-index: 1200;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 100vw;
  max-height: 78vh;
  max-height: min(78dvh, 680px);
  background: #ffffff;
  border-radius: 24px 24px 0 0;
  border-top: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: 0 -16px 50px rgba(15, 23, 42, 0.2);
  transform: translateY(101%);
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}

body.is-mobile-view .mobile-sheet,
body.is-mobile-view .mobile-sheet * {
  min-width: 0;
}

body.is-mobile-view .mobile-sheet[hidden] {
  display: none !important;
}

body.is-mobile-view .mobile-sheet.is-open {
  transform: translateY(0);
}

body.is-mobile-view.mobile-sheet-open {
  overflow: hidden;
}

body.is-mobile-view.menu-modal-open {
  overflow: hidden;
}

body.is-mobile-view .mobile-sheet-header {
  position: relative;
  padding: 14px 18px 10px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  background: #ffffff;
}

body.is-mobile-view .mobile-sheet-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding-right: 20px;
}

body.is-mobile-view .mobile-sheet-icon {
  width: 58px;
  height: 58px;
  border-radius: 0;
  background: transparent;
  border: 0;
  display: grid;
  place-items: center;
  overflow: visible;
  margin-top: 4px;
}

body.is-mobile-view .mobile-sheet-icon img {
  width: 54px;
  height: 54px;
  object-fit: contain;
}

body.is-mobile-view .mobile-sheet-icon span {
  font-family: "Cera GR", "Roboto", system-ui, sans-serif;
  font-weight: 700;
  font-size: 21px;
  color: #2c3076;
}

body.is-mobile-view .mobile-sheet-category {
  margin: 0 0 10px;
  font-family: "Cera GR", "Roboto", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: 1;
  text-transform: uppercase;
  color: var(--cluster-color, #2c3076);
}

body.is-mobile-view .mobile-sheet[data-theme="1"] .mobile-sheet-category { color: var(--block-1); }
body.is-mobile-view .mobile-sheet[data-theme="2"] .mobile-sheet-category { color: var(--block-2); }
body.is-mobile-view .mobile-sheet[data-theme="3"] .mobile-sheet-category { color: var(--block-3); }
body.is-mobile-view .mobile-sheet[data-theme="4"] .mobile-sheet-category { color: var(--block-4); }

body.is-mobile-view .mobile-sheet-title {
  margin: 0;
  font-family: "Cera GR", "Roboto", system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(18px, 5vw, 25px);
  line-height: 1.1;
  color: #0b0f19;
}

body.is-mobile-view .mobile-sheet-subtitle {
  margin: 5px 0 0;
  font-family: "Cera GR", "Roboto", system-ui, sans-serif;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.35;
  color: #334155;
}

body.is-mobile-view .mobile-sheet-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: 0;
  background: transparent;
  color: #0b0f19;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

body.is-mobile-view .mobile-sheet-scroll {
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 14px 22px;
  display: grid;
  gap: 14px;
}

body.is-mobile-view .mobile-sheet-content {
  display: grid;
  gap: 10px;
  color: #1f2937;
  font-size: 15px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

body.is-mobile-view .mobile-sheet-content p {
  margin: 0;
}

body.is-mobile-view .mobile-sheet-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

body.is-mobile-view .mobile-sheet-tab {
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: #f8fafc;
  color: #0b0f19;
  border-radius: 999px;
  padding: 8px 10px;
  font-family: "Cera GR", "Roboto", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

body.is-mobile-view .mobile-sheet-tab.is-active {
  background: #2c3076;
  color: #ffffff;
  border-color: #2c3076;
}

body.is-mobile-view .mobile-sheet-tab-panel {
  display: grid;
  gap: 10px;
}

body.is-mobile-view .mobile-level-layout {
  display: grid;
  gap: 10px;
}

body.is-mobile-view .mobile-level-group {
  display: grid;
  gap: 8px;
}

body.is-mobile-view .mobile-level-heading {
  margin: 0;
  font-family: "Cera GR", "Roboto", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: #475569;
  text-transform: uppercase;
}

body.is-mobile-view .mobile-level-card {
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  padding: 11px 12px;
  background: #f8f1e4;
  display: grid;
  gap: 8px;
  overflow-wrap: anywhere;
}

body.is-mobile-view .mobile-level-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

body.is-mobile-view .mobile-level-title {
  font-family: "Cera GR", "Roboto", system-ui, sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #0b0f19;
}

body.is-mobile-view .mobile-level-score {
  font-family: system-ui, -apple-system, "Segoe UI Symbol", "Apple Symbols", "Arial Unicode MS", sans-serif;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 2px;
  color: #0b0f19;
  flex: 0 0 auto;
}

body.is-mobile-view .mobile-level-points {
  margin: 0;
  padding-left: 16px;
  font-size: 14px;
  line-height: 1.5;
  color: #0f172a;
  overflow-wrap: anywhere;
}

body.is-mobile-view .mobile-level-points li + li {
  margin-top: 6px;
}

body.is-mobile-view .mobile-sheet[data-theme="1"] .mobile-level-card {
  background: #fcf5f8;
}

body.is-mobile-view .mobile-sheet[data-theme="2"] .mobile-level-card {
  background: #fef7ec;
}

body.is-mobile-view .mobile-sheet[data-theme="3"] .mobile-level-card {
  background: #eaeff6;
}

body.is-mobile-view .mobile-sheet[data-theme="4"] .mobile-level-card {
  background: #f1faf6;
}

body.is-mobile-view .mobile-sheet-notes {
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  padding-top: 10px;
  display: grid;
  gap: 7px;
}

body.is-mobile-view .mobile-sheet-notes-title {
  margin: 0;
  font-family: "Cera GR", "Roboto", system-ui, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: #475569;
  text-transform: uppercase;
}

body.is-mobile-view .mobile-sheet-notes-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

body.is-mobile-view .mobile-sheet-notes-item {
  position: relative;
  padding-left: 12px;
  color: #334155;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

body.is-mobile-view .mobile-sheet-notes-item::before {
  content: ">";
  position: absolute;
  left: 0;
  top: 0;
  color: #64748b;
}

body.is-mobile-view .mobile-sheet-notes-link {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
  word-break: break-word;
  overflow-wrap: anywhere;
}

body.is-mobile-view .mobile-sheet-notes-link:hover,
body.is-mobile-view .mobile-sheet-notes-link:focus-visible {
  text-decoration-style: solid;
}

@media (min-width: 769px) {
  body.is-mobile-view .mobile-notice {
    padding-left: 20px;
    padding-right: 20px;
  }

  body.is-mobile-view .mobile-app {
    gap: 16px;
  }

  body.is-mobile-view .mobile-cluster-stack {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 370px) {
  body.is-mobile-view .mobile-cluster-header {
    padding: 12px 11px 11px;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 9px;
  }

  body.is-mobile-view .mobile-cluster-icon {
    width: 32px;
    height: 32px;
  }

  body.is-mobile-view .mobile-cluster-title {
    font-size: 18px;
  }

  body.is-mobile-view .mobile-competency-button {
    font-size: 9.8px;
    padding-left: 4px;
    padding-right: 4px;
    min-height: 68px;
  }

  body.is-mobile-view .mobile-competency-icon {
    width: 27px;
    height: 27px;
  }
}

@keyframes mobile-cluster-enter {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
