/* Sticky footer: pin footer to bottom when page content is short */
html, body { min-height: 100vh; }
body { display: flex; flex-direction: column; min-height: 100vh; }
html, body { overflow-x: hidden; max-width: 100vw; }

/* Pages rendered via PageShell portal into the outer <main class="container">.
   If a page also wraps its content in another <main class="container">, the
   built-in .container padding (100px top, 20-240px sides) stacks and creates a
   huge gap + horizontal overflow. Neutralize the inner one. */
main.container main.container {
  padding: 0 !important;
  max-width: 100% !important;
  margin: 0 !important;
}

/* Every wrapper between <body> and the PageHTML content is a plain div. Make
   every direct-and-nested chain flex so margin-top:auto on .footer reaches. */
body > div:not(.flex-container):not(.grid-x):not(.modal):not(.modal-card):not(.modal-card-body):not(.section-borderless):not(.card):not(.card-body),
body > div > div:not(.flex-container):not(.grid-x):not(.modal):not(.modal-card):not(.modal-card-body):not(.section-borderless):not(.card):not(.card-body),
body > div > div > div:not(.flex-container):not(.grid-x):not(.modal):not(.modal-card):not(.modal-card-body):not(.section-borderless):not(.card):not(.card-body),
body > div > div > div > div:not(.flex-container):not(.grid-x):not(.modal):not(.modal-card):not(.modal-card-body):not(.section-borderless):not(.card):not(.card-body) {
  display: contents;
}

main.container { flex: 1 0 auto; }
.footer { flex-shrink: 0; margin-top: auto; }

/* --- Forum mobile polish --- */
.wtc-topic-card {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.15s ease;
}
.wtc-topic-card:hover { box-shadow: 0 2px 6px rgba(0,0,0,0.08); }
.wtc-topic-card:active { transform: scale(0.995); }

.wtc-topic-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--gray-600); }
.wtc-topic-meta b { color: var(--body-color); }

@media (max-width: 640px) {
  /* Forum index category cards: stack right-hand counts under the title */
  .wtc-topic-card .flex-container.align-middle {
    flex-wrap: wrap;
  }
  .wtc-topic-card .text-right {
    text-align: left !important;
    width: 100%;
    margin-top: 6px;
    display: flex;
    gap: 12px;
  }
  .wtc-topic-card .text-right > div { min-width: 0 !important; }

  /* Discuss headers: keep New Topic below title on small screens */
  main.container h1.text-2xl { font-size: 1.35rem !important; line-height: 1.2; }

  /* Foundation grid fallback in case cell sizing collapses */
  .grid-x > .cell.small-12 { width: 100% !important; }

  .wtc-post-card .wtc-post-author {
    display: flex; align-items: center; gap: 10px; text-align: left !important;
    padding-bottom: 8px; border-bottom: 1px solid var(--section-border-color); margin-bottom: 10px;
  }
  .wtc-post-card .wtc-post-author .wtc-avatar-wrap { width: 56px !important; height: 56px !important; }
  .wtc-post-card .wtc-post-author .wtc-avatar-wrap canvas,
  .wtc-post-card .wtc-post-author .wtc-avatar-wrap > div { width: 56px !important; height: 56px !important; }
  .wtc-post-card .wtc-post-meta { text-align: left !important; }
  main.container { padding-left: 10px !important; padding-right: 10px !important; }
}

/* Notifications dropdown */
/* Verified badge: render an actual shield-with-check glyph in place of the
   Font Awesome circle-check whenever it is styled as the verified badge
   (text-success). Uses CSS mask so it inherits color via currentColor. */
i.fa-circle-check.text-success,
i.fas.fa-circle-check.text-success,
i.fa-solid.fa-circle-check.text-success,
i.verified-check {
  color: #22c55e !important;
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
  line-height: 1;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><path d='M269 5c-8-4-17-4-25 0L48 82C29 89 16 108 16 129c0 173 100 291 217 335 6 3 12 4 19 4s13-1 19-4c117-44 217-162 217-335 0-21-13-40-32-47L269 5zm107 199L241 340c-6 6-16 6-22 0l-64-64c-6-6-6-16 0-22s16-6 22 0l53 53 124-124c6-6 16-6 22 0s6 16 0 22z'/></svg>") no-repeat center / contain;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><path d='M269 5c-8-4-17-4-25 0L48 82C29 89 16 108 16 129c0 173 100 291 217 335 6 3 12 4 19 4s13-1 19-4c117-44 217-162 217-335 0-21-13-40-32-47L269 5zm107 199L241 340c-6 6-16 6-22 0l-64-64c-6-6-6-16 0-22s16-6 22 0l53 53 124-124c6-6 16-6 22 0s6 16 0 22z'/></svg>") no-repeat center / contain;
}
i.fa-circle-check.text-success::before,
i.fas.fa-circle-check.text-success::before,
i.fa-solid.fa-circle-check.text-success::before,
i.verified-check::before { content: none !important; }
i.fa-circle-check.text-6xl.text-success,
i.fas.fa-circle-check.text-6xl.text-success { width: 4rem; height: 4rem; }

.wtc-notif-item { padding: 8px 6px; border-radius: 8px; }
.wtc-notif-item:hover { background: rgba(0,0,0,0.05); }
.wtc-notif-item.unread { background: rgba(13,105,172,0.08); }
.wtc-notif-actor { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; flex-shrink: 0; background: #eee; }
.wtc-notif-body { font-size: 13px; line-height: 1.35; min-width: 0; }
.wtc-notif-body b { color: var(--body-color); }
.wtc-notif-time { font-size: 11px; color: var(--gray-600); margin-top: 2px; }

/* Quick-search result rows */
.wtc-search-item { display: block; text-decoration: none; color: inherit; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.wtc-search-item:hover { background: rgba(0,0,0,0.06); }
.wtc-search-avatar { width: 34px; height: 34px; border-radius: 50%; overflow: hidden; background: #eee; flex-shrink: 0; }
.wtc-search-icon { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #eef2f6; color: var(--gray-700); flex-shrink: 0; }
/* Breathing room between market/inventory content and the footer */
main.container { padding-bottom: 3rem; }

/* Isolated two-step login prompt. Do not rely on generic .modal classes here,
   because the imported frontend modal CSS is used for several different layouts. */
.wtc-mfa-overlay {
  position: fixed !important;
  inset: 0 !important;
  z-index: 1000000 !important;
  display: grid !important;
  place-items: center !important;
  width: 100vw !important;
  min-height: 100vh !important;
  padding: 18px !important;
  overflow-y: auto !important;
  background: rgba(15, 23, 42, 0.58) !important;
  backdrop-filter: blur(3px);
}

.wtc-mfa-card {
  width: min(100%, 430px) !important;
  max-height: calc(100vh - 36px) !important;
  overflow: hidden !important;
  border: 1px solid var(--section-border-color) !important;
  border-radius: 10px !important;
  background: var(--section-bg) !important;
  color: var(--body-color) !important;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.3) !important;
}

.wtc-mfa-header {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) !important;
  gap: 12px !important;
  align-items: center !important;
  padding: 18px 20px !important;
  border-bottom: 1px solid var(--section-border-color) !important;
  background: var(--section-bg) !important;
}

.wtc-mfa-icon {
  display: grid !important;
  width: 42px !important;
  height: 42px !important;
  place-items: center !important;
  flex-shrink: 0 !important;
  border-radius: 50% !important;
  background: rgba(34, 197, 94, 0.12) !important;
  color: var(--success-500) !important;
  font-size: 20px !important;
}

.wtc-mfa-heading { min-width: 0 !important; }
.wtc-mfa-heading h1 {
  margin: 0 !important;
  overflow: hidden !important;
  color: var(--body-color) !important;
  font-size: 20px !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}
.wtc-mfa-heading p {
  margin: 3px 0 0 !important;
  color: var(--gray-600) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 1.25 !important;
}

.wtc-mfa-body {
  padding: 20px !important;
  background: var(--section-bg) !important;
}

.wtc-mfa-copy {
  margin: 0 0 12px !important;
  color: var(--gray-600) !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  line-height: 1.45 !important;
}

.wtc-mfa-input {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  margin: 0 0 12px !important;
  font-size: 18px !important;
  letter-spacing: 0 !important;
  text-align: center !important;
}

.wtc-mfa-remember {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) !important;
  gap: 10px !important;
  align-items: center !important;
  max-width: 100% !important;
  margin: 0 0 10px !important;
  cursor: pointer !important;
  color: var(--body-color) !important;
}

.wtc-mfa-remember input {
  width: 18px !important;
  height: 18px !important;
  margin: 0 !important;
  flex-shrink: 0 !important;
  accent-color: var(--success-500);
}

.wtc-mfa-remember span {
  min-width: 0 !important;
  overflow-wrap: anywhere !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
}

.wtc-mfa-error {
  margin-top: 8px !important;
  color: var(--danger-600) !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
}

.wtc-mfa-actions {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 10px !important;
  padding: 16px 20px !important;
  border-top: 1px solid var(--section-border-color) !important;
  background: var(--section-bg) !important;
}

.wtc-mfa-actions .btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  min-width: 0 !important;
  height: 42px !important;
  line-height: normal !important;
  text-align: center !important;
  white-space: nowrap !important;
}

@media (max-width: 640px) {
  .wtc-mfa-overlay {
    align-items: start !important;
    place-items: start center !important;
    padding: 14px 10px !important;
  }

  .wtc-mfa-card {
    width: 100% !important;
    max-height: calc(100vh - 28px) !important;
    border-radius: 8px !important;
  }

  .wtc-mfa-header { padding: 14px !important; }
  .wtc-mfa-icon { width: 38px !important; height: 38px !important; font-size: 18px !important; }
  .wtc-mfa-heading h1 { font-size: 18px !important; }
  .wtc-mfa-body { padding: 14px !important; }
  .wtc-mfa-actions { padding: 14px !important; }
}

/* ============ Catalog (Market) redesign ============ */
.wtc-catalog { max-width: 1400px; margin: 0 auto; padding: 12px 4px 40px; }
.wtc-catalog-hero {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 20px;
  padding: 22px 24px; margin-bottom: 20px; border-radius: 14px;
  background: linear-gradient(135deg, #eef2f8 0%, #dfe7f3 55%, #cfdcee 100%);
  color: #0b1220; box-shadow: 0 6px 20px -14px rgba(15,25,50,.25);
  flex-wrap: wrap;
}
.wtc-catalog-hero-text { min-width: 0; }
.wtc-catalog-eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: 11px; opacity: .75; font-weight: 700; }
.wtc-catalog-title { font-size: 34px; font-weight: 800; margin: 4px 0 6px; line-height: 1.05; color: inherit; }
.wtc-catalog-sub { font-size: 13px; opacity: .82; max-width: 520px; }

[data-theme="dark"] .wtc-catalog-hero {
  background: linear-gradient(135deg, #0b1220 0%, #1a2540 55%, #22406e 100%);
  color: #fff; box-shadow: 0 8px 28px -14px rgba(15,25,50,.35);
}
[data-theme="dark"] .wtc-catalog-search input {
  background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.18);
}
.wtc-catalog-search {
  position: relative; flex: 0 1 360px; min-width: 240px;
}
.wtc-catalog-search i {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: #6b7590; font-size: 13px;
}
.wtc-catalog-search input {
  width: 100%; height: 42px; padding: 0 14px 0 38px;
  background: rgba(255,255,255,.96); border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px; font-size: 14px; color: #0b1220; outline: none;
  transition: box-shadow .15s ease;
}
.wtc-catalog-search input:focus { box-shadow: 0 0 0 3px rgba(85,140,255,.35); }

.wtc-catalog-layout { display: grid; grid-template-columns: 240px 1fr; gap: 22px; align-items: start; }
@media (max-width: 991px) { .wtc-catalog-layout { grid-template-columns: 1fr; } .wtc-catalog-side { display: none; } }

.wtc-cat-filters {
  background: #fff; border: 1px solid #e6e8ee; border-radius: 12px; padding: 14px;
  position: sticky; top: 84px;
}
.wtc-cat-filters-title { font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: #4a5470; margin-bottom: 12px; }
.wtc-cat-filters-title i { margin-right: 6px; color: #6b7590; }
.wtc-cat-filter-group { margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid #f0f2f6; }
.wtc-cat-filter-group:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.wtc-cat-filter-label { font-size: 11px; font-weight: 700; color: #8890a4; text-transform: uppercase; letter-spacing: .1em; padding: 4px 8px 6px; }
.wtc-cat-filter-header {
  width: 100%; background: transparent; border: 0; text-align: left;
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px; border-radius: 8px; font-weight: 600; font-size: 13px; color: #232a3d;
  cursor: pointer;
}
.wtc-cat-filter-header:hover { background: #f5f7fb; }
.wtc-cat-filter-sub { padding: 4px 0 4px 8px; }
.wtc-cat-filter-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  background: transparent; border: 0; text-align: left;
  padding: 7px 8px; border-radius: 8px; font-size: 13px; color: #3a4258;
  cursor: pointer; transition: background .12s ease, color .12s ease;
}
.wtc-cat-filter-item:hover { background: #f0f3f9; color: #0b1220; }
.wtc-cat-filter-item.is-active { background: #eef3ff; color: #1c4fd6; font-weight: 600; }
.wtc-cat-filter-sub-item { padding-left: 26px; font-size: 12.5px; }
.wtc-cat-filter-icon { width: 16px; color: #8890a4; font-size: 12px; }
.wtc-cat-filter-item.is-active .wtc-cat-filter-icon { color: #1c4fd6; }

.wtc-catalog-main { min-width: 0; }
.wtc-catalog-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: #fff; border: 1px solid #e6e8ee; border-radius: 12px;
  padding: 10px 14px; margin-bottom: 14px; flex-wrap: wrap;
}
.wtc-catalog-bar-left { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.wtc-catalog-heading { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.wtc-catalog-heading-label { font-size: 18px; font-weight: 700; color: #0b1220; }
.wtc-catalog-heading-count { font-size: 12.5px; color: #6b7590; }
.wtc-catalog-sort { display: flex; align-items: center; gap: 8px; }
.wtc-catalog-sort label { font-size: 12px; font-weight: 600; color: #6b7590; text-transform: uppercase; letter-spacing: .08em; margin: 0; }
.wtc-catalog-sort select {
  height: 36px; padding: 0 32px 0 12px; border-radius: 8px;
  border: 1px solid #dde1ea; background: #fff; font-size: 13px; color: #232a3d;
  cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%236b7590' d='M0 0l5 6 5-6z'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center;
}
.wtc-cat-mobile-filter-btn {
  display: none; height: 36px; padding: 0 12px; border-radius: 8px;
  border: 1px solid #dde1ea; background: #fff; font-size: 13px; font-weight: 600;
  color: #232a3d; cursor: pointer;
}
.wtc-cat-mobile-filter-btn i { margin-right: 6px; color: #6b7590; }
@media (max-width: 991px) {
  .wtc-cat-mobile-filter-btn { display: inline-flex; align-items: center; }
  .wtc-cat-mobile-filters .wtc-cat-filters { position: static; margin-bottom: 14px; }
  .wtc-catalog-title { font-size: 26px; }
  .wtc-catalog-hero { padding: 18px; }
}

.wtc-catalog-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
@media (max-width: 575px) {
  .wtc-catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
}

.wtc-cat-card {
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid #e6e8ee; border-radius: 12px;
  overflow: hidden; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  position: relative;
}
.wtc-cat-card:hover {
  transform: translateY(-2px);
  border-color: #b7c6ff;
  box-shadow: 0 10px 24px -14px rgba(28,79,214,.25);
}
.wtc-cat-thumb {
  position: relative; aspect-ratio: 1/1; width: 100%;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid #eef0f5;
}
.wtc-cat-thumb img { width: 100%; height: 100%; object-fit: contain; }
.wtc-cat-thumb-fallback {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 34px;
}
.wtc-cat-owned {
  position: absolute; top: 8px; left: 8px;
  background: #16a34a; color: #fff; font-size: 10.5px; font-weight: 700;
  padding: 3px 8px; border-radius: 999px; letter-spacing: .04em; text-transform: uppercase;
  box-shadow: 0 2px 6px rgba(22,163,74,.35);
}
.wtc-cat-owned i { margin-right: 4px; }
.wtc-cat-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 2px; }
.wtc-cat-name {
  font-weight: 700; font-size: 13.5px; color: #0b1220;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wtc-cat-creator {
  font-size: 11.5px; color: #6b7590;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wtc-cat-price { display: flex; align-items: center; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.wtc-cat-price-pill {
  display: inline-flex; align-items: center; gap: 4px;
  background: #f5f7fb; border: 1px solid #e6e8ee; border-radius: 6px;
  padding: 3px 8px; font-size: 12px; font-weight: 700; color: #0b1220;
}
.wtc-cat-price-pill i { font-size: 11px; }
.wtc-cat-free { font-size: 12px; font-weight: 700; color: #16a34a; }

.wtc-catalog-empty {
  background: #fff; border: 1px dashed #d5dae4; border-radius: 12px;
  padding: 48px 20px; text-align: center; color: #6b7590;
}
.wtc-catalog-empty i { font-size: 34px; color: #b6bccc; display: block; margin-bottom: 6px; }

/* ==== Membership: gradient username + cover photo ==== */
.wtc-member-name,
.wtc-member-name * {
  background: linear-gradient(90deg, #a855f7 0%, #7c3aed 50%, #c084fc 100%) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  color: transparent !important;
  font-weight: 700;
}

.wtc-cover-photo {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 1;
  max-height: 200px;
  min-height: 90px;
  border-radius: 10px;
  overflow: hidden;
  margin: 0 0 14px 0;
  background: linear-gradient(135deg, #a855f7, #6366f1, #ec4899);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .08);
}
.wtc-cover-photo img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.wtc-cover-badge {
  position: absolute; right: 10px; bottom: 10px;
  background: rgba(255,255,255,.92); color: #7c3aed;
  font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: .04em;
  display: inline-flex; align-items: center; gap: 5px;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.wtc-cover-badge i { color: #a855f7; }

.wtc-cover-uploader {
  border: 2px dashed #d5dae4; border-radius: 10px; padding: 18px; text-align: center;
  background: #fafbfd;
}
.wtc-cover-uploader.locked { opacity: .65; }
.wtc-cover-pending {
  margin-top: 10px; padding: 8px 12px; border-radius: 8px;
  background: #fef3c7; color: #92400e; font-size: 12.5px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
}
