:root {
  color-scheme: dark;
}

@font-face {
  font-family: "Inter";
  src: url("./assets/fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #09090b;
  --panel: rgba(24, 24, 27, 0.84);
  --panel-dark: rgba(9, 9, 11, 0.74);
  --line: rgba(63, 63, 70, 0.58);
  --line-soft: rgba(39, 39, 42, 0.72);
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --dim: #71717a;
  --purple: #4169e1;
  --purple-line: #5f7ff0;
  --purple-text: #9bb0ff;
  --purple-soft: #10225f;
  --red-bg: #450a0a;
  --red-line: #991b1b;
  --red-text: #f87171;
  --yellow-bg: #422006;
  --yellow-line: #854d0e;
  --yellow-text: #eab308;
  --radius: 12px;
  --radius-sm: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.header-inner,
.main,
.footer-inner {
  width: min(1280px, 100%);
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-box {
  display: flex;
  align-items: center;
  min-height: 31px;
  border: 1px solid var(--line);
  background: var(--purple);
  color: #fff;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.version {
  color: var(--dim);
  font-size: 12px;
  white-space: nowrap;
}

.mobile-nav {
  display: none;
  position: relative;
}

.mobile-nav-button,
.sort-button {
  min-height: 31px;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.mobile-nav-button {
  display: flex;
  width: 100%;
  justify-content: space-between;
  border: 1px solid var(--line);
  background: var(--panel-dark);
  align-items: center;
}

.nav-tabs {
  display: flex;
  width: auto;
  border: 1px solid var(--line);
  background: var(--panel-dark);
  padding: 2px;
}

.nav-tab {
  min-height: 31px;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.nav-tab:hover {
  background: var(--panel);
  color: #fff;
}

.nav-tab.is-active {
  background: var(--purple);
  color: #fff;
}

.main {
  flex: 1;
  display: flex;
  gap: 24px;
  padding-top: 24px;
  padding-bottom: 24px;
}

.main.single-column .left-column {
  width: 100%;
}

.left-column {
  flex: 1 1 auto;
  min-width: 0;
}

.archive-view,
#browseView {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.archive-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border: 1px solid var(--line);
  background: var(--panel-dark);
  padding: 2px;
}

.archive-subtab {
  min-height: 31px;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.archive-subtab:hover {
  background: var(--panel);
  color: #fff;
}

.archive-subtab.is-active {
  background: var(--purple);
  color: #fff;
}

.detail-column {
  flex: 0 0 420px;
  width: 420px;
}

.filters-panel,
.import-panel,
.empty-detail,
.detail-panel {
  border: 1px solid var(--line);
  background: var(--panel);
}

.filters-panel {
  padding: 16px;
}

.controls-row {
  display: flex;
  gap: 12px;
}

.search-wrap {
  position: relative;
  flex: 1 1 auto;
  min-width: 220px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--panel-dark);
  color: var(--text);
  outline: none;
  border-radius: 0;
}

input,
select {
  height: 38px;
  padding: 0 12px;
}

textarea {
  display: block;
  padding: 12px;
  resize: vertical;
  line-height: 1.5;
}

input::placeholder,
textarea::placeholder {
  color: #52525b;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--purple-line);
}

.clear-search {
  position: absolute;
  top: 50%;
  right: 10px;
  border: 0;
  background: transparent;
  color: var(--dim);
  transform: translateY(-50%);
  font-size: 12px;
}

.clear-search:hover,
.link-button:hover,
.inline-action:hover,
.footer a:hover {
  color: var(--purple-text);
}

.sort-box,
.toggle-box {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--panel-dark);
  color: var(--muted);
  font-size: 12px;
}

.sort-box {
  position: relative;
  gap: 8px;
  padding-left: 12px;
}

.sort-button {
  display: flex;
  width: 142px;
  align-items: center;
  justify-content: space-between;
  border-left: 1px solid var(--line);
}

.sort-button:hover,
.mobile-nav-button:hover {
  color: #fff;
}

.sort-menu {
  position: absolute;
  top: calc(100% + 1px);
  right: -1px;
  z-index: 30;
  min-width: 144px;
  border: 1px solid var(--line);
  background: var(--panel-dark);
  padding: 2px;
}

.sort-menu button {
  display: block;
  width: 100%;
  min-height: 31px;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0 10px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.sort-menu button:hover,
.sort-menu button.is-active {
  background: var(--purple);
  color: #fff;
}

.toggle-box {
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  user-select: none;
}

.toggle-box input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.switch {
  position: relative;
  display: inline-block;
  width: 32px;
  height: 16px;
  border: 1px solid #3f3f46;
  background: var(--line);
}

.switch span {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 12px;
  background: #fff;
  transition: transform 150ms ease, background 150ms ease;
}

.toggle-box input:checked + .switch {
  border-color: var(--purple-line);
  background: var(--purple);
}

.toggle-box input:checked + .switch span {
  transform: translateX(16px);
  background: #dbe4ff;
}

.tag-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.advanced-filters {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.advanced-filters summary {
  color: var(--purple-text);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.advanced-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.advanced-grid label,
.advanced-grid fieldset {
  border: 1px solid var(--line);
  background: var(--panel-dark);
  color: var(--dim);
  padding: 12px;
  font-size: 11px;
  text-transform: uppercase;
}

.advanced-grid label {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.advanced-grid fieldset {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
}

.advanced-grid legend {
  color: var(--muted);
  padding: 0 4px;
}

.advanced-grid input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--purple);
}

.filter-block {
  margin-top: 12px;
}

.filter-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--dim);
  font-size: 11px;
  text-transform: uppercase;
}

.tag-label {
  margin-right: 4px;
  color: var(--dim);
  text-transform: uppercase;
}

.tag-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-picker {
  display: grid;
  gap: 8px;
}

.tag-picker input {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  background: var(--panel-dark);
  color: var(--text);
  padding: 0 10px;
  font-size: 13px;
}

.tag-picker input:focus {
  outline: 1px solid var(--purple-line);
  border-color: var(--purple-line);
}

.selected-tags,
.tag-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-button {
  min-height: 24px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  padding: 0 8px;
  font-size: 11px;
}

.tag-button:hover {
  border-color: #3f3f46;
  color: #fff;
}

.tag-button.is-active {
  border-color: var(--purple-line);
  background: var(--purple);
  color: #fff;
}

.tag-button.is-excluded {
  border-color: var(--red-line);
  background: var(--red-bg);
  color: var(--red-text);
}

.push-right {
  margin-left: auto;
}

.load-more {
  width: 100%;
  margin-top: 12px;
}

.link-button,
.inline-action {
  border: 0;
  background: transparent;
  color: var(--purple-text);
  padding: 0;
  font-size: 11px;
}

.strong {
  font-weight: 700;
}

.result-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--dim);
  font-size: 12px;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 218px;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line);
  background: var(--panel);
  cursor: pointer;
}

.card:hover,
.card.is-selected {
  border-color: var(--purple-line);
}

.card.is-selected {
  outline: 4px solid rgba(147, 51, 234, 0.3);
  outline-offset: 0;
}

.nsfw-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
  border: 1px solid var(--red-line);
  background: var(--red-bg);
  color: var(--red-text);
  padding: 2px 6px;
  font-size: 9px;
  font-weight: 700;
}

.source-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1;
  border: 1px solid var(--line);
  background: var(--panel-dark);
  color: var(--muted);
  padding: 2px 6px;
  font-size: 9px;
  font-weight: 700;
}

.source-badge.user {
  border-color: var(--purple-line);
  color: var(--purple-text);
}

.source-badge.original {
  border-color: var(--yellow-line);
  color: var(--yellow-text);
}

.inline-detail-host {
  display: none;
  grid-column: 1 / -1;
}

.inline-detail-host .detail-panel {
  position: static;
  max-height: none;
}

.card-main {
  display: flex;
  gap: 16px;
  padding: 16px;
  min-width: 0;
}

.avatar {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #121216;
}

.avatar img,
.detail-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1);
  transition: filter 180ms ease;
}

.card:hover .avatar img {
  filter: grayscale(0);
}

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

.card-info h2 {
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card:hover .card-info h2 {
  color: var(--purple-text);
}

.creator {
  margin: 4px 0 0;
  overflow: hidden;
  color: var(--dim);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 10px;
}

.card-description {
  flex: 1 1 auto;
  padding: 0 16px 12px;
}

.card-description p {
  display: -webkit-box;
  height: 36px;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid rgba(39, 39, 42, 0.8);
  background: var(--panel-dark);
  padding: 10px 16px;
}

.card-tags {
  display: flex;
  max-width: 70%;
  gap: 4px;
  overflow: hidden;
}

.mini-tag {
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--dim);
  padding: 2px 6px;
  font-size: 9px;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.star-button {
  min-width: 26px;
  min-height: 26px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--dim);
  font-size: 14px;
}

.star-button:hover {
  color: #fff;
}

.star-button.is-starred {
  border-color: var(--yellow-line);
  background: rgba(66, 32, 6, 0.45);
  color: var(--yellow-text);
}

.empty-results {
  border: 1px solid var(--line);
  background: rgba(24, 24, 27, 0.5);
  padding: 48px;
  text-align: center;
  color: var(--dim);
}

.empty-results p {
  margin: 0 0 8px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
}

.empty-results span {
  font-size: 12px;
}

.import-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px;
}

.import-panel h1,
.profile-panel h1 {
  margin: 0 0 8px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
  color: var(--text);
  font-size: 16px;
  text-transform: uppercase;
}

.import-panel p,
.profile-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.profile-panel,
.preserve-panel,
.blog-panel,
.feature-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 24px;
}

.feature-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.card-page-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.feature-head h1 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  text-transform: uppercase;
}

.feature-head span {
  color: var(--dim);
  font-size: 12px;
}

.directory-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.directory-item,
.idea-panel {
  border: 1px solid var(--line);
  background: var(--panel-dark);
  padding: 14px;
}

.directory-item {
  text-align: left;
}

.directory-item strong,
.idea-panel h2 {
  display: block;
  margin: 0 0 8px;
  color: var(--text);
  font-size: 14px;
}

.directory-item span,
.idea-panel p,
.file-path,
.panel-search {
  color: var(--dim);
  font-size: 12px;
  line-height: 1.6;
}

.directory-item:hover {
  border-color: var(--purple-line);
  color: #fff;
}

.card-page-body {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
}

.card-page-cover {
  border: 1px solid var(--line);
  background: var(--panel-dark);
  aspect-ratio: 2 / 3;
  overflow: hidden;
}

.card-page-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: none;
}

.card-page-sections {
  display: grid;
  gap: 14px;
}

.card-page-section {
  border: 1px solid var(--line);
  background: var(--panel-dark);
  padding: 14px;
}

.card-page-section h2 {
  margin: 0 0 8px;
  color: var(--purple-text);
  font-size: 12px;
  text-transform: uppercase;
}

.card-page-section p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.file-path,
.panel-search {
  border: 1px solid var(--line);
  background: var(--panel-dark);
  padding: 10px 12px;
  margin-bottom: 12px;
}

.profile-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.eyebrow,
.preserve-label {
  display: block;
  margin-bottom: 8px;
  color: var(--purple-text);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.profile-card {
  border: 1px solid var(--line);
  background: var(--panel-dark);
  padding: 16px;
}

.profile-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--dim);
  font-size: 11px;
  text-transform: uppercase;
}

.profile-card strong {
  color: var(--text);
  font-size: 22px;
}

.profile-sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.auth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.auth-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid var(--line);
  background: var(--panel-dark);
  padding: 16px;
}

.auth-card h2 {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.auth-card label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--dim);
  font-size: 11px;
  text-transform: uppercase;
}

.auth-card p {
  color: var(--dim);
  font-size: 11px;
}

.category-form,
.url-import {
  display: flex;
  gap: 8px;
}

.author-claim {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.author-claim input {
  width: 14px;
  height: 14px;
  accent-color: var(--purple);
}

.category-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.category-pill {
  border: 1px solid var(--purple-line);
  background: rgba(46, 16, 101, 0.35);
  color: #b8c6ff;
  padding: 4px 8px;
  font-size: 11px;
  text-transform: uppercase;
}

.profile-sections section {
  border: 1px solid var(--line);
  background: var(--panel-dark);
  padding: 16px;
}

.profile-sections h2 {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.profile-sections label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.profile-sections input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--purple);
}

.preserve-panel {
  min-height: 560px;
}

.blog-panel h1 {
  max-width: 840px;
  font-size: clamp(28px, 5vw, 64px);
  line-height: 0.95;
}

.blog-list {
  display: grid;
  gap: 16px;
  max-width: 920px;
  margin-top: 28px;
}

.blog-post {
  border: 1px solid var(--line);
  background: var(--panel-dark);
  padding: 18px;
}

.blog-post span {
  display: block;
  margin-bottom: 8px;
  color: var(--purple-text);
  font-size: 11px;
  text-transform: uppercase;
}

.blog-post h2 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 18px;
}

.blog-post p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.manifesto {
  max-width: 1040px;
  margin: 28px 0 0;
  color: #fff;
  font-size: clamp(20px, 3vw, 38px);
  font-weight: 800;
  line-height: 1.12;
  text-transform: uppercase;
}

.about-lede {
  max-width: 760px;
  margin: 24px 0 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
}

.manifesto.small {
  max-width: 880px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.7;
  text-transform: none;
}

.manifesto-divider {
  width: min(560px, 100%);
  height: 1px;
  margin: 40px 0 18px;
  background: var(--line);
}

.about-separator {
  width: min(360px, 100%);
  height: 1px;
  margin: 20px 0;
  background: var(--line-soft);
}

.notice {
  border: 1px solid;
  padding: 12px;
  font-size: 12px;
}

.notice-error {
  border-color: var(--red-line);
  background: var(--red-bg);
  color: var(--red-text);
}

.notice-success {
  border-color: var(--purple-line);
  background: var(--purple-soft);
  color: #b8c6ff;
  font-weight: 700;
}

.form-head,
.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--dim);
  font-size: 12px;
}

#importForm {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.builder-grid,
.upload-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

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

.builder-grid label,
.upload-row label,
.builder-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--dim);
  font-size: 11px;
  text-transform: uppercase;
}

.builder-label textarea,
.raw-import textarea {
  min-height: 0;
}

.raw-import,
.builder-details,
.upload-card {
  border: 1px solid var(--line);
  background: var(--panel-dark);
  padding: 12px;
}

.raw-import summary,
.builder-details summary {
  color: var(--purple-text);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.builder-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
}

.upload-card {
  display: grid;
  grid-template-columns: minmax(260px, 360px) 1fr;
  gap: 16px;
  align-items: center;
}

.upload-card p {
  margin: 0;
  color: var(--dim);
  font-size: 12px;
  line-height: 1.6;
}

.upload-button {
  display: flex;
  min-height: 72px;
  width: 100%;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--purple-line);
  background: rgba(46, 16, 101, 0.35);
  color: #fff;
  padding: 12px;
  text-align: left;
}

.upload-button:hover {
  background: rgba(126, 34, 206, 0.5);
}

.upload-button span {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.upload-button small {
  max-width: 100%;
  overflow: hidden;
  color: var(--purple-text);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.primary-button {
  min-height: 40px;
  border: 0;
  background: var(--purple);
  color: #fff;
  padding: 0 24px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.primary-button:hover {
  background: var(--purple-line);
}

.full {
  width: 100%;
}

.empty-detail {
  position: sticky;
  top: 80px;
  padding: 24px;
  text-align: center;
  color: var(--dim);
}

.empty-detail p {
  margin: 0 0 8px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
}

.empty-detail span {
  font-size: 12px;
  line-height: 1.6;
}

.detail-panel {
  position: sticky;
  top: 80px;
  display: flex;
  max-height: calc(100vh - 120px);
  flex-direction: column;
  overflow-y: auto;
}

.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-dark);
  padding: 16px;
}

.min-zero {
  min-width: 0;
}

.detail-head span {
  color: var(--purple-text);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.detail-head h2 {
  margin: 4px 0 0;
  overflow: hidden;
  color: var(--text);
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.outline-button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--dim);
  padding: 6px 8px;
  font-size: 12px;
}

.outline-button:hover {
  color: #fff;
}

.icon-button {
  width: 32px;
  min-width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--dim);
  padding: 0;
  font-size: 20px;
  line-height: 1;
}

.icon-button:hover {
  border-color: var(--purple-line);
  color: #fff;
}

.detail-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 16px;
}

.detail-top {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 16px;
}

.detail-avatar {
  width: 100%;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #121216;
}

.detail-avatar img {
  filter: none;
}

.detail-meta {
  flex: 1 1 auto;
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
}

.detail-meta span {
  color: var(--dim);
}

.detail-meta b {
  font-weight: 400;
}

.detail-block h3 {
  margin: 0 0 6px;
  color: var(--dim);
  font-size: 11px;
  font-weight: 400;
  text-transform: uppercase;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.detail-tag {
  border: 1px solid rgba(88, 28, 135, 0.6);
  background: rgba(46, 16, 101, 0.35);
  color: #b8c6ff;
  padding: 3px 8px;
  font-size: 12px;
  text-transform: uppercase;
}

.detail-tag.nsfw {
  border-color: rgba(127, 29, 29, 0.7);
  background: rgba(69, 10, 10, 0.5);
  color: var(--red-text);
}

.text-box {
  margin: 0;
  border: 1px solid var(--line-soft);
  background: var(--panel-dark);
  color: #d4d4d8;
  padding: 12px;
  font-size: 12px;
  line-height: 1.6;
}

.purple-text {
  color: #b8c6ff;
}

.italic {
  font-style: italic;
}

.scroll-box {
  max-height: 144px;
  overflow-y: auto;
}

.raw-block {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.raw-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  color: var(--dim);
  font-size: 11px;
  text-transform: uppercase;
}

pre {
  max-height: 128px;
  margin: 0;
  overflow: auto;
  border: 1px solid var(--line-soft);
  background: var(--panel-dark);
  color: var(--dim);
  padding: 12px;
  font-size: 10px;
  line-height: 1.5;
}

.detail-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  background: var(--panel-dark);
  color: var(--dim);
  padding: 12px;
  font-size: 11px;
}

.footer {
  margin-top: 48px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 16px;
  padding-bottom: 16px;
  color: var(--dim);
  font-size: 12px;
}

.footer span {
  color: var(--muted);
}

.footer nav {
  display: flex;
  gap: 16px;
}

.blog-popup {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 60;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  width: min(520px, calc(100vw - 32px));
  border: 1px solid var(--purple-line);
  background: var(--panel);
  box-shadow: 0 0 0 1px #000;
  padding: 12px;
}

.blog-popup span {
  display: block;
  color: var(--purple-text);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.blog-popup strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header,
.footer {
  background: rgba(24, 24, 27, 0.82);
  backdrop-filter: blur(12px);
}

.brand-box,
.nav-tabs,
.archive-subtabs,
.mobile-nav-button,
.filters-panel,
.import-panel,
.empty-detail,
.detail-panel,
.profile-panel,
.preserve-panel,
.blog-panel,
.feature-panel,
.sort-box,
.toggle-box,
.sort-menu,
.advanced-grid label,
.advanced-grid fieldset,
.tag-picker input,
.raw-import,
.builder-details,
.upload-card,
.directory-item,
.idea-panel,
.card,
.empty-results,
.card-page-cover,
.card-page-section,
.profile-card,
.auth-card,
.profile-sections section,
.notice,
.text-box,
pre,
.blog-post,
.blog-popup,
.pagination-bar {
  border-radius: var(--radius);
}

.nav-tab,
.archive-subtab,
.sort-menu button,
.tag-button,
.mini-tag,
.star-button,
.source-badge,
.nsfw-badge,
.detail-tag,
.category-pill,
.primary-button,
.outline-button,
.upload-button,
input,
select,
textarea,
.switch,
.switch span,
.page-size-control {
  border-radius: var(--radius-sm);
}

.brand-box {
  min-height: 34px;
  border-color: var(--line);
  background: rgba(9, 9, 11, 0.72);
  color: var(--purple-text);
  padding: 0 12px;
}

.nav-tabs,
.archive-subtabs {
  gap: 2px;
  background: rgba(9, 9, 11, 0.58);
}

.nav-tab,
.archive-subtab {
  min-height: 30px;
}

.nav-tab.is-active,
.archive-subtab.is-active,
.sort-menu button.is-active {
  background: var(--purple);
  color: #fff;
}

.main {
  gap: 28px;
}

.archive-view,
#browseView {
  gap: 20px;
}

.filters-panel,
.import-panel,
.empty-detail,
.detail-panel,
.profile-panel,
.preserve-panel,
.blog-panel,
.feature-panel,
.blog-popup {
  border-color: rgba(63, 63, 70, 0.5);
  background: rgba(24, 24, 27, 0.82);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.2);
}

input,
select,
textarea,
.sort-box,
.toggle-box,
.tag-picker input,
.advanced-grid label,
.advanced-grid fieldset,
.raw-import,
.builder-details,
.upload-card,
.text-box,
pre {
  background: rgba(9, 9, 11, 0.58);
}

input:focus,
select:focus,
textarea:focus,
.tag-picker input:focus {
  outline: 1px solid rgba(168, 85, 247, 0.28);
  border-color: rgba(168, 85, 247, 0.76);
}

.sort-menu {
  top: calc(100% + 6px);
  padding: 4px;
  background: #09090b;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.tag-row {
  border-top-color: rgba(63, 63, 70, 0.44);
}

.tag-button {
  background: rgba(24, 24, 27, 0.42);
}

.tag-button.is-active {
  border-color: rgba(168, 85, 247, 0.72);
  background: rgba(147, 51, 234, 0.34);
  color: #dbe4ff;
}

.cards-grid {
  gap: 16px;
}

.card {
  min-height: 218px;
  overflow: hidden;
  border-color: rgba(63, 63, 70, 0.5);
  background: rgba(24, 24, 27, 0.82);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.card:hover,
.card.is-selected {
  border-color: rgba(168, 85, 247, 0.72);
  box-shadow: 0 14px 36px rgba(147, 51, 234, 0.12);
}

.card:hover {
  transform: translateY(-1px);
}

.card.is-selected {
  outline: 1px solid rgba(168, 85, 247, 0.32);
  outline-offset: 2px;
}

.avatar,
.detail-avatar,
.card-page-cover {
  border-color: rgba(63, 63, 70, 0.58);
  background: rgba(39, 39, 42, 0.6);
  border-radius: var(--radius);
}

.avatar img,
.detail-avatar img {
  filter: none;
}

.card-description p {
  height: 36px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.card-bottom,
.detail-head,
.detail-footer {
  border-color: rgba(63, 63, 70, 0.42);
  background: rgba(9, 9, 11, 0.46);
}

.stats span {
  border: 1px solid rgba(39, 39, 42, 0.7);
  background: rgba(9, 9, 11, 0.42);
  border-radius: var(--radius-sm);
  padding: 2px 6px;
}

.mini-tag {
  background: rgba(24, 24, 27, 0.76);
}

.source-badge {
  background: rgba(9, 9, 11, 0.78);
  backdrop-filter: blur(8px);
}

.primary-button {
  background: var(--purple);
}

.outline-button {
  border-color: rgba(63, 63, 70, 0.68);
  background: rgba(9, 9, 11, 0.35);
}

.outline-button:disabled,
.page-size-control select:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  border: 1px solid rgba(63, 63, 70, 0.5);
  background: rgba(24, 24, 27, 0.62);
  padding: 10px;
}

.page-info {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.page-button {
  min-width: 82px;
  min-height: 34px;
}

.page-size-control {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(63, 63, 70, 0.58);
  background: rgba(9, 9, 11, 0.46);
  color: var(--dim);
  padding: 0 8px;
  font-size: 11px;
  text-transform: uppercase;
}

.page-size-control select {
  width: 70px;
  height: 32px;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0 6px;
}

.text-box,
.card-page-section p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

[hidden] {
  display: none !important;
}

@media (max-width: 1100px) {
  .main {
    flex-direction: column;
  }

  .detail-column {
    flex: 0 1 auto;
    width: 100%;
  }

  .detail-panel,
  .empty-detail {
    position: static;
    max-height: none;
  }

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

@media (max-width: 760px) {
  .header-inner {
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }

  .brand-row {
    flex: 1 1 auto;
  }

  .brand-box {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .version {
    display: none;
  }

  .mobile-nav {
    display: block;
    flex: 0 0 132px;
  }

  .nav-tabs {
    display: none;
    position: absolute;
    top: calc(100% - 1px);
    left: 16px;
    right: 16px;
    z-index: 50;
    flex-direction: column;
    width: 100%;
    width: auto;
    overflow: visible;
  }

  .nav-tabs.is-open {
    display: flex;
  }

  .nav-tab {
    flex: 0 0 auto;
    width: 100%;
    padding-left: 8px;
    padding-right: 8px;
    text-align: left;
  }

  .controls-row {
    flex-direction: column;
  }

  .sort-box {
    padding-right: 12px;
  }

  .sort-button {
    width: 100%;
  }

  .sort-menu {
    left: -1px;
    right: -1px;
  }

  .toggle-box {
    min-height: 38px;
  }

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

  .result-line,
  .form-actions,
  .pagination-bar,
  .profile-head,
  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .pagination-bar {
    align-items: stretch;
  }

  .page-info {
    text-align: center;
  }

  .page-size-control {
    justify-content: space-between;
    min-height: 38px;
  }

  .blog-popup {
    grid-template-columns: 1fr;
  }

  .profile-grid,
  .profile-sections,
  .auth-grid,
  .directory-grid,
  .card-page-body,
  .advanced-grid,
  .builder-grid,
  .upload-row,
  .upload-card {
    grid-template-columns: 1fr;
  }
}
