/* Midnight Lightbox — the paint and bodywork take the largest surface. */
body.night.lightbox {
  --paper: #131218;
  --ink: #faf7f7;
  --muted: #b6acbb;
  --line: #38313d;
  --lime: #ffd0cb;
  background: var(--paper);
}
.lightbox .mast {
  padding: 12px 17px 8px;
  border: 0;
}
.lightbox .mast .identity b {
  font-size: 20px;
  letter-spacing: -1px;
}
#followAuthor {
  display:inline-flex;align-items:center;justify-content:center;min-height:44px;
  padding:0 13px;border:1px solid #69515f;border-radius:24px;
  color:#ffd0d4;background:#2b202b;font-size:13px;font-weight:650;
}
#followAuthor:disabled {color:#cbbac6;border-color:#473b48;background:#211c24}
.lightbox .brandmark {
  width: 28px;
  height: 28px;
  margin: 0 7px 0 0;
  flex: none;
  transform: none;
  border-radius: 0;
  background: url("./vice-palm.webp") center / contain no-repeat;
}
.lightbox #catalogCover { padding: 0; }
.lightbox .cover {
  height: auto;
  border-radius: 0;
  border: 0;
  color: #fff8f6;
  background: #18141e;
}
.lightbox .cover img {
  position: static;
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  mix-blend-mode: normal;
  filter: none;
  -webkit-mask-image: none;
  mask-image: none;
}
.lightbox .cover::after { content: none; }
.lightbox .cover-title {
  top: 19px;
  left: 20px;
  right: 18px;
}
.lightbox .cover-title small {
  margin: 0 0 8px 2px;
  color: #ffe3e8;
  font: 650 9px/1.15 "Helvetica Neue", Arial, sans-serif;
  letter-spacing: 2.4px;
}
.lightbox .cover-title strong {
  font: italic 500 27px/1 Georgia, "Times New Roman", serif;
  font-size: clamp(24px, 6.5vw, 33px);
  letter-spacing: -.8px;
  white-space: nowrap;
}
.lightbox .cover-title br { display: none; }
.lightbox .edition {
  right: 18px;
  top: 15px;
  padding: 0;
  line-height: 18px;
  color: #fff1ee;
  border: 0;
  background: transparent;
  font-size: 10px;
  font-weight: 600;
}
.lightbox .edition i {
  width: 5px;
  height: 5px;
  background: #ffd6c4;
  box-shadow: 0 0 7px #f6beaa;
}
.lightbox .cover-foot {
  position: static;
  padding: 8px 18px 10px;
}
.lightbox .cover-foot b { font-size: 17px; font-weight: 680; }
.lightbox .cover-foot > span {
  color: #fff7f7;
  font-weight: 500;
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 16px;
  border: 1px solid #beadbe;
}
.lightbox .library { padding: 21px 17px; }
.lightbox .section-head h1 { font-size: 17px; letter-spacing: -.3px; }
.lightbox .count { color: #bdb2c2; font-weight: 500; }
.lightbox .searchbox {
  height: 42px;
  border: 1px solid #4a3f4a;
  border-radius: 21px;
  background: #211d25;
}
.lightbox .filters { margin: 7px -2px 11px; padding: 0; }
.lightbox .filters button { margin: 0 2px 0 0; }
.lightbox .filters button span {
  background: transparent;
  border-color: transparent;
  border-radius: 20px;
  padding: 0 10px;
  color: #d0c8d1;
}
.lightbox .filters button.active span {
  background: #f5d0cb;
  border-color: #f5d0cb;
  color: #332328;
}
.lightbox .grid {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  grid-gap: 17px 10px;
}
.lightbox .tile {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 6px 6px 0 0;
  text-align: left;
}
.lightbox .thumb {
  display: block;
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 64%;
  border-radius: 6px;
  background: #c9bed0;
}
.lightbox .thumb img { inset: 0; left: 0; top: 0; }
.thumb .photo-reference {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 2px 5px;
  border-radius: 3px;
  background: rgba(40, 32, 46, .86);
  color: #fff3fa;
  font-size: 10px;
  line-height: 1.4;
}
.detail-content .photo-reference { margin: 5px 0 0; font-size: 12px; color: var(--muted); }
.image-unavailable + .photo-reference { display: none; }
.lightbox .thumb .tag {
  top: auto;
  left: 7px;
  bottom: 6px;
  padding: 1px 5px;
  font-size: 9px;
  font-weight: 600;
  background: #302435;
  color: #fff0fa;
}
.lightbox .tile-body { display: block; padding: 7px 0 4px; }
.lightbox .tile-body b { font-size: 15px; letter-spacing: 0; }
.lightbox .tile-body .latin { font-family: Georgia,serif; font-style: italic; }
.lightbox nav > div, .lightbox .dock-inner { border-top: 1px solid #433943; background: var(--paper); }
.lightbox nav button[aria-current=page] .icon {
  color: #ffcfcb;
  background: transparent;
}
.lightbox nav button[aria-current=page] { color: #ffcfcb; }
.lightbox .detail-top { border: 0; padding: 9px 17px; }
.lightbox .detail-top .back { border-color: #594b58; }
.lightbox .detail-photo { background: #c8bfcd; filter: saturate(1.03); }
.lightbox .detail-content { padding: 20px; }
.lightbox .detail-title strong { font: italic 19px/1.2 Georgia,serif; color: #e9c7d4; }
.lightbox .detail-title { border-color: #64505e; }
.lightbox .block h2 { color: #f2d7dc; }
.lightbox .dock button { border-radius: 22px; border-color: #cfb6c3; }
.lightbox .dock button + button { color: #2b1b27; background: #f7c8c6; border-color: #f7c8c6; }
.lightbox .dock button.selected { color: #30222d; background: #f7e4ed; }
.lightbox #nav button{width:25%;flex:1}
.lightbox .detail-content .block .unmapped{color:var(--muted);font-size:12px;margin-top:10px}

.lightbox .library[data-shelf="catalog"] {padding-top:8px}
.lightbox .library[data-shelf="catalog"] .section-head {margin-bottom:9px}
.lightbox .library[data-shelf="catalog"] .searchbox {height:58px;border-radius:16px;border-color:#806878;background:#2c242e;padding:0 5px 0 16px}
.lightbox .library[data-shelf="catalog"] .searchbox:focus-within {border-color:#f6c7d2}
.lightbox .library[data-shelf="catalog"] .searchbox > .icon {width:23px;height:23px;color:#f8cdd9;margin-right:11px}
.lightbox .library[data-shelf="catalog"] .searchbox input {font-size:17px}
.lightbox .library[data-shelf="catalog"] .searchbox input::placeholder {color:#d6cbd4}
.lightbox .library[data-shelf="catalog"] .filters {margin:6px -17px 9px;padding:0 17px}
.lightbox .library[data-shelf="catalog"] .filters button {min-height:44px}
.lightbox .library[data-shelf="catalog"] .filters button span {padding:0 11px;font-size:13px}
.lightbox .library #catalogCover {margin-bottom:16px;overflow:hidden;border-radius:8px}
.lightbox .library .cover-title,.lightbox .library .edition {text-shadow:0 1px 3px #351c42}
.lightbox .library .cover-title {top:13px;left:14px}
.lightbox .library .cover-title small {margin-bottom:5px}
.lightbox .library .cover-foot {padding:7px 13px}

#more {height:1px}
.lightbox .library[data-shelf="catalog"] .filter-strip {display:flex;align-items:flex-start;margin:6px -3px 9px}
.lightbox .library[data-shelf="catalog"] .filter-strip .filters {min-width:0;flex:1;margin:0;padding:0}
.lightbox .filter-strip #allTypes {min-height:44px;padding:0 3px 0 9px;margin-left:3px;color:#eac4d1;font-size:11px;font-weight:650}
.lightbox .filter-strip.expanded .filters {flex-wrap:wrap;overflow:visible}

#kindFilters {
  min-width:0;margin:0 0 15px;padding:0 3px 3px;
  border:1px solid #4a3b4a;border-radius:9px;
}
#kindFilters legend {margin-left:7px;padding:0 5px;color:#c8b4c3;font-size:11px;line-height:1}
.kind-options {display:grid;grid-template-columns:repeat(4,minmax(0,1fr)) minmax(4.2em,1.45fr) minmax(3.2em,1.15fr);grid-gap:2px;padding-top:3px;font-size:12px}
.kind-options button {min-width:0;min-height:44px;padding:3px 1px;border-radius:6px;color:#d5cbd4;font-size:12px;font-weight:600}
.kind-options button small {display:block;margin-top:1px;color:#b4a4b3;font-size:11px;line-height:1.2;font-variant-numeric:tabular-nums}
.kind-options button[aria-pressed="true"] {background:#503744;color:#ffe2e2}
.kind-options button[aria-pressed="true"] small {color:#f1c7d3}

.image-unavailable {display:block;padding:22px 8px;text-align:center;font-size:12px;color:#b6aabb;background:#28222c}
.thumb .image-unavailable {
  position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;
  border:1px solid #514454;border-radius:inherit;color:#dfcfdc;
  background:linear-gradient(145deg,#3a2d3d,#261f2c);
}
.cover .image-unavailable {height:185px}

html, body, .filters {overscroll-behavior-x:contain}
#nav {z-index:4}
#message {color:#2b1c28;background:#ffe2e6}
#openStats {position:relative;display:flex;align-items:center;justify-content:center;flex:none;height:44px;margin-left:4px;padding:0 8px 0 11px;border-radius:10px;color:#f8cdd9;font-size:14px;font-weight:600;white-space:nowrap}
#openStats::before {content:"";position:absolute;left:0;top:12px;bottom:12px;width:1px;background:#695364}
#openStats .icon {width:18px;height:18px;margin:0 5px 0 0;color:inherit}
#statBadge {margin-left:4px;min-width:15px;padding:0 3px;border-radius:8px;background:#f4c6d0;color:#30202b;font:700 10px/15px Arial,sans-serif;text-align:center}
.card-stats {display:flex;flex-wrap:wrap;margin-top:5px;font-size:11px;line-height:1.65;color:#c7b6c6}
.card-stats>span {margin-right:8px}.card-stats strong {color:#ffd0d6;font-variant-numeric:tabular-nums}
.lightbox .related-model {display:flex;align-items:center;justify-content:space-between;width:100%;padding:9px 0;text-align:left;color:#efd2db;min-height:44px}
.related-model+.related-model {border-top:1px solid var(--line)}
.related-model strong,.related-model small {display:block}.related-model small {margin-top:2px;color:var(--muted)}
.related-model .icon {width:16px;height:16px;flex:none}
.lightbox .base-link {margin-top:8px;border-top:1px solid var(--line);font-size:13px}
#statSheet {
  position:fixed;z-index:6;top:auto;bottom:58px;bottom:calc(58px + env(safe-area-inset-bottom,0px));
  left:0;right:0;width:100%;max-width:560px;max-height:calc(100vh - 66px);
  max-height:calc(100% - var(--top,0px) - 66px - env(safe-area-inset-bottom,0px));
  margin:0 auto;padding:0;border:1px solid #665063;border-bottom:0;
  border-radius:20px 20px 0 0;background:#1d1821;color:#f8f0f4;
}
#statSheet[open] {display:flex;flex-direction:column}
body.stats-open {overflow:hidden}
#statTitle:focus {outline:none}
#statBackdrop {position:fixed;z-index:5;top:0;right:0;left:0;bottom:58px;bottom:calc(58px + env(safe-area-inset-bottom,0px));background:rgba(10,7,13,.74)}
.stat-head,.stat-footer {display:flex;align-items:center;justify-content:space-between;flex:none;padding:10px 17px}
.stat-head {border-bottom:1px solid #423645}
.stat-head h2 {margin:0;font-size:20px}
#closeStats {width:44px;height:44px;color:#e3cbd9;font-size:27px}
.stat-body {overflow-y:auto;padding:12px 17px 4px;overscroll-behavior:contain}
.stat-body p {margin:0 0 16px;color:#c9b9c8;font-size:12px;line-height:1.55}
#statOptions fieldset {margin:0 0 15px;padding:0;border:0;min-width:0}
#statOptions legend {padding:0;margin:0 0 7px;font-size:14px;font-weight:650}
#statOptions small {font-size:11px;font-weight:400;color:#c1adbf}
#statOptions fieldset div {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));grid-gap:5px}
#statOptions button,.stat-footer button {min-height:44px;padding:0 3px;border:1px solid #524353;border-radius:8px;color:#ddcfdb;font-size:12px}
#statOptions [aria-pressed="true"] {background:#573b49;color:#ffe8ea;border-color:#bb899b}
.stat-footer {border-top:1px solid #423645;padding-bottom:12px}
.stat-footer button {font-size:15px;font-weight:650}
#resetStats {flex:1}
#applyStats {flex:2;margin-left:9px;color:#34222b;background:#f5cbd0;border-color:#f5cbd0}
