:root {
  color-scheme: light;
  --navy: #082b57;
  --blue: #0867c5;
  --pale: #eaf4fb;
  --ink: #182e47;
  --muted: #526780;
  --line: #d7e2ee;
  font-family: "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
  color: var(--ink);
  background: #eff4f9;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button, input { font: inherit; }
button, .reader-footer a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .42; }
a { color: var(--blue); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.sr-only, .skip:not(:focus) {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.skip:focus { position: fixed; z-index: 9; top: .5rem; left: .5rem; padding: .75rem; background: white; }
.brand { width: 155px; height: auto; flex: none; }
.site-header {
  display: flex; align-items: center; gap: 1.3rem; min-height: 69px;
  padding: .6rem clamp(1rem, 3vw, 3rem); background: #fff; border-top: 4px solid var(--navy);
  border-bottom: 1px solid var(--line);
}
.catalog-heading { display: flex; gap: .6rem; align-items: baseline; color: var(--navy); }
.catalog-heading h1 { margin: 0; font-size: clamp(1.05rem, 1.8vw, 1.45rem); line-height: 1.3; }
#volume { font-size: .9rem; font-weight: 700; white-space: nowrap; }
.edition-heading { margin-left: auto; display: flex; flex-wrap: wrap; justify-content: end; gap: .35rem .85rem; align-items: center; font-size: .875rem; text-align: right; }
#edition { color: var(--navy); font-weight: 700; }
.local-label, .review-label { color: var(--muted); }
.reading-layout {
  display: grid; grid-template-columns: minmax(226px, 265px) minmax(0, 1fr);
  margin: 0 auto; height: calc(100dvh - 69px); min-height: 400px;
}
.reading-layout.panel-closed { grid-template-columns: minmax(0, 1fr); }
#panel {
  min-height: 0; display: flex; flex-direction: column; background: #fff; border-right: 1px solid var(--line);
}
.panel-tabs { display: flex; background: var(--navy); padding: .4rem .45rem 0; flex: none; }
.panel-tabs button { flex: auto; min-height: 43px; color: #fff; background: transparent; border: 0; border-radius: .45rem .45rem 0 0; font-size: .875rem; }
.panel-tabs button[aria-pressed="true"] { background: #fff; color: var(--navy); font-weight: 700; }
.panel-tabs button:focus-visible { outline-color: #60b5ff; outline-offset: -3px; }
.panel-body { min-height: 0; overflow: auto; padding: .7rem .65rem; }
.section-label { margin: .9rem .55rem .25rem; font-size: .82rem; font-weight: 700; color: var(--muted); }
.section-link, .result-link {
  display: flex; width: 100%; gap: .65rem; justify-content: space-between; align-items: center;
  font-size: .875rem; border-radius: .4rem; padding: .48rem .55rem; min-height: 38px;
  color: var(--ink); text-decoration: none;
}
.section-link:hover, .result-link:hover, .section-link[aria-current], .thumbnail[aria-current] {
  color: var(--navy); background: var(--pale);
}
.section-page { color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.reader-area { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.toolbar, .reader-footer { display: flex; gap: .5rem .7rem; padding: .45rem .7rem; align-items: center; background: white; }
.toolbar { border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.toolbar button, .search-box button {
  min-height: 40px; padding: .24rem .65rem; color: var(--navy); background: white;
  border: 1px solid var(--line); border-radius: .45rem; font-size: .875rem; white-space: nowrap;
}
.toolbar button:hover:not(:disabled), .toolbar button[aria-pressed="true"] { background: var(--pale); border-color: #9dbfdf; }
.page-control, #page-form, .view-control { display: flex; align-items: center; gap: .35rem; }
.page-control button, #zoom-out, #zoom-in { min-width: 40px; font-size: 1.25rem; line-height: 1; }
#page-form { position: relative; color: var(--muted); font-variant-numeric: tabular-nums; }
#page {
  width: 3.1rem; min-height: 40px; text-align: center; border: 1px solid var(--line);
  border-radius: .4rem; background: #f7faff; color: var(--navy);
}
#total { min-width: 2.1ch; }
.view-control { margin-left: auto; }
.workspace {
  position: relative; overflow: auto; min-width: 0; min-height: 0;
  background: radial-gradient(ellipse at 50% 40%, #f3f7fb 0%, #dce7f2 100%);
  touch-action: pan-x pan-y pinch-zoom;
}
.workspace:focus-visible { outline-offset: -3px; }
.workspace.swipe-enabled { touch-action: pan-y pinch-zoom; }
.sheet-space { display: grid; place-items: center; min-width: 100%; min-height: 100%; width: max-content; padding: 18px 42px; }
.pages { display: flex; width: max-content; align-items: flex-start; gap: 2px; perspective: 1100px; }
.sheet { position: relative; flex: none; background: white; box-shadow: 0 8px 24px #082b5733; }
.sheet canvas { display: block; width: 100%; height: 100%; }
.pages.flip-next .sheet { animation: next-sheet .24s ease-out; transform-origin: left center; }
.pages.flip-previous .sheet { animation: previous-sheet .24s ease-out; transform-origin: right center; }
@keyframes next-sheet { from { opacity: .62; transform: rotateY(-10deg) translateX(6px); } to { transform: none; } }
@keyframes previous-sheet { from { opacity: .62; transform: rotateY(10deg) translateX(-6px); } to { transform: none; } }
.edge {
  position: sticky; top: calc(50% - 22px); float: left; z-index: 2; margin-bottom: -44px;
  width: 38px; height: 44px; font-size: 1.65rem; line-height: 1; color: var(--navy);
  border: 1px solid #a9bed4; border-radius: .5rem; background: #fff; box-shadow: 0 2px 8px #082b571a;
}
.edge-previous { left: 3px; margin-left: 3px; }
.edge-next { float: right; right: 3px; margin-right: 3px; }
.render-message {
  position: sticky; left: 3%; bottom: 1rem; width: max-content; max-width: 94%; padding: .6rem .85rem;
  margin: -3rem auto 0; border-radius: .45rem; background: var(--navy); color: white; z-index: 3;
}
.reader-footer { justify-content: space-between; border-top: 1px solid var(--line); font-size: .875rem; color: var(--muted); }
.reader-footer p { margin: 0; }
.reader-footer > div { display: flex; flex-wrap: wrap; gap: .35rem 1rem; }
.reader-footer a { padding-block: .3rem; white-space: nowrap; text-underline-offset: .18em; }
.thumbnail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: .45rem; }
.thumbnail {
  display: grid; justify-items: center; gap: .3rem; padding: .35rem; min-width: 0;
  border: 1px solid var(--line); background: #f7faff; color: var(--navy); border-radius: .4rem; text-decoration: none;
}
.thumb-art { display: grid; place-items: center; width: 100%; max-width: 110px; aspect-ratio: 210 / 297; background: white; }
.thumb-art canvas { width: 100%; height: 100%; object-fit: contain; }
.search-box { display: flex; align-items: center; gap: .3rem; margin-top: .35rem; }
#search-form label { color: var(--navy); font-weight: 700; font-size: .875rem; }
.search-box input { width: 100%; min-width: 0; min-height: 40px; border: 1px solid #a9bed4; border-radius: .4rem; padding: .3rem .4rem; }
.search-box button { background: var(--navy); color: white; }
#search-status { font-size: .875rem; color: var(--muted); }
#search-results { margin: 0; padding: 0; list-style: none; }
.result-link { display: block; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.result-link strong { display: block; color: var(--navy); }
.result-link small { color: var(--muted); }
#reader:fullscreen, #reader.expanded { background: #fff; }
#reader:fullscreen .reading-layout, #reader.expanded .reading-layout { height: 100dvh; }
#reader.expanded { position: fixed; inset: 0; z-index: 8; }
.review { display: grid; min-height: 100dvh; place-items: center; padding: 1rem; }
.review-panel {
  width: min(100%, 37rem); padding: clamp(1.25rem, 5vw, 2.7rem); border-radius: 1rem;
  background: #fff; border: 1px solid var(--line); border-top: 5px solid var(--navy);
  box-shadow: 0 15px 45px #082b5714;
}
.review h1 { color: var(--navy); margin: .4rem 0; }
.review-label { font-size: .875rem; margin: 1.5rem 0 0; }
.review-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; margin-top: 1.25rem; }
.review-choice {
  display: grid; gap: .35rem; padding: 1rem; text-decoration: none; border-radius: .6rem;
  background: #f2f7fd; border: 1px solid #b9cee5; color: var(--navy);
}
.review-choice:hover { border-color: var(--blue); background: var(--pale); }
.review-choice span { font-size: .875rem; color: var(--muted); }
@media (max-width: 760px) {
  .site-header { display: grid; grid-template-columns: 1fr auto; min-height: 80px; gap: .28rem .55rem; padding: .43rem .75rem; }
  .site-header .brand { width: 115px; }
  .catalog-heading { grid-column: 1 / -1; grid-row: 2; flex-wrap: wrap; gap: .25rem .55rem; }
  .edition-heading { grid-column: 2; grid-row: 1; font-size: .75rem; gap: 0 .45rem; }
  .local-label { font-size: .75rem; }
  .reading-layout, .reading-layout.panel-closed { display: block; position: relative; height: calc(100dvh - 80px); min-height: 315px; }
  #panel { position: absolute; z-index: 5; top: var(--toolbar-height, 52px); bottom: 0; left: 0; width: min(320px, 87vw); box-shadow: 6px 0 24px #082b5744; }
  .reader-area { height: 100%; }
  .toolbar { padding-inline: .4rem; gap: .35rem .55rem; }
  .view-control { margin-left: 0; }
  #spread { display: none; }
  .sheet-space { padding: 10px 8px; }
  .edge { display: none; }
  .reader-footer { padding-inline: .55rem; }
}
@media (max-width: 370px) { .review-choices { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .sheet { animation: none !important; } }
