/* GameRava child theme: reading-map finish, 2026-10-28. */
:is(.grv-story-sidebar, .grv-page-sidebar) .grv-toc {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  max-height: none;
  padding: 0;
  border: 1px solid var(--grv-line);
  border-radius: 22px;
  background: radial-gradient(ellipse at 100% 0%, color-mix(in srgb, var(--grv-accent) 10%, transparent), transparent 65%), var(--grv-panel);
}
:is(.grv-story-sidebar, .grv-page-sidebar) .grv-toc::before,
:is(.grv-story-sidebar, .grv-page-sidebar) .grv-toc::after {
  content: "";
  position: absolute;
  inset-inline: 20px;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--grv-purple), var(--grv-accent), transparent);
}
:is(.grv-story-sidebar, .grv-page-sidebar) .grv-toc::before { top: 0; opacity: .8; animation: grv-toc-glow 5s ease-in-out infinite; }
:is(.grv-story-sidebar, .grv-page-sidebar) .grv-toc::after { bottom: 0; opacity: .55; }
:is(.grv-story-sidebar, .grv-page-sidebar) .grv-toc summary {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 70px;
  padding: 18px 22px;
  margin: 0;
  list-style: none;
  font-size: 16px;
  line-height: 1.8;
  cursor: pointer;
}
:is(.grv-story-sidebar, .grv-page-sidebar) .grv-toc summary::-webkit-details-marker { display: none; }
:is(.grv-story-sidebar, .grv-page-sidebar) .grv-toc summary::before {
  content: "";
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  background: var(--grv-accent);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 5 6-2 6 2 6-2v16l-6 2-6-2-6 2V5Zm6-2v16m6-14v16'/%3E%3C/svg%3E") center / contain no-repeat;
}
:is(.grv-story-sidebar, .grv-page-sidebar) .grv-toc summary::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-inline-start: auto;
  border-right: 1.5px solid var(--grv-accent);
  border-bottom: 1.5px solid var(--grv-accent);
  transform: rotate(45deg);
  transition: transform .22s ease;
}
:is(.grv-story-sidebar, .grv-page-sidebar) :is(details.grv-toc:not([open]), .grv-toc details:not([open])) summary::after { transform: rotate(135deg); }
:is(.grv-story-sidebar, .grv-page-sidebar) :is(.grv-toc[open], .grv-toc details[open]) summary { border-bottom: 1px solid var(--grv-line); }
:is(.grv-story-sidebar, .grv-page-sidebar) .grv-toc ol {
  max-height: min(48vh, 430px);
  overflow-y: auto;
  overscroll-behavior-y: auto;
  scrollbar-width: thin !important;
  scrollbar-color: color-mix(in srgb, var(--grv-accent) 65%, var(--grv-panel)) transparent;
  scrollbar-gutter: stable;
  padding: 10px 14px 16px;
  margin: 0;
  scroll-padding-block: 12px;
}
:is(.grv-story-sidebar, .grv-page-sidebar) .grv-toc ol::-webkit-scrollbar { width: 6px; height: 6px; }
:is(.grv-story-sidebar, .grv-page-sidebar) .grv-toc ol::-webkit-scrollbar-track { background: transparent; margin-block: 12px; }
:is(.grv-story-sidebar, .grv-page-sidebar) .grv-toc ol::-webkit-scrollbar-thumb { background: var(--grv-accent); border-radius: 20px; }
:is(.grv-story-sidebar, .grv-page-sidebar) .grv-toc ol::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
:is(.grv-story-sidebar, .grv-page-sidebar) .grv-toc li { border: 0; margin: 3px 0; }
:is(.grv-story-sidebar, .grv-page-sidebar) .grv-toc .grv-toc-sub { margin-inline-start: 10px; }
:is(.grv-story-sidebar, .grv-page-sidebar) .grv-toc a {
  align-items: flex-start;
  gap: 9px;
  padding: 11px 9px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 12px;
  line-height: 1.95;
  transition: color .2s ease, background-color .2s ease, border-color .2s ease, transform .2s ease;
}
:is(.grv-story-sidebar, .grv-page-sidebar) .grv-toc a::before {
  display: grid;
  place-items: center;
  flex: 0 0 23px;
  min-height: 23px;
  margin-top: 1px;
  border-radius: 7px;
  background: color-mix(in srgb, var(--grv-purple) 9%, transparent);
  font-size: 10px;
  line-height: 1;
  opacity: .85;
  transition: background-color .2s ease, color .2s ease;
}
:is(.grv-story-sidebar, .grv-page-sidebar) .grv-toc a:hover,
:is(.grv-story-sidebar, .grv-page-sidebar) .grv-toc a[aria-current="true"] {
  color: var(--grv-fg);
  background: color-mix(in srgb, var(--grv-accent) 8%, transparent);
  border-color: color-mix(in srgb, var(--grv-accent) 24%, transparent);
}
:is(.grv-story-sidebar, .grv-page-sidebar) .grv-toc a:hover { transform: translateX(-3px); }
:is(.grv-story-sidebar, .grv-page-sidebar) .grv-toc a[aria-current="true"]::before { background: var(--grv-accent); color: var(--grv-bg); opacity: 1; }
:is(.grv-story-sidebar, .grv-page-sidebar) .grv-toc a:focus-visible,
:is(.grv-story-sidebar, .grv-page-sidebar) .grv-toc summary:focus-visible { outline: 2px solid var(--grv-accent); outline-offset: -3px; }
:is(.grv-story-sidebar, .grv-page-sidebar) :is(.grv-toc[open], .grv-toc details[open]) ol { animation: grv-toc-open .24s ease both; }
@keyframes grv-toc-open { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: none; } }
@keyframes grv-toc-glow { 0%, 100% { opacity: .3; } 50% { opacity: .95; } }
@media (max-width: 600px) {
  :is(.grv-story-sidebar, .grv-page-sidebar) .grv-toc summary { min-height: 64px; padding: 16px 18px; }
  :is(.grv-story-sidebar, .grv-page-sidebar) .grv-toc ol { max-height: min(46vh, 390px); padding-inline: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  :is(.grv-story-sidebar, .grv-page-sidebar) .grv-toc::before,
  :is(.grv-story-sidebar, .grv-page-sidebar) :is(.grv-toc[open], .grv-toc details[open]) ol { animation: none; }
  :is(.grv-story-sidebar, .grv-page-sidebar) .grv-toc a,
  :is(.grv-story-sidebar, .grv-page-sidebar) .grv-toc summary::after { transition: none; }
  :is(.grv-story-sidebar, .grv-page-sidebar) .grv-toc a:hover { transform: none; }
}
.grv-motion-off :is(.grv-story-sidebar, .grv-page-sidebar) .grv-toc::before,
.grv-motion-off :is(.grv-story-sidebar, .grv-page-sidebar) :is(.grv-toc[open], .grv-toc details[open]) ol,
.grv-motion-subtle :is(.grv-story-sidebar, .grv-page-sidebar) .grv-toc::before { animation: none; }
.grv-motion-off :is(.grv-story-sidebar, .grv-page-sidebar) .grv-toc a:hover { transform: none; }

@supports selector(::-webkit-scrollbar) {
  :is(.grv-story-sidebar, .grv-page-sidebar) .grv-toc ol { scrollbar-width: auto !important; scrollbar-color: auto !important; }
}

/* Shared front-end scrollbars: page, sidebars, dialogs, tables and text fields. */
html, body, body * {
  scrollbar-width: thin !important;
  scrollbar-color: var(--grv-accent) transparent !important;
}
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  min-height: 36px;
  min-width: 36px;
  border-radius: 999px;
  background: var(--grv-accent);
}
::-webkit-scrollbar-thumb:hover { background: var(--grv-purple); }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
::-webkit-scrollbar-corner { background: transparent; }
@supports selector(::-webkit-scrollbar) {
  html, body, body * { scrollbar-width: auto !important; scrollbar-color: auto !important; }
}
@media (forced-colors: active) {
  html, body, body * { scrollbar-color: auto; }
  ::-webkit-scrollbar-thumb { background: CanvasText; }
}
