:root {
  color: #eceae3;
  background: #111311;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  background: #111311;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.catalog-shell {
  width: min(1440px, calc(100% - 48px));
  margin: 0 auto;
  padding: 36px 0 72px;
}

.topbar,
.controls,
.catalog-meta,
.card-footer,
.details-actions {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  gap: 32px;
  padding-bottom: 28px;
  border-bottom: 1px solid #3e433d;
}

.eyebrow,
.summary,
.preview-tag,
.catalog-meta,
.details-note {
  color: #a8aca3;
}

.eyebrow {
  margin: 0 0 9px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(32px, 4vw, 52px);
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1;
}

.summary {
  max-width: 420px;
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  text-align: right;
}

.account-area {
  display: grid;
  justify-items: end;
  gap: 10px;
}

.account-actions {
  display: flex;
  gap: 8px;
}

.account-button {
  display: inline-flex;
  align-items: center;
  border: 1px solid #4a5148;
  border-radius: 999px;
  padding: 7px 12px;
  color: #bec3b9;
  background: transparent;
  font-size: 12px;
  text-decoration: none;
}

.account-button[hidden] {
  display: none;
}

.account-button:hover {
  border-color: #788374;
  color: #f0eee7;
}

.account-button:disabled {
  cursor: wait;
  opacity: .55;
}

.controls {
  flex-wrap: wrap;
  gap: 12px;
  padding: 24px 0 18px;
}

.search-field,
.select-field {
  display: grid;
  gap: 6px;
  color: #a8aca3;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.search-field {
  flex: 1 1 320px;
}

.select-field {
  min-width: 190px;
}

input,
select {
  width: 100%;
  min-height: 43px;
  border: 1px solid #3e433d;
  border-radius: 5px;
  outline: none;
  background: #1b1e1a;
  color: #eceae3;
  padding: 0 13px;
  font-size: 14px;
  letter-spacing: 0;
  text-transform: none;
}

input:focus,
select:focus {
  border-color: #d5c761;
  box-shadow: 0 0 0 3px #d5c76122;
}

.filter-group {
  display: flex;
  min-height: 43px;
  overflow: hidden;
  align-self: end;
  border: 1px solid #3e433d;
  border-radius: 5px;
}

.filter-button {
  border: 0;
  border-right: 1px solid #3e433d;
  background: #1b1e1a;
  color: #c6c9c2;
  padding: 0 13px;
  font-size: 12px;
}

.filter-button:last-child {
  border-right: 0;
}

.filter-button:hover,
.filter-button.is-active {
  background: #d5c761;
  color: #141510;
}

.catalog-meta {
  justify-content: space-between;
  gap: 24px;
  padding: 0 0 22px;
  font-size: 12px;
  line-height: 1.45;
}

.catalog-meta p {
  max-width: 680px;
  margin-bottom: 0;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.prompt-card.has-audit.is-mismatch {
  box-shadow: 0 0 0 1px #d86b61;
}

.prompt-card.has-audit.is-uncertain {
  box-shadow: 0 0 0 1px #d5b95f;
}

.audit-tag {
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
}

.audit-tag.is-mismatch {
  background: #3d1c1a;
  color: #ffaaa1;
}

.audit-tag.is-uncertain {
  background: #332d18;
  color: #f0d77e;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding-top: 30px;
}

.pagination[hidden] {
  display: none;
}

.page-button {
  min-width: 82px;
  border: 1px solid #4d514b;
  border-radius: 999px;
  padding: 9px 14px;
  color: #eceae3;
  background: #1b1e1a;
}

.page-button:hover:not(:disabled) {
  border-color: #d5c761;
  color: #d5c761;
}

.page-button:disabled {
  cursor: default;
  opacity: .35;
}

.page-status {
  min-width: 100px;
  margin: 0;
  color: #a8aca3;
  font-size: 13px;
  text-align: center;
}

.prompt-card {
  min-width: 0;
}

.card-button {
  display: block;
  width: 100%;
  overflow: hidden;
  border: 1px solid #3e433d;
  border-radius: 6px;
  background: #1b1e1a;
  color: inherit;
  padding: 0;
  text-align: left;
  transition: border-color 160ms ease, transform 160ms ease;
}

.card-button:hover,
.card-button:focus-visible {
  border-color: #d5c761;
  outline: none;
  transform: translateY(-2px);
}

.card-media,
.detail-media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #2a2f29;
}

.card-media img,
.detail-media img,
.card-media video,
.detail-media video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.media-fallback {
  display: none;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 20px;
  color: #d0d2cc;
  font-size: 12px;
  text-align: center;
}

.media-spec {
  position: absolute;
  z-index: 3;
  top: 10px;
  left: 10px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 4px;
  background: rgba(12, 14, 12, 0.82);
  color: #f4f2ea;
  padding: 5px 7px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.04em;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(6px);
}

.media-spec.is-unavailable {
  border-color: rgba(229, 187, 104, 0.42);
  color: #f0ce8d;
}

.media-spec.is-none {
  border-color: rgba(255, 255, 255, 0.14);
  color: #b8bbb4;
}

.source-media.is-missing .media-fallback {
  display: grid;
}

.generated-media {
  isolation: isolate;
  background: #c6d2ba;
  color: #141510;
}

.cover-grid {
  position: absolute;
  inset: 0;
  opacity: 0.32;
  background-image: linear-gradient(#141510 1px, transparent 1px), linear-gradient(90deg, #141510 1px, transparent 1px);
  background-size: 24px 24px;
}

.cover-shape {
  position: absolute;
  display: block;
  border: 1px solid #141510;
}

.cover-shape-one {
  width: 48%;
  height: 62%;
  right: 8%;
  bottom: -14%;
  background: #e25635;
}

.cover-shape-two {
  width: 31%;
  height: 31%;
  left: 11%;
  top: 16%;
  border-radius: 50%;
  background: #e8d6b2;
}

.cover-label,
.cover-index {
  position: absolute;
  z-index: 1;
  font-size: clamp(13px, 1.2vw, 17px);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.cover-label {
  max-width: 70%;
  left: 11%;
  bottom: 13%;
}

.cover-index {
  top: 11%;
  right: 11%;
}

.cover-variant-1 { background: #d6ca72; }
.cover-variant-1 .cover-shape-one { background: #4a80b3; transform: rotate(18deg); }
.cover-variant-1 .cover-shape-two { background: #f3f0df; border-radius: 0; }
.cover-variant-2 { background: #d3bdb3; }
.cover-variant-2 .cover-shape-one { background: #285e4d; border-radius: 50%; }
.cover-variant-2 .cover-shape-two { background: #f3aa56; }
.cover-variant-3 { background: #a7c1c8; }
.cover-variant-3 .cover-shape-one { background: #e9ebdf; transform: skewX(-18deg); }
.cover-variant-3 .cover-shape-two { background: #b0443c; border-radius: 0; }
.cover-variant-4 { background: #e3c7a9; }
.cover-variant-4 .cover-shape-one { background: #2f3345; }
.cover-variant-4 .cover-shape-two { background: #ed7455; }
.cover-variant-5 { background: #b9c7b7; }
.cover-variant-5 .cover-shape-one { background: #a23e34; transform: rotate(-17deg); }
.cover-variant-5 .cover-shape-two { background: #f2e7cf; border-radius: 0; }
.cover-variant-6 { background: #c8bfdb; }
.cover-variant-6 .cover-shape-one { background: #e5a54c; border-radius: 50%; }
.cover-variant-6 .cover-shape-two { background: #203b55; }
.cover-variant-7 { background: #e0dada; }
.cover-variant-7 .cover-shape-one { background: #23675c; transform: skewY(14deg); }
.cover-variant-7 .cover-shape-two { background: #e8c957; }

.card-footer {
  min-height: 94px;
  justify-content: space-between;
  gap: 12px;
  padding: 13px;
}

.card-text {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.card-tags {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.card-title {
  color: #f2f0e9;
  display: -webkit-box;
  min-height: 36px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card-original-title {
  color: #9da29a;
  display: -webkit-box;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.preview-tag,
.resolution-tag,
.kind-tag {
  border: 1px solid #4d514b;
  border-radius: 999px;
  padding: 4px 7px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.resolution-tag {
  border-color: #9d7d47;
  color: #eccd91;
}

.kind-tag {
  border-color: #57777a;
  color: #b2d4d5;
}

.empty-state {
  grid-column: 1 / -1;
  border: 1px dashed #4d514b;
  padding: 42px 24px;
  color: #a8aca3;
  text-align: center;
}

.details-dialog {
  width: min(820px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  border: 0;
  border-radius: 7px;
  background: #1b1e1a;
  color: #eceae3;
  overflow: auto;
  padding: 0;
}

.details-dialog::backdrop {
  background: #0000009c;
}

.password-dialog {
  width: min(470px, calc(100% - 32px));
  border: 0;
  border-radius: 10px;
  padding: 0;
  color: #eceae3;
  background: #1b1e1a;
}

.password-dialog::backdrop {
  background: #000000b5;
}

.announcement-dialog {
  width: min(460px, calc(100% - 32px));
  border: 1px solid #4d514b;
  border-radius: 8px;
  padding: 0;
  color: #eceae3;
  background: #1b1e1a;
}

.announcement-dialog::backdrop {
  background: #000000b5;
}

.announcement-card {
  display: grid;
  gap: 16px;
  padding: 30px;
}

.announcement-card h2 {
  margin: -4px 0 0;
  font-size: 28px;
}

.announcement-message,
.announcement-note {
  margin: -6px 0 0;
  color: #bfc3b9;
  font-size: 14px;
  line-height: 1.6;
}

.announcement-note {
  color: #939a90;
  font-size: 13px;
}

.announcement-url {
  display: block;
  overflow-wrap: anywhere;
  border: 1px solid #50574e;
  border-radius: 6px;
  background: #11130f;
  padding: 12px 14px;
  color: #e4d779;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 14px;
  text-decoration: none;
}

.announcement-url:hover,
.announcement-url:focus-visible {
  border-color: #d5c761;
  color: #f0e98a;
}

.announcement-close-button {
  min-height: 42px;
  border: 1px solid #d5c761;
  border-radius: 6px;
  padding: 9px 16px;
  color: #11130f;
  background: #d5c761;
  font-size: 13px;
  font-weight: 700;
}

.announcement-close-button:hover,
.announcement-close-button:focus-visible {
  border-color: #e4d779;
  background: #e4d779;
}

.password-card {
  position: relative;
  display: grid;
  gap: 16px;
  padding: 30px;
}

.password-card h2 {
  margin: -4px 0 0;
  font-size: 30px;
}

.password-help {
  margin: -6px 0 4px;
  color: #a8aca3;
  font-size: 13px;
  line-height: 1.55;
}

.password-field {
  display: grid;
  gap: 7px;
  color: #bec3b9;
  font-size: 12px;
}

.password-field input {
  width: 100%;
  border: 1px solid #4d514b;
  border-radius: 6px;
  padding: 12px;
  outline: none;
  color: #eceae3;
  background: #11130f;
}

.password-field input:focus {
  border-color: #d5c761;
  box-shadow: 0 0 0 3px rgb(213 199 97 / 12%);
}

.save-password-button {
  min-height: 44px;
  border: 1px solid #d5c761;
  border-radius: 6px;
  padding: 10px 16px;
  color: #11130f;
  background: #d5c761;
  font-weight: 700;
}

.save-password-button:hover {
  background: #e4d779;
}

.save-password-button:disabled {
  cursor: wait;
  opacity: .55;
}

.password-close-button {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 0;
  color: #a8aca3;
  background: transparent;
  font-size: 27px;
  line-height: 1;
}

.password-close-button:hover {
  color: #eceae3;
}

.password-status {
  min-height: 20px;
  margin: -4px 0 0;
  color: #e49a91;
  font-size: 13px;
}

.password-status.is-success {
  color: #b9d7a8;
}

.details-card {
  position: relative;
}

.details-preview {
  border-bottom: 1px solid #3e433d;
}

.details-content {
  padding: 24px;
}

h2 {
  margin-bottom: 8px;
  font-size: clamp(25px, 4vw, 42px);
  font-weight: 500;
  letter-spacing: 0;
}

.details-original-title {
  margin: -1px 0 14px;
  color: #a8aca3;
  font-size: 15px;
  line-height: 1.4;
}

.details-actions {
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 10px;
}

.source-link,
.close-button {
  border: 1px solid #5d625a;
  border-radius: 4px;
  background: transparent;
  color: #eceae3;
  padding: 9px 11px;
  font-size: 12px;
  text-decoration: none;
}

.source-link:hover,
.close-button:hover {
  border-color: #d5c761;
  color: #d5c761;
}

.details-note {
  max-width: 670px;
  margin-bottom: 18px;
  font-size: 13px;
  line-height: 1.55;
}

.prompt-text-section {
  border-top: 1px solid #3e433d;
  padding-top: 18px;
}

.prompt-text-section h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
}

.prompt-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.select-prompt-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid #d5c761;
  border-radius: 4px;
  background: #d5c761;
  color: #11130f;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.select-prompt-button[hidden],
.prompt-copy-help[hidden],
.details-prompt[hidden],
.prompt-locked[hidden] {
  display: none;
}

.select-prompt-button:hover,
.select-prompt-button:focus-visible {
  background: #e4d779;
  border-color: #e4d779;
}

.prompt-copy-help {
  margin: 6px 0 10px;
  color: #a8aca3;
  font-size: 13px;
  line-height: 1.5;
}

.prompt-locked {
  display: grid;
  gap: 14px;
  margin-top: 12px;
  border: 1px dashed #575d54;
  border-radius: 5px;
  background: #151714;
  padding: 18px;
  color: #c9ccc4;
}

.prompt-locked p {
  margin: 0;
  line-height: 1.6;
}

.prompt-locked-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.prompt-register-link {
  color: #d5c761;
  font-size: 13px;
}

.details-prompt {
  -webkit-user-select: text;
  user-select: text;
  touch-action: auto;
  width: 100%;
  height: min(46vh, 420px);
  min-height: 220px;
  max-height: 46vh;
  overflow: auto;
  border: 1px solid #4d514b;
  border-radius: 5px;
  background: #11130f;
  color: #eceae3;
  margin: 0;
  padding: 14px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  cursor: text;
  resize: vertical;
}

.details-prompt::selection {
  background: #d5c761;
  color: #11130f;
}

.select-status {
  min-height: 20px;
  margin: 8px 0 0;
  color: #d5c761;
  font-size: 13px;
  line-height: 1.5;
}

.close-button {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  padding: 0;
  background: #151714e6;
  font-size: 27px;
  line-height: 1;
}

@media (max-width: 1060px) {
  .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .catalog-shell { width: min(100% - 28px, 600px); padding-top: 24px; }
  .topbar { display: block; }
  .account-area { margin-top: 16px; justify-items: start; }
  .summary { text-align: left; }
  .controls { display: grid; grid-template-columns: 1fr; }
  .select-field { min-width: 0; }
  .filter-group { width: 100%; }
  .filter-button { flex: 1; padding: 0 8px; }
  .catalog-meta { display: block; }
  .catalog-meta p + p { margin-top: 9px; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .card-footer { min-height: 110px; display: block; padding: 10px; }
  .card-tags { justify-content: flex-start; margin-top: 8px; }
}

@media (max-width: 440px) {
  .gallery { grid-template-columns: 1fr; }
}
