:root {
  color: #17212b;
  background: #f3f7f8;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 62px;
  padding: 12px 18px;
  color: #fff;
  background: #315e8d;
}

.brand {
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.account {
  padding: 7px 10px;
  border: 0;
  border-radius: 99px;
  color: #174c42;
  background: #e9fff4;
  font-size: 12px;
}

main {
  width: min(100%, 520px);
  margin: auto;
  padding: 20px 16px 40px;
}

.hero {
  padding: 24px 8px 18px;
}

.hero-with-action,
.filters-head,
.filter-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

h1 {
  margin: 0;
  font-size: 27px;
}

h2 {
  font-size: 18px;
}

.lead,
.status {
  color: #557080;
  font-size: 14px;
  line-height: 1.6;
}

.card {
  padding: 22px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 7px 24px #315e8d1a;
}

.center {
  text-align: center;
}

.book,
.cover {
  display: grid;
  place-items: center;
  color: #fff;
}

.book {
  width: 62px;
  height: 62px;
  margin: 0 auto 15px;
  border-radius: 15px;
  background: #e17755;
  font-size: 29px;
}

.primary,
.manga,
.secondary {
  width: 100%;
  border: 0;
  border-radius: 12px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.primary {
  min-height: 50px;
  color: #fff;
  background: #315e8d;
}

.secondary,
.text-button {
  min-height: 34px;
  color: #fff;
  background: linear-gradient(135deg, #315e8d, #427eab);
  border: 0;
  box-shadow: 0 4px 12px #315e8d33;
}

.secondary {
  width: auto;
  flex: none;
  padding: 0 12px;
  border-radius: 99px;
  font-size: 13px;
  white-space: nowrap;
}

.text-button {
  padding: 8px;
  color: #315e8d;
  background: transparent;
  border: 0;
  box-shadow: none;
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
}

.active-filters {
  margin: -6px 8px 14px;
  color: #557080;
  font-size: 13px;
}

.hero-with-action h1 {
  white-space: nowrap;
}

.manga {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 16px;
  padding: 12px;
  color: inherit;
  background: #fff;
  box-shadow: 0 4px 17px #315e8d17;
  text-align: left;
  text-decoration: none;
}

.cover {
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 10px;
  background: linear-gradient(150deg, #315e8d, #5baab1 54%, #f1bd62 55%);
  font-size: 30px;
}

.cover-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.manga h2 {
  margin: 8px 0 6px;
}

.manga p {
  margin: 0;
  color: #557080;
  font-size: 13px;
}

.manga .manga-tags {
  margin-top: 10px;
  color: #315e8d;
  font-size: 12px;
}

.filters-dialog {
  width: min(calc(100% - 32px), 460px);
  max-height: calc(100dvh - 32px);
  padding: 20px;
  border: 0;
  border-radius: 18px;
  color: #17212b;
  box-shadow: 0 16px 48px #17212b55;
}

.filters-dialog::backdrop {
  background: #17212b66;
}

.filters-dialog form {
  display: grid;
  gap: 18px;
}

.filters-dialog h2 {
  margin: 0;
}

.icon-button {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  color: #315e8d;
  background: #f3f7f8;
  font-size: 25px;
  line-height: 1;
}

.filters-dialog fieldset {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.filters-dialog legend {
  font-weight: 800;
}

.filter-help {
  margin: -4px 0 0;
  color: #557080;
  font-size: 12px;
  line-height: 1.5;
}

.filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid #b9cbd5;
  border-radius: 99px;
  font-size: 13px;
}

.filter-option:has(input:checked) {
  border-color: #315e8d;
  color: #174c42;
  background: #e9fff4;
}

.filter-actions .primary {
  width: auto;
  min-height: 42px;
  padding: 0 18px;
}

.volume-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.volume {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
  color: inherit;
  font-size: 13px;
  text-align: center;
  text-decoration: none;
}

.volume-cover {
  display: grid;
  width: 100%;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(150deg, #315e8d, #5baab1 54%, #f1bd62 55%);
  font-size: 24px;
  box-shadow: 0 4px 17px #315e8d17;
}

.volume b,
.volume small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.volume small {
  color: #557080;
}

.back {
  padding: 0;
  border: 0;
  color: #315e8d;
  background: transparent;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
}

.reader-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.page {
  display: block;
  width: 100%;
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 3px 14px #17212b33;
}

.page-placeholder {
  display: grid;
  min-height: 100vh;
  margin: 0 auto 16px;
  place-items: center;
  background: #fff;
  box-shadow: 0 3px 14px #17212b33;
}

.page-placeholder:not(.is-loaded)::after {
  grid-area: 1 / 1;
  content: "読み込み中";
  color: #557080;
  font-size: 13px;
}

.page-placeholder .page {
  grid-area: 1 / 1;
}

.page-placeholder.is-loaded::after {
  content: none;
}

.page-placeholder.is-loaded {
  min-height: 0;
}

.error {
  color: #b32727;
}

@media (min-width: 521px) {
  body {
    background: #dfe9ed;
  }
}
