:root {
  font-family: var(--site-font);
  line-height: 1.6;
  color: var(--site-text);
  background: var(--site-bg);
  --surface: var(--site-surface);
  --muted: var(--site-muted);
  --line: var(--site-line);
  --accent: var(--site-accent);
  --soft: var(--site-soft);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  -webkit-font-smoothing: antialiased;
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}
select {
  -webkit-appearance: none;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 14px) 50%,
    calc(100% - 10px) 50%;
  background-size: 4px 4px;
  background-repeat: no-repeat;
}
button,
summary {
  cursor: pointer;
}
a {
  color: inherit;
  text-underline-offset: 3px;
}
button:disabled {
  opacity: 1;
  cursor: default;
  color: var(--site-disabled-text);
  background: var(--site-disabled-bg);
  border-color: var(--line);
}
[hidden] {
  display: none !important;
}
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.library-shell {
  display: grid;
  grid-template-columns: 196px minmax(0, 1fr);
  min-height: 100vh;
  max-width: 1800px;
  margin: auto;
}
.library-sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  padding: 24px 14px 18px;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--soft) 40%, var(--site-bg));
  display: flex;
  flex-direction: column;
  overflow: auto;
}
.library-sidebar header {
  display: contents;
}
.library-sidebar header > div {
  padding: 0 10px;
}
.library-sidebar h1 {
  font-size: 1rem;
  font-weight: 650;
  margin: 20px 0 4px;
  letter-spacing: -0.03em;
}
.library-sidebar h1 a {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.library-sidebar h1 img {
  width: 25px;
  height: 25px;
}
.intro {
  font-size: 0.75rem;
  margin: 5px 0 24px;
  color: var(--muted);
}
.install-button {
  order: 5;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 8px 10px;
  min-height: 36px;
  font-size: 0.75rem;
  background: transparent;
  text-align: left;
  margin: 16px 8px 0;
}
.install-button:hover:not(:disabled) {
  background: var(--soft);
}
#summary {
  order: 4;
  margin: auto 10px 0;
  padding-top: 30px;
  font-size: 0.75rem;
  line-height: 1.9;
  color: var(--muted);
}
.tabs {
  display: grid;
  gap: 3px;
}
.tab {
  display: flex;
  align-items: center;
  text-align: left;
  justify-content: space-between;
  border: 0;
  border-radius: 5px;
  padding: 10px 12px;
  min-height: 44px;
  background: transparent;
  font-size: 0.875rem;
  gap: 8px;
  white-space: nowrap;
}
.tab::before {
  content: "";
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  background: currentColor;
  color: var(--muted);
  mask: var(--tab-icon) center / contain no-repeat;
  -webkit-mask: var(--tab-icon) center / contain no-repeat;
}
.tab[data-kind="wallpaper"] {
  --tab-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%223%22%20y%3D%224%22%20width%3D%2218%22%20height%3D%2216%22%20rx%3D%222%22/%3E%3Ccircle%20cx%3D%229%22%20cy%3D%229%22%20r%3D%221.5%22/%3E%3Cpath%20d%3D%22m4%2017%205-5%204%204%203-3%204%204%22/%3E%3C/svg%3E");
}
.tab[data-kind="avatar"] {
  --tab-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%229%22/%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%229%22%20r%3D%223%22/%3E%3Cpath%20d%3D%22M5%2018a8%208%200%200%201%2014%200%22/%3E%3C/svg%3E");
}
.tab[data-kind="icon"] {
  --tab-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%223%22%20y%3D%223%22%20width%3D%227%22%20height%3D%227%22%20rx%3D%221.5%22/%3E%3Crect%20x%3D%2214%22%20y%3D%223%22%20width%3D%227%22%20height%3D%227%22%20rx%3D%221.5%22/%3E%3Crect%20x%3D%223%22%20y%3D%2214%22%20width%3D%227%22%20height%3D%227%22%20rx%3D%221.5%22/%3E%3Crect%20x%3D%2214%22%20y%3D%2214%22%20width%3D%227%22%20height%3D%227%22%20rx%3D%221.5%22/%3E%3C/svg%3E");
}
.tab[data-kind="bank-card"] {
  --tab-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%223%22%20y%3D%225%22%20width%3D%2218%22%20height%3D%2214%22%20rx%3D%222%22/%3E%3Cpath%20d%3D%22M3%2010h18M7%2015h4%22/%3E%3C/svg%3E");
}
.tab[data-kind="game-cover"] {
  --tab-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%225%22%20y%3D%223%22%20width%3D%2214%22%20height%3D%2218%22%20rx%3D%222%22/%3E%3Cpath%20d%3D%22M8%203v18M11%208h5M11%2012h5%22/%3E%3C/svg%3E");
}
.tab[data-kind="other"],
.tab[data-kind="actress"] {
  --tab-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%3E%3Crect%20x%3D%224%22%20y%3D%224%22%20width%3D%2216%22%20height%3D%2216%22%20rx%3D%223%22/%3E%3Cpath%20d%3D%22M8%2012h8M12%208v8%22/%3E%3C/svg%3E");
}
.tab span {
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  margin-left: auto;
}
.tab[aria-pressed="true"] {
  background: var(--site-selected);
  font-weight: 650;
  color: var(--accent);
  box-shadow: inset 3px 0 var(--accent);
}
.tab[aria-pressed="true"]::before {
  color: var(--accent);
}
.tab:hover:not([aria-pressed="true"]) {
  background: var(--soft);
}
.library-content {
  padding: 0 32px 20px;
  min-width: 0;
}
.search-row {
  height: 76px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--site-bg);
  border-bottom: 1px solid var(--line);
  gap: 12px;
  margin-bottom: 28px;
}
.search-icon {
  width: 17px;
  height: 17px;
  stroke: var(--muted);
  stroke-width: 1.5;
  fill: none;
  flex-shrink: 0;
}
.search-row input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  outline: 0;
  padding: 10px 0;
  font-size: 1rem;
  height: 44px;
}
.search-row:focus-within {
  border-color: var(--accent);
  box-shadow: 0 2px 0 var(--accent);
}
.search-row kbd {
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--muted);
  width: 22px;
  height: 22px;
  border: 1px solid var(--line);
  text-align: center;
  border-radius: 4px;
}
.collection-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
#appearance {
  flex: 0 0 auto;
  min-height: 44px;
  max-width: 120px;
  padding: 7px 28px 7px 10px;
  font-size: 0.8125rem;
  color: var(--site-text);
  background-color: var(--surface);
  border: 1px solid var(--site-line-strong);
  border-radius: 5px;
  cursor: pointer;
}
#appearance:hover { border-color: var(--accent); }
.collection-heading h2 {
  font-size: 1.625rem;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.4;
  margin: 0;
}
.collection-heading .secondary-button {
  font-size: 0.75rem;
  min-height: 30px;
  background: transparent;
}
.browse-toolbar {
  display: flex;
  align-items: start;
  gap: 12px;
  position: relative;
  flex-wrap: wrap;
  min-height: 36px;
}
.device-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.device-filter label {
  display: none;
}
.field.device-filter select {
  min-width: 128px;
  width: auto;
  min-height: 34px;
  font-size: 0.875rem;
  padding: 5px 26px 5px 10px;
  background-color: var(--surface);
  border: 1px solid var(--site-line-strong);
}
.filter-panel {
  flex: 1;
  min-width: 0;
}
.filter-panel > summary {
  display: flex;
  align-items: center;
  min-height: 34px;
  gap: 14px;
  list-style: none;
  font-size: 0.875rem;
  color: var(--muted);
  border: 1px solid var(--site-line-strong);
  padding: 5px 10px;
  border-radius: 5px;
  width: fit-content;
  max-width: 100%;
  background: var(--surface);
}
.filter-panel > summary > span:first-child {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  color: var(--site-text);
}
.filter-panel summary svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}
.filter-panel > summary::after {
  content: "⌄";
  font-size: 0.875rem;
}
.filter-panel[open] > summary {
  border-color: var(--accent);
}
.filter-panel[open] > summary::after {
  content: "⌃";
}
summary::-webkit-details-marker {
  display: none;
}
#filter-summary {
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}
#filter-summary:empty {
  display: none;
}
.filter-actions {
  display: flex;
  align-items: end;
  justify-content: end;
  grid-column: 1/-1;
}
.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  padding: 16px;
  background: var(--soft);
  border-radius: 6px;
  margin-top: 10px;
}
.field {
  min-width: 0;
}
.field label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 6px;
}
.field select {
  max-width: 100%;
  width: 100%;
  min-height: 36px;
  font-size: 0.875rem;
  border: 1px solid var(--site-line-strong);
  border-radius: 5px;
  background-color: var(--surface);
  padding: 7px 28px 7px 9px;
}
.results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  color: var(--muted);
  font-size: 0.75rem;
  margin: 4px 0 15px;
}
.result-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.result-actions button {
  border: 0;
  background: transparent;
  font-size: 0.75rem;
  padding: 8px 0;
  min-height: 32px;
  color: var(--muted);
}
#show-favorites[aria-pressed="true"] {
  color: var(--accent);
  font-weight: 600;
}
#show-favorites::before {
  content: "♡";
  font-size: 0.9375rem;
  margin-right: 5px;
}
#show-favorites[aria-pressed="true"]::before {
  content: "♥";
}
#reset:disabled {
  display: none;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 24px 16px;
  align-items: start;
}
.grid.grouped {
  display: block;
}
.grid[data-device="desktop"] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.grid[data-device="phone"] {
  grid-template-columns: repeat(auto-fill, minmax(130px, 175px));
}
.grid[data-device="icon"] {
  grid-template-columns: repeat(auto-fill, minmax(95px, 1fr));
  gap: 22px 16px;
}
.grid[data-device="bank-card"] {
  grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
}
.grid[data-device="game-cover"] {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}
.compact-gallery .grid[data-device="desktop"] {
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
.compact-gallery .grid[data-device="phone"] {
  grid-template-columns: repeat(auto-fill, minmax(110px, 140px));
}
.compact-gallery .grid[data-device="icon"] {
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
}
.compact-gallery .grid[data-device="bank-card"] {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}
.device-section + .device-section,
.category-section + .category-section {
  margin-top: 30px;
}
.device-heading,
.category-heading,
.region-heading {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 0.9375rem;
  letter-spacing: -0.02em;
  font-weight: 550;
  margin: 0 0 12px;
}
.device-count {
  font-size: 0.75rem;
  letter-spacing: 0;
  color: var(--muted);
  font-weight: 400;
}
.card {
  min-width: 0;
  position: relative;
}
.preview-wrap {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
}
.preview {
  display: grid;
  position: relative;
  width: 100%;
  padding: 0;
  border: 0;
  place-items: center;
  border-radius: 6px;
  background: var(--soft);
  overflow: hidden;
  aspect-ratio: 4/3;
  isolation: isolate;
}
.preview::before,
.loading-grid span::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    transparent 20%,
    #ffffff28 50%,
    transparent 80%
  );
  transform: translateX(-100%);
  animation: shimmer 1.6s infinite;
}
.preview.is-loaded::before,
.preview.has-error::before {
  display: none;
}
.preview img {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.2s;
}
.preview.is-loaded img {
  opacity: 1;
}
.preview:hover img {
  filter: brightness(0.95);
}
.preview.icon {
  background: var(--soft);
  aspect-ratio: 1 !important;
}
.preview.icon img {
  inset: 18%;
  width: 64%;
  height: 64%;
}
.preview.game-cover {
  aspect-ratio: 2/3;
}
.cover-backdrop {
  position: absolute;
  inset: -24px;
  background-position: center;
  background-size: cover;
  filter: blur(20px) brightness(0.55);
  z-index: -1;
}
.favorite-toggle {
  position: absolute;
  right: 6px;
  top: 6px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 5px;
  color: #fff;
  background: #121a25a8;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 1;
}
.favorite-toggle svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}
.favorite-toggle[aria-pressed="true"] {
  opacity: 1;
  color: #ffe1df;
}
.favorite-toggle[aria-pressed="true"] svg {
  fill: currentColor;
}
.preview-wrap:hover .favorite-toggle,
.favorite-toggle:focus-visible {
  opacity: 1;
}
.meta {
  padding: 9px 1px 0;
}
.card h2,
.card h3,
.card h4 {
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.5;
  margin: 0;
  overflow-wrap: anywhere;
}
.card[data-kind="icon"] .meta {
  text-align: center;
}
.card[data-kind="icon"] h3 {
  font-size: 0.875rem;
}
.resolution {
  font-size: 0.75rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  margin: 4px 0 0;
  line-height: 1.5;
}
.asset-info {
  font-size: 0.75rem;
  color: var(--muted);
}
.asset-info summary {
  font-size: 0.75rem;
  list-style: none;
  min-height: 32px;
  padding: 5px 0;
}
.asset-info summary::after {
  content: " ＋";
}
.asset-info[open] summary::after {
  content: " −";
}
.synopsis {
  font-size: 0.875rem;
  line-height: 1.9;
  margin: 0;
  overflow-wrap: anywhere;
}
.source-link {
  font-size: 0.75rem;
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.card-region + .card-region {
  margin-top: 38px;
}
.bank-section + .bank-section {
  margin-top: 24px;
}
.bank-heading {
  font-size: 0.875rem;
  font-weight: 550;
  margin: 0 0 2px;
}
.bank-english {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0 0 12px;
}
.bank-heading + .grid {
  margin-top: 10px;
}
.series-link {
  text-decoration: none;
  font-size: 0.875rem;
}
.series-link::after {
  content: " ↗";
  font-size: 0.875rem;
  color: var(--muted);
}
.series-link:hover {
  text-decoration: underline;
}
.grid.series-strip {
  --cover-width: 165px;
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  overflow-x: auto;
  padding-bottom: 12px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.series-strip > .card {
  width: var(--cover-width);
  scroll-snap-align: start;
}
.series-strip > .card:has(.game-synopsis[open]) {
  width: min(320px, calc(100vw - 48px));
}
.game-work:has(.game-synopsis[open]) {
  grid-column: span 2;
}
.game-work:has(.game-synopsis[open]) > .card {
  width: min(320px, 100%);
}
.card[data-kind="game-cover"]:has(.game-synopsis[open]) {
  display: grid;
  grid-template-columns: 145px minmax(0, 1fr);
  gap: 8px 14px;
}
.card[data-kind="game-cover"]:has(.game-synopsis[open]) > .preview-wrap {
  grid-column: 1;
  grid-row: 1 / 3;
}
.card[data-kind="game-cover"]:has(.game-synopsis[open]) > .meta {
  display: contents;
}
.card[data-kind="game-cover"]:has(.game-synopsis[open]) > .meta > h3,
.card[data-kind="game-cover"]:has(.game-synopsis[open]) > .meta > h4 {
  grid-column: 2;
  align-self: end;
}
.card[data-kind="game-cover"]:has(.game-synopsis[open]) .resolution {
  grid-column: 2;
}
.card[data-kind="game-cover"]:has(.game-synopsis[open]) .game-synopsis {
  grid-column: 1 / -1;
}
.compact-gallery .grid.series-strip {
  --cover-width: 135px;
}
.cover-navigation {
  font-size: 0.875rem;
  color: var(--muted);
  margin: 0 0 16px;
}
.extra-covers {
  font-size: 0.875rem;
  margin-top: 10px;
}
.extra-covers > summary {
  min-height: 32px;
  color: var(--muted);
}
.extra-covers .card + .card {
  margin-top: 16px;
}
.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 7px 12px;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  background: var(--surface);
}
.primary-button {
  background: var(--accent);
  color: var(--site-on-accent);
  border-color: var(--accent);
}
.secondary-button:hover:not(:disabled) {
  background: var(--soft);
}
.empty {
  padding: 75px 24px;
  text-align: center;
  grid-column: 1/-1;
  background: var(--soft);
  border-radius: 6px;
  color: var(--muted);
  font-size: 1rem;
}
.empty button {
  margin-top: 18px;
}
.loading-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  grid-column: 1/-1;
}
.loading-grid span {
  position: relative;
  aspect-ratio: 1.5;
  background: var(--soft);
  border-radius: 6px;
  overflow: hidden;
}
@keyframes shimmer {
  to {
    transform: translateX(100%);
  }
}
#notice {
  font-size: 0.875rem;
  padding: 10px 16px;
  border-radius: 5px;
  background: var(--soft);
  color: var(--muted);
  margin-bottom: 18px;
}
footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  border-top: 1px solid var(--line);
  margin-top: 36px;
  padding: 18px 0;
  color: var(--muted);
  font-size: 0.75rem;
}
footer > div {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-more {
  position: relative;
}
.footer-more summary {
  min-height: 32px;
  align-content: center;
  list-style: none;
}
.footer-more > a {
  position: absolute;
  bottom: 100%;
  right: 0;
  width: 120px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 10px;
}
dialog {
  color: var(--site-text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
  max-height: 90dvh;
  max-width: calc(100vw - 24px);
  overscroll-behavior: contain;
}
dialog::backdrop {
  background: var(--site-overlay);
  backdrop-filter: blur(3px);
}
body:has(dialog[open]) {
  overflow: hidden;
}
.dialog-header {
  position: sticky;
  top: -20px;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  padding: 10px 0;
}
.dialog-header h2 {
  font-size: 1.0625rem;
  font-weight: 550;
  margin: 0;
  line-height: 1.5;
}
.dialog-header p {
  font-size: 0.75rem;
  margin: 4px 0 0;
  color: var(--muted);
}
.close-button {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: var(--soft);
  border: 0;
  border-radius: 5px;
  font-size: 1.5rem;
  flex-shrink: 0;
  line-height: 1;
}
.preview-dialog {
  width: 100vw;
  height: 100dvh;
  max-width: 100vw;
  max-height: 100dvh;
  inset: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  padding: 0 28px 18px;
  background: #111213;
  color: #f0f1f3;
  overflow: auto;
  --surface: #202225;
  --line: #4c5158;
  --soft: #2c3035;
  --muted: #b8bec7;
  --accent: #d4e0f1;
  --site-text: #f0f1f3;
  --site-on-accent: #17202b;
  --site-muted: #b8bec7;
  --site-surface: #202225;
  --site-line-strong: #78838f;
  --site-selected: #27364b;
  --site-hover: #303740;
  --site-disabled-bg: #303439;
  --site-disabled-text: #939ca7;
  color-scheme: dark;
}
.preview-dialog .dialog-header {
  height: 76px;
  background: #111213;
  top: 0;
  padding: 12px 0;
}
.preview-dialog .dialog-header h2 {
  font-size: 0.9375rem;
}
.preview-dialog .dialog-header p {
  font-size: 0.75rem;
}
.preview-toolbar,
.preview-navigation,
.preview-options {
  display: flex;
  align-items: center;
  gap: 8px;
}
.preview-toolbar {
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 16px;
}
.preview-options {
  flex-wrap: wrap;
  justify-content: end;
}
.preview-toolbar .secondary-button {
  font-size: 0.75rem;
  min-height: 32px;
  background: transparent;
}
.preview-navigation button {
  font-size: 1.375rem;
  width: 34px;
  min-height: 32px;
  padding: 0;
}
.preview-navigation span {
  font-size: 0.875rem;
  min-width: 50px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.viewer-body {
  display: flex;
  align-items: stretch;
  min-height: 0;
  gap: 24px;
}
.full-image {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 200px;
  flex: 1;
  min-width: 0;
  height: calc(100dvh - 240px);
  background: #090a0b;
  border-radius: 4px;
  overflow: hidden;
}
.full-image.icon-preview {
  background: #e8ebef;
}
.full-image.icon-preview > .image-error {
  color: #202a36;
}
.image-stage {
  position: relative;
  width: min(100%, calc((100dvh - 240px) * var(--image-ratio, 1)));
  height: auto;
  max-height: 100%;
  aspect-ratio: var(--image-ratio, 1);
  touch-action: pan-y pinch-zoom;
}
.image-stage img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  max-height: calc(100dvh - 240px);
}
.image-stage .preview-placeholder {
  position: absolute;
  inset: 0;
  filter: blur(7px);
  opacity: 0.65;
  pointer-events: none;
}
.icon-preview .image-stage {
  width: min(420px, 50dvh);
}
.image-stage.round-avatar {
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  width: min(100%, calc(100dvh - 240px));
}
.image-stage.round-avatar img {
  object-fit: cover;
}
.image-error {
  color: var(--muted);
  font-size: 0.875rem;
  padding: 16px;
  z-index: 2;
}
.full-image > .image-error {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  margin: 0;
}
.preview-details {
  width: 270px;
  flex-shrink: 0;
  padding: 16px 8px 20px 0;
  overflow: auto;
  max-height: calc(100dvh - 240px);
  background: var(--surface);
}
.preview-details h3 {
  font-size: 0.875rem;
  font-weight: 550;
  margin: 0 0 16px;
}
.preview-details dl {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 10px 12px;
  margin: 0 0 20px;
  font-size: 0.875rem;
}
.preview-details dt {
  color: var(--muted);
}
.preview-details dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.filename {
  font-size: 0.75rem;
  color: var(--muted);
  overflow-wrap: anywhere;
  line-height: 1.9;
  margin: 16px 0;
}
.note {
  font-size: 0.875rem;
  padding: 10px;
  border-radius: 5px;
  background: var(--soft);
  color: var(--muted);
  line-height: 1.9;
}
.lockscreen-clock {
  position: absolute;
  top: 8%;
  left: 0;
  right: 0;
  display: grid;
  text-align: center;
  color: #fff;
  text-shadow: 0 1px 12px #0009;
  pointer-events: none;
}
.lockscreen-clock span:first-child {
  font-size: clamp(10px, 2vw, 18px);
}
.lockscreen-clock span:last-child {
  font-weight: 550;
  font-size: clamp(28px, 6vw, 68px);
  line-height: 1.15;
  letter-spacing: -0.045em;
}
.preview-hint {
  font-size: 0.75rem;
  margin: 8px 0;
  color: var(--muted);
}
.dialog-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.dialog-footer p {
  width: 100%;
  text-align: center;
  color: var(--muted);
  font-size: 0.75rem;
  margin: 0;
}
.dialog-footer .primary-button,
.dialog-footer .secondary-button {
  min-height: 36px;
  font-size: 0.875rem;
}
.preview-dialog #preview-retry {
  display: block;
  margin: 10px auto;
}
.install-dialog {
  width: 460px;
}
.install-intro {
  font-size: 0.875rem;
  color: var(--muted);
  margin: 12px 0 24px;
}
.install-dialog h3 {
  font-size: 0.875rem;
  margin: 20px 0 10px;
}
.install-dialog li,
.install-dialog section p,
.install-hint {
  font-size: 0.875rem;
  line-height: 1.9;
}
.install-dialog ol {
  padding-left: 20px;
}
.install-hint {
  color: var(--muted);
  margin-top: 20px;
}
.toast {
  position: fixed;
  z-index: 30;
  bottom: calc(22px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  width: max-content;
  padding: 11px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: inherit;
  box-shadow: 0 8px 24px #0002;
  font-size: 0.875rem;
}

.person-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 22px 0 20px;
}
.person-tabs a {
  text-decoration: none;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 0.9rem;
}
.person-tabs [aria-current="page"] {
  background: var(--soft);
  border-color: var(--accent);
  font-weight: 650;
}
.person-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 4px;
}
.person-heading h2 {
  font-size: 1.4rem;
  margin: 0;
  letter-spacing: -0.03em;
}
.person-year {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 0.8rem;
  color: var(--muted);
}
.person-year select {
  min-height: 44px;
  padding: 8px 28px 8px 14px;
  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--site-radius-sm);
}
.person-method {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 10px 0 18px;
}
.person-method summary {
  min-height: 38px;
  padding: 6px 0;
}
.person-method p {
  margin: 6px 0;
}
.person-method .source-link {
  margin-right: 18px;
}
.person-description {
  color: var(--muted);
  font-size: 0.8rem;
  margin: 10px 0 18px;
}
.person-entry-preference {
  display: flex;
  align-items: center;
  gap: 4px 16px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.8rem;
  margin-bottom: 14px;
}
.person-entry-preference label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  cursor: pointer;
}
.person-entry-preference input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}
.person-gallery {
  display: block;
}
.person-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 20px 14px;
}
.person-card {
  min-width: 0;
  overflow: hidden;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: var(--site-radius);
  background: var(--surface);
}
.person-card:hover {
  border-color: var(--accent);
}
.person-photo {
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--soft);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.person-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.person-rank {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgb(22 38 48 / 0.88);
  color: white;
  font-variant-numeric: tabular-nums;
  font-size: 0.82rem;
  border-radius: 6px;
  padding: 4px 8px;
}
.person-meta {
  padding: 11px 10px;
}
.person-meta h3 {
  font-size: 0.88rem;
  margin: 0;
  overflow-wrap: anywhere;
}
.person-meta p {
  color: var(--muted);
  font-size: 0.7rem;
  margin: 3px 0 0;
  overflow-wrap: anywhere;
}
.person-image-error {
  font-size: 0.8rem;
  color: var(--muted);
}
.person-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  margin: 24px 0 12px;
  font-size: 0.8rem;
  color: var(--muted);
}
.person-dialog {
  width: min(820px, calc(100% - 24px));
}
.person-content {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: 24px;
  margin-top: 18px;
}
.person-detail-photo {
  align-self: start;
  background: var(--soft);
  border-radius: 10px;
  overflow: hidden;
}
.person-detail-photo img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 65dvh;
  object-fit: contain;
}
.person-facts {
  min-width: 0;
  font-size: 0.86rem;
}
.person-facts h3 {
  font-size: 0.9rem;
  margin: 20px 0 8px;
}
.person-facts h3:first-child {
  margin-top: 0;
}
.person-facts p {
  overflow-wrap: anywhere;
}
.person-profile {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 16px;
  margin: 0 0 12px;
}
.person-profile dt {
  color: var(--muted);
}
.person-profile dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.person-stat {
  font-weight: 600;
}
.person-history {
  list-style: none;
  padding: 0;
  margin: 8px 0;
}
.person-history li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 38px;
  border-bottom: 1px solid var(--line);
}
.person-history a {
  padding: 7px 0;
}
.person-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.loading-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.gallery-skeleton {
  aspect-ratio: 1.6;
  background: linear-gradient(
    100deg,
    var(--soft) 30%,
    var(--line) 50%,
    var(--soft) 70%
  );
  background-size: 200% 100%;
  border-radius: 6px;
  animation: shimmer 1.5s ease-in-out infinite;
}
@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}
@media (max-width: 1100px) {
  .library-shell {
    grid-template-columns: 180px minmax(0, 1fr);
  }
  .library-content {
    padding-inline: 24px;
  }
  .grid[data-device="desktop"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .person-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .grid.series-strip {
    --cover-width: 145px;
    grid-template-columns: none;
  }
  .preview-details {
    width: 230px;
    background: var(--surface);
  }
  .full-image {
    height: calc(100dvh - 250px);
    background: #090a0b;
  }
}
@media (max-width: 760px) {
  .loading-gallery {
    grid-template-columns: 1fr;
  }
  .gallery-skeleton:nth-child(n + 4) {
    display: none;
  }
  .library-shell {
    display: block;
  }
  .library-sidebar {
    position: sticky;
    top: 0;
    height: auto;
    padding: 0 16px;
    z-index: 6;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background: var(--site-bg);
    overflow: visible;
    display: grid;
    grid-template-columns: 1fr auto;
  }
  .library-sidebar header > div {
    padding: 0;
    grid-column: 1;
    grid-row: 1;
  }
  .library-sidebar h1 {
    margin: 0;
    height: 60px;
    align-content: center;
    font-size: 1rem;
  }
  .library-sidebar h1 img {
    width: 26px;
    height: 26px;
  }
  .library-sidebar .ecosystem-link,
  .library-sidebar .intro,
  #summary {
    display: none;
  }
  .install-button {
    grid-column: 2;
    grid-row: 1;
    margin: 0;
    align-self: center;
    border: 0;
    font-size: 0.75rem;
    min-height: 40px;
    padding: 8px 0 8px 12px;
  }
  .tabs {
    grid-column: 1/-1;
    grid-row: 2;
    display: flex;
    overflow-x: auto;
    gap: 12px;
    scrollbar-width: none;
    min-height: 46px;
  }
  .tabs::-webkit-scrollbar {
    display: none;
  }
  .tab {
    border-radius: 0;
    min-height: 44px;
    flex-shrink: 0;
    padding: 10px 2px;
    gap: 4px;
    font-size: 0.875rem;
    border-bottom: 2px solid transparent;
  }
  .tab::before {
    display: none;
  }
  .tab span {
    font-size: 0.75rem;
    margin-left: 3px;
  }
  .tab[aria-pressed="true"] {
    background: transparent;
    border-bottom-color: var(--accent);
    color: var(--accent);
    box-shadow: none;
  }
  .library-content {
    padding: 0 18px 16px;
  }
  .search-row {
    height: 54px;
    position: static;
    margin-bottom: 16px;
    gap: 10px;
  }
  .search-row input {
    font-size: 1rem;
    min-height: 44px;
  }
  .search-row kbd {
    display: none;
  }
  .collection-heading {
    margin-bottom: 14px;
  }
  .collection-heading h2 {
    font-size: 1.4375rem;
  }
  .collection-heading .secondary-button {
    min-height: 34px;
    font-size: 0.75rem;
  }
  .browse-toolbar {
    gap: 8px;
    flex-wrap: nowrap;
  }
  .field.device-filter select {
    min-height: 36px;
    font-size: 0.875rem;
    min-width: 114px;
    max-width: 125px;
    border: 1px solid var(--site-line-strong);
    background-color: var(--surface);
  }
  .filter-panel > summary {
    min-height: 36px;
    font-size: 0.875rem;
    gap: 6px;
    border: 1px solid var(--site-line-strong);
  }
  #filter-summary {
    display: none;
  }
  .filter-panel[open] {
    position: static;
  }
  .filter-panel[open] .filters {
    position: absolute;
    left: 0;
    right: 0;
    top: 38px;
    z-index: 4;
    box-shadow: 0 8px 30px #0002;
    border: 1px solid var(--line);
    padding: 16px;
    gap: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    background: var(--surface);
  }
  .field select {
    font-size: 1rem;
    min-height: 42px;
    padding: 8px 28px 8px 9px;
    border: 1px solid var(--site-line-strong);
  }
  .field label {
    font-size: 0.75rem;
  }
  .results-bar {
    font-size: 0.75rem;
    min-height: 38px;
    margin: 6px 0 12px;
    gap: 8px;
  }
  .result-actions {
    gap: 10px;
  }
  .result-actions button {
    font-size: 0.75rem;
    min-height: 40px;
  }
  .grid {
    gap: 20px 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid[data-device="desktop"] {
    grid-template-columns: 1fr;
  }
  .grid[data-device="phone"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid[data-device="icon"] {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px 10px;
  }
  .grid[data-device="bank-card"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 12px;
  }
  .grid[data-device="game-cover"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .compact-gallery .grid[data-device="desktop"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .compact-gallery .grid[data-device="phone"] {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .compact-gallery .grid[data-device="icon"] {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  .compact-gallery .grid[data-device="bank-card"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid.series-strip {
    --cover-width: 145px;
    grid-template-columns: none;
    gap: 12px;
    margin-right: -18px;
    padding-right: 18px;
  }
  .compact-gallery .grid.series-strip {
    --cover-width: 120px;
  }
  .device-heading,
  .category-heading {
    font-size: 0.875rem;
    margin-bottom: 12px;
  }
  .device-count {
    font-size: 0.75rem;
  }
  .card h2,
  .card h3,
  .card h4 {
    font-size: 0.875rem;
  }
  .card[data-kind="icon"] h3 {
    font-size: 0.75rem;
    line-height: 1.5;
  }
  .card[data-kind="bank-card"] h4 {
    font-size: 0.75rem;
  }
  .resolution {
    font-size: 0.75rem;
  }
  .favorite-toggle {
    opacity: 1;
    width: 36px;
    height: 36px;
    right: 5px;
    top: 5px;
  }
  .favorite-toggle svg {
    width: 18px;
    height: 18px;
  }
  .preview.icon + .favorite-toggle {
    width: 30px;
    height: 30px;
    padding: 0;
    right: 3px;
    top: 3px;
  }
  .card[data-kind="icon"] .favorite-toggle svg {
    width: 14px;
    height: 14px;
  }
  .asset-info summary {
    min-height: 40px;
  }
  .source-link {
    min-height: 40px;
  }
  .card-region + .card-region {
    margin-top: 32px;
  }
  .region-heading {
    font-size: 0.875rem;
  }
  .bank-heading {
    font-size: 0.875rem;
  }
  .bank-english {
    font-size: 0.75rem;
  }
  .loading-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .loading-grid span {
    aspect-ratio: 1;
  }
  .preview-dialog {
    padding: 0 14px calc(14px + env(safe-area-inset-bottom));
    background: #111213;
    color: #f0f1f3;
    --surface: #202225;
    --line: #4c5158;
    --soft: #2c3035;
    --muted: #b8bec7;
    --accent: #d4e0f1;
    --site-text: #f0f1f3;
    --site-muted: #b8bec7;
    --site-on-accent: #17202b;
  }
  .preview-dialog .dialog-header {
    height: 68px;
    align-items: center;
    background: #111213;
  }
  .preview-dialog .dialog-header h2 {
    font-size: 0.875rem;
    max-width: 270px;
  }
  .preview-dialog .dialog-header p {
    font-size: 0.75rem;
  }
  .close-button {
    height: 40px;
    width: 40px;
  }
  .preview-toolbar {
    flex-wrap: wrap;
    gap: 9px;
    margin-bottom: 12px;
  }
  .preview-options {
    gap: 6px;
    margin-left: auto;
  }
  .preview-toolbar .secondary-button {
    min-height: 36px;
    padding: 5px 8px;
    font-size: 0.75rem;
  }
  .preview-navigation {
    gap: 4px;
  }
  .preview-navigation span {
    font-size: 0.75rem;
    min-width: 36px;
  }
  .preview-navigation button {
    width: 32px;
  }
  .viewer-body {
    display: block;
    position: relative;
  }
  .full-image {
    height: calc(100dvh - 282px);
    min-height: 190px;
    background: #090a0b;
  }
  .image-stage {
    width: min(100%, calc((100dvh - 282px) * var(--image-ratio, 1)));
  }
  .image-stage img {
    max-height: calc(100dvh - 282px);
  }
  .image-stage.round-avatar {
    width: min(100%, calc(100dvh - 282px));
  }
  .preview-details {
    position: absolute;
    inset: 0;
    background: var(--surface);
    backdrop-filter: blur(12px);
    width: 100%;
    max-height: 100%;
    padding: 20px;
    z-index: 2;
    border-radius: 4px;
  }
  .preview-details dl {
    grid-template-columns: 80px 1fr;
    font-size: 0.875rem;
  }
  .preview-details h3 {
    font-size: 0.875rem;
  }
  .dialog-footer {
    gap: 8px;
    margin-top: 14px;
  }
  .dialog-footer .primary-button,
  .dialog-footer .secondary-button {
    min-height: 40px;
    font-size: 0.75rem;
    padding: 7px 10px;
  }
  .dialog-footer p {
    font-size: 0.75rem;
  }
  .preview-hint {
    font-size: 0.75rem;
  }
  .preview-dialog #preview-retry {
    min-height: 40px;
  }
  .person-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px 10px;
  }
  .person-tabs {
    gap: 6px;
    margin-top: 12px;
  }
  .person-tabs a {
    font-size: 0.875rem;
    padding: 8px 12px;
    min-height: 40px;
  }
  .person-heading {
    gap: 12px;
    flex-wrap: wrap;
  }
  .person-heading h2 {
    font-size: 1.125rem;
  }
  .person-content {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .person-detail-photo {
    max-width: 270px;
    margin-inline: auto;
  }
  .person-detail-photo img {
    max-height: 45dvh;
  }
  .person-dialog {
    padding: 16px;
  }
  .person-dialog .dialog-header {
    top: -16px;
  }
  .person-profile {
    font-size: 0.875rem;
  }
  .person-method,
  .person-description {
    font-size: 0.875rem;
  }
  .person-entry-preference {
    font-size: 0.75rem;
  }
  .person-meta h3 {
    font-size: 0.875rem;
  }
  .person-rank {
    font-size: 0.75rem;
    padding: 2px 5px;
  }
  footer {
    font-size: 0.75rem;
    gap: 10px;
    margin-top: 28px;
  }
  footer > div {
    gap: 12px;
  }
  .install-dialog {
    padding: 18px;
  }
  .install-dialog .dialog-header {
    top: -18px;
  }
}
@media (max-width: 360px) {
  .library-content {
    padding-inline: 14px;
  }
  .grid.series-strip {
    margin-right: -14px;
    padding-right: 14px;
  }
  .library-sidebar {
    padding-inline: 14px;
  }
  .tabs {
    gap: 10px;
  }
  .tab {
    font-size: 0.875rem;
    min-height: 44px;
  }
  .tab span {
    font-size: 0.75rem;
  }
  .library-sidebar h1 {
    font-size: 1rem;
  }
  .install-button {
    font-size: 0.75rem;
  }
  .results-bar {
    align-items: start;
    line-height: 2;
  }
  .result-actions {
    gap: 7px;
  }
  .result-actions button {
    font-size: 0.75rem;
  }
  .grid[data-device="icon"] {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .compact-gallery .grid[data-device="icon"] {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .preview-dialog .dialog-header h2 {
    max-width: 235px;
    font-size: 0.875rem;
  }
  .preview-options {
    justify-content: start;
    margin-left: 0;
    width: 100%;
    flex-wrap: wrap;
  }
  .preview-navigation {
    margin: auto;
  }
  .full-image {
    height: calc(100dvh - 318px);
    background: #090a0b;
  }
  .image-stage {
    width: min(100%, calc((100dvh - 318px) * var(--image-ratio, 1)));
  }
  .image-stage img {
    max-height: calc(100dvh - 318px);
  }
  .person-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (hover: hover) {
  .tab:hover:not([aria-pressed="true"]) {
    background: var(--soft);
  }
}

/* Ordinary resource editing uses the existing gallery, without a separate dashboard. */
.manage-dialog { width: min(680px, calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 24px; border: 1px solid var(--line); border-radius: 20px; color: var(--site-text); background: var(--surface, var(--site-bg)); overflow-y: auto; }
.manage-dialog::backdrop { background: rgb(0 0 0 / .55); }
.manage-dialog .dialog-header { position: sticky; top: -24px; z-index: 2; background: var(--surface, var(--site-bg)); padding: 16px 0; }
.manage-dialog fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.manage-dialog label { display: grid; gap: 6px; margin: 14px 0; font-size: 14px; }
.manage-dialog input:not([type=checkbox]), .manage-dialog select, .manage-dialog textarea { width: 100%; min-height: 42px; box-sizing: border-box; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--site-bg); color: var(--site-text); font: inherit; }
.manage-dialog small, .manage-hint, #manage-tech { color: var(--muted); font-size: 13px; }
.manage-dialog .manage-drop { border: 1px dashed var(--line); border-radius: 12px; padding: 18px; text-align: center; }
.manage-drop.drag-over { outline: 2px solid var(--accent); }
.manage-picture { display: grid; justify-items: center; }
#manage-image { max-width: 100%; max-height: 220px; border-radius: 10px; object-fit: contain; }
.manage-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.manage-dialog .manage-check { display: flex; align-items: center; gap: 8px; }
.manage-warning, #manage-error { color: var(--danger, #b43d3d); }
#manage-summary { border: 1px solid var(--line); border-radius: 10px; padding: 12px; overflow-wrap: anywhere; }
#manage-summary p { margin: 8px 0; }
.manage-buttons { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
#manage-path { overflow-wrap: anywhere; }
@media (max-width: 600px) { .manage-dialog { padding: 18px; } .manage-row { grid-template-columns: 1fr; gap: 0; } .manage-dialog .dialog-header { top: -18px; } }
