/* ===== Core tokens (only what the page uses) ===== */
.bgfx {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(600px 300px at 12% 18%, #c7ddff40, transparent 60%),
    radial-gradient(520px 240px at 85% 82%, #e7eaff40, transparent 60%);
}

/* Page-specific styles (header/footer/base live in site_ui) */
:root {
  --ctrl-h: 34px;
  --pager-h: 28px;
  --pager-minw: 32px;
  --one-line: 1.25em;
  --cell-px: 12px;
  --cell-py: 6px;
}

.wrap {
  width: min(100%, var(--wrap));
  margin: 26px auto;
  padding: 0 16px;
  box-sizing: border-box;
}
h1 { margin: 0 0 8px; font-size: 24px; font-weight: 700; }
#intro { margin: 0 0 12px; color: #444; font-size: 15px; }

.controls {
  display: grid;
  grid-template-columns: 250px 160px 130px 1fr;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.controls > input,
.controls > select,
.controls > button {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
  font: inherit;
  outline: none;
  height: var(--ctrl-h);
  box-sizing: border-box;
}
.controls > button { cursor: pointer; }
.controls .pager { margin-left: auto; display: flex; gap: 6px; }

.sheet {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  scroll-margin-top: calc(var(--top-h) + 12px);
}

/* Consistent table box model */
table { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; }

/* Inner gutter parity (12px) */
thead th {
  text-align: left;
  padding: var(--cell-py) var(--cell-px);
  border-bottom: 1px solid var(--line);
  color: #444;
  font-weight: 600;
  background: #fbfbfb;
}
tbody td {
  padding: var(--cell-py) var(--cell-px);
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody td { border-bottom: 1px solid #eee; }
tbody tr:nth-child(odd) { background: #fcfcfd; }

/* Column widths aligned to “Novels” page grid */
thead th.title, tbody td.title { width: auto; }
thead th.release, tbody td.release { width: 110px; }
thead th.episode, tbody td.episode { width: 200px; }

/* LINKS */
.title a, .episode a, .release a {
  text-decoration: none;
  font-weight: 400;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.title a:hover, .episode a:hover, .release a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* compact single-line layout */
.title a, .episode a {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
  max-height: var(--one-line);
  min-height: var(--one-line);
}

.synopsis {
  display: none;
  margin-top: 4px;
  color: #555;
  font-size: 13px;
  line-height: 1.25;
  max-height: var(--one-line);
  min-height: var(--one-line);
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* when synopsis is toggled on, show fully */
body.syn-on .title a,
body.syn-on .episode a {
  display: block;
  -webkit-line-clamp: unset;
  -webkit-box-orient: unset;
  overflow: visible;
  text-overflow: unset;
  max-height: none;
  min-height: 0;
}
body.syn-on .synopsis {
  display: block;
  overflow: visible;
  text-overflow: unset;
  max-height: none;
  min-height: 0;
  line-height: 1.45;
  white-space: pre-line;
}

.pager {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}
.pbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--pager-h);
  min-width: var(--pager-minw);
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--card);
  color: inherit;
  font: inherit;
  font-weight: 400;
  line-height: 1;
  box-sizing: border-box;
  user-select: none;
  cursor: pointer;
  text-decoration: none;
}
.pbtn.active { font-weight: 700; }
.pbtn[disabled],
.pbtn[aria-disabled="true"] { opacity: .45; cursor: default; }

.bottom { display: flex; justify-content: flex-end; margin-top: 8px; }

@media (max-width: 640px) {
  thead th.release, tbody td.release,
  thead th.episode, tbody td.episode { width: auto; }

  thead {
    border: 0;
    clip: rect(0 0 0 0);
    height: 1px;
    width: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
  }

  table, tbody, tr, td {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }

  tbody tr {
    border-bottom: 1px solid var(--line);
    padding: 10px 12px;
  }
  tbody td {
    border: 0;
    padding: 6px 0;
  }

  tbody td.title a { font-weight: 600; }

  tbody td.release::before {
    content: "Release: ";
    font-weight: 600;
    margin-right: 6px;
  }
  tbody td.episode::before {
    content: "Episode: ";
    font-weight: 600;
    margin-right: 6px;
  }

  .title a, .episode a {
    display: block;
    -webkit-line-clamp: unset;
    -webkit-box-orient: unset;
    overflow: visible;
    text-overflow: unset;
    max-height: none;
    min-height: 0;
  }

  .synopsis { display: none; }
  body.syn-on .synopsis { display: block; }

  #search { display: none; }
  #pagerTop { display: none; }
  .controls { grid-template-columns: 160px 130px 1fr; }

  #rows a, #rows .synopsis {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
  }
}
