* { box-sizing: border-box; }

/* Ensure the hidden attribute always wins over any display rule below,
   regardless of which class is applied to the element. */
[hidden] { display: none !important; }


body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(120% 100% at 50% -10%, #171727 0%, #0A0A12 55%);
  color: #EDEAE3;
  font-family: 'Space Grotesk', sans-serif;
  padding-bottom: 80px;
}
body.modal-open { overflow: hidden; height: 100vh; }

h1, h2, h3 { font-family: 'Fraunces', serif; font-weight: 400; margin: 0; }

.back-link {
  display: inline-block;
  color: #787594;
  text-decoration: none;
  font-size: 14px;
  padding: 20px 24px 0;
}
.back-link:hover { color: #52FFC4; }

.hero {
  position: relative;
  text-align: center;
  padding: 72px 24px 48px;
  overflow: hidden;
}
.hero.small { padding: 32px 24px 40px; }
.hero.small h1 { font-size: clamp(2rem, 5vw, 3rem); margin-bottom: 20px; }

.header-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.glow {
  position: absolute;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 480px;
  height: 320px;
  background: radial-gradient(circle, rgba(82,255,196,0.16) 0%, rgba(82,255,196,0) 70%);
  filter: blur(10px);
  pointer-events: none;
}

.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  color: #F4F2ED;
}
.hero p {
  max-width: 560px;
  margin: 0 auto 32px;
  color: #9A97A6;
  font-size: 16px;
  line-height: 1.6;
}
.lovecraft-quote {
  max-width: 480px;
  margin: -16px auto 28px;
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 14px;
  color: #63607A;
  line-height: 1.6;
}
.quote-source {
  display: inline-block;
  margin-top: 4px;
  font-style: normal;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
  color: #4A4760;
}

.btn-primary {
  background: #52FFC4;
  color: #0A0A12;
  border: none;
  border-radius: 999px;
  padding: 14px 30px;
  font-size: 15px;
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
  cursor: pointer;
  transition: transform .15s ease;
}
.btn-primary:hover { transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.5; cursor: default; }
.btn-primary.full { width: 100%; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  background: transparent;
  color: #EDEAE3;
  border: 1px solid #3A3A56;
  border-radius: 999px;
  padding: 14px 26px;
  font-size: 15px;
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
  text-decoration: none;
  transition: border-color .15s ease;
}
.btn-secondary:hover { border-color: #52FFC4; }
.danger-btn { border-color: rgba(255,92,108,0.4); color: #FF9DA8; }
.danger-btn:hover { border-color: #FF5C6C; color: #FF5C6C; }

.section { max-width: 1080px; margin: 0 auto; padding: 24px 24px 0; }
.section h2 {
  font-size: 26px;
  color: #F4F2ED;
  margin: 32px 0 4px;
}
.section h2:first-child { margin-top: 0; }
.hint { color: #787594; font-size: 14px; margin: 0 0 20px; }
.empty {
  color: #787594;
  font-size: 15px;
  padding: 24px 0 40px;
  border-top: 1px solid #23233A;
  margin-top: 8px;
}

.projects-grid, .cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.project-card-group {
  background: #12121C;
  border: 1px solid #23233A;
  border-radius: 20px;
  padding: 24px 22px;
  transition: transform .15s ease, border-color .15s ease;
}
.project-card-group:hover { transform: translateY(-2px); border-color: #52FFC455; }
.project-card {
  display: block;
  text-decoration: none;
  color: #EDEAE3;
}
.project-card h3 { font-size: 20px; margin-bottom: 8px; color: #F4F2ED; }
.project-card span { font-size: 12px; color: #63607A; }
.lock-badge { font-size: 13px; }
.archived-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #63607A;
  background: rgba(154,151,166,0.12);
  border-radius: 999px;
  padding: 2px 8px;
  vertical-align: middle;
}

.project-subitems {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #23233A;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.project-subitem {
  display: block;
  font-size: 13px;
  color: #9A97A6;
  text-decoration: none;
  padding-left: 2px;
}
.project-subitem:hover { color: #52FFC4; }

.card {
  background: #12121C;
  border: 1px solid #23233A;
  border-radius: 20px;
  padding: 24px 20px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.img-pair { display: flex; justify-content: center; margin-bottom: 18px; }
.card-img {
  width: 108px; height: 108px;
  object-fit: cover;
  border-radius: 63% 37% 54% 46% / 55% 45% 55% 45%;
  border: 2px solid #0A0A12;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.card-img:first-child { margin-right: -18px; z-index: 1; }
.card-text { font-size: 14.5px; line-height: 1.55; color: #D8D5CE; margin: 0 0 10px; }
.card-meta { font-size: 12px; color: #63607A; }

.pending-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 12px;
}
.pending-card {
  background: #14121C;
  border: 1px dashed rgba(139,111,255,0.35);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.img-pair-small { display: flex; gap: 8px; margin-bottom: 14px; }
.pending-img { width: 84px; height: 84px; object-fit: cover; border-radius: 12px; }
.pending-actions { display: flex; gap: 10px; margin-top: 6px; }

.small-btn {
  border: none;
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
  cursor: pointer;
}
.small-btn:disabled { opacity: 0.5; cursor: default; }
.approve-btn { background: #52FFC4; color: #0A0A12; }
.reject-btn { background: transparent; color: #FF5C6C; border: 1px solid rgba(255,92,108,0.35); }

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(6,6,10,0.72);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}
.modal {
  position: relative;
  background: #14141F;
  border: 1px solid #2A2A42;
  border-radius: 22px;
  padding: 32px 28px 28px;
  max-width: 460px;
  width: 100%;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
}
.close-btn {
  position: absolute;
  top: 14px; right: 16px;
  background: none;
  border: none;
  color: #787594;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}
.modal h3 { font-size: 24px; margin: 0 0 6px; color: #F4F2ED; }

input[type="text"], textarea {
  width: 100%;
  background: #0F0F18;
  border: 1px solid #2A2A42;
  border-radius: 12px;
  padding: 12px 14px;
  color: #EDEAE3;
  font-size: 14px;
  font-family: 'Space Grotesk', sans-serif;
  margin-bottom: 16px;
  outline: none;
}
textarea { resize: vertical; }

.upload-row { display: flex; gap: 12px; margin-bottom: 16px; }
.upload-box {
  flex: 1;
  height: 130px;
  border: 1.5px dashed #3A3A56;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  background: #0F0F18;
  color: #63607A;
  font-size: 13px;
  text-align: center;
}
.upload-box input[type="file"], .hidden-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.upload-preview { width: 100%; height: 100%; object-fit: cover; }

.local-error { color: #FF9DA8; font-size: 13px; margin: -6px 0 14px; }

.dropzone {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1.5px dashed #3A3A56;
  border-radius: 16px;
  padding: 28px 20px;
  color: #787594;
  font-size: 14px;
  cursor: pointer;
  position: relative;
  margin-bottom: 16px;
  transition: border-color .15s ease, background .15s ease;
}
.dropzone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone.dropzone-active { border-color: #52FFC4; background: rgba(82,255,196,0.05); }

.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
  margin-bottom: 8px;
}
.library-thumb {
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #23233A;
}
.library-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.library-thumb.pickable { cursor: pointer; transition: transform .12s ease, border-color .12s ease; }
.library-thumb.pickable:hover { transform: translateY(-2px); border-color: #52FFC4; }

.pick-box {
  flex: 1;
  height: 130px;
  border: 1.5px dashed #3A3A56;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  background: #0F0F18;
  color: #63607A;
  font-size: 13px;
  text-align: center;
  padding: 0 10px;
  font-family: 'Space Grotesk', sans-serif;
}
.pick-preview { width: 100%; height: 100%; object-fit: cover; }

.picker-modal { max-width: 560px; max-height: 70vh; overflow-y: auto; }
.picker-grid { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }

/* imported card list page */
#import-panel {
  background: #12121C;
  border: 1px solid #23233A;
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 8px;
}
#import-panel h2 { margin-top: 0; margin-bottom: 4px; }

#bulk-panel {
  background: #12121C;
  border: 1px solid #23233A;
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 8px;
}
#bulk-panel h2 { margin-top: 0; margin-bottom: 4px; }
#bulk-panel code {
  background: #0F0F18;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 12px;
  color: #9A97A6;
}
.bulk-report {
  background: #0F0F18;
  border: 1px solid #23233A;
  border-radius: 12px;
  padding: 16px 18px;
  margin-top: 4px;
}
.bulk-summary { color: #52FFC4; font-size: 14px; margin: 0 0 8px; }
.bulk-issue { color: #FF9DA8; font-size: 13px; margin: 10px 0 4px; }
.bulk-report ul { margin: 0 0 4px; padding-left: 18px; }
.bulk-report li { font-size: 12px; color: #787594; }
.sync-row { margin-top: 18px; padding-top: 18px; border-top: 1px solid #23233A; }

/* revised-text card list on the project page */
.revision-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}
.filter-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #D8D5CE;
  cursor: pointer;
}
.filter-toggle input { width: 16px; height: 16px; accent-color: #52FFC4; cursor: pointer; }

.revision-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}
.revision-card {
  background: #12121C;
  border: 1px solid #23233A;
  border-radius: 16px;
  padding: 14px;
}
.revision-textarea {
  width: 100%;
  min-height: 70px;
  background: #0F0F18;
  border: 1px solid #2A2A42;
  border-radius: 10px;
  padding: 10px 12px;
  color: #EDEAE3;
  font-size: 13px;
  font-family: 'Space Grotesk', sans-serif;
  resize: vertical;
  margin: 8px 0 4px;
  outline: none;
}
.revision-textarea:focus { border-color: #52FFC4; }
.revision-status { font-size: 11px; color: #63607A; min-height: 14px; display: block; }

.author-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.author-row label { font-size: 13px; color: #787594; }
#author-name-input {
  background: #0F0F18;
  border: 1px solid #2A2A42;
  border-radius: 10px;
  padding: 8px 12px;
  color: #EDEAE3;
  font-size: 13px;
  font-family: 'Space Grotesk', sans-serif;
  outline: none;
  max-width: 240px;
}
#author-name-input:focus { border-color: #52FFC4; }

.original-link-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.original-label { font-size: 13px; color: #787594; }
#original-select {
  background: #0F0F18;
  border: 1px solid #2A2A42;
  border-radius: 10px;
  padding: 8px 12px;
  color: #EDEAE3;
  font-size: 13px;
  font-family: 'Space Grotesk', sans-serif;
  cursor: pointer;
}

.original-block {
  background: #0F0F18;
  border: 1px dashed #3A3A56;
  border-radius: 10px;
  padding: 10px 12px;
  margin: 8px 0;
}
.original-label-tag {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.04em;
  color: #8B6FFF;
  margin-bottom: 4px;
}
.original-name { font-size: 12px; color: #D8D5CE; margin: 0 0 4px; font-weight: 600; }
.json-toggle-btn {
  background: none;
  border: none;
  color: #8B6FFF;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  font-family: 'Space Grotesk', sans-serif;
}
.json-toggle-btn:hover { text-decoration: underline; }
.json-content { margin-top: 8px; }
.json-flavor { font-style: italic; color: #787594; }
.original-text {
  font-size: 12px;
  color: #9A97A6;
  white-space: pre-wrap;
  margin: 0 0 6px;
  max-height: 160px;
  overflow-y: auto;
}
.original-text:last-child { margin-bottom: 0; }

/* review status badge + controls */
.status-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 3px 10px;
  border-radius: 999px;
  margin: 4px 0 10px;
}
.status-ok { background: rgba(82,255,196,0.15); color: #52FFC4; }
.status-review { background: rgba(255,180,80,0.15); color: #FFB450; }
.status-none { background: rgba(154,151,166,0.12); color: #9A97A6; }

.status-controls { display: flex; gap: 8px; margin-bottom: 12px; }
.status-btn {
  flex: 1;
  border: 1px solid #2A2A42;
  background: #0F0F18;
  color: #D8D5CE;
  border-radius: 999px;
  padding: 6px 0;
  font-size: 11px;
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
  cursor: pointer;
}
.status-btn-ok:hover { border-color: #52FFC4; color: #52FFC4; }
.status-btn-review:hover { border-color: #FFB450; color: #FFB450; }

.status-filter-group { display: flex; gap: 6px; flex-wrap: wrap; }
.status-filter-btn {
  background: #0F0F18;
  border: 1px solid #2A2A42;
  color: #9A97A6;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
  cursor: pointer;
}
.status-filter-btn:hover { border-color: #52FFC4; }
.status-filter-btn.active { background: #52FFC4; color: #0A0A12; border-color: #52FFC4; }

.revision-toggle-btn {
  background: none;
  border: none;
  color: #52FFC4;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
  font-family: 'Space Grotesk', sans-serif;
}
.revision-toggle-btn:hover { text-decoration: underline; }

/* has-revisions outline */
.revision-card.has-revisions {
  border-color: #52FFC4;
  box-shadow: 0 0 0 1px rgba(82, 255, 196, 0.25);
}

/* expandable per-set card list in the sidebar */
.set-filter-group { margin-bottom: 4px; }
.set-filter-item .set-expand-btn {
  background: none;
  border: none;
  color: #63607A;
  font-size: 11px;
  cursor: pointer;
  padding: 0;
  width: 14px;
  flex-shrink: 0;
}
.set-card-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 4px 0 10px 22px;
  max-height: 220px;
  overflow-y: auto;
}
.set-card-link {
  background: none;
  border: none;
  color: #9A97A6;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  padding: 2px 0;
}
.set-card-link:hover { color: #52FFC4; }

/* flash highlight when scrolled to via sidebar */
@keyframes flash-highlight {
  0%, 100% { box-shadow: 0 0 0 2px rgba(82, 255, 196, 0); }
  30% { box-shadow: 0 0 0 2px rgba(82, 255, 196, 0.9); }
}
.flash-highlight { animation: flash-highlight 1.5s ease; }

/* collaborative revisions list */
.revisions-list { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.revision-entry {
  background: #0F0F18;
  border: 1px solid #23233A;
  border-radius: 10px;
  padding: 8px 10px;
}
.revision-entry-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #63607A;
  margin-bottom: 4px;
}
.revision-entry-meta strong { color: #D8D5CE; font-weight: 600; }
.revision-remove-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: #63607A;
  font-size: 14px;
  cursor: pointer;
  padding: 0 4px;
}
.revision-remove-btn:hover { color: #FF5C6C; }
.revision-ip {
  font-size: 10px;
  color: #63607A;
  font-family: monospace;
}
.ip-block-btn {
  background: none;
  border: none;
  color: #FF9DA8;
  font-size: 10px;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}
.revision-entry-text { font-size: 12.5px; color: #D8D5CE; white-space: pre-wrap; margin: 0; }

.add-revision { margin-top: 10px; }
.revision-author-input {
  width: 100%;
  background: #0F0F18;
  border: 1px solid #2A2A42;
  border-radius: 10px;
  padding: 8px 10px;
  color: #EDEAE3;
  font-size: 12px;
  font-family: 'Space Grotesk', sans-serif;
  margin-bottom: 6px;
  outline: none;
}
.new-revision-textarea {
  width: 100%;
  min-height: 60px;
  background: #0F0F18;
  border: 1px solid #2A2A42;
  border-radius: 10px;
  padding: 8px 10px;
  color: #EDEAE3;
  font-size: 12.5px;
  font-family: 'Space Grotesk', sans-serif;
  resize: vertical;
  margin-bottom: 6px;
  outline: none;
}
.new-revision-textarea:focus, .revision-author-input:focus { border-color: #52FFC4; }
.add-revision-btn { width: 100%; padding: 8px 0; }

/* admin password lock screen */
.admin-lock-box {
  max-width: 380px;
  margin: 60px auto;
  background: #12121C;
  border: 1px solid #23233A;
  border-radius: 20px;
  padding: 32px;
  text-align: center;
}
.admin-lock-box h2 { margin-bottom: 8px; }
#admin-password-input {
  width: 100%;
  background: #0F0F18;
  border: 1px solid #2A2A42;
  border-radius: 12px;
  padding: 12px 14px;
  color: #EDEAE3;
  font-size: 14px;
  font-family: 'Space Grotesk', sans-serif;
  margin-bottom: 12px;
  outline: none;
}

#ban-panel {
  background: #12121C;
  border: 1px solid #23233A;
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 8px;
}
#ban-panel h2 { margin-top: 0; margin-bottom: 4px; }
.ban-row { display: flex; gap: 10px; margin-bottom: 10px; }
.ban-row input {
  flex: 1;
  background: #0F0F18;
  border: 1px solid #2A2A42;
  border-radius: 10px;
  padding: 10px 12px;
  color: #EDEAE3;
  font-size: 13px;
  font-family: 'Space Grotesk', sans-serif;
  outline: none;
}
.banned-ips-list { display: flex; flex-direction: column; gap: 6px; }
.banned-ip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0F0F18;
  border: 1px solid #23233A;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  color: #D8D5CE;
}

/* card viewer: zoom + original + notes, with keyboard navigation */
#card-viewer {
  background: rgba(4, 4, 8, 0.92);
  z-index: 150;
  overflow-y: auto;
  padding: 40px 20px;
}
.viewer-content {
  position: relative;
  max-width: min(1500px, 96vw);
  width: 100%;
  margin: 0 auto;
  background: #14141F;
  border: 1px solid #2A2A42;
  border-radius: 22px;
  padding: 32px;
}
.viewer-title {
  text-align: center;
  font-family: 'Fraunces', serif;
  font-size: 22px;
  color: #F4F2ED;
  margin: 0 0 4px;
}
.viewer-toggle-original {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  color: #9A97A6;
  margin: 8px 0 0;
  cursor: pointer;
}
.viewer-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-top: 16px;
}
.viewer-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.viewer-col-notes {
  align-items: stretch;
  max-height: 78vh;
  overflow-y: auto;
  padding-right: 6px;
}
.viewer-pair {
  display: flex;
  gap: 10px;
  width: 100%;
  justify-content: center;
}
.viewer-pair-stacked {
  flex-direction: column;
  align-items: center;
}
.viewer-pair-stacked .viewer-img {
  flex: none;
  width: 100%;
  max-height: 42vh;
}
.viewer-label { font-size: 12px; color: #63607A; letter-spacing: 0.04em; }
.viewer-img {
  flex: 1;
  min-width: 0;
  width: 100%;
  height: auto;
  max-height: 62vh;
  border-radius: 12px;
  object-fit: contain;
  box-shadow: 0 12px 30px rgba(0,0,0,0.4);
}
.viewer-notes { width: 100%; }
.viewer-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: #0F0F18;
  border: 1px solid #2A2A42;
  color: #EDEAE3;
  font-size: 28px;
  line-height: 1;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
}
.viewer-nav-btn:hover { border-color: #52FFC4; }
.viewer-prev { left: 8px; }
.viewer-next { right: 8px; }

@media (max-width: 900px) {
  .viewer-nav-btn { position: static; transform: none; margin: 12px 8px 0; }
  .viewer-layout { flex-direction: column; }
  .viewer-col-notes { max-height: none; overflow-y: visible; }
  .viewer-img { max-height: 45vh; }
}


/* sidebar layout for the project cards section */
.revision-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 28px;
  align-items: start;
}
.revision-sidebar {
  position: sticky;
  top: 20px;
  background: #12121C;
  border: 1px solid #23233A;
  border-radius: 16px;
  padding: 18px;
  max-height: 80vh;
  overflow-y: auto;
}
.sidebar-search { margin-bottom: 14px; }
.sidebar-search input {
  width: 100%;
  background: #0F0F18;
  border: 1px solid #2A2A42;
  border-radius: 10px;
  padding: 8px 12px;
  color: #EDEAE3;
  font-size: 13px;
  font-family: 'Space Grotesk', sans-serif;
  outline: none;
}
.sidebar-search input:focus { border-color: #52FFC4; }

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.sidebar-header h3 { font-size: 15px; color: #F4F2ED; }
.sidebar-actions { display: flex; gap: 8px; }
.link-btn {
  background: none;
  border: none;
  color: #52FFC4;
  font-size: 11px;
  font-family: 'Space Grotesk', sans-serif;
  cursor: pointer;
  padding: 0;
}
.link-btn:hover { text-decoration: underline; }

.set-filter-list { display: flex; flex-direction: column; gap: 10px; }
.set-filter-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #D8D5CE;
  cursor: pointer;
}
.set-filter-item input { accent-color: #52FFC4; cursor: pointer; flex-shrink: 0; }
.set-filter-item span:nth-child(2) { flex: 1; }
.set-count { color: #63607A; font-size: 11px; }

.set-group { margin-bottom: 32px; }
.set-group-title {
  font-size: 18px;
  color: #F4F2ED;
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid #23233A;
  display: flex;
  align-items: center;
  gap: 10px;
}

@media (max-width: 780px) {
  .revision-layout { grid-template-columns: 1fr; }
  .revision-sidebar { position: static; max-height: none; }
}

/* shared lightbox */
.lightbox-overlay {
  background: rgba(4,4,8,0.9);
  z-index: 200;
}
.lightbox-content {
  position: relative;
  max-width: 92vw;
  max-height: 92vh;
}
.lightbox-content img {
  max-width: 92vw;
  max-height: 92vh;
  object-fit: contain;
  border-radius: 10px;
  display: block;
}
.lightbox-content .close-btn {
  position: absolute;
  top: -14px;
  right: -14px;
  background: #14141F;
  border: 1px solid #2A2A42;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 20px;
}

.cardlist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}
.cardlist-item {
  background: #12121C;
  border: 1px solid #23233A;
  border-radius: 16px;
  padding: 14px;
  cursor: pointer;
  transition: border-color .15s ease, transform .15s ease;
}
.cardlist-item:hover { border-color: #52FFC455; transform: translateY(-2px); }
.cardlist-thumbs { display: flex; gap: 8px; margin-bottom: 10px; overflow: hidden; }
.cardlist-thumb {
  flex: 1;
  min-width: 0;
  width: 100%;
  display: block;
  aspect-ratio: 3 / 4;
  border-radius: 8px;
  object-fit: cover;
  background: #0F0F18;
}
.cardlist-thumb.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #63607A;
  font-size: 11px;
  border: 1px dashed #3A3A56;
}
.cardlist-name {
  font-size: 13px;
  color: #D8D5CE;
  margin: 0;
  text-align: center;
}
.card-side { flex: 1; }
