/* Hianime extras on top of manga-rw-static tokens. */
html, body { overflow-x: hidden; }
html {
  scrollbar-gutter: auto;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--faint) 70%, transparent) transparent;
}
html::-webkit-scrollbar { width: 8px; height: 0; }
html::-webkit-scrollbar-track { background: transparent; }
html::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--faint) 55%, transparent);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
html::-webkit-scrollbar-thumb:hover { background: var(--muted); background-clip: padding-box; }
.page-home { overflow-x: clip; }
.rail-track, .rail-track-hero { scrollbar-width: none !important; }
.rail-track::-webkit-scrollbar,
.rail-track-hero::-webkit-scrollbar { display: none !important; height: 0 !important; }
.sched-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin: 0 0 var(--s5);
}
.sched-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 48px;
  border-radius: var(--r1);
  background: var(--surface);
  font-weight: 700;
  font-size: var(--t-sm);
  color: var(--muted);
}
.sched-day:hover { color: var(--ink); background: var(--raised); }
.sched-day[aria-current] { background: var(--accent); color: var(--on-accent); }
.sched-today { font-family: var(--font-data); font-size: 10px; font-weight: 600; opacity: 0.85; }
@media (max-width: 640px) {
  .sched-week { gap: 4px; }
  .sched-day { min-height: 40px; font-size: var(--t-xs); }
}
.lang-switch {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 2px;
  border-radius: var(--r-full);
  background: var(--surface);
  flex-shrink: 0;
}
.lang-switch button {
  height: 28px;
  padding: 0 10px;
  border: none;
  border-radius: var(--r-full);
  background: transparent;
  color: var(--muted);
  font: 700 var(--t-2xs)/1 var(--font-data);
  letter-spacing: 0.06em;
  cursor: pointer;
}
.lang-switch button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--bg);
}
.crawl-wrap { max-width: 1180px; margin: 0 auto; padding: var(--s4); }
.crawl-wrap .an-header,
.crawl-wrap .an-sidebar,
.crawl-wrap .an-footer { display: none !important; }
.crawl-wrap .an-layout { display: block !important; }
.page-title-wrap { display: grid; grid-template-columns: 180px 1fr; gap: var(--s5); }
@media (max-width: 767px) {
  .page-title-wrap { grid-template-columns: 1fr; }
}
.title-cover { width: 100%; border-radius: var(--r1); aspect-ratio: 3/4; object-fit: cover; background: var(--surface); }
.ep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: var(--s2); margin-top: var(--s4); }
.ep-grid a {
  display: flex; align-items: center; justify-content: center;
  height: 40px; border-radius: var(--r1); background: var(--surface);
  font-family: var(--font-data); font-size: var(--t-sm); font-weight: 600;
}
.ep-grid a:hover { background: var(--ink); color: var(--bg); }
.pager { display: flex; gap: var(--s2); margin-top: var(--s5); flex-wrap: wrap; }
.pager a, .pager span {
  min-width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r1); background: var(--surface); font-family: var(--font-data);
}
.pager a[aria-current] { background: var(--ink); color: var(--bg); }
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; height: 56px; background: var(--chrome); display: flex; z-index: 30; }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 11px; color: var(--muted); gap: 2px; }
.tabbar a[aria-current] { color: var(--ink); font-weight: 700; }
@media (min-width: 768px) { .tabbar { display: none; } }
body.hi-watch .tabbar { display: none; }

.bookmark-btn {
  width: 40px; height: 40px; border: none; border-radius: var(--r-full);
  background: var(--surface); color: var(--ink); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.bookmark-btn svg { width: 18px; height: 18px; }
.bookmark-btn[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.bookmark-btn[aria-pressed="true"] svg { fill: currentColor; }
.ep-box-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
  gap: 6px;
}
.ep-box {
  width: 100%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: var(--r1);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-data);
  font-size: var(--t-xs);
  font-weight: 600;
  content-visibility: auto;
}
.ep-box:hover { background: var(--raised); }
.chapter-ord {
  width: 40px; height: 40px; border: none; border-radius: var(--r1);
  background: var(--surface); color: var(--muted); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.chapter-ord:hover { color: var(--ink); background: var(--raised); }
.chapter-ord svg { width: 18px; height: 18px; }
.chapter-ord[data-asc="1"] svg { transform: scaleY(-1); }
.page-title { font-size: var(--t-2xl); font-weight: 800; margin: 0 0 var(--s3); }
.topbar-search { position: relative; margin-left: auto; flex: 1; max-width: 320px; }
.topbar-search .search-drop {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: var(--bg); border-radius: var(--r3); box-shadow: var(--shadow-lg);
  padding: var(--s3); z-index: 50; max-height: 70vh; overflow: auto;
}
.pager a svg { width: 16px; height: 16px; }
.detail-cover { width: 100%; border-radius: var(--r1); aspect-ratio: 3/4; object-fit: cover; background: var(--surface); }
.detail-actions { display: flex; gap: var(--s2); align-items: center; }
.detail-desc { max-width: 65ch; color: var(--muted); line-height: 1.6; }
.detail-facts { display: grid; gap: var(--s2); }
.detail-fact { margin: 0; display: flex; gap: var(--s2); font-size: var(--t-sm); }
.detail-fact-label { color: var(--faint); min-width: 6em; }
.detail-tags { display: flex; flex-wrap: wrap; gap: var(--s2); margin: var(--s3) 0; }
.section-title { display: inline-flex; align-items: center; gap: var(--s2); font-size: var(--t-lg); }
.section-title svg { width: 18px; height: 18px; }
.rail-btn svg { width: 16px; height: 16px; }
.crawl-wrap iframe, .crawl-wrap video { width: 100%; min-height: 360px; background: #111; }
.crawl-wrap form { display: none !important; }
body.hi-watch .tabbar { display: none; }

.page-watch { padding-bottom: var(--s6); }
.watch-back {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  height: 36px;
  margin-bottom: var(--s3);
  padding: 0 var(--s3);
  border-radius: var(--r-full);
  background: var(--surface);
  color: var(--muted);
  font-size: var(--t-sm);
  font-weight: 600;
  max-width: 100%;
}
.watch-back:hover { color: var(--ink); }
.watch-back svg { width: 16px; height: 16px; flex-shrink: 0; }
.watch-back span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.watch-layout {
  display: grid;
  gap: var(--s4);
}
@media (min-width: 1024px) {
  .watch-layout {
    grid-template-columns: minmax(0, 1fr) 280px;
    align-items: start;
  }
}
.watch-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: hsl(240 6% 6%);
  border-radius: var(--r1);
  overflow: hidden;
}
.watch-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.watch-error {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  gap: var(--s2);
  padding: var(--s5);
  background: hsl(240 6% 8%);
  color: var(--ink);
  text-align: center;
}
.watch-error[hidden] { display: none; }
.watch-error p { margin: 0; font-weight: 700; }
.ep-box.is-dead,
.watch-ep.is-dead {
  opacity: 0.38;
  text-decoration: line-through;
}
.watch-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  margin-top: var(--s4);
}
.watch-title { font-size: var(--t-xl); font-weight: 800; margin: 0; }
.watch-title span { color: var(--muted); font-family: var(--font-data); font-size: var(--t-sm); font-weight: 600; margin-left: var(--s2); }
.watch-step { display: flex; gap: var(--s2); }
.watch-step .btn svg { width: 16px; height: 16px; }
.watch-label {
  margin: 0 0 var(--s2);
  color: var(--muted);
  font-size: var(--t-sm);
  font-weight: 600;
}
.watch-label span { font-family: var(--font-data); font-weight: 500; }
.watch-servers { margin-top: var(--s4); }
.watch-server-row { display: flex; flex-wrap: wrap; gap: var(--s2); }
.watch-server {
  height: 36px;
  padding: 0 var(--s3);
  border: none;
  border-radius: var(--r1);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-data);
  font-size: var(--t-xs);
  font-weight: 600;
  cursor: pointer;
}
.watch-server:hover { background: var(--raised); }
.watch-server[aria-current] { background: var(--accent); color: var(--on-accent); }
.watch-muted { color: var(--faint); font-size: var(--t-sm); }
.watch-aside {
  background: var(--surface);
  border-radius: var(--r2);
  padding: var(--s3);
  max-height: min(70vh, 640px);
  overflow: auto;
}
.watch-epgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
  gap: 6px;
}
.watch-ep {
  width: 100%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: var(--r1);
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-data);
  font-size: var(--t-xs);
  font-weight: 600;
  content-visibility: auto;
}
.watch-ep:hover { background: var(--raised); }
.watch-ep[aria-current] { background: var(--accent); color: var(--on-accent); }
.watch-related { margin-top: var(--s6); }
.watch-related .card-grid { margin-top: var(--s3); }
@media (max-width: 1023px) {
  .watch-aside { max-height: none; }
}
