.chars[hidden] { display: none; }
.chars__head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.chars__title { flex: 1 1 auto; min-width: 0; }
.chars__ctl { display: flex; gap: 5px; flex: none; }
.chars__ctl[hidden] { display: none; }
.chars .chars__ctl button { position: static; width: 40px; height: 40px; margin: 0; padding: 0; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--accent); background-color: var(--accent); color: #fff; font-size: 18px; box-shadow: var(--bsh); cursor: pointer; transition: opacity .2s; }
.chars .chars__ctl button:hover { background-color: var(--bg-btn-hover); border-color: var(--bg-btn-hover); color: #fff; }
.chars .chars__ctl .is-off { opacity: .35; pointer-events: none; }
.chars__wrap { position: relative; }
.chars__track { display: flex; gap: 18px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity; scroll-padding: 0 6px; scroll-behavior: smooth; scrollbar-width: none; padding: 6px 6px 8px; margin: 0 -6px; }
.chars__track::-webkit-scrollbar { display: none; }
.chr { flex: 0 0 132px; width: 132px; scroll-snap-align: start; display: flex; flex-direction: column; min-width: 0; cursor: pointer; outline: none; }
.chr:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.chr__img { position: relative; display: block; width: 100%; aspect-ratio: 4 / 5; border-radius: 4px; background: var(--bg-darker-2); box-shadow: var(--bsh-item); transition: transform .2s ease; }
.chr__img > img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; border-radius: 4px; }
.chr:hover .chr__img, .chr:focus-visible .chr__img { transform: translateY(-3px); }
.chr__ph { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 4px; color: var(--accent); font-size: 40px; font-weight: 700; }
.chr__role { position: absolute; left: 6px; top: 6px; padding: 1px 8px; border-radius: 3px; background: var(--accent); color: #fff; font-size: 11px; font-style: normal; font-weight: 600; line-height: 18px; }
.chr__va { position: absolute; right: -6px; bottom: -6px; width: 40px; height: 40px; border-radius: 50%; overflow: hidden; border: 3px solid var(--bg); background: var(--bg-darker-2); }
.chr__va img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; }
.chr__va .chr__ph { font-size: 16px; }
.chr__name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 12px; color: var(--tt); font-size: 14px; font-weight: 600; line-height: 1.3; word-break: break-word; }
.chr:hover .chr__name { color: var(--accent); }
.chr__sei { display: block; max-width: 100%; margin-top: 3px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--tt-fade); font-size: 13px; line-height: 1.3; }
.chars .chars__all { display: block; margin: 18px auto 0; height: 40px; padding: 0 22px; border: 0; border-radius: 4px; font-size: 14px; font-weight: 600; background-color: var(--bg-darker-2); color: var(--tt); cursor: pointer; transition: background-color .2s, color .2s; }
.chars .chars__all:hover { background-color: var(--accent); color: #fff; }
.chars .chars__all:disabled { opacity: .7; cursor: default; }
.chr-modal { position: fixed; inset: 0; z-index: 100000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.chr-modal[hidden] { display: none; }
.chr-modal__bg { position: absolute; inset: 0; background: rgba(0,0,0,.65); }
.chr-modal__win { position: relative; width: 100%; max-width: 540px; max-height: calc(100vh - 32px); overflow: auto; border-radius: 6px; background: var(--bg); color: var(--tt); box-shadow: 0 20px 60px rgba(0,0,0,.45); }
.dt-is-active .chr-modal__win { background: #1a1a1a; box-shadow: 0 0 0 1px #2c2c2c, 0 20px 60px rgba(0,0,0,.6); }
.chr-modal .chr-modal__x { position: absolute; z-index: 2; right: 12px; top: 12px; display: grid; place-items: center; width: 36px; height: 36px; min-width: 0; margin: 0; padding: 0; line-height: 1; border: 0; border-radius: 50%; background: var(--bg-darker-2); color: var(--tt); box-shadow: none; cursor: pointer; }
.chr-modal .chr-modal__x:hover { background: var(--accent); color: #fff; }
.chr-modal__body { display: flex; gap: 22px; padding: 24px; }
.chr-modal__pic { flex: 0 0 170px; }
.chr-modal__pic img, .chr-modal__pic .chr__ph { display: block; width: 170px; aspect-ratio: 4 / 5; height: auto; object-fit: cover; object-position: 50% 20%; border-radius: 4px; background: var(--bg-darker-2); box-shadow: var(--bsh-item); }
.chr-modal__info { flex: 1 1 auto; min-width: 0; padding-right: 30px; }
.chr-modal__tag { display: inline-block; padding: 2px 10px; border-radius: 3px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 600; }
.chr-modal__tag--sup { background: var(--bg-darker-2); color: var(--tt); }
.chr-modal__name { margin: 12px 0 2px; color: var(--tt); font-size: 20px; font-weight: 700; line-height: 1.25; }
.chr-modal__orig { color: var(--tt-fade); font-size: 13px; }
.chr-modal__sub { margin: 18px 0 8px; color: var(--tt-fade); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.chr-modal__va { display: flex; align-items: center; gap: 12px; }
.chr-modal__va img, .chr-modal__va .chr__ph { flex: none; width: 64px; height: 64px; border-radius: 50%; object-fit: cover; object-position: 50% 15%; background: var(--bg-darker-2); font-size: 24px; }
.chr-modal__va b { display: block; color: var(--tt); font-size: 15px; font-weight: 700; }
.chr-modal__va small { display: block; margin-top: 2px; color: var(--tt-fade); font-size: 13px; }
.chr-modal__none { color: var(--tt-fade); font-size: 14px; }
html.chr-open { overflow: hidden; }
@media (min-width: 761px) {
  .chars--all .chars__track { display: grid; grid-template-columns: repeat(auto-fill, minmax(122px, 1fr)); gap: 22px 18px; overflow: visible; scroll-snap-type: none; }
  .chars--all .chr { width: auto; }
}
@media (max-width: 760px) {
  .chars__head { margin-bottom: 12px; }
  .chars__track { gap: 12px; padding: 6px 4px 6px; margin: 0 -4px; }
  .chr { flex-basis: 106px; width: 106px; }
  .chars .chars__ctl { display: none; }
  .chr__name { font-size: 13px; margin-top: 11px; }
  .chr__sei { font-size: 12px; }
  .chr__va { width: 34px; height: 34px; }
  .chars--all .chars__track { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 12px; overflow: visible; scroll-snap-type: none; }
  .chars--all .chr { width: auto; }
  .chr-modal__body { flex-direction: column; align-items: center; text-align: center; padding: 22px 16px; gap: 14px; }
  .chr-modal__pic { flex-basis: auto; }
  .chr-modal__pic img, .chr-modal__pic .chr__ph { width: 150px; }
  .chr-modal__info { padding-right: 0; width: 100%; }
  .chr-modal__va { justify-content: center; text-align: left; }
}
