/* UK site header/footer around the mirrored textbook chapter pages (uk-tutor-tools/textbooks_mirror.py).
   The chapter keeps the book's own stylesheet; every UK element is prefixed ukx- so the two never collide. */
.ukx-navbar { position: relative; z-index: 60; background: #fffdf7; border-bottom: 2px solid #16161d; font-family: 'Nunito', system-ui, sans-serif; color: #16161d; }
.ukx-container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.ukx-nav-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 12px; }
.ukx-nav-logo { display: flex; align-items: center; gap: 10px; font-family: 'Fredoka', 'Nunito', system-ui, sans-serif; font-size: 1.25rem; font-weight: 700; color: #16161d !important; text-decoration: none; letter-spacing: -.01em; white-space: nowrap; }
.ukx-logo-icon { width: 36px; height: 36px; border-radius: 10px; background: #ffd93d; border: 2px solid #16161d; box-shadow: 2px 2px 0 #16161d; transform: rotate(-4deg); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.ukx-logo-icon img { width: 26px; height: 26px; display: block; }
.ukx-nav-links { display: flex; align-items: center; gap: 4px; }
.ukx-nav-links a { padding: 8px 14px; border-radius: 9999px; font-size: .9375rem; font-weight: 700; color: #3b3b48; text-decoration: none; white-space: nowrap; line-height: 1.5; }
.ukx-nav-links a:hover, .ukx-nav-links a.ukx-active { color: #16161d; background: #fff1a6; }
.ukx-nav-links a.ukx-nb-nav-tests, .ukx-mobile-menu a.ukx-nb-nav-tests { background: #d6f7e8; color: #16161d; border: 2px solid #16161d; font-weight: 800; }
.ukx-nav-links a.ukx-nb-nav-books, .ukx-mobile-menu a.ukx-nb-nav-books { background: #ffe3cf; color: #16161d; border: 2px solid #16161d; font-weight: 800; }
.ukx-nav-links a.ukx-nb-nav-tests, .ukx-nav-links a.ukx-nb-nav-books { padding: 6px 12px; }
.ukx-nav-links a.ukx-nb-nav-books.ukx-active { background: #ffcfa8; }
.ukx-nav-actions { display: flex; align-items: center; }
.ukx-btn, .ukx-nav-actions a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; font-size: .8125rem; font-weight: 800; color: #16161d !important; background: #ffd93d; border: 2px solid #16161d; border-radius: 12px; box-shadow: 3px 3px 0 #16161d; text-decoration: none; white-space: nowrap; font-family: 'Nunito', system-ui, sans-serif; }
.ukx-btn:hover, .ukx-nav-actions a:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 #16161d; }
.ukx-nav-toggle { display: none; flex-direction: column; gap: 5px; padding: 8px; cursor: pointer; background: none; border: 0; }
.ukx-nav-toggle span { display: block; width: 22px; height: 2px; background: #16161d; border-radius: 2px; }
.ukx-mobile-menu { display: none; flex-direction: column; gap: 4px; padding: 16px 24px; border-top: 2px solid #16161d; background: #fffdf7; }
.ukx-mobile-menu.ukx-open { display: flex; }
.ukx-mobile-menu a { padding: 12px 16px; border-radius: 12px; font-weight: 700; color: #16161d; text-decoration: none; }
.ukx-mobile-menu a:hover { background: #fff1a6; }
.ukx-mobile-actions { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid #e5e0d0; margin-top: 8px; }
.ukx-mobile-actions a { justify-content: center; text-align: center; white-space: normal; }
.ukx-crumbs { background: #fff1a6; border-bottom: 2px solid #16161d; font: 700 .88rem/1.4 'Nunito', system-ui, sans-serif; padding: 8px 0; color: #3b3b48; }
.ukx-crumbs a { color: #16161d; }
.ukx-cta { background: #fffdf7; border-top: 2px solid #16161d; padding: 44px 0; text-align: center; font-family: 'Nunito', system-ui, sans-serif; }
.ukx-cta h2 { font-family: 'Fredoka', 'Nunito', sans-serif; color: #16161d; font-size: 1.6rem; margin: 0 0 8px; }
.ukx-cta p { color: #45455a; margin: 0 auto 20px; max-width: 560px; }
footer.ukx-footer { background: #0f172a; color: #a3a3b8; padding: 64px 0 32px; text-align: left; font: 400 15px/1.7 'Nunito', system-ui, sans-serif; }
.ukx-footer a { color: #a3a3b8; text-decoration: none; }
.ukx-footer a:hover { color: #fff; }
.ukx-footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 48px; }
.ukx-footer-brand .ukx-nav-logo { color: #fff !important; margin-bottom: 16px; }
.ukx-footer .ukx-logo-icon { border-color: #fff; box-shadow: 2px 2px 0 #fff; }
.ukx-footer-desc { max-width: 300px; margin: 0; }
.ukx-footer-col h4 { color: #fff; font-family: 'Fredoka', 'Nunito', sans-serif; font-size: .9375rem; font-weight: 600; margin: 0 0 18px; }
.ukx-footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ukx-footer-bottom { border-top: 1px solid #1e293b; padding-top: 28px; font-size: .875rem; }
.ukx-footer-copy { margin: 0; }
.wa-float { position: fixed; bottom: 28px; right: 28px; z-index: 9999; display: flex; align-items: center; gap: 10px; background: #25D366; color: #fff; border-radius: 9999px; padding: 14px 22px 14px 18px; font: 700 .9375rem/1.2 'Nunito', system-ui, sans-serif; box-shadow: 0 6px 24px rgba(37,211,102,.4); text-decoration: none; }
.wa-float:hover { transform: translateY(-3px); color: #fff; }
.wa-float svg { width: 22px; height: 22px; flex-shrink: 0; }
/* wide maths tables scroll inside the page instead of being cut off */
.ukx-tscroll { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
/* the book's own top bar: let the title shrink so the tier/year pills stay on screen on 320 px phones */
.topbar .brand { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.topbar .tier { flex: 0 0 auto; }
@media (max-width: 400px) { .topbar { gap: 6px; padding: 0 8px; } .topbar .tier a { padding: 4px 8px; font-size: .78rem; } .menu-btn { padding: 4px 7px; } }
@media (max-width: 1240px) and (min-width: 769px) {
  .ukx-nav-links { gap: 2px; } .ukx-nav-links a { padding: 7px 9px; font-size: .88rem; }
  .ukx-nav-links a.ukx-nb-nav-tests, .ukx-nav-links a.ukx-nb-nav-books { padding: 5px 9px; }
  .ukx-nav-actions a { padding: 7px 11px; font-size: .8rem; }
}
@media (max-width: 1060px) and (min-width: 769px) { .ukx-nav-links a[href$="index.html"]:first-child { display: none; } .ukx-nav-logo { font-size: 1rem; } }
@media (max-width: 920px) and (min-width: 769px) { .ukx-nav-links a[href$="faq.html"] { display: none; } }
@media (max-width: 860px) and (min-width: 769px) { .ukx-nav-links a[href$="subjects.html"] { display: none; } }
.pagenav { flex-wrap: wrap; gap: 8px; }
.pagenav a { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
@media (max-width: 1100px) { .ukx-footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; } }
@media (max-width: 768px) {
  .ukx-nav-links, .ukx-nav-actions { display: none; }
  .ukx-nav-toggle { display: flex; }
  .ukx-container { padding: 0 16px; }
  .ukx-nav-inner { height: 60px; }
  .ukx-nav-logo { font-size: 1.1rem; }
  footer.ukx-footer { padding-top: 40px; }
  .ukx-footer-grid { grid-template-columns: 1fr; gap: 0; margin-bottom: 24px; }
  .ukx-footer-brand { padding-bottom: 16px; }
  .ukx-footer-col { border-top: 1px solid rgba(255,255,255,.14); }
  .ukx-footer-col h4 { margin: 0; padding: 14px 0; cursor: pointer; display: flex; justify-content: space-between; }
  .ukx-footer-col h4::after { content: '+'; }
  .ukx-footer-col ul { display: none; padding-bottom: 14px; }
  .ukx-footer-col.ukx-open ul { display: flex; }
  .ukx-cta { padding: 32px 0; } .ukx-cta h2 { font-size: 1.3rem; }
  .ukx-btn { white-space: normal; }
}
@media (max-width: 600px) { .wa-float span { display: none; } .wa-float { padding: 14px; border-radius: 50%; bottom: 18px; right: 16px; } }
@media print { .ukx-navbar, .ukx-crumbs, .ukx-cta, .ukx-footer, .wa-float { display: none !important; } }
