/* Owned reset, utilities, components, and color tokens. Values are lifted from
   Bootstrap 5.3.8 to keep rendering identical. Kept first so the project's own
   rules below win on conflicts. The one deliberate deviation is the dropped
   `cursor: wait` on `.placeholder`. */

/* Color tokens, keyed off data-theme so dark mode resolves correctly. */
:root {
  --app-page-bg: #f8f9fa;
  --app-body-bg: #fff;
  --app-body-color: #212529;
  --app-border-color: #dee2e6;
  --app-border-color-translucent: rgba(0, 0, 0, 0.175);
  --app-secondary-color: rgba(33, 37, 41, 0.75);
  --app-secondary: #6c757d;
  --app-secondary-bg: #e9ecef;
  --app-emphasis-color: #000;
  --app-accent: #0d6efd;
  --app-link-color: #0d6efd;
  --app-link-hover-color: #0a58ca;
}

[data-theme="dark"] {
  --app-page-bg: #2b3035;
  --app-body-bg: #212529;
  --app-body-color: #dee2e6;
  --app-border-color: #495057;
  --app-border-color-translucent: rgba(255, 255, 255, 0.15);
  --app-secondary-color: rgba(222, 226, 230, 0.75);
  --app-secondary-bg: #343a40;
  --app-emphasis-color: #fff;
  --app-link-color: #6ea8fe;
  --app-link-hover-color: #8bb9fe;
}

/* Minimal reset (Reboot subset) */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  line-height: 1.5;
}

.h1, .h2, .h3, .h4, .h5, .h6,
h1, h2, h3, h4, h5, h6 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-weight: 500;
  line-height: 1.2;
}

h1 { font-size: calc(1.375rem + 1.5vw); }
h2 { font-size: calc(1.325rem + 0.9vw); }
h3 { font-size: calc(1.3rem + 0.6vw); }
.h4, h4 { font-size: calc(1.275rem + 0.3vw); }
.h5, h5 { font-size: 1.25rem; }
.h6, h6 { font-size: 1rem; }

@media (min-width: 1200px) {
  h1 { font-size: 2.5rem; }
  h2 { font-size: 2rem; }
  h3 { font-size: 1.75rem; }
  .h4, h4 { font-size: 1.5rem; }
}

p {
  margin-top: 0;
  margin-bottom: 1rem;
}

ol, ul {
  margin-top: 0;
  margin-bottom: 1rem;
  padding-left: 2rem;
}

button {
  margin: 0;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  border-radius: 0;
  text-transform: none;
}

button,
[type="button"] {
  -webkit-appearance: button;
  appearance: button;
}

img,
svg {
  vertical-align: middle;
}

/* Utilities (only the ~40 actually used) */
.d-flex { display: flex !important; }
.d-inline-block { display: inline-block !important; }
.d-none { display: none !important; }
[hidden] { display: none !important; }
.flex-row { flex-direction: row !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-nowrap { flex-wrap: nowrap !important; }
.align-items-center { align-items: center !important; }
.justify-content-between { justify-content: space-between !important; }
.gap-2 { gap: 0.5rem !important; }
.w-100 { width: 100% !important; }

.mt-3 { margin-top: 1rem !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.me-2 { margin-right: 0.5rem !important; }
.ms-2 { margin-left: 0.5rem !important; }
.ms-auto { margin-left: auto !important; }
.my-1 { margin-top: 0.25rem !important; margin-bottom: 0.25rem !important; }
.p-3 { padding: 1rem !important; }
.pt-2 { padding-top: 0.5rem !important; }
.pb-3 { padding-bottom: 1rem !important; }
.py-3 { padding-top: 1rem !important; padding-bottom: 1rem !important; }

.text-center { text-align: center !important; }
.text-decoration-none { text-decoration: none !important; }
.text-secondary { color: #6c757d !important; }
.opacity-50 { opacity: 0.5 !important; }
.small { font-size: 0.875em; }
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-unstyled { padding-left: 0; list-style: none; }
.border-0 { border: 0 !important; }
.shadow-sm { box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important; }
.bg-body-tertiary { background-color: var(--app-page-bg) !important; }

@media (min-width: 992px) {
  .px-lg-2 { padding-right: 0.5rem !important; padding-left: 0.5rem !important; }
  .d-lg-none { display: none !important; }
}

/* 2-column layout (container-fluid / row / col-* / g-3). The only row always
   carries g-3, so the 1rem gutter is baked into .row / .row > *. The container
   keeps a 1.5rem gutter (0.75rem padding each side). */
.container-fluid {
  width: 100%;
  padding-right: 0.75rem;
  padding-left: 0.75rem;
  margin-right: auto;
  margin-left: auto;
}

.row {
  display: flex;
  flex-wrap: wrap;
  margin-top: -1rem;
  margin-right: -0.5rem;
  margin-left: -0.5rem;
}

.row > * {
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
  padding-right: 0.5rem;
  padding-left: 0.5rem;
  margin-top: 1rem;
}

.col-12 { flex: 0 0 auto; width: 100%; }

@media (min-width: 992px) {
  .col-lg-3 { flex: 0 0 auto; width: 25%; }
  .col-lg-9 { flex: 0 0 auto; width: 75%; }
}

@media (min-width: 1400px) {
  .col-xxl-2 { flex: 0 0 auto; width: 16.66666667%; }
  .col-xxl-10 { flex: 0 0 auto; width: 83.33333333%; }
}

/* Buttons */
.btn {
  --btn-padding-x: 0.75rem;
  --btn-padding-y: 0.375rem;
  --btn-font-size: 1rem;
  --btn-font-weight: 400;
  --btn-line-height: 1.5;
  --btn-color: var(--app-body-color);
  --btn-bg: transparent;
  --btn-border-width: 1px;
  --btn-border-color: transparent;
  --btn-border-radius: 0.375rem;
  --btn-hover-color: var(--app-body-color);
  --btn-hover-bg: transparent;
  --btn-hover-border-color: transparent;
  --btn-active-color: var(--app-body-color);
  --btn-active-bg: transparent;
  --btn-active-border-color: transparent;
  --btn-disabled-color: var(--app-body-color);
  --btn-disabled-bg: transparent;
  --btn-disabled-border-color: transparent;
  --btn-disabled-opacity: 0.65;
  --btn-focus-shadow-rgb: 108, 117, 125;
  display: inline-block;
  padding: var(--btn-padding-y) var(--btn-padding-x);
  font-size: var(--btn-font-size);
  font-weight: var(--btn-font-weight);
  line-height: var(--btn-line-height);
  color: var(--btn-color);
  text-align: center;
  text-decoration: none;
  vertical-align: middle;
  cursor: pointer;
  user-select: none;
  border: var(--btn-border-width) solid var(--btn-border-color);
  border-radius: var(--btn-border-radius);
  background-color: var(--btn-bg);
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out,
    border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.btn:hover {
  color: var(--btn-hover-color);
  background-color: var(--btn-hover-bg);
  border-color: var(--btn-hover-border-color);
}

.btn:focus-visible {
  color: var(--btn-hover-color);
  background-color: var(--btn-hover-bg);
  border-color: var(--btn-hover-border-color);
  outline: 0;
  box-shadow: 0 0 0 0.25rem rgba(var(--btn-focus-shadow-rgb), 0.5);
}

.btn.active,
.btn:active {
  color: var(--btn-active-color);
  background-color: var(--btn-active-bg);
  border-color: var(--btn-active-border-color);
}

.btn:disabled,
.btn.disabled {
  color: var(--btn-disabled-color);
  pointer-events: none;
  background-color: var(--btn-disabled-bg);
  border-color: var(--btn-disabled-border-color);
  opacity: var(--btn-disabled-opacity);
}

.btn-sm {
  --btn-padding-y: 0.25rem;
  --btn-padding-x: 0.5rem;
  --btn-font-size: 0.875rem;
  --btn-border-radius: 0.25rem;
}

.btn-secondary {
  --btn-color: #fff;
  --btn-bg: #6c757d;
  --btn-border-color: #6c757d;
  --btn-hover-color: #fff;
  --btn-hover-bg: #5c636a;
  --btn-hover-border-color: #565e64;
  --btn-active-color: #fff;
  --btn-active-bg: #565e64;
  --btn-active-border-color: #51585e;
  --btn-disabled-color: #fff;
  --btn-disabled-bg: #6c757d;
  --btn-disabled-border-color: #6c757d;
  --btn-focus-shadow-rgb: 130, 138, 145;
}

.btn-outline-secondary {
  --btn-color: #6c757d;
  --btn-bg: transparent;
  --btn-border-color: #6c757d;
  --btn-hover-color: #fff;
  --btn-hover-bg: #6c757d;
  --btn-hover-border-color: #6c757d;
  --btn-active-color: #fff;
  --btn-active-bg: #6c757d;
  --btn-active-border-color: #6c757d;
  --btn-disabled-color: #6c757d;
  --btn-disabled-bg: transparent;
  --btn-disabled-border-color: #6c757d;
}

.btn-link {
  --btn-font-weight: 400;
  --btn-color: var(--app-link-color);
  --btn-bg: transparent;
  --btn-border-color: transparent;
  --btn-hover-color: var(--app-link-hover-color);
  --btn-hover-border-color: transparent;
  --btn-active-color: var(--app-link-hover-color);
  --btn-active-border-color: transparent;
  --btn-disabled-color: #6c757d;
  --btn-disabled-border-color: transparent;
  --btn-focus-shadow-rgb: 49, 132, 253;
  text-decoration: underline;
}

.btn-link:hover { color: var(--btn-hover-color); }
.btn-link:focus-visible { color: var(--btn-color); }

/* Nav link: only the theme toggle uses it — transparent, no padding-y, inherits
   text colour. */
.nav-link {
  display: block;
  padding: 0;
  color: inherit;
  text-decoration: none;
  background: none;
  border: 0;
}

/* Card */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  word-wrap: break-word;
  color: var(--app-body-color);
  background-color: var(--app-body-bg);
  background-clip: border-box;
  border: 1px solid var(--app-border-color-translucent);
  border-radius: 0.375rem;
}

.card-body {
  flex: 1 1 auto;
  padding: 1rem 1rem;
}

/* List group (sidebar nav + story selector) */
.list-group {
  display: flex;
  flex-direction: column;
  padding-left: 0;
  margin-bottom: 0;
  border-radius: 0.375rem;
}

.list-group-item {
  position: relative;
  display: block;
  padding: 0.5rem 1rem;
  color: var(--app-body-color);
  text-decoration: none;
  background-color: var(--app-body-bg);
  border: 1px solid var(--app-border-color);
}

.list-group-item:first-child {
  border-top-left-radius: inherit;
  border-top-right-radius: inherit;
}

.list-group-item:last-child {
  border-bottom-right-radius: inherit;
  border-bottom-left-radius: inherit;
}

.list-group-item + .list-group-item {
  border-top-width: 0;
}

.list-group-item-action {
  width: 100%;
  color: var(--app-secondary-color);
  text-align: inherit;
}

.list-group-item-action:not(.active):hover,
.list-group-item-action:not(.active):focus {
  z-index: 1;
  color: var(--app-emphasis-color);
  text-decoration: none;
  background-color: var(--app-page-bg);
}

.list-group-item-action:not(.active):active {
  color: var(--app-body-color);
  background-color: var(--app-secondary-bg);
}

.list-group-flush {
  border-radius: 0;
}

.list-group-flush > .list-group-item {
  border-width: 0 0 1px;
}

.list-group-flush > .list-group-item:last-child {
  border-bottom-width: 0;
}

/* Badge */
.badge {
  display: inline-block;
  padding: 0.35em 0.65em;
  font-size: 0.75em;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 0.375rem;
}

.text-bg-light {
  color: #000 !important;
  background-color: #f8f9fa !important;
}

/* Form control (sidebar search input) */
.form-control {
  display: block;
  width: 100%;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--app-body-color);
  appearance: none;
  background-color: var(--app-body-bg);
  background-clip: padding-box;
  border: 1px solid var(--app-border-color);
  border-radius: 0.375rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
  color: var(--app-body-color);
  background-color: var(--app-body-bg);
  border-color: #86b7fe;
  outline: 0;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.form-control::placeholder {
  color: var(--app-secondary-color);
  opacity: 1;
}

.form-control-sm {
  min-height: calc(1.5em + 0.5rem + 2px);
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  border-radius: 0.25rem;
}

/* Dropdown (theme + language menus, driven by the owned vanilla helper) */
.dropdown {
  position: relative;
}

.dropdown-toggle {
  white-space: nowrap;
}

.dropdown-toggle::after {
  display: inline-block;
  margin-left: 0.255em;
  vertical-align: 0.255em;
  content: "";
  border-top: 0.3em solid;
  border-right: 0.3em solid transparent;
  border-bottom: 0;
  border-left: 0.3em solid transparent;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1000;
  display: none;
  min-width: 10rem;
  padding: 0.5rem 0;
  margin: 0.125rem 0 0;
  font-size: 1rem;
  color: var(--app-body-color);
  text-align: left;
  list-style: none;
  background-color: var(--app-body-bg);
  background-clip: padding-box;
  border: 1px solid var(--app-border-color-translucent);
  border-radius: 0.375rem;
}

.dropdown-menu.show {
  display: block;
}

.dropdown-item {
  display: block;
  width: 100%;
  padding: 0.25rem 1rem;
  clear: both;
  font-weight: 400;
  color: var(--app-body-color);
  text-align: inherit;
  text-decoration: none;
  white-space: nowrap;
  background-color: transparent;
  border: 0;
}

.dropdown-item:hover,
.dropdown-item:focus {
  color: var(--app-body-color);
  background-color: var(--app-page-bg);
}

.dropdown-item.active,
.dropdown-item:active {
  color: #fff;
  text-decoration: none;
  background-color: var(--app-accent);
}

/* Placeholder base (without `cursor: wait`) */
.placeholder {
  display: inline-block;
  min-height: 1em;
  vertical-align: middle;
  background-color: currentcolor;
  opacity: 0.5;
}

:root {
  color-scheme: light dark;

  --bg-surface: light-dark(#ffffff, #212529);
  --bg-surface-2: light-dark(#f8fafc, #212529);
  --bg-blue-tint: light-dark(#eff6ff, #1a2a3f);
  --bg-warm-tint: light-dark(#fffbeb, #412f0e);

  --border: light-dark(#e2e8f0, #3d4349);
  --border-2: light-dark(#cbd5e1, #565e67);
  --border-3: light-dark(#edf1f5, #31373d);
  --border-blue: light-dark(#bfdbfe, #1e3a5f);
  --border-warm: light-dark(#f3d9b1, #5a3a0a);

  --text-primary: light-dark(#0f172a, #e9ecef);
  --text-secondary: light-dark(#1e293b, #dee2e6);
  --text-body: light-dark(#334155, #d2dae2);
  --text-subtle: light-dark(#475569, #d2dae2);
  --text-muted: light-dark(#64748b, #9ea6ad);
  --text-blue: light-dark(#1d4ed8, #74c0fc);
  --text-amber: light-dark(#92400e, #ffd43b);
  --text-warn: light-dark(#9a5b00, #fd7e14);

  --focus-ring: light-dark(#93c5fd, #74c0fc);
  --mark-icon: light-dark(#475569, #868e96);
  --reward-mark-bg: light-dark(linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%),
      linear-gradient(180deg, #2c3035 0%, #212529 100%));

  --shadow: light-dark(rgba(15, 23, 42, 0.08), rgba(0, 0, 0, 0.4));

  --lightbox-bg: rgba(0, 0, 0, 0.82);
  --lightbox-img-bg: #111317;
  --lightbox-border: rgba(255, 255, 255, 0.15);
  --lightbox-close-bg: rgba(0, 0, 0, 0.6);
  --lightbox-close-border: rgba(255, 255, 255, 0.2);
  --lightbox-close-color: #f8fafc;

  --badge-overlay-bg: rgba(0, 0, 0, 0.72);
  --badge-overlay-border: rgba(255, 255, 255, 0.18);
  --badge-overlay-color: #f8fafc;
}

[data-theme="dark"] {
  color-scheme: dark;
}

[data-theme="light"] {
  color-scheme: light;
}

[data-lang="kr"] body {
  font-family: "Noto Sans", "Noto Sans KR", "Noto Sans JP", "Noto Sans SC", "Noto Sans TC", system-ui, sans-serif;
}

[data-lang="jp"] body {
  font-family: "Noto Sans", "Noto Sans JP", "Noto Sans KR", "Noto Sans SC", "Noto Sans TC", system-ui, sans-serif;
}

[data-lang="chs"] body {
  font-family: "Noto Sans", "Noto Sans SC", "Noto Sans TC", "Noto Sans KR", "Noto Sans JP", system-ui, sans-serif;
}

[data-lang="chs_t"] body {
  font-family: "Noto Sans", "Noto Sans TC", "Noto Sans SC", "Noto Sans KR", "Noto Sans JP", system-ui, sans-serif;
}

html,
body {
  height: 100%;
}

body {
  font-family: "Noto Sans", "Noto Sans SC", "Noto Sans TC", "Noto Sans JP", "Noto Sans KR", system-ui, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-surface-2);
  color: var(--text-secondary);
}

.app-main-layout {
  flex: 1 0 auto;
}

.app-footer {
  flex-shrink: 0;
}

.app-title {
  color: var(--text-primary);
}

.app-title:hover {
  color: var(--text-primary);
}

.github-link:hover {
  color: var(--text-primary) !important;
}

.app-footer-note {
  font-size: 0.8rem;
}

.home-links-layout {
  display: grid;
  gap: 1rem;
  justify-items: center;
}

#viewRoot.home-view-root {
  min-height: calc(100dvh - 10.5rem);
  display: flex;
  align-items: center;
  justify-content: center;
}

.home-region {
  width: min(100%, 56rem);
  padding-bottom: 0.95rem;
  text-align: center;
}

.home-region-divider {
  border-bottom: 1px solid var(--border);
}

.home-region-title {
  margin: 0 0 0.5rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
}

.home-region-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.42rem 0.5rem;
}

.home-region-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.62rem;
  padding: 0.14rem 0.58rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-surface);
  color: var(--text-subtle);
  text-decoration: none;
  font-size: 0.8rem;
  line-height: 1.2;
  transition: border-color 0.14s ease, background-color 0.14s ease, color 0.14s ease;
}

.home-region-link:hover {
  color: var(--text-primary);
  border-color: var(--border-2);
  background: var(--bg-surface-2);
  text-decoration: none;
}

.achievement-summary {
  margin-bottom: 0.6rem;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.achievement-group-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.7rem;
}

.achievement-entry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  max-width: 100%;
  gap: 0.55rem;
}

.achievement-entry {
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  background: var(--bg-surface);
  padding: 0.68rem 0.72rem;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

@media (hover: hover) and (pointer: fine) {
  .achievement-entry:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.45rem 0.9rem var(--shadow);
    border-color: var(--border-2);
  }
}

@media (hover: hover) and (pointer: fine) {
  .activity-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.45rem 0.9rem var(--shadow);
    border-color: var(--border-2);
  }
}

@media (hover: hover) and (pointer: fine) {
  .character-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.45rem 0.9rem var(--shadow);
    border-color: var(--border-2);
  }
}

@media (hover: hover) and (pointer: fine) {
  .item-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.45rem 0.9rem var(--shadow);
    border-color: var(--border-2);
  }
}

@media (hover: hover) and (pointer: fine) {
  .detail-contract-item:hover .detail-contract-thumb-wrap {
    transform: translateY(-2px);
    box-shadow: 0 0.45rem 0.9rem var(--shadow);
    border-color: var(--border-2);
  }
}

@media (hover: hover) and (pointer: fine) {

  .detail-stamp-image:hover,
  .detail-stamp-image.placeholder:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.45rem 0.9rem var(--shadow);
    border-color: var(--border-2);
  }
}

.achievement-entry-title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.achievement-entry-description {
  margin: 0.38rem 0 0;
  color: var(--text-body);
  font-size: 0.84rem;
  line-height: 1.45;
}

.achievement-entry-meta {
  margin-top: 0.42rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
}

.achievement-meta-badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.22rem;
  padding: 0.08rem 0.42rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-surface-2);
  color: var(--text-body);
  font-size: 0.7rem;
  font-weight: 500;
  line-height: 1.2;
}

.achievement-meta-rare-0 {
  border-color: var(--border);
  background: var(--bg-surface-2);
  color: var(--text-muted);
}

.achievement-meta-rare-1 {
  border-color: var(--border);
  background: var(--bg-surface-2);
  color: var(--text-body);
}

.achievement-meta-rare-2 {
  border-color: var(--border-blue);
  background: var(--bg-blue-tint);
  color: var(--text-blue);
}

.achievement-meta-rare-3 {
  border-color: var(--border-warm);
  background: var(--bg-warm-tint);
  color: var(--text-amber);
}

.achievement-meta-warning {
  border-color: var(--border-warm);
  background: var(--bg-warn-tint);
  color: var(--text-warn);
}

.achievement-meta-muted {
  border-color: var(--border);
  background: var(--bg-surface);
  color: var(--text-muted);
}

.achievement-reward-list {
  margin-top: 0.52rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.achievement-reward-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.14rem 0.44rem 0.14rem 0.18rem;
  background: var(--bg-surface);
}

.achievement-reward-chip-button {
  appearance: none;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.14s ease, background-color 0.14s ease, transform 0.14s ease;
}

.achievement-reward-chip-button:hover {
  border-color: var(--border-2);
  background: var(--bg-surface-2);
  transform: translateY(-1px);
}

.achievement-reward-chip-button:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
}

.achievement-reward-mark {
  position: relative;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 999px;
  border: 1px solid var(--border-2);
  background: var(--reward-mark-bg);
  flex: 0 0 auto;
}

.achievement-reward-mark::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0.21rem;
  width: 0.5rem;
  height: 0.4rem;
  transform: translateX(-50%);
  border: 1.4px solid var(--mark-icon);
  border-radius: 0.08rem;
}

.achievement-reward-mark::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 0.23rem;
  width: 0.42rem;
  height: 0.12rem;
  transform: translateX(-50%);
  border-radius: 999px;
  background: var(--mark-icon);
}

.achievement-reward-text {
  font-size: 0.74rem;
  color: var(--text-body);
  line-height: 1.2;
}

.activity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.58rem;
}

.activity-card {
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  appearance: none;
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  background: var(--bg-surface);
  padding: 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.activity-card.is-previewable {
  cursor: zoom-in;
}

.activity-thumb,
.activity-thumb.placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 0.55rem;
  border: 1px solid var(--border);
  object-fit: cover;
  background: var(--bg-surface-2);
}

.activity-thumb.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  padding: 0.2rem;
}

.activity-thumb.is-clickable {
  cursor: zoom-in;
}

.activity-name {
  margin: 0.2rem 0 0;
  font-size: 0.87rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-detail-page {
  display: grid;
  gap: 0.5rem;
}

.activity-detail-top-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 0.5rem;
  align-items: start;
}

.activity-detail-banner-column {
  min-width: 0;
}

.activity-detail-banner,
.activity-detail-banner.placeholder {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 0.65rem;
  border: 1px solid var(--border);
  object-fit: cover;
  background: var(--bg-surface-2);
}

.activity-detail-banner.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  padding: 0.4rem;
}

.activity-detail-name {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.18;
  color: var(--text-primary);
}

.activity-detail-type {
  margin: 0.34rem 0 0;
  font-size: 0.88rem;
  color: var(--text-subtle);
}

.activity-detail-stats-grid {
  margin-top: 0.72rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.42rem 0.6rem;
}

.activity-detail-stat-cell {
  border: 1px solid var(--border);
  border-radius: 0.55rem;
  background: var(--bg-surface);
  padding: 0.38rem 0.46rem;
}

.activity-detail-stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.2;
}

.activity-detail-stat-value {
  margin-top: 0.12rem;
  font-size: 0.82rem;
  color: var(--text-primary);
  font-weight: 600;
  line-height: 1.25;
}

.activity-detail-banner-meta {
  margin: 0.72rem 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.activity-item-group+.activity-item-group {
  margin-top: 0.82rem;
}

.activity-item-group-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
}

.activity-item-chip-list {
  margin-top: 0.38rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.34rem;
}

.activity-item-chip {
  appearance: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-surface);
  color: var(--text-body);
  padding: 0.12rem 0.42rem;
  font-size: 0.74rem;
  line-height: 1.22;
  cursor: pointer;
  transition: border-color 0.14s ease, background-color 0.14s ease, transform 0.14s ease;
}

.activity-item-chip:hover {
  border-color: var(--border-2);
  background: var(--bg-surface-2);
  transform: translateY(-1px);
}

.activity-item-chip:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
}

.activity-table-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.48rem;
}

.activity-table-card {
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  background: var(--bg-surface);
  padding: 0.55rem 0.62rem;
}

.activity-table-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
}

.activity-table-card-title {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.24;
  color: var(--text-primary);
}

.activity-table-scope {
  display: inline-flex;
  align-items: center;
  min-height: 1.1rem;
  border-radius: 999px;
  padding: 0.05rem 0.34rem;
  border: 1px solid var(--border);
  background: var(--bg-surface-2);
  color: var(--text-body);
  font-size: 0.67rem;
  line-height: 1.2;
}

.activity-table-scope.derived {
  border-color: var(--border-blue);
  background: var(--bg-blue-tint);
  color: var(--text-blue);
}

.activity-table-card-meta {
  margin: 0.28rem 0 0;
  font-size: 0.74rem;
  color: var(--text-subtle);
  line-height: 1.28;
}

.activity-table-keys {
  margin-top: 0.36rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.24rem;
}

.activity-table-key {
  display: inline-flex;
  align-items: center;
  min-height: 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  padding: 0.03rem 0.32rem;
  font-size: 0.65rem;
  color: var(--text-muted);
  line-height: 1.15;
}

.activity-table-preview {
  margin: 0.44rem 0 0;
  border: 1px solid var(--border);
  border-radius: 0.45rem;
  background: var(--bg-surface-2);
  padding: 0.34rem 0.42rem;
  font-size: 0.7rem;
  color: var(--text-secondary);
  line-height: 1.35;
  max-height: 9.5rem;
  overflow: auto;
}

.sidebar-meta {
  min-width: 0;
  gap: 0.5rem;
}

.sidebar-search {
  position: relative;
}

.sidebar-search-input {
  width: 100%;
}

.sidebar-search-input::placeholder {
  color: var(--text-muted);
}

.sidebar-search-results {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  z-index: 25;
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  background: var(--bg-surface);
  box-shadow: 0 0.7rem 1.3rem var(--shadow);
  max-height: 17.5rem;
  overflow: auto;
}

.sidebar-search-message {
  padding: 0.55rem 0.62rem;
  font-size: 0.78rem;
  line-height: 1.35;
}

.sidebar-search-loading {
  color: var(--text-body);
}

.sidebar-search-empty {
  color: var(--text-muted);
}

.sidebar-search-result-list {
  display: flex;
  flex-direction: column;
}

.sidebar-search-result {
  appearance: none;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--border-3);
  background: var(--bg-surface);
  color: inherit;
  text-align: left;
  padding: 0.42rem 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.46rem;
  cursor: pointer;
}

.sidebar-search-result:last-child {
  border-bottom: 0;
}

.sidebar-search-result:hover {
  background: var(--bg-surface-2);
}

.sidebar-search-thumb,
.sidebar-search-thumb.placeholder {
  width: 2rem;
  height: 2rem;
  border-radius: 0.45rem;
  border: 1px solid var(--border);
  object-fit: cover;
  flex: 0 0 auto;
}

.sidebar-search-thumb.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface-2);
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.15;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-align: center;
  padding: 0.14rem;
}

.sidebar-search-result-body {
  min-width: 0;
  flex: 1 1 auto;
}

.sidebar-search-result-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-search-result-meta {
  margin-top: 0.06rem;
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.2;
}

.sidebar-language {
  flex: 1 1 auto;
  width: clamp(5.5rem, 52%, 8.5rem);
  /* Never shrink below the toggle's own content, so the caret can't clip out. */
  min-width: fit-content;
  max-width: 8.5rem;
}

.sidebar-meta-right {
  /* Yield space (the game version ellipsizes) so the language toggle stays intact. */
  min-width: 0;
  flex: 0 1 auto;
}

#gameVersion {
  display: inline-block;
  max-width: 9.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.github-link {
  color: var(--text-body);
  flex: 0 0 auto;
  line-height: 1;
}

.nav-list .nav-item {
  border-left: 0;
  border-right: 0;
  border-color: var(--border-3);
  color: var(--text-body);
  font-size: 0.9rem;
}

.nav-list .nav-item:first-child {
  border-top: 0;
}

.nav-list .nav-item.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  font-weight: 600;
}

.character-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.7rem;
}

.character-filter-btn {
  --btn-padding-y: 0.2rem;
  --btn-padding-x: 0.55rem;
  --btn-font-size: 0.78rem;
}

.character-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.5rem;
}

.character-card {
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  background: var(--bg-surface);
  padding: 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  align-items: center;
  text-align: center;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

:is(.character-card, .item-card),
:is(.character-card, .item-card):hover,
:is(.character-card, .item-card):focus,
:is(.character-card, .item-card):active,
:is(.character-card, .item-card):visited {
  color: inherit;
  text-decoration: none;
}

.character-card-button {
  width: 100%;
  color: inherit;
  cursor: pointer;
  appearance: none;
  border: 1px solid var(--border);
}

.character-avatar {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 0.6rem;
  border: 1px solid var(--border);
  object-fit: cover;
}

.character-avatar.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-align: center;
  line-height: 1.2;
  padding: 0.35rem;
}

.character-name {
  margin: 0;
  width: 100%;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.7rem;
}

.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 0.45rem;
}

.item-card {
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  background: var(--bg-surface);
  padding: 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  align-items: center;
  text-align: center;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.item-card-button {
  width: 100%;
  color: inherit;
  cursor: pointer;
  appearance: none;
  border: 1px solid var(--border);
}

.item-icon {
  width: 76px;
  height: 76px;
  border-radius: 0.6rem;
  border: 1px solid var(--border);
  object-fit: cover;
}

.item-icon.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-surface-2);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-align: center;
  line-height: 1.2;
  padding: 0.3rem;
}

.item-name {
  margin: 0;
  width: 100%;
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-detail-page {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.item-detail-top-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
}

.item-detail-illustration-column {
  min-width: 0;
}

.item-detail-image-wrap {
  width: 100%;
}

.item-detail-info-column .card-body {
  padding: 1.35rem;
}

.item-detail-icon,
.item-detail-icon.placeholder {
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  border-radius: 0.8rem;
  border: 1px solid var(--border);
  object-fit: cover;
  background: var(--bg-surface-2);
}

.item-detail-icon.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-weight: 600;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-align: center;
  line-height: 1.2;
  padding: 0.5rem;
}

.item-detail-heading {
  min-width: 0;
}

.item-detail-name {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
}

.item-detail-description {
  margin: 0.55rem 0 0;
  color: var(--text-body);
  font-size: 1rem;
  line-height: 1.6;
}

.item-detail-original-body {
  padding: 0.85rem;
}

.loading-sprite-original-section {
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
}

.loading-sprite-original-section .item-detail-original-body {
  display: flex;
  justify-content: center;
}

.loading-sprite-original-section .item-detail-original-image,
.loading-sprite-original-section .item-detail-original-image.placeholder {
  width: auto;
}

.item-detail-original-image,
.item-detail-original-image.placeholder {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  object-fit: contain;
  background: var(--bg-surface-2);
}

.item-detail-original-image.placeholder {
  min-height: 18rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-weight: 600;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-align: center;
  line-height: 1.2;
  padding: 0.6rem;
}

.item-detail-audio-section {
  display: block;
}

.item-detail-audio-player {
  display: block;
  width: 100%;
}

.item-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem 1rem;
}

.item-detail-field {
  min-width: 0;
}

.item-detail-label {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.item-detail-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
  word-break: break-word;
}

.empty-result {
  padding: 0.25rem 0;
  color: var(--text-muted);
  text-align: left;
  font-size: 0.88rem;
}

.character-detail-page {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.detail-header .card-body {
  padding: 0.9rem;
}

.detail-section .card-body {
  padding: 1.5rem;
}

.detail-section-title {
  margin: 0 0 0.6rem;
  font-weight: 600;
}

.detail-avatar,
.detail-avatar.placeholder {
  width: 128px;
  height: 128px;
  border-radius: 0.7rem;
  border: 1px solid var(--border);
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-surface-2);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-align: center;
  line-height: 1.2;
  padding: 0.35rem;
}

.detail-meta-grid {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 0.35rem 0.65rem;
}

.detail-meta-label {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.detail-meta-value {
  font-size: 0.86rem;
  word-break: break-word;
}

.detail-asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.5rem;
}

.detail-asset-tile {
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  background: var(--bg-surface);
  padding: 0.45rem;
}

.detail-asset-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.detail-asset-image,
.detail-asset-image.placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 0.55rem;
  border: 1px solid var(--border);
  object-fit: cover;
  background: var(--bg-surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-align: center;
  line-height: 1.2;
  padding: 0.3rem;
}

.detail-asset-empty {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.detail-material-stages {
  display: grid;
  gap: 0.45rem;
}

.detail-material-stage {
  border: 1px solid var(--border);
  border-radius: 0.55rem;
  padding: 0.45rem 0.55rem;
  background: var(--bg-surface);
}

.detail-material-stage-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-subtle);
  margin-bottom: 0.25rem;
}

.detail-table-wrap {
  max-height: 20rem;
  overflow: auto;
  border-radius: 0.45rem;
}

.detail-table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--bg-surface-2);
}

.detail-table-compact {
  font-size: 0.78rem;
}

.detail-preline {
  white-space: pre-line;
}

.detail-top-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(340px, 1fr);
  gap: 0.75rem;
  align-items: start;
}

.detail-illustration-column {
  min-width: 0;
}

.detail-info-column {
  min-width: 0;
}

.detail-profile-section .detail-section-title {
  font-size: 1.32rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-top: 1.45rem;
  margin-bottom: 1.15rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.detail-character-name {
  font-size: 3rem;
  font-weight: 700;
  line-height: 1.2;
}

.detail-character-description {
  color: var(--text-body);
  font-size: 1.03rem;
  line-height: 1.6;
  margin-bottom: 1.35rem;
}

.detail-profile-title,
.detail-skins-title,
.detail-stamps-title,
.detail-contract-title {
  font-size: 1.3rem;
  margin-top: 1.45rem;
  margin-bottom: 1.05rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.detail-profile-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem 1rem;
}

.detail-profile-item {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.detail-profile-label {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.detail-profile-value {
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
  word-break: break-word;
}

.detail-contract-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 64px);
  gap: 0.55rem 0.7rem;
  justify-content: start;
  align-items: start;
}

.detail-contract-item {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  width: 64px;
  display: block;
  color: inherit;
  cursor: pointer;
}

.detail-contract-item:disabled {
  cursor: default;
}

.detail-contract-thumb-wrap {
  display: block;
  position: relative;
  border: 1px solid var(--border);
  border-radius: 0.55rem;
  overflow: hidden;
  background: var(--bg-surface-2);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.detail-contract-item:focus-visible .detail-contract-thumb-wrap {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
}

.detail-contract-icon,
.detail-contract-icon.placeholder {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 0;
  border-radius: 0;
  object-fit: contain;
  background: var(--bg-surface-2);
}

.detail-contract-icon.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-align: center;
  line-height: 1.2;
  padding: 0.22rem;
}

.detail-contract-count-badge {
  position: absolute;
  top: 0.18rem;
  right: 0.18rem;
  padding: 0.03rem 0.3rem;
  border-radius: 999px;
  border: 1px solid var(--badge-overlay-border);
  background: var(--badge-overlay-bg);
  color: var(--badge-overlay-color);
  font-size: 0.64rem;
  font-weight: 600;
  line-height: 1.2;
}

.detail-contract-name {
  width: 100%;
  margin: 0.32rem 0 0;
  font-size: 0.66rem;
  font-weight: 600;
  line-height: 1.22;
  color: var(--text-secondary);
  display: -webkit-box;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-align: center;
}

.detail-full-image,
.detail-full-image.placeholder {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
}

.detail-full-image-wrap {
  width: 100%;
  position: relative;
}

.detail-live2d-controls {
  margin-top: 0.5rem;
}

.detail-live2d-toggle {
  min-width: 8.5rem;
}

.detail-spine-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  margin-top: 0.5rem;
}

.detail-spine {
  width: 100%;
}

.detail-spine-host {
  display: none;
}

.detail-spine-host-active {
  display: block;
  aspect-ratio: 3 / 4;
  min-height: 24rem;
  width: 100%;
}

.detail-spine-host canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

@keyframes spine-viewer-spin {
  to { transform: rotate(360deg); }
}

.spine-viewer-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.spine-viewer-canvas-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-height: 0;
}

.spine-viewer-loading {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111;
}

.spine-viewer-loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111;
  pointer-events: none;
}

.spine-viewer-loading-overlay.spine-viewer-error {
  flex-direction: column;
  padding: 16px;
  pointer-events: auto;
}

.spine-viewer-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #2a2a2a;
  border-top-color: #888;
  border-radius: 50%;
  animation: spine-viewer-spin 0.75s linear infinite;
}

.spine-viewer-controls {
  display: flex;
  flex-direction: column;
  background: #111;
  border-top: 1px solid #2a2a2a;
  flex-shrink: 0;
}

.spine-viewer-timeline {
  position: relative;
  height: 6px;
  background: #2a2a2a;
  cursor: pointer;
}

.spine-viewer-timeline-fill {
  height: 100%;
  width: 0%;
  background: #666;
  pointer-events: none;
}

.spine-viewer-controls-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
}

.spine-viewer-fullscreen-button {
  margin-left: auto;
}

.spine-viewer-button {
  background: #2a2a2a;
  color: #d0d0d0;
  border: none;
  border-radius: 6px;
  padding: 0 10px;
  height: 28px;
  box-sizing: border-box;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}

.spine-viewer-button:hover { background: #3a3a3a; }
.spine-viewer-button:active { background: #1a1a1a; }
.spine-viewer-button-active { background: #3a3a3a; }

.spine-viewer-animation-select {
  background: #2a2a2a;
  color: #d0d0d0;
  border: 1px solid #3a3a3a;
  border-radius: 6px;
  padding: 0 10px;
  height: 28px;
  box-sizing: border-box;
  font-size: 14px;
  cursor: pointer;
}

.spine-viewer-animation-select:focus {
  outline: none;
  border-color: #555;
}

.spine-viewer-error-title {
  color: #f66;
  margin-bottom: 8px;
}

.spine-viewer-error-detail {
  color: #c44;
  font-size: 11px;
  white-space: pre-wrap;
  max-width: 280px;
}

.detail-full-image.placeholder {
  min-height: 24rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface-2);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-align: center;
  line-height: 1.25;
  padding: 0.8rem;
}

.detail-skin-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
}

.detail-skin-card {
  appearance: none;
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  background: var(--bg-surface);
  padding: 0.38rem;
  text-align: center;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.14s ease, box-shadow 0.14s ease, transform 0.14s ease;
}

.detail-skin-card:hover {
  border-color: var(--border-2);
  box-shadow: 0 0.35rem 0.85rem var(--shadow);
  transform: translateY(-1px);
}

.detail-skin-card.active,
.detail-skin-radio:checked + .detail-skin-card {
  border-color: var(--text-muted);
  background: var(--bg-surface-2);
}

/* The skin radios drive the CSS-only selector; keep them off-canvas but still
   focusable for keyboard navigation (the visible state is the highlighted card). */
.detail-skin-radio {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.detail-skin-radio:focus-visible + .detail-skin-card {
  outline: 2px solid var(--text-muted);
  outline-offset: 2px;
}

.detail-skin-hero-frame {
  display: none;
}

.detail-skin-hero-frame-spine-active .detail-skin-static {
  display: none;
}

.detail-skin-desc-stack .detail-skin-description {
  display: none;
}

.detail-skin-thumb,
.detail-skin-thumb.placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  object-fit: cover;
  background: var(--bg-surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-align: center;
  line-height: 1.2;
  padding: 0.25rem;
}

.detail-skin-thumb-wrap {
  position: relative;
  display: block;
  line-height: 0;
}

.detail-skin-name {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.76rem;
  font-weight: 500;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.detail-skin-description {
  margin: 0.75rem 0 0;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  background: var(--bg-surface-2);
  color: var(--text-body);
  font-size: 0.92rem;
  line-height: 1.5;
}

.detail-skin-tag {
  position: absolute;
  top: 0.32rem;
  right: 0.32rem;
  padding: 0.14rem 0.42rem;
  border-radius: 999px;
  border: 1px solid var(--border-2);
  background: light-dark(rgba(248, 250, 252, 0.92), rgba(15, 23, 42, 0.92));
  color: var(--text-body);
  font-size: 0.64rem;
  line-height: 1.2;
  font-weight: 600;
  pointer-events: none;
}

.detail-stamp-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.5rem;
}

.detail-stamp-image,
.detail-stamp-image.placeholder {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 0.45rem;
  border: 1px solid var(--border);
  object-fit: contain;
  background: var(--bg-surface-2);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.detail-stamp-image.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-align: center;
  line-height: 1.2;
  padding: 0.2rem;
}

.detail-voice-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 0.6rem;
}

.detail-voice-subtitle {
  margin-top: 1.15rem;
  margin-bottom: 0.75rem;
  font-size: 1.03rem;
  font-weight: 500;
  color: var(--text-primary);
}

.detail-voice-empty {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.84rem;
}

.detail-voice-item {
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  background: var(--bg-surface);
  padding: 0.7rem 0.8rem;
}

.detail-voice-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
}

.detail-voice-title-wrap {
  min-width: 0;
}

.detail-voice-title {
  margin: 0;
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text-primary);
}

.detail-audio-play-btn {
  min-width: 4.25rem;
}

.detail-voice-words {
  margin: 0.32rem 0 0;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--text-body);
}

.detail-voice-volume {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.detail-voice-volume-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
  margin: 0;
}

.detail-voice-volume-slider {
  flex: 1;
  max-width: 180px;
  accent-color: var(--app-secondary);
}

.detail-content-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.detail-content-switch-panel {
  margin-top: 0.8rem;
}


.cv-story-tabbed {
  position: relative;
}

.cv-story-tab-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.detail-story-item {
  cursor: pointer;
}

.detail-story-panel {
  display: none;
}

.detail-story-layout {
  display: grid;
  grid-template-columns: minmax(220px, 270px) minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
}

.detail-story-list {
  max-height: 32rem;
  overflow: auto;
  border-radius: 0.55rem;
}

.detail-story-item {
  font-size: 0.84rem;
  line-height: 1.35;
}

.detail-story-view {
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  background: var(--bg-surface);
  padding: 0.85rem 0.95rem;
  min-height: 10rem;
}

.detail-story-title {
  margin: 0 0 0.45rem;
  font-size: 1.04rem;
  font-weight: 600;
  color: var(--text-primary);
}

.detail-story-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.detail-story-locktips {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.detail-story-inline {
  margin: 0.62rem 0 0;
  color: var(--text-body);
  font-size: 0.88rem;
  line-height: 1.55;
}

.detail-story-subtitle {
  margin: 0.9rem 0 0.55rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
}

.detail-story-empty {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.84rem;
}

.detail-story-endings {
  display: grid;
  gap: 0.45rem;
}

.detail-story-ending {
  border: 1px solid var(--border);
  border-radius: 0.52rem;
  padding: 0.5rem 0.6rem;
}

.detail-story-ending-title {
  font-size: 0.83rem;
  color: var(--text-primary);
  font-weight: 600;
}

.detail-story-ending-reward {
  margin-top: 0.26rem;
  font-size: 0.79rem;
  color: var(--text-subtle);
}

.detail-story-ending-reward-list {
  margin-top: 0.3rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.34rem;
}

.detail-story-reward-chip {
  appearance: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-surface);
  color: var(--text-body);
  padding: 0.12rem 0.44rem;
  font-size: 0.74rem;
  line-height: 1.2;
  cursor: pointer;
  transition: border-color 0.14s ease, background-color 0.14s ease, transform 0.14s ease;
}

.detail-story-reward-chip:disabled {
  cursor: default;
}

.detail-story-reward-chip:hover {
  border-color: var(--border-2);
  background: var(--bg-surface-2);
  transform: translateY(-1px);
}

.detail-story-reward-chip:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
}

.detail-story-summary {
  margin: 0 0 0.6rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.detail-story-script {
  display: grid;
  gap: 0.52rem;
}

.detail-story-line {
  border: 1px solid var(--border);
  border-radius: 0.55rem;
  padding: 0.58rem 0.65rem;
  background: var(--bg-surface);
}

.detail-story-line-top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.detail-story-line-id,
.detail-story-line-spot {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.08rem 0.42rem;
  background: var(--bg-surface-2);
}

.detail-story-speaker {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
}

.detail-story-text {
  margin: 0.32rem 0 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-body);
}

.detail-story-options {
  display: grid;
  gap: 0.3rem;
  margin-top: 0.48rem;
}

.detail-story-option {
  font-size: 0.79rem;
  color: var(--text-secondary);
  border-left: 2px solid var(--border-2);
  padding-left: 0.45rem;
}

.detail-story-condition {
  margin-top: 0.46rem;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.catchat-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.7rem;
}

.catchat-scenario {
  display: grid;
  gap: 1rem;
}

.catchat-thread-list {
  display: grid;
  gap: 1rem;
}

.catchat-entry {
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  background: var(--bg-surface);
  padding: 0.65rem 0.72rem;
  display: grid;
  gap: 0.32rem;
}

.catchat-entry.is-private {
  border-color: var(--border-blue);
  background: light-dark(#f8fbff, #0f1f35);
}

.catchat-entry.is-reply {
  border-radius: 0.6rem;
}

.catchat-system-entry {
  border: 0;
  background: transparent;
  padding: 0.1rem 0.2rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.35;
  text-align: center;
}

.catchat-system-entry.is-reply {
  text-align: left;
}

.catchat-entry-header {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 0.5rem;
  align-items: start;
}

.catchat-entry-avatar,
.catchat-entry-avatar.placeholder {
  width: 44px;
  height: 44px;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  object-fit: cover;
  background: var(--bg-surface-2);
}

.catchat-entry-avatar.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.66rem;
  font-weight: 600;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.15;
  padding: 0.16rem;
}

.catchat-entry-author {
  margin: 0;
  font-size: 0.89rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.25;
}

.catchat-entry-meta {
  margin-top: 0.18rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.26rem;
}

.catchat-entry-badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.12rem;
  padding: 0.05rem 0.38rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-surface-2);
  color: var(--text-subtle);
  font-size: 0.66rem;
  line-height: 1.2;
}

.catchat-entry-badge.choice {
  border-color: var(--border-blue);
  background: var(--bg-blue-tint);
  color: var(--text-blue);
}

.catchat-entry-badge.private {
  border-color: var(--border-blue);
  background: var(--bg-blue-tint);
  color: var(--text-blue);
}

.catchat-entry-text {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.55;
}

.catchat-reply-mention {
  color: var(--text-blue);
  font-weight: 500;
}

.catchat-entry-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.38rem;
}

.catchat-entry-image,
.catchat-entry-image.placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 0.55rem;
  border: 1px solid var(--border);
  object-fit: cover;
  background: var(--bg-surface-2);
}

.catchat-entry-image.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 600;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.15;
  padding: 0.2rem;
}

.catchat-entry-image.is-clickable {
  cursor: zoom-in;
}

.catchat-unlock {
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-surface-2);
  padding: 0.15rem 0.45rem 0.15rem 0.18rem;
}

.catchat-unlock-icon,
.catchat-unlock-icon.placeholder {
  width: 20px;
  height: 20px;
  border-radius: 0.35rem;
  border: 1px solid var(--border-3);
  object-fit: cover;
  background: var(--bg-surface);
}

.catchat-unlock-icon.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.58rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.1;
  padding: 0.08rem;
}

.catchat-unlock-text {
  font-size: 0.7rem;
  color: var(--text-subtle);
  line-height: 1.2;
}

.catchat-entry-children {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.5rem;
  padding-left: 0.85rem;
  border-left: 1px solid var(--border);
}

.catchat-lightbox,
.activity-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1060;
  background: var(--lightbox-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.catchat-lightbox-image,
.activity-lightbox-image {
  max-width: min(96vw, 1200px);
  max-height: 90vh;
  border-radius: 0.7rem;
  border: 1px solid var(--lightbox-border);
  background: var(--lightbox-img-bg);
  object-fit: contain;
}

.catchat-lightbox-close,
.activity-lightbox-close {
  position: fixed;
  top: 0.9rem;
  right: 1rem;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--lightbox-close-border);
  border-radius: 999px;
  background: var(--lightbox-close-bg);
  color: var(--lightbox-close-color);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.bi {
  width: 1em;
  height: 1em;
  vertical-align: -.125em;
  fill: currentcolor;
}

[data-theme="dark"] .btn-outline-secondary {
  --btn-color: #adb5bd;
  --btn-border-color: #565e67;
  --btn-hover-color: #e9ecef;
  --btn-hover-bg: #3d4349;
  --btn-hover-border-color: #6c757d;
  --btn-active-color: #e9ecef;
  --btn-active-bg: #3d4349;
  --btn-active-border-color: #6c757d;
  --btn-disabled-color: #6c757d;
  --btn-disabled-border-color: #3d4349;
}

@media (max-width: 575.98px) {
  #viewRoot.home-view-root {
    min-height: calc(100dvh - 8rem);
  }

  .achievement-entry-grid {
    grid-template-columns: 1fr;
  }

  .activity-grid {
    grid-template-columns: 1fr;
  }

  .activity-table-grid {
    grid-template-columns: 1fr;
  }

  .activity-detail-name {
    font-size: 1.45rem;
  }

  .activity-detail-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .catchat-entry-images {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .character-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .item-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .item-detail-top-layout {
    grid-template-columns: 1fr;
  }

  .item-detail-name {
    font-size: 1.6rem;
  }

  .item-detail-original-image.placeholder {
    min-height: 12rem;
  }

  .item-detail-grid {
    grid-template-columns: 1fr;
  }

  .detail-voice-list {
    grid-template-columns: 1fr;
  }

  .detail-meta-grid {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .detail-profile-grid {
    grid-template-columns: 1fr;
  }

  .detail-skin-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-stamp-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .detail-story-layout {
    grid-template-columns: 1fr;
  }

  .detail-story-list {
    max-height: 14rem;
  }

  .detail-spine-host-active {
    min-height: 18rem;
  }
}

@media (max-width: 991.98px) {
  .detail-top-layout {
    grid-template-columns: 1fr;
  }

  .activity-detail-top-layout {
    grid-template-columns: 1fr;
  }

  .item-detail-top-layout {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 576px) and (max-width: 991.98px) {
  .item-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-profile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-skin-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .detail-stamp-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}
/* CSS-only Voices/Story tabs on the character detail page (radio + :checked,
   no JavaScript). The two radio inputs precede the tablist and panels as
   siblings so `:checked ~` can drive both the active label and the visible
   panel. */
.cv-tab-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.cv-tablist {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--app-border-color);
  margin-bottom: 1rem;
}

.cv-tab-label {
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  color: var(--app-secondary-color);
  user-select: none;
}

#cv-voices:checked ~ .cv-tablist .cv-tab-label-voices,
#cv-story:checked ~ .cv-tablist .cv-tab-label-story {
  color: inherit;
  font-weight: 600;
  border-bottom-color: currentColor;
}

.cv-panel {
  display: none;
}

#cv-voices:checked ~ .cv-panel-voices,
#cv-story:checked ~ .cv-panel-story {
  display: block;
}

.cv-subtitle {
  margin: 1.1rem 0 0.6rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
}

.cv-voice-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
  gap: 0.6rem;
  margin: 0;
}

.cv-voice {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--app-border-color);
  border-radius: 0.6rem;
  background: var(--app-body-bg);
}

.cv-voice-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
}

.cv-voice-text {
  min-width: 0;
}

.cv-voice-words {
  color: var(--app-secondary-color);
  font-size: 0.9rem;
}

.cv-volume {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.cv-volume-label {
  color: var(--app-secondary-color);
  font-size: 0.85rem;
  margin: 0;
}

.cv-volume-slider {
  flex: 0 1 11rem;
  max-width: 100%;
  /* Grey track/thumb to match the original, not the blue default. */
  accent-color: var(--app-secondary);
}

/* Text "Play"/"Pause" button: grey outline at rest, solid grey while playing. */
.cv-voice-play {
  flex: 0 0 auto;
  min-width: 4.25rem;
}

.cv-story-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0;
}

.cv-story {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cv-story-name {
  font-weight: 500;
}
