:root {
  color-scheme: dark;
  --bg: #0d0f12;
  --surface: #14171b;
  --surface-2: #1b2026;
  --surface-3: #252b33;
  --line: #2d3540;
  --line-2: #435061;
  --text: #eef2f5;
  --muted: #aeb8c2;
  --dim: #778493;
  --accent: #e06f36;
  --accent-soft: #2b1b15;
  --green: #34a46f;
  --danger: #ef6b6b;
  --radius: 8px;
  --radius-sm: 8px;
  --shadow: 0 18px 48px rgb(0 0 0 / 0.38);
}

.light {
  color-scheme: light;
  --bg: #f4ead4;
  --surface: #fff9eb;
  --surface-2: #f3e6cb;
  --surface-3: #e7d3aa;
  --line: #dcc69a;
  --line-2: #b9a174;
  --text: #231b13;
  --muted: #675940;
  --dim: #8d7b59;
  --accent: #9e5d2c;
  --accent-soft: #efd7ae;
  --green: #2d8056;
  --danger: #b65349;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(var(--bg), var(--bg)),
    var(--bg);
  color: var(--text);
  font: 14px/1.5 "Inter", "Segoe UI", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  letter-spacing: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(color-mix(in srgb, var(--line-2) 78%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--line-2) 78%, transparent) 1px, transparent 1px),
    linear-gradient(color-mix(in srgb, var(--line-2) 46%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--line-2) 46%, transparent) 1px, transparent 1px);
  background-size: 144px 144px, 144px 144px, 36px 36px, 36px 36px;
  mask-image: radial-gradient(circle at top center, #000 0, #000 52%, transparent 82%);
  opacity: 0.62;
}

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

button,
input,
textarea,
select {
  font: inherit;
  letter-spacing: 0;
}

button,
select {
  cursor: pointer;
}

button {
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--surface-2);
}

button:hover,
a:hover {
  border-color: var(--line-2);
  background: var(--surface-3);
}

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

select option {
  background-color: var(--surface);
  color: var(--text);
}

select option:checked {
  background-color: var(--surface-3);
  color: var(--accent);
}

.light select {
  color-scheme: light;
}

.light select option {
  background-color: #fff8e8;
  color: #241a0f;
}

.light select option:checked {
  background-color: #ecd6ab;
  color: var(--accent);
}

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

textarea {
  padding: 10px 12px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 2px;
}

.page-shell {
  width: min(1680px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 10px 0 34px;
}

.site-header {
  position: relative;
  min-height: 172px;
  padding: 14px 6px 24px;
}

.top-title {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: min(520px, calc(100vw - 560px));
  min-height: 50px;
  margin: 0;
  padding: 0;
  text-align: left;
}

.top-title strong {
  display: block;
  color: var(--text);
  font-size: clamp(28px, 3.2vw, 54px);
  line-height: 1;
  font-weight: 900;
  text-wrap: balance;
  white-space: nowrap;
}

.top-actions {
  position: absolute;
  top: 14px;
  right: 6px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: 0 10px 28px rgb(0 0 0 / 0.18);
  backdrop-filter: blur(16px);
}

.language-control {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 138px;
  color: var(--muted);
}

.top-actions .language-control {
  flex: 0 0 138px;
  display: inline-flex;
  align-items: center;
  gap: 0;
  margin: 0;
  font-size: 13px;
  font-weight: 800;
}

.language-icon {
  position: absolute;
  left: 12px;
  z-index: 1;
  width: 16px;
  height: 16px;
  pointer-events: none;
}

.top-actions .language-icon {
  width: 16px;
  height: 16px;
}

.top-actions .language-control select {
  width: 100%;
  height: 36px;
  padding-left: 34px;
  padding-right: 24px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-2) 72%, transparent);
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
}

#loginButton {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
}

#loginButton.admin-user {
  border-color: color-mix(in srgb, var(--accent) 48%, transparent);
  color: var(--text);
}

.user-chip {
  justify-content: flex-start;
  gap: 9px;
  min-width: 0;
  min-height: 40px;
  padding: 4px 10px 4px 5px;
  border-color: color-mix(in srgb, var(--line-2) 42%, transparent);
  background: var(--surface-2);
  color: var(--text);
}

.user-chip:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: var(--surface-3);
}

.user-chip-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background:
    radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--accent) 38%, #fff), transparent 32%),
    var(--surface-3);
  color: var(--text);
  font-size: 11px;
  font-weight: 900;
  object-fit: cover;
}

.user-chip-name {
  display: block;
  min-width: 0;
  max-width: 132px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip-role {
  flex: 0 0 auto;
  padding: 2px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.user-chip.anonymous-user {
  color: var(--muted);
}

.top-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

.top-action:hover {
  color: var(--text);
  border-color: var(--line);
  background: var(--surface-2);
}

.primary-action {
  min-height: 40px;
  padding: 0 16px;
  border-color: color-mix(in srgb, var(--accent) 88%, #fff);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 92%, #fff), var(--accent));
  color: #160a05;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 26%, transparent);
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.primary-action:hover {
  color: #160a05;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 100%, #fff), color-mix(in srgb, var(--accent) 88%, #000));
  box-shadow: 0 14px 30px color-mix(in srgb, var(--accent) 34%, transparent);
  transform: translateY(-1px);
}

.action-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.theme-switch {
  position: relative;
  width: 64px;
  height: 34px;
  padding: 0;
  border-radius: 999px;
  background: var(--surface-2);
  border-color: var(--line);
  overflow: hidden;
}

.switch-thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  z-index: 1;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--text);
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.25);
  transition: transform 0.22s cubic-bezier(.2,.8,.2,1), background 0.22s ease;
}

.theme-icon {
  position: absolute;
  top: 9px;
  z-index: 2;
  width: 16px;
  height: 16px;
  transition: color 0.18s ease, opacity 0.18s ease;
}

.theme-icon-moon {
  left: 9px;
  color: var(--bg);
}

.theme-icon-sun {
  right: 9px;
  color: var(--dim);
}

.theme-switch[aria-pressed="true"] .switch-thumb {
  transform: translateX(30px);
}

.theme-switch[aria-pressed="true"] .theme-icon-moon {
  color: var(--dim);
}

.theme-switch[aria-pressed="true"] .theme-icon-sun {
  color: var(--bg);
}

.nav-link,
.nav-action,
.icon-button,
.text-button,
.sort-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}

.nav-link.active {
  color: var(--text);
}

.nav-action:hover,
.nav-link:hover,
.icon-button:hover,
.text-button:hover {
  color: var(--text);
  border-color: var(--line);
  background: var(--surface-2);
}

.icon-button {
  width: 34px;
  padding: 0;
  font-size: 18px;
}

.hero {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding-top: 24px;
  text-align: center;
}

.hero h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 72px);
  line-height: 0.95;
  font-weight: 900;
}

.hero p {
  margin: 0;
  max-width: 720px;
  color: var(--dim);
  font-size: 15px;
}

.search-box {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: min(660px, calc(100vw - 52px));
  height: 42px;
  margin-top: 12px;
  padding: 0 10px 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.search-box input {
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
}

.search-icon,
kbd {
  color: var(--dim);
}

kbd {
  padding: 2px 7px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  background: var(--surface-2);
  font: 12px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.market-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 310px;
  gap: 16px;
}

.filters-panel,
.market-board,
.announcements-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.filters-panel {
  position: sticky;
  top: 76px;
  align-self: start;
  padding: 16px;
}

.announcements-panel {
  position: sticky;
  top: 76px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 92px);
  align-self: start;
  overflow: hidden;
}

.release-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent-soft) 28%, var(--surface)), var(--surface));
}

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

.release-head span {
  min-width: 0;
  color: var(--dim);
  font: 12px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.release-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 60%, var(--line));
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-weight: 750;
}

.release-download:hover {
  background: color-mix(in srgb, var(--accent) 88%, var(--text));
}

.release-download.disabled,
.release-download.disabled:hover {
  cursor: not-allowed;
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--dim);
}

.release-meta {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.leaderboard-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-2) 68%, var(--surface));
}

.leaderboard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.leaderboard-head strong {
  color: var(--text);
}

.leaderboard-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.leaderboard-tabs button {
  min-width: 0;
  min-height: 28px;
  padding: 0 6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-tabs button.selected {
  background: var(--surface-3);
  color: var(--text);
}

.leaderboard-list {
  display: grid;
  gap: 5px;
  max-height: 238px;
  overflow: auto;
  padding-right: 2px;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 26px 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 4px 6px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--muted);
}

.leaderboard-row.current {
  border-color: color-mix(in srgb, var(--accent) 44%, var(--line));
  background: color-mix(in srgb, var(--accent-soft) 46%, transparent);
  color: var(--text);
}

.leaderboard-rank {
  color: var(--dim);
  font: 800 11px/1 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.leaderboard-avatar {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--surface-3);
  object-fit: cover;
}

.leaderboard-name {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-score {
  color: var(--dim);
  font: 850 11px/1 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.leaderboard-divider {
  height: 1px;
  margin: 4px 0;
  background: var(--line);
}

.leaderboard-empty {
  padding: 10px 6px;
  color: var(--dim);
  font-size: 12px;
  text-align: center;
}

.announcements-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 54px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
}

.announcements-list {
  display: grid;
  flex: 1 1 auto;
  gap: 10px;
  min-height: 132px;
  max-height: none;
  overflow: auto;
  padding: 12px;
}

.announcement-item,
.announcement-empty {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.announcement-item {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.announcement-item.pinned {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent-soft) 34%, var(--surface-2)), var(--surface-2));
}

.announcement-item strong {
  line-height: 1.25;
}

.announcement-item p {
  margin: 0;
  color: var(--muted);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.announcement-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--dim);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.announcement-empty {
  padding: 18px 12px;
  color: var(--dim);
  text-align: center;
}

.filters-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.filters-title strong {
  font-size: 15px;
}

.filters-title p {
  margin: 3px 0 0;
  color: var(--dim);
  font-size: 13px;
}

.text-button {
  min-height: 28px;
  padding: 0 9px;
  color: var(--dim);
}

.filter-group {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.range-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.range-head strong {
  color: var(--text);
}

.range-head span {
  color: var(--muted);
  font-weight: 800;
}

.dual-range {
  position: relative;
  height: 34px;
  margin: 10px 0 4px;
}

.dual-range-track {
  position: absolute;
  left: 0;
  right: 0;
  top: 15px;
  height: 6px;
  border-radius: 999px;
  background: var(--surface-3);
}

.dual-range-track span {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 45%, #ffd24d));
}

.range-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 28px;
  padding: 0;
  border: 0;
  accent-color: var(--accent);
  background: transparent;
  pointer-events: none;
  appearance: none;
}

.range-input::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  border: 2px solid var(--surface);
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 2px 10px rgb(0 0 0 / 0.35);
  cursor: grab;
  pointer-events: auto;
  appearance: none;
}

.range-input::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 2px solid var(--surface);
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 2px 10px rgb(0 0 0 / 0.35);
  cursor: grab;
  pointer-events: auto;
}

.range-scale {
  display: flex;
  justify-content: space-between;
  color: var(--dim);
  font-size: 12px;
  font-weight: 750;
}

.filter-note {
  color: var(--muted);
  font-size: 13px;
}

.filter-heading {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 850;
  text-align: left;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 232px;
  overflow: auto;
  padding-right: 2px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 700;
}

.chip .count {
  min-width: 18px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--dim);
  font-size: 12px;
}

.chip.active {
  border-color: var(--line-2);
  background: #f3f3f3;
  color: #111;
}

.light .chip.active {
  background: #111;
  color: #fff;
}

.more-tags {
  flex: 1 1 100%;
  min-width: 0;
  margin-top: 2px;
}

.more-tags span {
  color: var(--dim);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.more-tags select {
  height: 36px;
  border-radius: var(--radius-sm);
}

.market-board {
  overflow: hidden;
}

.board-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  min-height: 58px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
}

.board-toolbar strong {
  padding-left: 2px;
  font-size: 15px;
}

.segmented {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
}

.segmented button,
.sort-button {
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 800;
}

.segmented .selected {
  background: #f4f4f4;
  color: #111;
}

.light .segmented .selected {
  background: #111;
  color: #fff;
}

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

.empty-state {
  grid-column: 1 / -1;
  min-height: 180px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius-sm);
  color: var(--dim);
}

.item-card {
  min-height: 360px;
  display: grid;
  grid-template-rows: auto auto minmax(170px, 1fr) auto;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
  animation: cardEnter 0.24s ease-out both;
}

.item-card:hover {
  border-color: var(--line-2);
  background: color-mix(in srgb, var(--surface) 88%, var(--surface-3));
  transform: translateY(-1px);
}

.card-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.card-preview {
  display: grid;
  place-items: center;
  min-height: 170px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background:
    linear-gradient(45deg, color-mix(in srgb, var(--surface-3) 76%, transparent) 25%, transparent 25%),
    linear-gradient(-45deg, color-mix(in srgb, var(--surface-3) 76%, transparent) 25%, transparent 25%),
    var(--surface-2);
  background-size: 24px 24px;
  color: var(--accent);
  font-weight: 900;
}

.card-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  animation: imageReveal 0.2s ease-out both;
}

.card-preview span {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  background: var(--accent-soft);
}

.card-title {
  overflow: hidden;
  color: var(--text);
  font-size: 17px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-pricing {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.pill-button {
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 800;
}

.copy-button {
  width: 31px;
  min-height: 31px;
  padding: 0;
  border-radius: 50%;
  color: var(--muted);
  font-size: 15px;
}

.card-desc {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  display: -webkit-box;
  min-height: 42px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 24px;
  margin-top: 8px;
}

.card-tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--dim);
  font-size: 12px;
  font-weight: 800;
}

.card-footer {
  display: grid;
  gap: 8px;
}

.card-meta {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--dim);
  font-size: 12px;
  font-weight: 750;
}

.card-meta strong {
  color: var(--muted);
}

.card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.like-button,
.comment-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  background: transparent;
  color: var(--dim);
  font-size: 12px;
  font-weight: 850;
}

.like-button span {
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
}

.comment-button svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  color: var(--muted);
}

.like-button:hover,
.like-button.liked,
.comment-button:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  background: color-mix(in srgb, var(--accent-soft) 72%, transparent);
  color: var(--text);
}

.like-button.liked span {
  color: var(--accent);
}

.comment-button:hover svg {
  color: var(--text);
}

.market-dialog {
  width: min(760px, calc(100vw - 34px));
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  animation: dialogEnter 0.18s cubic-bezier(.2,.8,.2,1) both;
}

.compact-dialog {
  width: min(520px, calc(100vw - 34px));
}

.market-dialog::backdrop {
  background: rgb(0 0 0 / 0.62);
  backdrop-filter: blur(4px);
}

.dialog-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.dialog-head h2 {
  margin: 0;
  font-size: 22px;
}

.overline {
  margin: 0 0 3px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.upload-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  gap: 16px;
}

.upload-drop {
  display: grid;
  gap: 12px;
  align-content: start;
}

.drop-zone {
  position: relative;
  min-height: 142px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 18px;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  background: var(--surface-2);
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.drop-zone:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--surface-2) 80%, var(--accent-soft));
  transform: translateY(-1px);
}

.drop-zone span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.drop-zone strong {
  color: var(--text);
  font-size: 15px;
}

.drop-zone small {
  color: var(--dim);
  font-size: 12px;
  font-weight: 750;
}

.drop-zone input {
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.upload-inspector {
  display: grid;
  gap: 12px;
}

.system-preview {
  min-height: 300px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(45deg, #1b1b1d 25%, transparent 25%),
    linear-gradient(-45deg, #1b1b1d 25%, transparent 25%),
    #111113;
  background-size: 26px 26px;
  color: var(--dim);
  text-align: center;
}

.system-preview img {
  width: 100%;
  height: 100%;
  max-height: 420px;
  object-fit: contain;
  animation: imageReveal 0.2s ease-out both;
}

.inspect-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.inspect-grid > div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.inspect-grid span,
.inspect-grid strong {
  display: block;
}

.inspect-grid span {
  color: var(--dim);
  font-size: 12px;
  font-weight: 800;
}

.inspect-grid strong {
  margin-top: 4px;
  color: var(--text);
  font-size: 16px;
}

.inspect-grid .valid {
  color: var(--green);
}

.inspect-grid .invalid {
  color: var(--danger);
}

.image-preview-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.upload-image-tile {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  animation: cardEnter 0.18s ease-out both;
}

.upload-image-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-image-tile span {
  position: absolute;
  right: 8px;
  top: 8px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgb(0 0 0 / 0.62);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.form-grid.one-col {
  grid-template-columns: 1fr;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.auth-tabs button {
  min-height: 34px;
  padding: 0 8px;
  overflow: hidden;
  border-color: transparent;
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-tabs button.selected {
  border-color: var(--line-2);
  background: var(--surface);
  color: var(--text);
}

.auth-pane {
  display: grid;
  gap: 12px;
}

.auth-pane[hidden] {
  display: none;
}

.code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.code-row .pill-button {
  min-width: 112px;
  min-height: 40px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.captcha-slot {
  width: min(100%, 320px);
  min-height: 78px;
  overflow: hidden;
}

.captcha-frame {
  display: block;
  width: 304px;
  max-width: 100%;
  height: 78px;
  border: 0;
}

.captcha-slot[hidden] {
  display: none;
}

.span-2 {
  grid-column: span 2;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.form-hint {
  margin: 0;
  color: var(--dim);
  font-size: 12px;
}

.primary {
  min-height: 42px;
  border-color: var(--accent);
  background: var(--accent);
  color: #160a05;
  font-weight: 900;
}

.github-login {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: var(--radius-sm);
  background: #1f2024;
  color: #fff;
  font-weight: 900;
}

.light .github-login {
  background: #23252a;
}

.github-login span:first-child {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #fff;
  color: #111;
  font-size: 10px;
  letter-spacing: 0;
}

.profile-dialog {
  width: min(980px, calc(100vw - 34px));
}

.profile-logout {
  justify-self: end;
  margin: -4px 0 12px;
}

.profile-header {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.profile-avatar,
.author-avatar {
  border-radius: 999px;
  background: var(--surface-3);
  object-fit: cover;
}

.profile-avatar {
  width: 56px;
  height: 56px;
}

.profile-avatar[src=""],
.author-avatar[src=""],
.admin-row img[src=""] {
  visibility: hidden;
}

.profile-header strong,
.profile-header span,
.profile-header code {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-header span,
.profile-header code {
  color: var(--dim);
  font-size: 12px;
}

.profile-header code {
  margin-top: 3px;
}

.author-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.author-line span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.author-avatar {
  width: 18px;
  height: 18px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.profile-quota {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 90%, var(--accent-soft)), var(--surface-2));
}

.profile-quota > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.profile-quota span,
.section-head span {
  color: var(--dim);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

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

.quota-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface);
}

.quota-bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #ffd24d));
  transition: width 0.28s ease;
}

.profile-quota p {
  margin: 0;
  color: var(--dim);
  font-size: 12px;
}

.profile-uploads,
.profile-interactions {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.profile-list {
  display: grid;
  gap: 8px;
}

.profile-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.profile-item img {
  width: 72px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  background: #0b0b0c;
}

.profile-item strong,
.profile-item span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.interaction-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.interaction-row .author-avatar,
.interaction-icon {
  width: 34px;
  height: 34px;
}

.interaction-icon {
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--accent);
  font-weight: 900;
}

.interaction-row strong,
.interaction-row span,
.interaction-row p {
  display: block;
  overflow: hidden;
  margin: 0;
  text-overflow: ellipsis;
}

.interaction-row span,
.interaction-row p {
  color: var(--dim);
  font-size: 12px;
}

.profile-empty {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  color: var(--dim);
  text-align: center;
}

.admin-panel {
  display: grid;
  gap: 12px;
  margin: 0 0 16px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent-soft) 18%, var(--surface)), var(--surface));
}

.admin-panel[hidden],
.admin-tabs button[hidden] {
  display: none;
}

.admin-panel-head {
  align-items: flex-start;
}

.admin-panel-head > div {
  min-width: 0;
}

.admin-panel-head strong,
.admin-form-title strong {
  display: block;
  color: var(--text);
  font-size: 15px;
}

.admin-panel-head small,
.admin-form-title span {
  display: block;
  margin-top: 2px;
  color: var(--dim);
  font-size: 12px;
  font-weight: 750;
}

.admin-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.admin-tabs button {
  min-width: 0;
  min-height: 34px;
  padding: 0 8px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-tabs button.selected {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--line));
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 8px 18px rgb(0 0 0 / 0.16);
}

.admin-panel-body,
.admin-list {
  display: grid;
  gap: 10px;
}

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

.admin-stat {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface-2) 84%, var(--surface));
}

.admin-stat strong {
  display: block;
  color: var(--text);
  font: 800 19px/1.05 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.admin-stat span {
  display: block;
  margin-top: 5px;
  color: var(--dim);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.admin-segmented {
  min-width: 0;
  overflow-x: auto;
}

.admin-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) minmax(148px, auto);
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface-2) 88%, var(--surface));
  transition: border-color 0.16s ease, background 0.16s ease;
}

.admin-row:hover {
  border-color: var(--line-2);
  background: color-mix(in srgb, var(--surface-2) 72%, var(--surface-3));
}

.admin-row img {
  width: 72px;
  height: 54px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--surface-3);
}

.admin-preview-fallback {
  display: grid;
  place-items: center;
  width: 72px;
  height: 54px;
  border-radius: 6px;
  background: var(--surface-3);
  color: var(--accent);
  font-weight: 900;
}

.admin-row.user-row img {
  width: 50px;
  height: 50px;
  border-radius: 999px;
}

.admin-row.report-row {
  grid-template-columns: minmax(0, 1fr) minmax(120px, auto);
}

.admin-row.announcement-row {
  grid-template-columns: minmax(0, 1fr) minmax(168px, auto);
  align-items: start;
}

.admin-row.user-row {
  grid-template-columns: 50px minmax(0, 1fr) minmax(148px, auto);
}

.admin-row-main {
  min-width: 0;
}

.admin-row-title {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.admin-row-actions {
  display: grid;
  grid-template-columns: minmax(132px, 1fr);
  gap: 6px;
  align-self: stretch;
  align-content: center;
}

.admin-row strong,
.admin-row span,
.admin-row p {
  display: block;
  overflow: hidden;
  margin: 0;
  text-overflow: ellipsis;
}

.admin-row span,
.admin-row p {
  color: var(--dim);
  font-size: 12px;
}

.admin-row p {
  display: -webkit-box;
  max-height: 3.1em;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  white-space: pre-wrap;
}

.admin-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.admin-metrics span {
  width: auto;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.admin-status {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.admin-status-published,
.admin-status-open {
  border-color: color-mix(in srgb, var(--green) 46%, var(--line));
  color: var(--green);
}

.admin-status-hidden,
.admin-status-draft,
.admin-status-pinned,
.admin-status-admin,
.admin-status-super_admin {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  color: var(--accent);
}

.admin-status-removed {
  border-color: color-mix(in srgb, var(--danger) 46%, var(--line));
  color: var(--danger);
}

.admin-row select,
.admin-config-form input,
.admin-config-form textarea {
  width: 100%;
}

.admin-config-form {
  display: grid;
  gap: 10px;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.announcement-editor,
.admin-settings-section {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.admin-form-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.admin-form-actions {
  display: flex;
  justify-content: flex-end;
}

.check-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

.check-field input {
  width: auto;
  height: auto;
  accent-color: var(--accent);
}

.admin-empty {
  background: var(--surface-2);
}

.danger-button {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  background: transparent;
  color: var(--danger);
  font-weight: 850;
}

.danger-button:hover {
  border-color: color-mix(in srgb, var(--danger) 54%, var(--line));
  background: color-mix(in srgb, var(--danger) 12%, var(--surface-2));
  color: var(--text);
}

#detailsDialog {
  width: min(920px, calc(100vw - 34px));
}

.detail-media {
  display: grid;
  gap: 10px;
}

.detail-stage {
  display: grid;
  place-items: center;
  min-height: 420px;
  max-height: min(58vh, 620px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background:
    linear-gradient(45deg, #1b1b1d 25%, transparent 25%),
    linear-gradient(-45deg, #1b1b1d 25%, transparent 25%),
    #0b0b0c;
  background-size: 24px 24px;
}

.detail-stage img {
  width: 100%;
  height: 100%;
  max-height: min(58vh, 620px);
  object-fit: contain;
  animation: imageReveal 0.16s ease-out both;
}

.detail-thumbs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(120px, 1fr);
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.detail-thumb {
  min-height: 74px;
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 6px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--muted);
  text-align: left;
}

.detail-thumb img {
  width: 68px;
  height: 54px;
  border-radius: 6px;
  object-fit: cover;
  background: #0b0b0c;
}

.detail-thumb span {
  overflow: hidden;
  font-size: 12px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-thumb.active {
  border-color: var(--accent);
  color: var(--text);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 60%, transparent);
}

.detail-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.admin-detail-tools {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
  margin: 10px 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.admin-detail-tools label {
  display: grid;
  gap: 4px;
  min-width: 180px;
}

.admin-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-left: 8px;
  padding: 0 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 52%, var(--line));
  border-radius: 999px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.report-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: transparent;
  color: var(--dim);
  font-weight: 850;
}

.report-button:hover {
  border-color: color-mix(in srgb, var(--danger) 50%, var(--line));
  background: color-mix(in srgb, var(--danger) 12%, var(--surface-2));
  color: var(--text);
}

.file-list {
  display: grid;
  gap: 10px;
}

.detail-downloads {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.file-row .pill-button {
  justify-self: end;
}

.package-download {
  display: inline-flex;
  justify-self: end;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: #160a05;
  font-weight: 900;
}

.package-download:hover {
  border-color: color-mix(in srgb, var(--accent) 88%, #fff);
  background: color-mix(in srgb, var(--accent) 86%, #fff);
}

.comments-section {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.comments-list {
  display: grid;
  gap: 8px;
}

.comment-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.comment-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

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

.comment-row p {
  margin: 4px 0 0;
  color: var(--muted);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.comment-form {
  display: grid;
  gap: 8px;
}

.comment-form .primary {
  justify-self: end;
  min-width: 140px;
}

.meta {
  margin-top: 4px;
  color: var(--dim);
  font-size: 13px;
}

#toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 30;
  transform: translateX(-50%);
  max-width: min(680px, calc(100vw - 32px));
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

#toast.visible {
  opacity: 1;
}

.site-footer {
  width: min(1680px, calc(100vw - 28px));
  margin: 24px auto 0;
  padding: 18px 6px 4px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 14px;
  color: var(--dim);
  font-size: 12px;
}

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

.site-footer a:hover {
  background: transparent;
  color: var(--text);
}

@media (max-width: 1320px) {
  .site-header {
    min-height: 206px;
  }

  .top-title {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .top-actions {
    position: relative;
    top: auto;
    right: auto;
    width: fit-content;
    max-width: 100%;
    margin: 10px auto 0;
  }

  .market-layout {
    grid-template-columns: 280px minmax(0, 1fr);
  }

  .announcements-panel {
    grid-column: 1 / -1;
    position: static;
    max-height: none;
  }

  .announcements-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: none;
  }

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

@media (max-width: 980px) {
  .top-title {
    padding: 0 6px;
    width: 100%;
  }

  .top-actions {
    width: 100%;
    max-width: calc(100vw - 28px);
    overflow-x: auto;
    overflow-y: hidden;
    justify-content: flex-start;
    border-radius: var(--radius);
  }

  .site-header {
    min-height: 224px;
  }

  .market-layout {
    grid-template-columns: 1fr;
  }

  .filters-panel {
    position: static;
  }

  .announcements-list {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 680px) {
  .page-shell {
    width: min(100vw - 16px, 1680px);
  }

  .hero {
    padding-top: 24px;
  }

  .top-title strong {
    max-width: 58vw;
    font-size: clamp(28px, 8vw, 42px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .top-action {
    padding: 0 10px;
  }

  .top-actions .language-control {
    flex-basis: 118px;
  }

  .primary-action span {
    display: none;
  }

  .user-chip {
    min-width: 44px;
    padding-right: 8px;
  }

  .user-chip-name {
    max-width: 82px;
  }

  .user-chip-role {
    display: none;
  }

  .market-layout {
    gap: 10px;
  }

  .board-toolbar {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .card-top {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .pill-button {
    padding: 0 10px;
  }

  .form-grid,
  .form-grid.one-col,
  .upload-layout {
    grid-template-columns: 1fr;
  }

  .auth-tabs {
    grid-template-columns: 1fr;
  }

  .code-row {
    grid-template-columns: 1fr;
  }

  .code-row .pill-button {
    width: 100%;
  }

  .detail-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .report-button {
    justify-self: stretch;
  }

  .profile-item {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .profile-item img {
    width: 64px;
    height: 44px;
  }

  .profile-item .danger-button {
    grid-column: 1 / -1;
  }

  .admin-row,
  .admin-row.announcement-row,
  .admin-row.report-row,
  .admin-row.user-row {
    grid-template-columns: 1fr;
  }

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

  .admin-toolbar,
  .admin-form-title {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-row img,
  .admin-preview-fallback {
    width: 100%;
    height: 120px;
  }

  .admin-row.user-row img {
    width: 52px;
    height: 52px;
  }

  .admin-row-actions {
    grid-template-columns: 1fr;
  }

  .admin-form-grid {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }
}

@keyframes cardEnter {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes dialogEnter {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes imageReveal {
  from { opacity: 0; transform: scale(.985); }
  to { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
