/* Small, late-loading accessibility and responsive refinements. */
html {
  overflow-x: hidden;
  scroll-behavior: smooth;
}

/* Keep frequently used controls comfortably tappable on touch screens. */
.middle-header .menu a,
.middle-header .menu-sidebar a,
.main-container .card-body .list a {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  line-height: 1.35;
}

.middle-header .settings .theme-link,
.middle-header .settings .mobile-menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
}

body,
.wrapper {
  max-width: 100%;
  overflow-x: clip;
}

img,
video,
iframe {
  max-width: 100%;
}

/* An infinite background-position shimmer kept image grids repainting continuously. */
img[loading="lazy"] {
  animation: none;
  background: #ececec;
}

body .wrapper header .middle-header .logo img {
  display: block;
  width: 163px;
  height: auto;
}

.skip-link {
  position: fixed;
  top: .5rem;
  left: .5rem;
  z-index: 100000;
  padding: .7rem 1rem;
  border-radius: .35rem;
  background: #fff;
  color: #111;
  font-weight: 600;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

:where(a, button, input, select, textarea):focus-visible {
  outline: 3px solid #ffae57;
  outline-offset: 3px;
}

.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.mobile-menu-toggle {
  min-width: 44px;
  min-height: 44px;
  padding: .5rem;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.bottom-header button {
  min-width: 44px;
  min-height: 44px;
}

#search_input > div {
  display: flex;
}

html body.dark #search_input input[type="search"] {
  color: #f3f4f6 !important;
  background-color: #17191d !important;
}

html body.dark #search_input input[type="search"]::placeholder {
  color: #aeb4bd;
  opacity: 1;
}

.c-nav-tabs .c-tabs-content li.active > a {
  color: #17191d !important;
}

html body footer.footer .footer-bottom .copy-text,
html body footer.footer .footer-bottom .copy-text a {
  color: #b8bcc2 !important;
}

html body.dark .th-home-intro a,
html body.dark .th-home-faq a {
  color: #60aefc !important;
  text-decoration: underline;
  text-decoration-thickness: .08em;
  text-underline-offset: .14em;
}

#search_input input[type="search"] {
  min-width: 0;
  width: 100%;
  height: 44px;
  padding: .7rem 1rem;
  border: 1px solid #bababa;
  border-radius: 10px 0 0 10px;
  background: #fdfdfd;
  color: #333;
}

.summary_image img,
.collection-item-thumbnail-wrapper img {
  height: auto;
}

.chapter-video-frame video {
  display: block;
  width: 100%;
  height: auto;
  background: #000;
}

.review-trust {
  margin-top: .35rem;
  font-size: .82rem;
  line-height: 1.45;
  opacity: .78;
}

.review-trust a {
  color: inherit;
  text-decoration: underline;
}

.category-review-note {
  margin: 0 0 1.1rem;
  font-size: .82rem;
  opacity: .72;
}

.category-review-note a {
  color: inherit;
  text-decoration: underline;
}

.editorial-page {
  padding: clamp(1rem, 3vw, 2.5rem);
}

.editorial-page__article {
  max-width: 820px;
  margin: 0 auto;
  font-size: 1rem;
  line-height: 1.75;
}

.editorial-page__article h1 {
  margin-bottom: 1rem;
  line-height: 1.2;
}

.editorial-page__article h2 {
  margin-top: 2rem;
  line-height: 1.3;
}

@media (max-width: 767px) {
  body .wrapper header .top-header {
    min-height: auto;
    padding: .5rem .75rem;
    line-height: 1.4;
    text-align: center;
  }

  body .wrapper header .middle-header {
    padding-inline: .75rem;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: center;
    box-sizing: border-box;
  }

  body .wrapper header .middle-header .logo img {
    width: 100px;
    max-width: min(52vw, 190px);
    height: auto;
  }

  body .wrapper header .middle-header .menu-sidebar {
    left: .75rem;
    right: .75rem;
    width: auto;
    max-height: calc(100vh - 90px);
    overflow-y: auto;
  }

  body .wrapper header .middle-header .settings {
    display: flex;
    align-items: center;
    justify-self: end;
    gap: .25rem;
    margin-left: 0;
  }

  body .wrapper header .middle-header .settings .theme-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
  }

  body .wrapper .main-container {
    width: auto !important;
    margin: 1rem .75rem !important;
  }

  .main-container,
  .main_container {
    min-width: 0;
    max-width: 100%;
  }

  body .wrapper .main-container .main_container {
    display: block;
    width: 100%;
  }

  body .wrapper .main-container .main_container > * {
    width: 100%;
    max-width: 100% !important;
    box-sizing: border-box;
  }

  body .wrapper .main-container .main_container > .card {
    margin-bottom: 1.25rem;
  }

  .site-heading {
    padding-inline: .25rem;
    font-size: clamp(1.25rem, 6vw, 1.5rem) !important;
    line-height: 1.3;
    overflow-wrap: break-word;
  }

  .th-home-intro,
  .th-home-faq {
    padding-inline: .25rem !important;
    overflow-wrap: anywhere;
  }

  .manga-page .entrySynopsis {
    gap: 1rem;
  }

  .manga-page .summary_image,
  .manga-page .metadata {
    min-width: 0;
    max-width: 100%;
  }
}
