/* ==========================================================================
   BLOCKFORGE — community home, account, wallet and modals
   Reuses station.css tokens and base components.
   ========================================================================== */

/* ---------- Topbar extensions ---------- */
.topnav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: none;
  margin-left: 4px;
}

.topnav__link {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  border-radius: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 550;
  white-space: nowrap;
  transition: background 0.16s, color 0.16s;
}

.topnav__link:hover {
  background: var(--hover);
  color: var(--text);
}

.topnav__link.is-active {
  background: var(--surface-2);
  color: var(--text);
}

.wallet {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: background 0.16s, border-color 0.16s;
}

.wallet:hover {
  background: var(--surface);
  border-color: var(--border-strong);
}

.wallet__item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.wallet__item svg {
  width: 12px;
  height: 12px;
  flex: none;
}

.wallet__item--coin {
  color: var(--accent-strong);
}

.wallet__item--credit {
  color: var(--warn);
}

.wallet__item b {
  font-weight: 600;
  color: var(--text-2);
}

.wallet__sep {
  width: 1px;
  height: 12px;
  background: var(--border);
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex: none;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--avatar-color, var(--accent));
  color: #fff;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
  transition: transform 0.16s, box-shadow 0.16s;
}

.avatar:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.avatar.is-guest {
  background: transparent;
  border-style: dashed;
  border-color: var(--border-strong);
  color: var(--muted);
}

.auth-btn {
  height: 30px;
  font-size: 10.5px;
}

/* ---------- Bottom nav ---------- */
.bottom-nav {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  height: 56px;
  align-items: center;
  justify-content: space-around;
  border-top: 1px solid var(--border);
  background: var(--surface-glass);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
}

.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 76px;
  height: 100%;
  color: var(--muted);
  font-size: 9px;
  font-weight: 550;
}

.bottom-nav a.is-active {
  color: var(--accent-strong);
}

.bottom-nav svg {
  width: 18px;
  height: 18px;
}

body.community {
  padding-bottom: 34px;
}

@media (max-width: 900px) {
  body.community {
    padding-bottom: 70px;
  }
  .bottom-nav {
    display: flex;
  }
  .topnav {
    display: none;
  }
  .auth-btn {
    display: none;
  }
  .topbar__inner {
    gap: 7px;
  }
}

@media (max-width: 640px) {
  .wallet {
    padding: 0 6px;
    gap: 4px;
    font-size: 9px;
  }
  .wallet__sep {
    height: 10px;
  }
  .wallet__item svg {
    width: 11px;
    height: 11px;
  }
  .search-trigger {
    display: none;
  }
  .topbar__actions {
    gap: 5px;
  }
  .lang-switch button {
    min-width: 22px;
    padding: 0 4px;
  }
}

/* ---------- Home ---------- */
.home {
  max-width: 1240px;
  margin: 0 auto;
  padding: 18px var(--pad) 8px;
}

.home-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 2px 0 14px;
}

.home-head__left {
  min-width: 0;
}

.home-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}

.home-eyebrow::before {
  content: "";
  width: 5px;
  height: 5px;
  background: var(--accent);
}

.home-title {
  margin: 6px 0 3px;
  font-size: clamp(22px, 2.6vw, 28px);
  line-height: 1.1;
  letter-spacing: -0.035em;
  font-weight: 700;
}

.home-desc {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--muted);
}

.home-head__actions {
  flex: none;
  padding-bottom: 2px;
}

/* Featured */
.featured {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.featured__view {
  position: relative;
  min-height: 250px;
  background: var(--canvas-bg);
  overflow: hidden;
}

.featured__view canvas {
  width: 100%;
  height: 100%;
  min-height: 250px;
  object-fit: cover;
  image-rendering: pixelated;
}

.featured__chip {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 4px;
  background: rgba(8, 8, 12, 0.68);
  color: #fff;
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.featured__chip i {
  width: 4px;
  height: 4px;
  background: var(--accent);
}

.featured__body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  min-width: 0;
}

.featured__label {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.featured__title {
  margin: 6px 0 6px;
  font-size: clamp(18px, 1.8vw, 24px);
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-weight: 700;
}

.featured__desc {
  margin: 0;
  font-size: 11px;
  line-height: 1.55;
  color: var(--muted);
}

.featured__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 8px;
  color: var(--faint);
}

.featured__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.featured__price {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
}

.featured__price.is-free {
  color: var(--ok);
}

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

.author__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex: none;
  border-radius: 50%;
  background: var(--avatar-color, var(--accent));
  color: #fff;
  font-family: var(--mono);
  font-size: 7px;
  font-weight: 600;
  text-transform: uppercase;
}

.author__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  color: var(--text-2);
}

/* Feed */
.feed-section {
  margin-top: 20px;
}

.feed-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.feed-title {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.feed-count {
  font-family: var(--mono);
  font-size: 8px;
  color: var(--faint);
}

.feed-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 0 12px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

.filter-chips {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  min-width: 0;
}

.filter-chip {
  height: 25px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
  transition: background 0.16s, color 0.16s, border-color 0.16s;
}

.filter-chip:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.filter-chip.is-active {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent-strong);
}

.feed-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  min-width: 0;
}

.feed-search {
  position: relative;
  width: 200px;
  min-width: 0;
}

.feed-search svg {
  position: absolute;
  left: 8px;
  top: 50%;
  width: 12px;
  height: 12px;
  transform: translateY(-50%);
  color: var(--faint);
  pointer-events: none;
}

.feed-search input {
  width: 100%;
  height: 26px;
  padding: 0 8px 0 25px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text);
  font-size: 10px;
}

.feed-search input:focus {
  outline: none;
  border-color: var(--accent-line);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.feed-sort {
  height: 26px;
  padding: 0 22px 0 7px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background-color: var(--surface);
  color: var(--text-2);
  font-size: 10px;
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 11px) 11px, calc(100% - 7px) 11px;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
}

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

.asset-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform 0.18s var(--ease), border-color 0.18s, box-shadow 0.18s;
}

.asset-tile:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: 0 10px 28px rgba(20, 20, 30, 0.1);
}

.asset-tile__view {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--canvas-bg);
}

.asset-tile__view canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}

.tile-badge {
  position: absolute;
  top: 7px;
  left: 7px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 18px;
  padding: 0 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  background: rgba(8, 8, 12, 0.7);
  color: #fff;
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.05em;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.tile-badge i {
  width: 4px;
  height: 4px;
  background: var(--ws-color, var(--accent));
}

.tile-price {
  position: absolute;
  top: 7px;
  right: 7px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 18px;
  padding: 0 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  background: rgba(8, 8, 12, 0.7);
  color: #fff;
  font-family: var(--mono);
  font-size: 7.5px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.tile-price.is-free {
  color: var(--accent);
}

.tile-price svg {
  width: 9px;
  height: 9px;
}

.asset-tile__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 6px;
  padding: 9px 10px 10px;
}

.asset-tile__title {
  margin: 0;
  min-height: 30px;
  font-size: 12px;
  line-height: 1.3;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.asset-tile__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-family: var(--mono);
  font-size: 7.5px;
  color: var(--faint);
  white-space: nowrap;
}

.asset-tile__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: auto;
  padding-top: 7px;
  border-top: 1px solid var(--border);
}

.tile-download {
  height: 25px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 9.5px;
  font-weight: 550;
  white-space: nowrap;
  transition: background 0.16s, border-color 0.16s, color 0.16s;
}

.tile-download:hover {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent-strong);
}

.tile-download.is-free {
  color: var(--accent-strong);
}

.tile-own {
  color: var(--accent-strong);
}

.feed-empty {
  padding: 44px 18px;
  text-align: center;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
}

.feed-empty p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 11.5px;
}

/* Site footer */
.site-foot {
  max-width: 1240px;
  margin: 26px auto 0;
  padding: 12px var(--pad) 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  font-family: var(--mono);
  font-size: 7.5px;
  line-height: 1.6;
  letter-spacing: 0.02em;
  color: var(--faint);
}

.site-foot a:hover {
  color: var(--accent-strong);
}

/* ---------- Account page ---------- */
.account {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px var(--pad) 10px;
}

.account-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

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

.account-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 50%;
  background: var(--avatar-color, var(--accent));
  color: #fff;
  font-size: 15px;
  font-weight: 650;
  text-transform: uppercase;
}

.account-name {
  margin: 0 0 2px;
  font-size: 20px;
  letter-spacing: -0.03em;
  font-weight: 700;
  line-height: 1.15;
}

.account-meta {
  margin: 0;
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-head__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}

.balance-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.balance-card {
  position: relative;
  overflow: hidden;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.balance-card::after {
  content: "";
  position: absolute;
  right: -20px;
  bottom: -20px;
  width: 80px;
  height: 80px;
  border: 1px solid var(--balance-color, var(--accent));
  opacity: 0.16;
  transform: rotate(45deg);
}

.balance-card--coin {
  --balance-color: var(--accent);
}

.balance-card--credit {
  --balance-color: var(--warn);
}

.balance-card__label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

.balance-card__label svg {
  width: 11px;
  height: 11px;
  color: var(--balance-color);
}

.balance-card__value {
  margin: 8px 0 2px;
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1;
  letter-spacing: -0.04em;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.balance-card__value small {
  margin-left: 4px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--faint);
}

.balance-card__sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 9.5px;
  color: var(--muted);
}

.balance-card__sub button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  font-size: 9.5px;
  font-weight: 600;
  white-space: nowrap;
}

.balance-card__sub button:hover {
  text-decoration: underline;
}

.account-tabs {
  display: flex;
  gap: 2px;
  margin-top: 16px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}

.account-tabs::-webkit-scrollbar {
  display: none;
}

.account-tab {
  position: relative;
  height: 32px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 550;
  white-space: nowrap;
}

.account-tab::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: -1px;
  height: 2px;
  background: transparent;
  border-radius: 1px;
}

.account-tab:hover {
  color: var(--text);
}

.account-tab.is-active {
  color: var(--text);
}

.account-tab.is-active::after {
  background: var(--accent);
}

.account-panel {
  padding: 12px 0 0;
}

.account-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.account-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
}

.account-row:first-child {
  border-top: 0;
}

.account-thumb {
  width: 44px;
  height: 44px;
  flex: none;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--canvas-bg);
}

.account-thumb canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}

.account-row__body {
  flex: 1;
  min-width: 0;
}

.account-row__title {
  margin: 0 0 2px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-row__meta {
  font-family: var(--mono);
  font-size: 7.5px;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-row__side {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.account-row__amount {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--text-2);
  white-space: nowrap;
  text-align: right;
}

.account-row__amount.is-free {
  color: var(--ok);
}

.account-row__amount small {
  display: block;
  margin-top: 2px;
  font-size: 7px;
  color: var(--faint);
}

.account-empty {
  padding: 38px 16px;
  text-align: center;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
}

.account-empty p {
  margin: 0 0 12px;
  font-size: 11px;
  color: var(--muted);
}

.tx-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-top: 1px solid var(--border);
}

.tx-row:first-child {
  border-top: 0;
}

.tx-type {
  width: 24px;
  height: 24px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--muted);
  background: var(--surface-2);
}

.tx-row__body {
  flex: 1;
  min-width: 0;
}

.tx-row__title {
  font-size: 10px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tx-row__meta {
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 7px;
  color: var(--faint);
}

.tx-amount {
  font-family: var(--mono);
  font-size: 9px;
  white-space: nowrap;
}

.tx-amount.is-plus {
  color: var(--ok);
}

.tx-amount.is-minus {
  color: var(--muted);
}

.account-guest {
  max-width: 420px;
  margin: 44px auto;
  padding: 32px 26px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.account-guest h1 {
  margin: 0 0 6px;
  font-size: 20px;
  letter-spacing: -0.03em;
}

.account-guest p {
  margin: 0 0 20px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
}

.account-guest .btn {
  width: 100%;
}

.account-note {
  margin: 4px 0 0;
  font-family: var(--mono);
  font-size: 8px;
  line-height: 1.6;
  color: var(--muted);
}

/* ---------- Modals (shared) ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 320;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(6, 6, 10, 0.5);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

.modal__dialog {
  position: relative;
  width: min(420px, 100%);
  max-height: 92vh;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-pop);
  animation: modal-in 0.16s var(--ease);
}

.modal__dialog--detail {
  width: min(820px, 100%);
}

.modal__dialog--buy {
  width: min(360px, 100%);
}

.modal__dialog--publish {
  width: min(660px, 100%);
}

.modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 12px;
}

.modal__eyebrow {
  display: block;
  margin-bottom: 4px;
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}

.modal__title {
  margin: 0;
  font-size: 20px;
  line-height: 1.15;
  letter-spacing: -0.035em;
  font-weight: 700;
}

.modal__head .icon-btn {
  width: 28px;
  height: 28px;
  flex: none;
}

.modal__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
}

.modal__foot-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.modal__note {
  font-family: var(--mono);
  font-size: 8px;
  color: var(--muted);
  line-height: 1.5;
}

.btn--block {
  display: flex;
  width: 100%;
}

.form-error {
  margin: 0;
  padding: 7px 9px;
  border: 1px solid rgba(194, 73, 73, 0.3);
  border-radius: 4px;
  background: rgba(194, 73, 73, 0.08);
  color: var(--danger);
  font-size: 9.5px;
  line-height: 1.4;
}

/* Auth */
.auth-tabs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 2px;
  margin: 0 18px 12px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
}

.auth-tabs button {
  height: 26px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 550;
}

.auth-tabs button.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

:root[data-theme="dark"] .auth-tabs button.is-active {
  background: var(--surface-3);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 18px;
}

.auth-demo {
  width: calc(100% - 36px);
  margin: 10px 18px 0;
}

.auth-note {
  margin: 10px 18px 0;
  font-size: 9px;
  line-height: 1.55;
  color: var(--muted);
}

.auth-switch {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 6px 18px 14px;
  font-size: 9.5px;
  color: var(--faint);
}

/* Recharge */
.recharge-body {
  padding: 0 18px 4px;
}

.recharge-balance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0 9px;
  font-family: var(--mono);
  font-size: 8px;
  color: var(--faint);
}

.recharge-balance b {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-2);
}

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

.recharge-pkg {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-height: 78px;
  padding: 10px 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
  text-align: left;
  transition: border-color 0.16s, background 0.16s;
}

.recharge-pkg:hover {
  border-color: var(--border-strong);
}

.recharge-pkg.is-selected {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent-line);
}

.recharge-pkg__amount {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.15;
}

.recharge-pkg__amount small {
  margin-left: 2px;
  font-family: var(--mono);
  font-size: 7px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--faint);
}

.recharge-pkg__bonus {
  font-family: var(--mono);
  font-size: 7px;
  color: var(--accent-strong);
}

.recharge-pkg__price {
  margin-top: auto;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--muted);
}

.recharge-hint {
  margin: 9px 0 10px;
  font-size: 9px;
  line-height: 1.5;
  color: var(--muted);
}

/* Detail */
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  gap: 14px;
  padding: 0 18px 16px;
}

.detail-preview {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--canvas-bg);
}

.detail-preview canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}

.detail-preview__price {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 4px;
  background: rgba(8, 8, 12, 0.7);
  color: #fff;
  font-family: var(--mono);
  font-size: 8px;
}

.detail-preview__price.is-free {
  color: var(--accent);
}

.detail-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.detail-author {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.detail-author .author__avatar {
  width: 26px;
  height: 26px;
  font-size: 9px;
}

.detail-author__name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
}

.detail-author__time {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 7.5px;
  color: var(--faint);
}

.detail-desc {
  margin: 10px 0 0;
  font-size: 10.5px;
  line-height: 1.6;
  color: var(--muted);
}

.detail-stats {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 8px;
  color: var(--faint);
}

.detail-stats b {
  font-weight: 600;
  color: var(--text-2);
}

.detail-price {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-top: auto;
  padding-top: 12px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.detail-price small {
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 500;
  color: var(--faint);
}

.detail-price.is-free {
  color: var(--ok);
}

.detail-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.detail-actions .btn {
  flex: 1;
}

.detail-note {
  margin: 8px 0 0;
  font-size: 8.5px;
  line-height: 1.5;
  color: var(--muted);
}

/* Buy */
.buy-body {
  padding: 0 18px 14px;
}

.buy-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
}

.buy-item__thumb {
  width: 40px;
  height: 40px;
  flex: none;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--canvas-bg);
}

.buy-item__thumb canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}

.buy-item__body {
  min-width: 0;
}

.buy-item__title {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.buy-item__author {
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 7.5px;
  color: var(--faint);
}

.buy-rows {
  margin: 12px 0 0;
}

.buy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  border-top: 1px solid var(--border);
  font-size: 10px;
  color: var(--muted);
}

.buy-row:first-child {
  border-top: 0;
}

.buy-row b {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 600;
  color: var(--text-2);
}

.buy-row--total {
  margin-top: 4px;
  padding-top: 9px;
  border-top: 1px solid var(--border-strong);
  font-size: 11px;
  color: var(--text);
}

.buy-row--total b {
  font-size: 16px;
  letter-spacing: -0.02em;
  color: var(--text);
}

.buy-note {
  margin: 9px 0 0;
  font-size: 8.5px;
  line-height: 1.5;
  color: var(--muted);
}

/* Publish */
.publish-grid {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 14px;
  padding: 0 18px 16px;
}

.publish-preview__view {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--canvas-bg);
}

.publish-preview__view canvas {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}

.publish-preview__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 7px;
  font-family: var(--mono);
  font-size: 7.5px;
  color: var(--faint);
}

.publish-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.publish-form .textarea {
  min-height: 56px;
}

.publish-note {
  margin: 0;
  font-size: 9px;
  line-height: 1.55;
  color: var(--muted);
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .featured {
    grid-template-columns: minmax(0, 1.3fr) minmax(250px, 0.9fr);
  }
  .feed-search {
    width: 170px;
  }
  .asset-tile__title {
    font-size: 11.5px;
  }
}

@media (max-width: 820px) {
  .featured {
    grid-template-columns: 1fr;
  }
  .featured__view {
    min-height: 0;
    aspect-ratio: 2.4 / 1;
  }
  .featured__view canvas {
    min-height: 0;
  }
  .featured__body {
    padding: 14px;
    gap: 10px;
  }
  .feed-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .feed-tools {
    width: 100%;
    margin-left: 0;
  }
  .feed-search {
    flex: 1;
    width: auto;
  }
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .detail-preview {
    aspect-ratio: 1.6 / 1;
  }
  .publish-grid {
    grid-template-columns: 150px minmax(0, 1fr);
  }
  .account-head {
    display: block;
  }
  .account-head__actions {
    margin-top: 10px;
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  .home {
    padding-top: 14px;
  }
  .home-head {
    align-items: flex-start;
    gap: 10px;
    padding-bottom: 12px;
  }
  .home-title {
    font-size: 23px;
  }
  .home-desc {
    font-size: 10.5px;
    max-width: 230px;
  }
  .home-head__actions {
    padding-top: 18px;
  }
  .featured__view {
    aspect-ratio: 1.9 / 1;
  }
  .featured__title {
    font-size: 17px;
  }
  .featured__desc {
    display: none;
  }
  .featured__body {
    gap: 8px;
  }
  .featured__meta {
    font-size: 7.5px;
  }
  .feed-grid {
    gap: 8px;
  }
  .asset-tile__body {
    padding: 7px 8px 8px;
  }
  .asset-tile__title {
    min-height: 28px;
    font-size: 11px;
  }
  .asset-tile__meta {
    font-size: 7px;
  }
  .tile-download {
    height: 23px;
    padding: 0 7px;
    font-size: 9px;
  }
  .tile-badge,
  .tile-price {
    top: 5px;
    font-size: 6.5px;
    height: 16px;
    padding: 0 5px;
  }
  .tile-badge {
    left: 5px;
  }
  .tile-price {
    right: 5px;
  }
  .filter-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
    width: 100%;
  }
  .filter-chips::-webkit-scrollbar {
    display: none;
  }
  .feed-tools {
    flex-wrap: wrap;
  }
  .feed-search {
    min-width: 150px;
  }
  .feed-sort {
    flex: none;
  }
  .account {
    padding-top: 14px;
  }
  .account-head {
    display: flex;
  }
  .account-avatar {
    width: 40px;
    height: 40px;
    font-size: 13px;
  }
  .account-name {
    font-size: 18px;
  }
  .account-head__actions {
    margin-top: 0;
  }
  .account-head__actions .btn span {
    display: none;
  }
  .account-head__actions .btn {
    width: 32px;
    padding: 0;
  }
  .balance-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .balance-card {
    padding: 12px;
  }
  .balance-card__value {
    font-size: 24px;
  }
  .balance-card__sub {
    display: block;
    font-size: 9px;
  }
  .balance-card__sub button {
    display: block;
    margin-top: 4px;
  }
  .account-row {
    padding: 8px 9px;
    gap: 8px;
  }
  .account-thumb {
    width: 38px;
    height: 38px;
  }
  .account-row__side .btn {
    height: 23px;
    padding: 0 7px;
    font-size: 9px;
  }
  .modal {
    padding: 10px;
    align-items: flex-end;
  }
  .modal__dialog {
    width: 100%;
    max-height: 88vh;
    border-radius: 12px 12px 8px 8px;
  }
  .modal__dialog--detail,
  .modal__dialog--publish,
  .modal__dialog--buy {
    width: 100%;
  }
  .detail-grid {
    padding: 0 14px 14px;
  }
  .detail-preview {
    aspect-ratio: 1.9 / 1;
  }
  .detail-price {
    margin-top: 10px;
  }
  .publish-grid {
    grid-template-columns: 1fr;
    padding: 0 14px 14px;
  }
  .publish-preview__view {
    aspect-ratio: 2 / 1;
  }
  .recharge-packages {
    gap: 5px;
  }
  .recharge-pkg {
    min-height: 72px;
    padding: 8px 7px;
  }
  .recharge-pkg__amount {
    font-size: 15px;
  }
  .modal__head {
    padding: 14px 14px 10px;
  }
  .auth-tabs {
    margin: 0 14px 10px;
  }
  .auth-form {
    padding: 0 14px;
  }
  .auth-demo {
    width: calc(100% - 28px);
    margin: 8px 14px 0;
  }
  .auth-note,
  .auth-switch {
    margin-left: 14px;
    margin-right: 14px;
  }
  .recharge-body {
    padding: 0 14px;
  }
  .modal__foot {
    padding: 10px 14px;
  }
  .modal__foot .btn {
    flex: none;
  }
  .buy-body {
    padding: 0 14px 12px;
  }
  .site-foot {
    display: block;
    padding-bottom: 14px;
  }
  .site-foot span {
    display: block;
  }
  .site-foot span + span {
    margin-top: 4px;
  }
  .account-guest {
    margin: 28px auto;
    padding: 26px 20px;
  }
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .modal__dialog {
    animation: none;
  }
}
