:root {
  color-scheme: light;
  --canvas: #f2f5f1;
  --surface: #fff;
  --surface-subtle: #edf3ed;
  --surface-hover: #e8f0e9;
  --ink: #182c24;
  --muted: #4e655a;
  --accent: #236049;
  --accent-strong: #174632;
  --line: #d0ddd3;
  --line-strong: #bacdbf;
  --radius: 12px;
  --radius-small: 8px;
  --page-width: 1680px;
  --page-gutter: clamp(14px, 3vw, 44px);
  font: 15px/1.6 system-ui, "Hiragino Sans", "Yu Gothic UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
.rail-widget-region { contain: layout paint; overflow-anchor: none; }
.rail-widget { display: block; width: 100%; height: var(--rail-widget-initial-height, 400px); border: 0; }
.rail-widget-fallback { position: absolute; inset: 0 0 auto; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-small); background: var(--surface); font-size: .9rem; }
.rail-widget-fallback p { margin: 0 0 8px; }
.rail-widget-fallback button { margin-bottom: 8px; }
.rail-widget-fallback a { display: block; }
a { color: var(--accent-strong); text-underline-offset: .18em; }
a:hover { color: var(--accent); }
h1, h2, h3 { line-height: 1.3; overflow-wrap: anywhere; }
h1 { margin: 0; font-size: clamp(1.65rem, 3.2vw, 2.6rem); letter-spacing: -.03em; }
h2 { font-size: 1.25rem; margin: 0 0 10px; }
h3 { font-size: 1rem; margin: 0 0 6px; }
small, .meta, .help { color: var(--muted); }
aside p { margin-block: 6px; }

.app-header { background: #16372b; color: white; }
.app-header-inner {
  max-width: var(--page-width); margin: auto; padding: 12px var(--page-gutter);
  display: flex; gap: 12px 26px; flex-wrap: wrap; align-items: center;
}
.app-brand {
  display: inline-flex; align-items: center; gap: 9px; color: white;
  font-weight: 750; white-space: nowrap; text-decoration: none;
}
.app-brand::before { content: ""; width: 9px; height: 9px; border-radius: 3px; background: #9de1bc; }
.app-brand:hover { color: #d5f3e2; }
.app-nav { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.app-nav a {
  display: inline-block; padding: 5px 9px; border-radius: 6px;
  color: #d7e9df; font-size: .87rem; text-decoration: none; white-space: nowrap;
}
.app-nav a:hover { color: white; background: #284d3e; }
.app-nav a[aria-current="page"] { background: #def1e4; color: #143e2c; font-weight: 750; }
.app-header :focus-visible { outline-color: #c4f7d9; }

html:has(body > .shelf-header) {
  --shelf-header-accent: #4baef3;
  scrollbar-gutter: stable;
}
html[data-all-ages]:has(body > .shelf-header) { --shelf-header-accent: #68d917; }
body > .shelf-header { position: sticky; top: 0; z-index: 5; }
.shelf-header {
  --shelf-header-link: #15578b;
  --shelf-header-hover: #ebf6ff;
  --shelf-header-pressed: #d9eefe;
  background: #fff;
  border-bottom: 4px solid var(--shelf-header-accent, #4baef3);
  color: #24364b;
}
html[data-all-ages] .shelf-header {
  --shelf-header-link: #2e651b;
  --shelf-header-hover: #edf8e7;
  --shelf-header-pressed: #dcefd2;
}
@supports selector(::-webkit-scrollbar) {
  @media (hover: hover) and (pointer: fine) {
    html:not([data-age-check-pending]):has(body > .shelf-header) { overflow-y: scroll; }
    html:has(body > .shelf-header)::-webkit-scrollbar {
      width: 15px;
      background: linear-gradient(to bottom,
        #fff calc(var(--work-shelf-header-height, 70px) - 4px),
        var(--shelf-header-accent) 0 var(--work-shelf-header-height, 70px),
        var(--canvas) 0);
    }
    html:has(body > .shelf-header)::-webkit-scrollbar-track {
      margin-block-start: var(--work-shelf-header-height, 70px);
      background: var(--canvas);
    }
    html:has(body > .shelf-header)::-webkit-scrollbar-thumb {
      border: 3px solid transparent;
      border-radius: 9px;
      background: #94a99b;
      background-clip: padding-box;
    }
  }
}
.shelf-header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px 24px; padding: 12px var(--page-gutter);
}
.shelf-brand {
  display: inline-flex; align-items: center; gap: 10px; width: fit-content;
  color: var(--shelf-header-link); text-decoration: none; white-space: nowrap;
  font-size: 1.5rem; font-weight: 800; line-height: 1.2;
}
.shelf-brand:hover { color: #17263c; }
.shelf-brand-logo { display: block; width: 158px; height: auto; }
.shelf-brand:has(.shelf-brand-logo) { min-height: 40px; }
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  :root { view-transition-name: none; }
  body > .shelf-header { view-transition-name: shelf-header; }
  ::view-transition-group(shelf-header),
  ::view-transition-new(shelf-header) { animation: none; }
  ::view-transition-old(shelf-header) { display: none; }
  .shelf-brand-logo[data-ready] { animation: shelf-brand-logo-in 150ms ease-out; }
  @keyframes shelf-brand-logo-in { from { opacity: 0; } }
}
.shelf-brand-mark {
  display: block; width: 40px; height: 40px; overflow: hidden;
  border-radius: 10px; background: var(--shelf-header-hover);
}
.shelf-brand-mark img {
  display: block; width: 100%; height: 100%; object-fit: contain; transform: scale(1.12);
}
.shelf-brand-edition {
  align-self: end; flex: none; margin-bottom: 7px;
  padding: 3px 6px 3px 7px; border-radius: 4px;
  background: #c12e65; color: #fff;
  font-size: .85rem; font-weight: 800; line-height: 1;
  letter-spacing: .055em; font-variant-numeric: tabular-nums;
}
html[data-all-ages] .shelf-brand-edition { display: none; }
.shelf-nav { --nav-gap: 8px; display: flex; flex-wrap: wrap; gap: var(--nav-gap); }
html[data-all-ages] .shelf-nav { display: grid; grid-template-columns: repeat(4, max-content) 6.5rem; }
.shelf-nav a {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 42px; padding: 6px 12px; border-radius: 6px;
  color: inherit; text-decoration: none; white-space: nowrap;
  font-size: .93rem; font-weight: 650;
}
.shelf-nav a:hover { background: var(--shelf-header-hover); color: var(--shelf-header-link); }
.shelf-nav a:active { background: var(--shelf-header-pressed); }
.shelf-nav a + a::before {
  position: absolute; top: 50%; left: calc(var(--nav-gap) / -2); transform: translateY(-50%);
  width: 1px; height: 18px; background: #dce4ec; content: "";
}
.shelf-nav a[aria-current="page"] { background: var(--shelf-header-hover); color: var(--shelf-header-link); }
.shelf-nav a[aria-current="page"]::after {
  position: absolute; right: 12px; bottom: 0; left: 12px;
  height: 2px; border-radius: 2px; background: var(--shelf-header-accent); content: "";
}
.shelf-nav-icon {
  position: relative; display: grid; place-items: center; flex: none;
  width: 16px; height: 16px; color: var(--shelf-header-link); line-height: 1;
}
.shelf-nav-home::before {
  position: absolute; top: 6px; left: 3px; width: 10px; height: 8px;
  border: 1px solid currentColor; border-top: 0; border-radius: 0 0 2px 2px; content: "";
}
.shelf-nav-home::after {
  position: absolute; top: 3px; left: 3px; width: 10px; height: 10px;
  border: solid currentColor; border-width: 1px 0 0 1px;
  transform: rotate(45deg); content: "";
}
.shelf-nav-star { font-size: 1.2rem; }
.shelf-nav-clock, .shelf-nav-info { border: 1px solid currentColor; border-radius: 50%; }
.shelf-nav-clock::before {
  position: absolute; top: 3px; left: 6px; width: 4px; height: 5px;
  border-left: 1px solid currentColor; border-bottom: 1px solid currentColor; content: "";
}
.shelf-nav-info { font: 700 .75rem/1 system-ui, sans-serif; }
.shelf-nav-edition-arrow::before {
  content: ""; width: 11px; height: 2px; background: currentColor; border-radius: 1px;
}
.shelf-nav-edition-arrow::after {
  content: ""; position: absolute; inset-inline-end: 2px; width: 7px; height: 7px;
  border-block-start: 2px solid; border-inline-end: 2px solid; transform: rotate(45deg);
}
.shelf-header :focus-visible { outline-color: var(--shelf-header-link); }
html:not([data-all-ages]) { scrollbar-gutter: stable; }
html[data-age-check-pending] { overflow: hidden; }
html[data-age-check-pending] body:not(:has(> .site-age-check[open])) > :not(.site-age-check) { visibility: hidden; }
.site-age-check {
  box-sizing: border-box; width: min(420px, calc(100% - 32px)); max-height: calc(100% - 32px);
  margin: auto; padding: 24px; border: 1px solid #d2deeb; border-radius: 14px;
  background: #fff; color: #24364b; box-shadow: 0 16px 44px #20344b26;
}
.site-age-check::backdrop {
  clip-path: inset(var(--age-check-header-bottom, 0px) 0 0);
  background: #e9eff6;
}
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .site-age-check::backdrop {
    background: rgb(233 239 246 / 55%);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
  }
}
.site-age-check[data-closing] .age-check-actions { pointer-events: none; }
@media (prefers-reduced-motion: no-preference) {
  .site-age-check[data-closing] { animation: age-check-hide 100ms ease-out both; }
  .site-age-check[data-closing]::backdrop { animation: age-check-clear-backdrop 100ms ease-out both; }
  @keyframes age-check-hide { to { opacity: 0; } }
  @keyframes age-check-clear-backdrop {
    to {
      background-color: transparent;
      -webkit-backdrop-filter: blur(0px);
      backdrop-filter: blur(0px);
    }
  }
}
.site-age-check .age-check-label { margin: 0 0 4px; color: #15578b; font-size: .875rem; font-weight: 750; }
.site-age-check h1 { margin: 0 0 8px; font-size: 1.4rem; line-height: 1.4; outline: none; }
.site-age-check #age-check-description { margin: 0; font-size: .95rem; line-height: 1.65; }
.age-check-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 18px; }
.age-check-actions > * {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 6px 10px; border: 1px solid #c8d9e8; border-radius: 7px;
  background: #fff; color: #15578b; font-size: .95rem; font-weight: 700; text-decoration: none;
}
.age-check-actions button { border-color: #15578b; background: #15578b; color: #fff; }
.age-check-actions button:hover { background: #104674; }
.age-check-actions a:hover { background: #ebf6ff; }
.shelf-visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.shelf-document { max-width: 860px; }
.shelf-document section { margin-block: 24px; }
.shelf-document p { overflow-wrap: anywhere; }
html[data-all-ages] .shelf-document [data-r18-info],
html:not([data-all-ages]) .shelf-document [data-all-ages-info],
html[data-all-ages]:not([data-all-ages-guide]) .shelf-document [data-guide-info] { display: none; }
.shelf-legal-links { display: flex; gap: 8px 18px; flex-wrap: wrap; font-size: .9rem; }
footer.shelf-legal-links { align-items: center; margin-top: 24px; }
.shelf-legal-links .shelf-debug-button {
  min-height: 32px; padding: 3px 8px; background: #fff; color: #25476d;
  border-color: #c4d4e6; font-size: inherit;
}
.shelf-legal-links .shelf-debug-button:hover { background: #edf5fc; }
.shelf-back-to-top {
  display: grid; place-items: center; width: 44px; height: 44px;
  margin: 24px 0 0 auto; padding: 0; border-color: #c4d4e6;
  background: #fff; color: #25476d; font-size: 1.35rem; line-height: 1;
}
.shelf-back-to-top:hover { border-color: #87aac6; background: #edf5fc; }
.shelf-legal-links .shelf-back-to-top { margin-block-start: 0; }
@media (max-width: 820px) {
  .shelf-header-inner { flex-direction: column; align-items: stretch; gap: 8px; padding-block: 10px; }
  .shelf-nav { --nav-gap: 6px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  html[data-all-ages] .shelf-nav { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .shelf-nav a {
    min-width: 0; flex-direction: column; gap: 4px; min-height: 48px; padding: 4px 3px 6px;
    white-space: normal; text-align: center; font-size: .87rem; line-height: 1.3;
  }
}

main {
  max-width: var(--page-width); min-width: 0; margin: 0 auto;
  padding: 24px var(--page-gutter) 48px;
}
.work-shelf-viewport {
  --work-shelf-top-gap: 16px;
  --work-shelf-bottom-gap: 24px;
  --work-shelf-header-offset: calc(var(--work-shelf-header-height, 69px) + var(--work-shelf-top-gap));
  scroll-padding-top: var(--work-shelf-header-offset);
  scrollbar-gutter: stable;
}
.work-shelf-viewport body > header {
  position: sticky;
  top: 0;
  z-index: 5;
}
.work-shelf-viewport .work-shelf-layout {
  max-width: none;
  padding-block: var(--work-shelf-top-gap) var(--work-shelf-bottom-gap);
}
@media (min-width: 721px) {
  .work-shelf-viewport .work-shelf-layout {
    display: grid;
    grid-template-columns: 244px minmax(0, 1fr);
    column-gap: 22px;
  }
  .work-shelf-viewport .work-shelf-rail {
    --rail-widget-initial-height: max(0px, calc(100dvh - var(--work-shelf-header-offset) - var(--work-shelf-bottom-gap)));
    display: block;
    position: sticky;
    top: var(--work-shelf-header-offset);
    align-self: start;
    height: var(--rail-widget-initial-height);
    overflow: hidden;
  }
}
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; margin: 0 0 18px;
}
.page-head p { margin: 5px 0 0; }
.saved-empty {
  display: flex; align-items: center; gap: clamp(12px, 3vw, 22px);
  width: fit-content; max-width: min(100%, 580px); margin-block: 24px;
}
.saved-empty figure { flex: none; width: clamp(74px, 19vw, 132px); margin: 0; text-align: center; }
.saved-empty img { display: block; width: 100%; height: auto; }
.saved-empty figcaption { font-size: .82rem; font-weight: 750; }
.saved-empty-speech {
  position: relative; min-width: 0; padding: clamp(12px, 3vw, 20px);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius);
}
.saved-empty-speech::before {
  position: absolute; top: calc(50% - 5px); left: -6px; width: 10px; height: 10px;
  background: inherit; border: solid var(--line-strong); border-width: 0 0 1px 1px;
  transform: rotate(45deg); content: "";
}
.saved-empty-speech p { margin: 0 0 8px; }
.saved-empty-speech a { display: inline-block; font-weight: 700; }
.page-head .meta, .help { font-size: .88rem; }
.page-head #debug-toggle { white-space: nowrap; }
.control-panel, .panel, .scroll, .table-wrap {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.control-panel {
  padding: 12px; margin: 0 0 14px;
  display: flex; align-items: end; gap: 8px 12px; flex-wrap: wrap;
}
.control-panel label { display: grid; gap: 4px; font-size: .84rem; font-weight: 650; }
.control-panel input, .control-panel select { max-width: 100%; }
.control-panel input[type="search"] { width: 100%; }

input, select, button, .button {
  font: inherit; color: inherit; min-height: 38px; padding: 6px 11px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-small); background: var(--surface);
}
button, .button { cursor: pointer; font-weight: 650; }
button:hover, .button:hover { background: var(--surface-subtle); }
button:disabled { opacity: .48; cursor: default; }
.button { display: inline-flex; align-items: center; text-decoration: none; }
.primary, button[aria-selected="true"], button[aria-pressed="true"] {
  color: white; background: var(--accent); border-color: var(--accent);
}
.primary:hover, button[aria-selected="true"]:hover, button[aria-pressed="true"]:hover {
  color: white; background: var(--accent-strong); border-color: var(--accent-strong);
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.actions, .pagination { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pagination { margin: 14px 0; }
#status, [role="status"] { color: var(--muted); font-size: .87rem; }
#status { min-height: 1.5em; }
.work-search-feedback { grid-column: 1 / -1; margin: 0; overflow-wrap: anywhere; }
.guide-id-search .work-search-feedback:empty { position: absolute; }
#guide-welcome[data-work-id-missing] :is(.guide-welcome-hint, .guide-start-hint) { display: none; }
#guide-welcome[data-work-id-missing] .guide-id-search label { overflow-wrap: anywhere; }
.work-search-message { display: block; font-weight: 650; }
.work-search-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.work-search-actions .button { min-height: 36px; padding: 4px 8px; font-size: .84rem; }

details {
  margin: 10px 0; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--surface);
}
summary { cursor: pointer; font-weight: 650; }
dialog {
  color: var(--ink); background: var(--surface); padding: clamp(14px, 3vw, 24px);
  width: min(720px, calc(100% - 24px)); max-height: 85dvh;
  border: 1px solid var(--line); border-radius: var(--radius);
}
dialog::backdrop { background: #10241db5; }
dialog h2 { margin-top: 10px; }
dialog form[method="dialog"] { margin: 0; }
.work-credits { margin: 6px 0; padding: 0; list-style: none; }
.debug-off .debug-only { display: none !important; }
@media (max-width: 520px) {
  .app-header-inner { gap: 7px 10px; }
  .app-nav { column-gap: 3px; }
  .app-nav a { padding-inline: 6px; }
  main { padding-top: 18px; }
}

.favorite-button{
  min-width:30px;min-height:28px;padding:2px 6px;
  color:#80560b;background:#fff;line-height:1.2;
}
.favorite-button[aria-pressed="true"],.favorite-button[aria-pressed="true"]:hover{
  color:#80560b;background:#fff1cd;border-color:#d4af58;
}
