/* Mobile polish for all pages: touch-first, stable layouts, clearer disabled states. */
@media(max-width:620px){
  .academy-body .certificate-entry{grid-template-columns:56px minmax(0,1fr)!important;gap:14px!important;align-items:start!important;padding:22px 16px!important}
  .academy-body .certificate-seal{width:56px;height:56px;margin-top:2px}
  .academy-body .certificate-seal span{font-size:16px}
  .academy-body .certificate-entry h2{font-size:21px;line-height:1.18;margin:0 0 8px}
  .academy-body .certificate-entry p{font-size:13px;line-height:1.5}
  .academy-body .certificate-actions{grid-column:1/-1;display:flex!important;flex-direction:row!important;flex-wrap:nowrap!important;gap:10px;margin-top:4px}
  .academy-body .certificate-actions .certificate-action{width:auto;min-width:0;flex:1 1 0;min-height:48px;padding:8px 8px;line-height:1.2;text-align:center}
}
.book-note {
  font-size: 13px !important;
  font-weight: 700;
  color: #fff !important;
  margin-top: 22px !important;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,.28);
}

.certificate-art {
  position: relative;
  overflow: hidden;
  border-radius: 5px;
  cursor: pointer;
  isolation: isolate;
}

.certificate-preview-shell {
  width: 100%;
  height: auto;
  min-height: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  box-shadow: none;
  line-height: 0;
}

.certificate-download-hint {
  margin: 12px 0 0;
  color: var(--muted);
  font: 700 12px/1.3 var(--body);
  text-align: center;
  cursor: pointer;
  opacity: .45;
  transition: opacity .35s ease, color .35s ease;
}

.certificate-download-hint.is-ready {
  color: var(--ink);
  opacity: 1;
}

#pdf-preview {
  display: block !important;
  width: 0 !important;
  height: 0 !important;
}

#download-certificate {
  display: block !important;
}

.pdf-preview-wrap {
  background: transparent !important;
  box-shadow: none !important;
  height: auto !important;
  min-height: 0 !important;
  line-height: 0;
}

.pdf-preview-wrap::before {
  content: none !important;
  display: none !important;
}

.certificate-art {
  display: block;
}

.certificate-art > img {
  vertical-align: top;
}

.certificate-art > img {
  display: block;
  width: 100%;
  height: auto;
  filter: blur(10px) saturate(.78);
  transform: scale(1.035);
  transition: filter .8s cubic-bezier(.16,1,.3,1), transform .8s cubic-bezier(.16,1,.3,1);
}

.certificate-art-cover {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(9, 17, 29, .20);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  text-align: center;
  transition: opacity .65s ease, backdrop-filter .8s ease;
}

.certificate-art-cover span {
  padding: 10px 14px;
  border: 1px solid rgba(255,255,255,.48);
  border-radius: 999px;
  background: rgba(9,17,29,.42);
  font: 700 12px/1.35 var(--body);
}

.certificate-art-name,
.certificate-art-date,
.certificate-art-id {
  position: absolute;
  z-index: 3;
  opacity: .25;
  pointer-events: none;
  transition: opacity .45s ease;
}

.certificate-art-name {
  display: block !important;
  left: 33%;
  top: 42.8%;
  width: 54%;
  color: #e9c46a !important;
  z-index: 4;
  opacity: 0 !important;
  padding: 0;
  border-radius: 0;
  text-shadow: 0 2px 7px rgba(0,0,0,.48);
  font: italic 600 clamp(14px, 2.4vw, 26px)/1 Georgia, serif;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transform: translateY(4px);
  transition: opacity .45s ease, transform .55s cubic-bezier(.16,1,.3,1);
}

.certificate-art-date,
.certificate-art-id {
  top: 75.4%;
  color: #e9c46a;
  font: 700 clamp(8px, 1.3vw, 15px)/1 var(--display);
  white-space: nowrap;
}

.certificate-art-date { left: 22.3%; width: 21.5%; text-align: center; }
.certificate-art-id { left: 74%; width: 18.5%; text-align: center; }

.certificate-art.is-revealed > img {
  filter: none;
  transform: scale(1);
}

.certificate-art.is-revealed .certificate-art-cover {
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(0);
  -webkit-backdrop-filter: blur(0);
}

.certificate-art.is-revealed .certificate-art-name,
.certificate-art.is-revealed .certificate-art-date,
.certificate-art.is-revealed .certificate-art-id {
  opacity: 1;
}
.certificate-art.is-revealed .certificate-art-name{opacity:1!important;transform:none}

/* Confirm-first certificate flow: the blurred card invites the next tap. */
.certificate-art:not(.is-confirmed) > img{filter:blur(10px) saturate(.72);}
.certificate-art.is-confirmed:not(.is-revealed){cursor:pointer;animation:certificate-invite 2.2s ease-in-out infinite;}
.certificate-art.is-confirmed:not(.is-revealed) .certificate-art-cover{background:rgba(9,17,29,.25)}
.certificate-art.is-confirmed:not(.is-revealed) .certificate-art-cover span{animation:certificate-prompt-pulse 2.2s ease-in-out infinite}
.certificate-art.is-confirmed.is-revealed{animation:none!important}
.certificate-art.is-confirmed.is-revealed > img{filter:none}
@keyframes certificate-invite{0%,100%{transform:scale(1);box-shadow:0 18px 38px rgba(8,15,28,.22)}50%{transform:scale(1.012);box-shadow:0 24px 52px rgba(49,87,227,.28)}}
@keyframes certificate-prompt-pulse{0%,100%{transform:scale(.98);opacity:.78}50%{transform:scale(1.05);opacity:1}}
@media(prefers-reduced-motion:reduce){.certificate-art.is-confirmed:not(.is-revealed),.certificate-art.is-confirmed:not(.is-revealed) .certificate-art-cover span{animation:none!important}}

@media (max-width: 767px) {
  .certificate-page {
    background: linear-gradient(180deg, #eef1f5 0%, #e4e8ee 100%);
    overflow-x: hidden !important;
  }

  .certificate-toolbar {
    height: 64px;
    padding-inline: 16px;
    gap: 12px;
  }

  .certificate-toolbar .brand {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    line-height: 1;
  }

  .certificate-toolbar > a:last-child {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    line-height: 1.2;
  }

  .certificate-workspace {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 22px 14px 72px;
  }

  .certificate-controls {
    order: 2;
  }

  .pdf-stage {
    order: 1;
  }

  .certificate-controls {
    width: 100%;
    height: auto;
    min-height: 0;
    padding: 22px 18px 20px;
    border-radius: 18px;
    box-shadow: 0 14px 30px rgba(21, 26, 34, .10);
  }

  .certificate-controls h1 {
    font-size: clamp(30px, 8vw, 36px);
    line-height: 1;
    margin-bottom: 14px;
  }

  .certificate-controls > p {
    font-size: 14px;
    line-height: 1.55;
  }

  .certificate-controls label {
    margin: 22px 0 16px;
  }

  .certificate-controls input {
    height: 54px;
    font-size: 16px;
  }

  .certificate-controls .button {
    min-height: 54px;
    border-radius: 12px;
    font-size: 14px;
  }

  .certificate-help {
    margin-top: 6px !important;
    line-height: 1.45;
  }

  .certificate-error {
    min-height: 0 !important;
    margin: 0 !important;
  }

  .pdf-stage {
    width: 100%;
    min-width: 0 !important;
    padding: 8px 0 38px;
    perspective: none;
  }

  .certificate-preview-shell {
    width: 100%;
    min-width: 0 !important;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    box-shadow: none !important;
  }

  .pdf-preview-wrap iframe {
    width: 100%;
    aspect-ratio: 1.414 / 1;
    min-height: 0;
    border-radius: 8px;
  }

  .route-visual {
    overflow: visible;
    margin-bottom: 150px;
    background: transparent;
    box-shadow: none;
  }

  .route-visual > img {
    border-radius: 20px;
    box-shadow: 0 24px 44px rgba(21, 26, 34, .24);
  }

  .route-panel {
    bottom: -112px;
    max-height: 188px;
    overflow: hidden;
    box-shadow: 0 18px 36px rgba(21, 26, 34, .24), 0 3px 10px rgba(21, 26, 34, .12);
    border: 1px solid rgba(255, 255, 255, .72);
  }

  .route-panel ol {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    padding: 2px 2px 10px;
  }

  .route-panel ol::-webkit-scrollbar {
    display: none;
  }

  .route-panel ol::before {
    left: 17px;
    right: 17px;
    top: 17px;
    width: auto;
    height: 2px;
  }

  .route-panel li {
    flex: 0 0 118px;
    display: block;
    text-align: center;
    scroll-snap-align: start;
  }

  .route-panel li > span {
    margin: 0 auto 8px;
  }

  .route-panel li > div {
    min-width: 0;
  }

  .route-panel small {
    display: block;
    font-size: 9px;
    white-space: normal;
  }

  .journey-line,
  .journey-line article {
    min-width: 0;
    width: 100%;
  }

  .journey-line article {
    padding-right: 0;
    overflow-wrap: anywhere;
  }

  .journey-line article::before {
    left: -28px;
  }

  .journey-line h3,
  .journey-line p {
    overflow-wrap: anywhere;
  }

  .button,
  .header-cta,
  .lesson-action,
  .certificate-action,
  .quiz-option,
  .quiz-submit,
  .quiz-retry,
  .glossary-letters button,
  .certificate-controls .button,
  .site-header a,
  .academy-header a,
  .reader-header a,
  .certificate-toolbar a {
    min-height: 44px;
  }

  button,
  .button,
  .lesson-action,
  .certificate-action,
  .quiz-option,
  .quiz-submit,
  .quiz-retry {
    touch-action: manipulation;
  }

  .site-header,
  .academy-header,
  .reader-header,
  .certificate-toolbar {
    align-items: center;
    overflow: hidden;
  }

  .site-header {
    height: 64px;
    padding-top: 0;
    padding-bottom: 0;
  }

  .site-header .brand {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    line-height: 1;
  }

  .site-header .header-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    line-height: 1.15;
    padding-top: 0;
    padding-bottom: 0;
  }

  .site-header .brand,
  .academy-header .brand,
  .reader-header .brand,
  .certificate-toolbar .brand {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .section {
    padding-inline: 14px;
  }

  .lesson-shell,
  .reader-shell,
  .academy,
  .glossary-shell,
  .certificate-workspace,
  .certificate-controls {
    width: 100%;
    max-width: 100%;
  }

  .table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }

  .table-wrap table {
    width: max-content;
    min-width: 100%;
  }

  .reader-progress,
  .progress-track {
    border-radius: 999px;
  }

  .quiz-option,
  .glossary-letters button,
  .lesson-action,
  .certificate-action,
  .certificate-controls .button {
    border-radius: 12px;
  }

  a[aria-disabled='true'],
  a[aria-disabled='true']:hover,
  a[aria-disabled='true']:active {
    pointer-events: none;
    cursor: not-allowed;
    opacity: 0.6;
  }

  .hero-actions .text-link {
    line-height: 1.2;
    width: 100%;
    text-align: center;
  }

  .route-panel ol,
  .lesson-nav nav {
    scrollbar-width: thin;
  }

  .glossary-list,
  .roadmap-row,
  .lesson-content,
  .lesson-nav,
  .certificate-controls,
  .pdf-stage {
    overflow-wrap: anywhere;
  }
}

@media (max-width: 560px) {
  h1 {
    overflow-wrap: anywhere;
    word-break: break-word;
    text-wrap: balance;
  }

  .lesson-table h3,
  .roadmap-row h2,
  .hero-copy h1,
  .academy-intro h1,
  .glossary-hero h1,
  .certificate-controls h1 {
    letter-spacing: -0.02em;
  }
}

@media (max-width: 380px) {
  .section-heading h2,
  .book-copy h2,
  .mentor-copy h2,
  .start h2 {
    font-size: 37px;
  }

  .academy-score > strong {
    font-size: 44px;
  }

  .reader-header .brand,
  .academy-header .brand,
  .certificate-toolbar .brand {
    max-width: 42vw;
  }
}
/* Unified, stable header geometry across every route. */
.site-header,.academy-header,.reader-header,.certificate-toolbar{box-sizing:border-box;display:flex!important;align-items:center;justify-content:space-between!important;width:100%;min-height:64px;transform:none!important;rotate:none!important;skew:none!important}
.site-header a,.academy-header a,.reader-header a,.certificate-toolbar a{transform:none!important;rotate:none!important;skew:none!important;white-space:nowrap}
.site-header .brand,.academy-header .brand,.reader-header .brand,.certificate-toolbar .brand{display:inline-flex;align-items:center;line-height:1.15;margin-top:0;margin-bottom:0}.certificate-toolbar .brand{margin-right:auto!important}.certificate-toolbar>a:last-child{margin-left:auto!important;padding-left:24px!important}
.site-header a:hover,.academy-header a:hover,.reader-header a:hover,.certificate-toolbar a:hover{transform:none!important}
@media(max-width:620px){.site-header,.academy-header,.reader-header,.certificate-toolbar{height:64px;min-height:64px;padding-left:16px;padding-right:16px;gap:16px}.site-header .brand,.academy-header .brand,.reader-header .brand,.certificate-toolbar .brand{font-size:15px;max-width:58vw;overflow:hidden;text-overflow:ellipsis}.academy-exit,.reader-header>a:not(.brand),.certificate-toolbar>a:last-child{margin-left:auto;max-width:42vw;text-align:right;white-space:normal}}
