:root {
  --bg: #06111f;
  --panel: rgba(10, 24, 45, 0.86);
  --panel-strong: rgba(17, 35, 63, 0.96);
  --line: rgba(116, 224, 255, 0.2);
  --text: #f6fbff;
  --muted: #9eb5c9;
  --blue: #32d9ff;
  --pink: #ff4fd8;
  --gold: #ffd86b;
  --green: #72ffb6;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.36);
  --container-width: 1124px;
  --pokemon-art-size: 64px;
  --pokemon-gap: 12px;
  --pokemon-tile-width: 72px;
}

[data-theme="light"] {
  --bg: linear-gradient(135deg, #e0e5ec 0%, #f5f7fa 50%, #e8ecf1 100%);
  --panel: rgba(255, 255, 255, 0.7);
  --panel-strong: rgba(255, 255, 255, 0.85);
  --line: rgba(255, 255, 255, 0.3);
  --text: #1e293b;
  --muted: #64748b;
  --blue: #007aff;
  --pink: #ec4899;
  --gold: #f59e0b;
  --green: #10b981;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] button {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .primary-action {
  background: rgba(0, 122, 255, 0.8);
  border: 1px solid rgba(0, 122, 255, 0.3);
  backdrop-filter: blur(10px);
  color: white;
  box-shadow: 0 4px 20px rgba(0, 122, 255, 0.3);
}

[data-theme="light"] .flow-header-next {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: none;
}

[data-theme="light"] .flow-header-next:hover {
  background: rgba(255, 255, 255, 0.06);
  box-shadow: none;
  transform: none;
}

[data-theme="light"] .primary-action:hover {
  background: rgba(0, 122, 255, 0.9);
  box-shadow: 0 6px 24px rgba(0, 122, 255, 0.4);
}

[data-theme="light"] .top-panel .primary-action:hover {
  transform: none;
  box-shadow: 0 4px 20px rgba(0, 122, 255, 0.3);
}

[data-theme="light"] .notification-button,
[data-theme="light"] .theme-toggle-button {
  background: transparent;
  border: 0;
  backdrop-filter: none;
  box-shadow: none;
}

[data-theme="light"] .notification-button:hover,
[data-theme="light"] .theme-toggle-button:hover {
  background: transparent;
  box-shadow: none;
}

[data-theme="light"] .dm-room {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .dm-room:hover {
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .dm-room.active {
  background: rgba(0, 122, 255, 0.15);
  border-color: rgba(0, 122, 255, 0.4);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 122, 255, 0.2);
}

[data-theme="light"] input {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] input:focus {
  border-color: rgba(0, 122, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15), 0 4px 16px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .dm-rooms,
[data-theme="light"] .dm-thread {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(15px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .section-heading {
  background: rgba(255, 255, 255, 0.5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(15px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .chat-form {
  background: rgba(255, 255, 255, 0.5);
  border-top: 1px solid rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(15px);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .icon-button {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .icon-button:hover {
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .filter-chip {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .filter-chip:hover {
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .filter-chip.active {
  background: rgba(0, 122, 255, 0.8);
  color: white;
  border-color: rgba(0, 122, 255, 0.4);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 122, 255, 0.3);
}

[data-theme="light"] .trade-card {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(15px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .pokemon-tile {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .bottom-nav {
  background: rgba(255, 255, 255, 0.5);
  border-top: 1px solid rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(20px);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .nav-item {
  color: var(--muted);
}

[data-theme="light"] .nav-item.active {
  color: #007aff;
}

[data-theme="light"] .nav-icon {
  filter: none;
}

[data-theme="light"] .nav-item:hover {
  background: rgba(0, 122, 255, 0.1);
}

[data-theme="light"] .modal-card {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(20px);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .modal-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
}

[data-theme="light"] .close-button {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .close-button:hover {
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 16% 8%, rgba(50, 217, 255, 0.22), transparent 28%),
    radial-gradient(circle at 85% 18%, rgba(255, 79, 216, 0.2), transparent 32%),
    linear-gradient(145deg, #06111f 0%, #0a1830 42%, #140b28 100%);
  overflow-x: hidden;
  transition: background 0.3s ease;
}

[data-theme="light"] body {
  background:
    radial-gradient(circle at 16% 8%, rgba(0, 122, 255, 0.15), transparent 28%),
    radial-gradient(circle at 85% 18%, rgba(236, 72, 153, 0.12), transparent 32%),
    radial-gradient(circle at 50% 50%, rgba(147, 197, 253, 0.1), transparent 40%),
    linear-gradient(145deg, #e0e5ec 0%, #f5f7fa 50%, #e8ecf1 100%);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.layout-container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  box-sizing: border-box;
}

.app-shell {
  padding: 0 0 calc(76px + env(safe-area-inset-bottom));
}

.top-panel,
.trade-card,
.profile-form,
.modal-card,
.chat-messages {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.top-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 10px;
  width: 100vw;
  min-height: 74px;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  margin-bottom: 20px;
  padding: 10px max(12px, calc((100vw - var(--container-width)) / 2 + 12px));
  border-top: 0;
  border-right: 0;
  border-left: 0;
  border-radius: 0;
  position: sticky;
  top: 0;
  z-index: 19;
  overflow: hidden;
}

.top-panel[hidden] {
  display: none !important;
}

.top-panel::before {
  content: none;
}

.top-panel-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.app-logo {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border-radius: 0;
  object-fit: contain;
  object-position: center;
  box-shadow: none;
}

.top-panel-brand-copy {
  display: flex;
  align-items: center;
  min-width: 0;
}

.top-panel-brand-copy h1,
.top-panel-brand-copy .eyebrow {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-panel h1 {
  font-size: clamp(1.35rem, 4vw, 2rem);
  line-height: 1;
}

.create-trade-icon-button {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.create-trade-icon-button:hover {
  transform: none;
  background: transparent;
  box-shadow: none;
}

.create-trade-plus-icon {
  width: 25px;
  height: 25px;
  display: block;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

[data-theme="light"] .create-trade-plus-icon {
  filter: none;
}

.top-panel .eyebrow {
  margin-bottom: 4px;
  font-size: 0.65rem;
  line-height: 1;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2.2rem, 6vw, 4.2rem);
  line-height: 0.92;
  text-shadow: 0 0 24px rgba(50, 217, 255, 0.4);
}

h2 {
  font-size: 1.45rem;
}

.badge,
.status-toast {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(50, 217, 255, 0.34);
  background: rgba(6, 18, 34, 0.76);
  border-radius: 999px;
  padding: 10px 14px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(92px + env(safe-area-inset-bottom, 0px));
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: min(420px, calc(100vw - 32px));
  min-height: 32px;
  padding: 7px 12px;
  border: 1px solid rgba(50, 217, 255, 0.38);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(7, 18, 34, 0.94), rgba(9, 31, 48, 0.92));
  color: var(--text);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.38), 0 0 22px rgba(50, 217, 255, 0.18);
  text-align: center;
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  pointer-events: none;
  transform: translateX(-50%);
  animation: toastIn 180ms ease-out both;
}

.toast::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-right: 7px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 12px rgba(67, 255, 151, 0.78);
}

.toast.leaving {
  animation: toastOut 160ms ease-in both;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translate(-50%, 12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
  to {
    opacity: 0;
    transform: translate(-50%, 10px) scale(0.98);
  }
}

.notification-button {
  position: relative;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  color: var(--text);
  background: transparent;
  display: grid;
  place-items: center;
  padding: 0;
}

.theme-toggle-button {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  color: var(--text);
  background: transparent;
  display: grid;
  place-items: center;
  padding: 0;
  transition: all 0.2s ease;
}

.notification-button:hover,
.theme-toggle-button:hover {
  background: transparent;
  transform: scale(1.05);
}

.theme-icon {
  width: 24px;
  height: 24px;
  filter: brightness(0) invert(1);
  object-fit: contain;
}

.notification-icon {
  width: 24px;
  height: 24px;
  filter: brightness(0) invert(1);
  object-fit: contain;
}

[data-theme="light"] .theme-icon,
[data-theme="light"] .notification-icon {
  filter: none;
}

.notification-button:active .notification-icon,
.notification-button:focus-visible .notification-icon,
.theme-toggle-button:active .theme-icon,
.theme-toggle-button:focus-visible .theme-icon,
[data-theme="light"] .notification-button:active .notification-icon,
[data-theme="light"] .notification-button:focus-visible .notification-icon,
[data-theme="light"] .theme-toggle-button:active .theme-icon,
[data-theme="light"] .theme-toggle-button:focus-visible .theme-icon {
  filter: brightness(0) invert(1);
}

[data-theme="light"] .notification-button:active .notification-icon,
[data-theme="light"] .notification-button:focus-visible .notification-icon,
[data-theme="light"] .theme-toggle-button:active .theme-icon,
[data-theme="light"] .theme-toggle-button:focus-visible .theme-icon {
  filter: none;
}

.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  color: #06111f;
  background: linear-gradient(135deg, var(--pink), var(--blue));
  font-size: 0.68rem;
  font-weight: 900;
  display: grid;
  place-items: center;
  box-shadow: 0 0 14px rgba(255, 79, 216, 0.45);
}

#notificationsView .back-button {
  margin-bottom: 10px;
}

.notification-page-list {
  display: grid;
  gap: 10px;
  padding-bottom: 18px;
}

.notification-empty {
  padding: 28px 18px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
}

.notification-item {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--text);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  padding: 14px;
  text-align: left;
}

.notification-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.notification-item.unread {
  border-color: rgba(50, 217, 255, 0.22);
  background: rgba(50, 217, 255, 0.08);
}

.notification-item-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.95rem;
}

.notification-item-body {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.notification-item-body strong {
  font-size: 0.86rem;
  line-height: 1.35;
}

.notification-preview {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.notification-item-body small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.trade-card-highlight {
  animation: trade-card-pulse 2.2s ease;
}

@keyframes trade-card-pulse {
  0%,
  100% {
    box-shadow: var(--shadow);
  }
  35% {
    box-shadow: 0 0 0 2px rgba(50, 217, 255, 0.55), 0 0 28px rgba(50, 217, 255, 0.28);
  }
}

.trainer-orb {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #06111f;
  font-weight: 900;
  background: linear-gradient(135deg, var(--blue), var(--pink));
  box-shadow: 0 0 24px rgba(255, 79, 216, 0.35);
}

.muted {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
}

.primary-action,
.icon-button {
  border: 0;
  color: #03101f;
  font-weight: 900;
  background: linear-gradient(135deg, var(--blue), var(--pink));
  box-shadow: 0 0 24px rgba(50, 217, 255, 0.28);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.primary-action {
  min-height: 48px;
  border-radius: 999px;
  padding: 0 20px;
}

.primary-action:hover,
.icon-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 30px rgba(255, 79, 216, 0.3), var(--shadow);
}

.top-panel .primary-action:hover {
  transform: none;
  box-shadow: 0 0 24px rgba(50, 217, 255, 0.28);
}

.trade-card:hover {
  transform: none;
  box-shadow: var(--shadow);
}

button:active {
  transform: scale(0.97);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(50, 217, 255, 0.82);
  outline-offset: 3px;
}

.full {
  width: 100%;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.section-heading > div {
  width: 100%;
  min-width: 0;
}

.feed-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
}

.feed-title-row h2 {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.feed-column {
  width: 100%;
}

.trade-search-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 14px;
  margin-bottom: 0;
}

.trade-search-panel.search-open {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
}

.trade-tool-group {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 0;
}

.trade-search-panel.search-open .trade-tool-group {
  grid-template-columns: minmax(0, 1fr) auto auto;
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
}

.trade-search-panel.search-open .home-search-input {
  order: 1;
  min-width: 0;
}

.trade-search-panel.search-open .home-search-toggle {
  order: 2;
}

.trade-search-panel.search-open .feed-detailed-toggle {
  order: 3;
}

.home-search-toggle {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  display: inline-grid;
  place-items: center;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.home-search-toggle:hover {
  background: transparent;
  box-shadow: none;
  transform: none;
}

.home-search-input[hidden] {
  display: none;
}

.feed-column .trade-search-panel .filter-chip {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  border-radius: 14px;
  padding: 0;
}

.trade-tool-group .filter-icon {
  width: 24px;
  height: 24px;
}

.trade-tool-group .undo-icon {
  width: 25px;
  height: 25px;
}

#pokedexView .pokedex-search-heading {
  align-items: center;
  margin-bottom: 14px;
}

.dex-subtitle-hidden {
  display: none;
}

.pokedex-search-panel {
  width: 100%;
  flex: 1 1 auto;
  min-width: 0;
}

.pokedex-search-panel input {
  min-width: 0;
  flex: 1 1 auto;
}

.feed-column .home-search-input,
.pokedex-search-panel input {
  min-height: 42px;
  border-color: rgba(116, 224, 255, 0.24);
  border-radius: 14px;
  background:
    linear-gradient(160deg, rgba(50, 217, 255, 0.11), rgba(255, 79, 216, 0.075)),
    rgba(10, 24, 45, 0.42);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025), 0 8px 20px rgba(0, 0, 0, 0.16);
  color: var(--text);
  font-size: 0.9rem;
}

.feed-column .home-search-input::placeholder,
.pokedex-search-panel input::placeholder {
  opacity: 0.58;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pokedex-search-panel .filter-chip {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  border-radius: 14px;
  padding: 0;
}

.feed-filter-panel {
  margin-bottom: 14px;
}

#feedFilters {
  display: grid;
  gap: 10px;
  overflow: visible;
  padding-bottom: 0;
}

.feed-category-chip-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding-bottom: 2px;
  white-space: nowrap;
}

.feed-category-chip-row::-webkit-scrollbar {
  display: none;
}

.feed-category-chip-row .filter-chip {
  min-height: 38px;
  padding: 0 12px;
}

.feed-tag-filter-section {
  display: grid;
  gap: 2px;
  margin-top: 0;
  padding-top: 2px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.feed-tag-filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 30px;
  border: 0;
  background: transparent;
  padding: 0 2px;
  text-align: left;
}

.feed-tag-filter-head span:first-child,
.feed-tag-filter-group p {
  margin: 0;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.feed-tag-chevron {
  display: inline-flex;
  align-items: center;
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
}

.feed-tag-filter-body {
  display: grid;
  gap: 6px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 280ms ease, opacity 220ms ease;
}

.feed-tag-filter-body.expanded {
  max-height: 260px;
  opacity: 1;
}

.feed-category-filter-body.expanded {
  max-height: 96px;
}

.feed-category-filter-body .feed-category-chip-row {
  padding-top: 0;
}

.feed-category-filter-section + .feed-tag-filter-section {
  padding-top: 2px;
}

.feed-tag-filter-actions {
  display: flex;
  justify-content: flex-end;
}

.feed-tag-filter-actions button {
  border: 0;
  color: var(--blue);
  background: transparent;
  padding: 0;
  font-size: 0.68rem;
  font-weight: 900;
}

.feed-tag-filter-group {
  display: grid;
  gap: 5px;
}

.feed-tag-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-height: 70px;
  overflow: hidden;
}

.feed-flow-quick-filters {
  margin-bottom: 10px;
}

.dex-attribute-filters {
  margin-top: 8px;
}

.dex-attribute-filters[hidden] {
  display: none;
}

.trade-empty {
  border: 1px dashed var(--line);
  border-radius: 18px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  padding: 24px 16px;
  font-weight: 800;
  text-align: center;
}

.feed {
  display: grid;
  gap: 14px;
  padding-bottom: 18px;
}

.ad-rail {
  display: none;
}

.ad-slot {
  min-height: 220px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(158, 181, 201, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.015);
  opacity: 0.42;
}

.ad-slot-label {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.7;
}

.feed-column .trade-card {
  border-radius: 20px;
  padding: 13px;
}

.feed-column .trade-head .trainer-orb {
  width: 40px;
  height: 40px;
}

.feed-column .trade-caption {
  display: block;
  margin-bottom: 12px;
  color: var(--text);
  font-size: 0.9rem;
}

.feed-column .trade-block {
  padding: 11px;
}

.feed-column .trade-sections {
  overflow: visible;
}

.feed-column .mini-grid {
  grid-template-columns: repeat(auto-fill, var(--pokemon-tile-width));
  gap: var(--pokemon-gap);
  justify-content: start;
  max-height: none;
  overflow: visible;
}

.feed-column .mini-mon {
  min-height: auto;
  border-radius: 0;
  padding: 4px;
}

.feed-column .mini-mon img {
  width: var(--pokemon-art-size);
  height: var(--pokemon-art-size);
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.34));
}

.feed-column .mini-mon span {
  font-size: 0.58rem;
}

.feed-column .mini-mon .badge {
  left: 4px;
  top: 4px;
  padding: 2px 5px;
  font-size: 0.52rem;
}

.feed-column .costume {
  font-size: 0.56rem;
}

.trade-card {
  border-radius: 24px;
  padding: 16px;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.trade-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.trade-head .trainer-orb {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
}

.trade-head-meta {
  flex: 1;
  min-width: 0;
}

.trade-profile-info {
  display: grid;
  gap: 4px;
}

.trade-profile-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.trade-profile-name-row .profile-level-badge {
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  font-size: 0.72rem;
}

.trade-profile-name {
  overflow: hidden;
  font-size: 1rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trade-profile-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.trade-country-flag {
  flex: 0 0 auto;
  width: 20px;
  height: 14px;
  border-radius: 3px;
  object-fit: cover;
  font-size: 0.92rem;
  line-height: 1;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.trade-profile-meta .profile-location {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trade-time {
  flex-shrink: 0;
  font-size: 0.78rem;
  font-weight: 800;
}

.trade-caption {
  margin: 0 0 14px;
  line-height: 1.5;
  font-size: 0.95rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.trade-tag-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0 0 12px;
  max-height: 58px;
  overflow: hidden;
}

.trade-tag-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid rgba(50, 217, 255, 0.34);
  border-radius: 999px;
  color: var(--blue);
  background: rgba(50, 217, 255, 0.1);
  padding: 0 8px;
  font-size: 0.66rem;
  font-weight: 900;
  white-space: nowrap;
}

.trade-sections {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
}

.trade-block {
  padding: 14px;
}

.trade-block-wanted {
  background: rgba(50, 217, 255, 0.05);
}

.trade-block-offers {
  background: rgba(255, 79, 216, 0.05);
}

.trade-block-label {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.trade-block-wanted .trade-block-label {
  color: var(--blue);
}

.trade-block-offers .trade-block-label {
  color: var(--pink);
}

.trade-divider {
  height: 1px;
  margin: 0 14px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
}

.mini-grid,
.pokemon-grid,
.flow-pokemon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, var(--pokemon-tile-width));
  gap: var(--pokemon-gap);
  justify-content: start;
}

.mini-mon,
.pokemon-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: var(--pokemon-tile-width);
  border: none;
  background: transparent;
  overflow: visible;
}

.mini-mon {
  min-height: auto;
  border-radius: 0;
  padding: 4px;
}

.mini-mon img,
.pokemon-tile img {
  width: var(--pokemon-art-size);
  height: var(--pokemon-art-size);
  flex-shrink: 0;
  object-fit: contain;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.34));
}

.mini-mon span,
.pokemon-tile span {
  display: block;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
}

.shiny::after {
  content: "✦";
  position: absolute;
  top: 8px;
  right: 9px;
  color: var(--gold);
  text-shadow: 0 0 12px var(--gold);
  animation: sparkle 1.25s infinite ease-in-out;
}

.badge {
  position: absolute;
  left: 6px;
  top: 6px;
  padding: 3px 7px;
  color: var(--text);
  font-size: 0.62rem;
}

.badge.Lucky {
  border-color: rgba(255, 216, 107, 0.5);
}

.badge.Shadow {
  border-color: rgba(177, 99, 255, 0.55);
}

.badge.Purified {
  border-color: rgba(114, 255, 246, 0.55);
}

.badge.Dynamax {
  border-color: rgba(255, 68, 120, 0.68);
  background: rgba(255, 68, 120, 0.18);
}

.badge.Gigantamax {
  border-color: rgba(255, 79, 216, 0.72);
  background: rgba(255, 79, 216, 0.2);
}

.costume {
  margin-top: 4px;
  color: var(--pink);
  font-size: 0.65rem;
  text-align: center;
}

.dynamax,
.gigantamax {
  border-color: rgba(255, 68, 120, 0.42);
}

.dynamax::before,
.gigantamax::before {
  content: "";
  position: absolute;
  inset: -32%;
  background: radial-gradient(circle, rgba(255, 68, 120, 0.28), transparent 58%);
  opacity: 0.82;
  animation: maxPulse 1.8s infinite ease-in-out;
}

.gigantamax::before {
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 79, 216, 0.36), transparent 48%),
    radial-gradient(circle, rgba(255, 68, 120, 0.18), transparent 62%);
}

.dynamax img,
.gigantamax img,
.dynamax span,
.gigantamax span,
.dynamax .badge,
.gigantamax .badge,
.dynamax .costume,
.gigantamax .costume {
  position: relative;
  z-index: 1;
}

.trade-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
  padding-left: 14px;
}

.ghost-action {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  padding: 0 14px;
  font-weight: 900;
}

.trade-actions .ghost-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  min-height: 32px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.trade-action-icon {
  width: 21px;
  height: 21px;
  display: block;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.like-button.liked .trade-action-icon {
  filter: none;
}

.ghost-action.liked {
  color: #fff;
  background: transparent;
  box-shadow: none;
}

.trade-actions .ghost-action.icon-only {
  min-width: 0;
  padding: 0;
  display: inline-grid;
  place-items: center;
}

.share-icon {
  display: block;
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

input,
select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  background: rgba(3, 12, 24, 0.74);
  outline: 0;
  padding: 0 12px;
}

select option {
  color: #07111f;
}

.dex-controls {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 10px;
  margin-bottom: 14px;
}

.compact {
  grid-template-columns: 1fr 150px;
}

.pokemon-grid {
  max-height: 480px;
  overflow: auto;
  padding: 2px 2px 12px;
}

.pokemon-grid.large {
  max-height: none;
}

.dex-load-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 18px 0 6px;
  color: var(--muted);
  font-weight: 900;
}

.dex-region-nav-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(50, 217, 255, 0.34);
  border-radius: 14px;
  color: var(--blue);
  background: rgba(6, 18, 34, 0.74);
  padding: 0 14px;
  font-size: 0.82rem;
  font-weight: 900;
  white-space: nowrap;
}

.dex-region-nav-button .back-icon,
.dex-region-nav-button .forward-icon {
  width: 22px;
  height: 22px;
  display: block;
}

.dex-region-prev {
  margin-right: auto;
}

.dex-region-next {
  margin-left: auto;
}

.dex-load-panel .primary-action[hidden] {
  display: none;
}

.pokemon-tile {
  border-radius: 0;
  min-height: auto;
  padding: 6px;
  transition: transform 180ms ease;
}

.pokemon-tile.selected img {
  outline: 2px solid var(--pink);
  outline-offset: 2px;
  border-radius: 8px;
  box-shadow: 0 0 18px rgba(255, 79, 216, 0.35);
}

.tile-form {
  display: block;
  margin-top: 4px;
  color: var(--pink);
  font-size: 0.64rem;
  font-weight: 900;
  text-align: center;
}

.pokemon-number {
  display: none;
}

.toggle,
.option-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle input {
  width: 22px;
  min-height: 22px;
  accent-color: var(--pink);
}

.penpal-online-count {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(114, 255, 182, 0.24);
  border-radius: 999px;
  color: var(--green);
  background: rgba(114, 255, 182, 0.08);
  padding: 0 12px;
  font-size: 0.74rem;
  font-weight: 900;
  white-space: nowrap;
}

.penpal-my-post,
.penpal-browse {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  padding: 16px;
  margin-bottom: 16px;
}

.penpal-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.penpal-section-head h3 {
  margin: 0;
  font-size: 1.1rem;
}

.penpal-status {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 0 10px;
  font-size: 0.72rem;
  font-weight: 900;
}

.penpal-status.live {
  border-color: rgba(114, 255, 182, 0.34);
  color: var(--green);
  background: rgba(114, 255, 182, 0.08);
}

.penpal-hint {
  margin: 0 0 14px;
  line-height: 1.45;
}

.penpal-form,
.penpal-filters {
  display: grid;
  gap: 12px;
}

.penpal-form label,
.penpal-filter-label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
}

.penpal-profile-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  padding: 12px;
}

.penpal-purpose-fieldset {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
}

.penpal-purpose-fieldset legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.penpal-purpose-grid,
.penpal-filter-purposes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.penpal-purpose-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: rgba(10, 24, 45, 0.88);
  padding: 0 10px;
  font-size: 0.72rem;
  font-weight: 800;
}

.penpal-purpose-chip.active {
  border-color: rgba(50, 217, 255, 0.58);
  color: #04111f;
  background: linear-gradient(135deg, var(--blue), var(--green));
}

.penpal-form-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.penpal-list {
  display: grid;
  gap: 12px;
}

.penpal-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(10, 24, 45, 0.72);
  padding: 14px;
}

.penpal-card-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.penpal-card-meta {
  min-width: 0;
}

.penpal-card-meta strong,
.penpal-card-meta span {
  display: block;
}

.penpal-vivillon-badge {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 216, 107, 0.34);
  border-radius: 999px;
  color: var(--gold);
  background: rgba(255, 216, 107, 0.08);
  padding: 0 10px;
  font-size: 0.68rem;
  font-weight: 900;
  white-space: nowrap;
}

.penpal-card-code {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px dashed rgba(50, 217, 255, 0.28);
  border-radius: 14px;
  background: rgba(50, 217, 255, 0.06);
  padding: 10px 12px;
  margin-bottom: 10px;
}

.penpal-card-code code {
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.penpal-card-purposes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.penpal-purpose-badge {
  min-width: 30px;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.9rem;
}

.penpal-card-note {
  margin: 0 0 10px;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.86rem;
}

.penpal-card-actions {
  display: flex;
  justify-content: flex-end;
}

.penpal-empty {
  border: 1px dashed var(--line);
  border-radius: 16px;
  color: var(--muted);
  padding: 24px 16px;
  text-align: center;
  line-height: 1.45;
}

/* Profile Page - New Design */
.profile-page {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 16px 24px;
}

.profile-page-header {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100vw;
  min-height: 38px;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-top: 0;
  border-right: 0;
  border-left: 0;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  padding: 4px max(12px, calc((100vw - var(--container-width)) / 2 + 12px));
  position: sticky;
  top: 0;
  z-index: 18;
  overflow: hidden;
}

.profile-page-header h2 {
  margin: 0;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1;
  text-align: center;
}

.profile-edit-icon-button {
  position: absolute;
  right: max(12px, calc((100vw - var(--container-width)) / 2 + 12px));
  top: 50%;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  display: inline-grid;
  place-items: center;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
  transform: translateY(-50%);
}

.profile-edit-icon-button:hover {
  background: transparent;
  box-shadow: none;
  transform: translateY(-50%);
}

.profile-edit-icon {
  width: 22px;
  height: 22px;
  display: block;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

[data-theme="light"] .profile-edit-icon {
  filter: none;
}

/* Profile Header */
.profile-header-section {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.profile-back-button {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: none;
  padding: 0;
  font-size: 1.15rem;
  font-weight: 900;
}

.icon-back-button {
  display: inline-grid;
  place-items: center;
}

.back-icon {
  width: 22px;
  height: 22px;
  display: block;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.forward-icon {
  width: 22px;
  height: 22px;
  display: block;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.search-icon {
  width: 22px;
  height: 22px;
  display: block;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.filter-icon {
  width: 22px;
  height: 22px;
  display: block;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.undo-icon {
  width: 22px;
  height: 22px;
  display: block;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

[data-theme="light"] .back-icon,
[data-theme="light"] .forward-icon,
[data-theme="light"] .search-icon,
[data-theme="light"] .filter-icon,
[data-theme="light"] .undo-icon {
  filter: none;
}

.profile-avatar-large {
  position: relative;
  flex-shrink: 0;
}

.trainer-orb.extra-large {
  width: 52px;
  height: 52px;
  font-size: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--pink));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(50, 217, 255, 0.24);
  border: 2px solid var(--blue);
}

.online-indicator {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--green);
  border: 2px solid var(--bg);
}

.profile-info {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 3px;
}

.profile-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  margin-bottom: 0;
  min-width: 0;
}

.profile-level-badge {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 20px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
}

.profile-name-large {
  display: block;
  overflow: hidden;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  min-width: 0;
}

.profile-location {
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-country-flag {
  width: 18px;
  height: 12px;
  border-radius: 2px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.profile-world-flag {
  font-size: 14px;
  line-height: 1;
}

.profile-status {
  font-size: 12px;
  color: var(--green);
  font-weight: 600;
}

/* Friend Code Card */
.profile-ids-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 14px;
}

.profile-id-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.profile-id-info {
  flex: 1;
}

.profile-id-label-small {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin: 0 0 4px 0;
}

.profile-id-value-large {
  font-size: 16px;
  font-weight: 700;
  color: var(--blue);
  letter-spacing: 1px;
  margin: 0;
}

.profile-id-divider {
  height: 1px;
  background: var(--line);
  margin: 8px 0;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(10, 24, 45, 0.5);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.copy-btn:hover {
  background: rgba(50, 217, 255, 0.1);
  border-color: var(--blue);
}

.copy-btn.small {
  padding: 4px 8px;
}

/* Profile URL Card */
.profile-url-card {
  background: rgba(10, 24, 45, 0.5);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.profile-url-text {
  font-size: 12px;
  color: var(--muted);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Profile Actions */
.profile-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.profile-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px 8px;
  border-radius: 12px;
  cursor: pointer;
  border: 1px solid var(--line);
  background: rgba(10, 24, 45, 0.5);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s;
}

.profile-action-btn:hover {
  background: rgba(50, 217, 255, 0.1);
  border-color: var(--blue);
}

.profile-action-btn.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--bg);
}

.profile-action-btn.primary:hover {
  background: var(--pink);
  border-color: var(--pink);
}

/* Stats Section (removed) */
/* Search Section (removed) */

/* Trade Cards Section */
.profile-cards-section {
  padding: 16px 0 24px;
}

.cards-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.cards-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.cards-filter {
  display: flex;
  gap: 6px;
}

.filter-btn {
  padding: 5px 12px;
  border-radius: 20px;
  border: none;
  background: rgba(10, 24, 45, 0.5);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-transform: capitalize;
  transition: all 0.15s;
}

.filter-btn:hover {
  background: rgba(50, 217, 255, 0.1);
}

.filter-btn.active {
  background: var(--blue);
  color: var(--bg);
}

.new-card-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  background: rgba(50, 217, 255, 0.1);
  border: 2px dashed var(--blue);
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  color: var(--blue);
  transition: all 0.2s;
  margin-bottom: 12px;
}

.new-card-btn:hover {
  background: rgba(50, 217, 255, 0.2);
}

.profile-actions[hidden],
.cards-filter[hidden],
.new-card-btn[hidden],
#editProfileBtn[hidden],
.profile-back-button[hidden] {
  display: none !important;
}

.profile-trade-list-new {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.trade-empty-new {
  text-align: center;
  padding: 32px 0;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 16px;
}

.trade-empty-new::before {
  content: "📭";
  display: block;
  font-size: 40px;
  margin-bottom: 8px;
}

/* Edit Profile Modal */
.edit-profile-modal {
  border: none;
  padding: 0;
  background: transparent;
  overflow: visible;
}

.edit-profile-modal::backdrop {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.edit-profile-content {
  padding: 20px;
  overflow: visible;
}

.edit-profile-content label {
  display: block;
  margin-bottom: 14px;
  color: var(--muted);
  font-weight: 600;
}

.edit-profile-content input {
  width: 100%;
  padding: 10px 12px;
  margin-top: 5px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: rgba(10, 24, 45, 0.8);
  color: var(--text);
  font-size: 14px;
  box-sizing: border-box;
}

.edit-profile-content input:focus {
  outline: none;
  border-color: var(--blue);
}

.country-picker {
  position: relative;
  margin-top: 5px;
}

.country-picker-button {
  position: relative;
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: rgba(10, 24, 45, 0.8);
  padding: 0 38px 0 12px;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
}

.country-picker-button::after {
  content: "";
  position: absolute;
  top: 18px;
  right: 14px;
  border-width: 5px 4px 0;
  border-style: solid;
  border-color: var(--muted) transparent transparent;
}

.country-picker-button.has-value {
  color: var(--text);
}

.country-picker-button:focus-visible {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(50, 217, 255, 0.14);
}

.country-picker-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  z-index: 40;
  max-height: 120px;
  overflow-y: auto;
  border: 1px solid rgba(50, 217, 255, 0.22);
  border-radius: 12px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025)),
    rgba(7, 18, 34, 0.98);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(18px);
  padding: 6px;
}

.country-picker-menu::-webkit-scrollbar {
  width: 8px;
}

.country-picker-menu::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
}

.country-picker-menu::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(50, 217, 255, 0.72), rgba(255, 79, 216, 0.62));
}

.country-picker-option {
  width: 100%;
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 8px;
  color: var(--text);
  background: transparent;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
}

.country-picker-flag {
  width: 24px;
  flex: 0 0 24px;
  text-align: center;
  font-size: 1.05rem;
  line-height: 1;
}

.country-picker-flag-img {
  width: 24px;
  height: 16px;
  flex: 0 0 24px;
  border-radius: 3px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.country-picker-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.country-picker-option:hover,
.country-picker-option.active {
  background: rgba(50, 217, 255, 0.12);
}

/* Team selector (removed) */

/* Trade Card Edit Mode */
.trade-card-edit {
  border: 2px solid var(--blue);
}

/* iPhone-style Toggle Switch */
.trade-active-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(10, 24, 45, 0.5);
  transition: 0.3s;
  border-radius: 24px;
  border: 1px solid var(--line);
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background-color: var(--muted);
  transition: 0.3s;
  border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--green);
  border-color: var(--green);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(20px);
  background-color: white;
}

.toggle-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.toggle-switch input:checked ~ .toggle-label {
  color: var(--green);
}

/* Trade Section Edit Mode */
.trade-block-edit {
  position: relative;
}

.trade-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.trade-section-delete {
  background: rgba(255, 59, 48, 0.2);
  border: 1px solid rgba(255, 59, 48, 0.5);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 14px;
  color: #ff3b30;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.trade-section-delete:hover {
  background: rgba(255, 59, 48, 0.4);
  transform: scale(1.1);
}

/* Mini Mon Wrapper for Edit Mode */
.mini-mon-wrapper {
  position: relative;
}

.mini-mon-delete {
  position: absolute;
  top: -4px;
  right: -4px;
  background: rgba(255, 59, 48, 0.2);
  border: 1px solid rgba(255, 59, 48, 0.5);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 14px;
  color: #ff3b30;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 10;
}

.mini-mon-delete:hover {
  background: rgba(255, 59, 48, 0.4);
  transform: scale(1.1);
}

/* Inline Plus Button */
.trade-section-add-inline {
  background: rgba(50, 217, 255, 0.15);
  border: 2px dashed var(--blue);
  border-radius: 8px;
  padding: 8px;
  font-size: 24px;
  color: var(--blue);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  transition: all 0.2s;
  aspect-ratio: 1;
}

.trade-section-add-inline:hover {
  opacity: 1;
  background: rgba(50, 217, 255, 0.25);
}

.push-status {
  margin: 0;
  line-height: 1.45;
  text-align: center;
}

.messages-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 12px;
}

.dm-rooms,
.dm-thread {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(10, 24, 45, 0.66);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.single-thread {
  min-height: 52vh;
}

.dm-rooms {
  max-height: 58vh;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: auto;
  padding: 8px;
}

.empty-room {
  display: grid;
  min-height: 110px;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 16px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
  text-align: center;
}

.dm-room {
  min-height: 72px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  padding: 12px 16px;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s ease;
}

.dm-room:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

.dm-room.active {
  border-color: rgba(79, 140, 255, 0.5);
  background: linear-gradient(135deg, rgba(79, 140, 255, 0.15), rgba(79, 140, 255, 0.08));
}

.dm-room span,
.dm-room small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dm-room span {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 2px;
}

.dm-room small {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 400;
}

.dm-thread {
  min-width: 0;
  overflow: hidden;
}

.dm-thread-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 54px;
  border-bottom: 1px solid var(--line);
  padding: 0 14px;
}

.dm-thread-head span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.chat-messages {
  min-height: 46vh;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  padding: 14px;
  overflow: auto;
}

.chat-bubble {
  width: fit-content;
  overflow-wrap: anywhere;
  border-radius: 18px;
  padding: 10px 12px;
  background: rgba(50, 217, 255, 0.12);
}

.chat-bubble strong {
  display: block;
  color: var(--blue);
  font-size: 0.78rem;
}

.chat-bubble small {
  display: block;
  margin-bottom: 4px;
  color: var(--pink);
  font-weight: 800;
}

.chat-form {
  margin-top: 10px;
}

.icon-button {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  width: 100%;
  max-width: none;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: rgba(7, 18, 34, 0.98);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
  padding-bottom: env(safe-area-inset-bottom);
  overflow: hidden;
}

.status-toast {
  justify-content: center;
  width: 100%;
  margin: 12px auto;
}

.nav-item {
  min-height: 68px;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 1.1rem;
  font-weight: 900;
}

.nav-icon {
  width: 22px;
  height: 22px;
  display: block;
  margin: 0 auto;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 0.72;
}

.nav-icon-trainer-hub {
  width: 25px;
  height: 25px;
}

.nav-item span {
  display: block;
  margin-top: 4px;
  font-size: 0.68rem;
  font-weight: 800;
}

.nav-item.active {
  color: var(--text);
  background: linear-gradient(180deg, rgba(50, 217, 255, 0.14), rgba(255, 79, 216, 0.16));
}

.nav-item.active .nav-icon {
  opacity: 1;
}

.dex-detail-modal {
  width: min(92vw, 340px);
  max-width: 340px;
  border: 0;
  padding: 0;
  margin: auto;
  color: var(--text);
  background: transparent;
}

.dex-detail-modal::backdrop {
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
}

.dex-detail-card {
  padding: 14px 16px 16px;
  border-radius: 20px;
}

.dex-detail-header-row {
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 12px;
}

.dex-detail-header {
  flex: 1;
  min-width: 0;
}

.dex-detail-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.dex-detail-hero img {
  width: 168px;
  height: 168px;
  object-fit: contain;
  filter: drop-shadow(0 12px 16px rgba(0, 0, 0, 0.38));
}

/* Pen Pal Modern Design */
.penpal-header {
  padding: 20px 16px 24px;
  background: linear-gradient(180deg, rgba(50, 217, 255, 0.08), rgba(255, 79, 216, 0.06));
  border-bottom: 1px solid var(--line);
}

.penpal-header-content {
  margin-bottom: 16px;
}

.penpal-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 8px 0;
  letter-spacing: -0.5px;
}

.penpal-subtitle {
  font-size: 0.95rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.4;
}

.penpal-header-actions {
  display: flex;
  gap: 12px;
}

.penpal-search-wrapper {
  flex: 1;
  display: flex;
  gap: 8px;
  align-items: center;
}

.penpal-search {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(7, 18, 34, 0.6);
  color: var(--text);
  font-size: 0.95rem;
  backdrop-filter: blur(10px);
  transition: all 0.2s ease;
}

.penpal-search:focus {
  outline: none;
  border-color: rgba(50, 217, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(50, 217, 255, 0.1);
}

.penpal-filter-toggle {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(7, 18, 34, 0.6);
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: all 0.2s ease;
}

.penpal-filter-toggle:hover {
  background: rgba(50, 217, 255, 0.1);
  border-color: rgba(50, 217, 255, 0.3);
}

.penpal-filter-toggle.active {
  background: rgba(50, 217, 255, 0.15);
  border-color: rgba(50, 217, 255, 0.5);
}

.penpal-filters-panel {
  padding: 20px 16px;
  background: rgba(7, 18, 34, 0.4);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.penpal-filter-section {
  margin-bottom: 20px;
}

.penpal-filter-section:last-child {
  margin-bottom: 0;
}

.penpal-filter-section-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 12px 0;
}

.penpal-purpose-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.penpal-purpose-chip {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(7, 18, 34, 0.6);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: all 0.2s ease;
}

.penpal-purpose-chip:hover {
  background: rgba(50, 217, 255, 0.1);
  border-color: rgba(50, 217, 255, 0.3);
  transform: translateY(-2px);
}

.penpal-purpose-chip.active {
  background: rgba(50, 217, 255, 0.15);
  border-color: rgba(50, 217, 255, 0.5);
  box-shadow: 0 4px 12px rgba(50, 217, 255, 0.2);
}

.penpal-vivillon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
}

.penpal-vivillon-chip {
  padding: 10px 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(7, 18, 34, 0.6);
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: all 0.2s ease;
  text-align: center;
}

.penpal-vivillon-chip:hover {
  background: rgba(255, 79, 216, 0.1);
  border-color: rgba(255, 79, 216, 0.3);
  transform: translateY(-2px);
}

.penpal-vivillon-chip.active {
  background: rgba(255, 79, 216, 0.15);
  border-color: rgba(255, 79, 216, 0.5);
  box-shadow: 0 4px 12px rgba(255, 79, 216, 0.2);
}

.penpal-users-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding: 20px 16px 100px;
}

.penpal-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
  font-size: 1rem;
}

.penpal-user-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(7, 18, 34, 0.6);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.penpal-user-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
  border-color: rgba(50, 217, 255, 0.3);
}

.penpal-user-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.penpal-user-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(50, 217, 255, 0.2), rgba(255, 79, 216, 0.2));
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  border: 2px solid rgba(50, 217, 255, 0.3);
}

.penpal-user-info {
  flex: 1;
  min-width: 0;
}

.penpal-user-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 4px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.penpal-user-level {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  margin: 0;
}

.penpal-user-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.penpal-user-flag {
  font-size: 1.2rem;
}

.penpal-user-vivillon {
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(255, 79, 216, 0.1);
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid rgba(255, 79, 216, 0.3);
}

.penpal-user-purposes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.penpal-user-purpose {
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(50, 217, 255, 0.1);
  color: var(--text);
  font-size: 0.7rem;
  font-weight: 600;
  border: 1px solid rgba(50, 217, 255, 0.2);
}

.penpal-user-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.penpal-user-active {
  font-size: 0.75rem;
  color: var(--muted);
}

.penpal-user-actions {
  display: flex;
  gap: 8px;
}

.penpal-user-action {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.penpal-user-action.primary {
  background: linear-gradient(135deg, rgba(50, 217, 255, 0.2), rgba(255, 79, 216, 0.2));
  color: var(--text);
  border: 1px solid rgba(50, 217, 255, 0.3);
}

.penpal-user-action.primary:hover {
  background: linear-gradient(135deg, rgba(50, 217, 255, 0.3), rgba(255, 79, 216, 0.3));
  transform: translateY(-2px);
}

.penpal-user-action.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

.penpal-user-action.ghost:hover {
  background: rgba(7, 18, 34, 0.8);
  border-color: rgba(50, 217, 255, 0.3);
}

.dex-detail-meta {
  width: 100%;
}

.dex-detail-hero h3 {
  font-size: 1.1rem;
}

.dex-detail-lead {
  margin: 0 0 12px;
  font-size: 0.78rem;
  line-height: 1.4;
}

.dex-trade-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.dex-trade-stat {
  display: grid;
  gap: 2px;
  min-height: 84px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.dex-trade-stat:hover:not(:disabled) {
  transform: translateY(-1px);
}

.dex-trade-stat:disabled,
.dex-trade-stat.is-empty {
  opacity: 0.42;
  cursor: not-allowed;
}

.dex-trade-stat:disabled:hover,
.dex-trade-stat.is-empty:hover {
  transform: none;
}

.dex-trade-stat.wanted {
  border-color: rgba(255, 79, 216, 0.42);
  background: linear-gradient(160deg, rgba(255, 79, 216, 0.14), rgba(255, 255, 255, 0.03));
}

.dex-trade-stat.offers {
  border-color: rgba(50, 217, 255, 0.42);
  background: linear-gradient(160deg, rgba(50, 217, 255, 0.14), rgba(255, 255, 255, 0.03));
}

.dex-stat-label {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dex-stat-count {
  font-size: 1.55rem;
  font-weight: 900;
  line-height: 1;
}

.dex-stat-hint {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
}

.creator-modal {
  max-height: calc(100dvh - 24px);
  border: 0;
  padding: 0;
  color: var(--text);
  background: transparent;
}

.creator-modal::backdrop {
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(6px);
}

.modal-card {
  border-radius: 26px;
  padding: 18px;
  max-height: calc(100dvh - 24px);
  overflow: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.creator-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.8fr);
  gap: 18px;
}

.creator-sidebar,
.live-preview {
  min-width: 0;
}

.preview-placeholder {
  border: 1px dashed var(--line);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.preview-placeholder p {
  margin: 0 0 8px;
}

.preview-placeholder p:last-child {
  margin-bottom: 0;
}

.creator-modal.creator-review-mode {
  max-height: 100dvh;
}

.creator-modal.creator-review-mode .modal-card {
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - 24px);
  max-height: 100dvh;
  border-radius: 0;
  padding: 16px 16px 24px;
}

.creator-review-body {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: auto;
  padding: 8px 0 16px;
}

.creator-review-body .trade-preview-export {
  width: 100%;
}

.creator-review-footer {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.creator-review-body .trade-caption {
  color: var(--text);
}

.trade-preview-export .trade-card-export {
  margin: 0;
}

.trade-card-export .mini-mon img {
  width: var(--pokemon-art-size);
  height: var(--pokemon-art-size);
}

.caption-field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.caption-field span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

textarea {
  width: 100%;
  min-height: 88px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  padding: 12px 14px;
  font: inherit;
  line-height: 1.45;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.feed-scope-segmented {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 0 12px;
}

.segment {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  font-weight: 900;
}

.segment.active {
  color: #06111f;
  background: linear-gradient(135deg, var(--blue), var(--pink));
}

.trade-flow-view {
  padding: 0 0 calc(130px + env(safe-area-inset-bottom));
}

.flow-toolbar {
  position: sticky;
  top: 0;
  z-index: 12;
  width: 100vw;
  min-height: 74px;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  margin-bottom: 10px;
  background: var(--panel-strong);
  border-top: 0;
  border-right: 0;
  border-bottom: 1px solid var(--line);
  border-left: 0;
  backdrop-filter: none;
}

.flow-step-progress {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  height: 16px;
  padding: 4px max(12px, calc((100vw - var(--container-width)) / 2 + 12px)) 0;
}

.flow-step-label {
  color: var(--blue);
  font-size: 0.66rem;
  font-weight: 900;
  line-height: 1;
}

.flow-step-track {
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.flow-step-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.flow-header {
  display: grid;
  grid-template-columns: auto minmax(0, 0.82fr) minmax(180px, 1.1fr) auto auto auto;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 6px max(12px, calc((100vw - var(--container-width)) / 2 + 12px)) 10px;
}

.flow-picker-header {
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  column-gap: 2px;
}

.flow-header.feed-filter-picker-header {
  padding-top: 8px;
  padding-bottom: 8px;
}

.flow-picker-header.search-open {
  grid-template-columns: auto minmax(0, 1fr) minmax(210px, 0.58fr) auto auto;
  column-gap: 2px;
}

.flow-header-tools {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  justify-content: end;
  gap: 0;
}

.feed-filter-picker-header .icon-back-button,
.feed-filter-picker-header .flow-header-tools,
.feed-filter-picker-header .flow-count,
.feed-filter-picker-header .feed-filter-ok-button {
  align-self: center;
}

.flow-picker-header.search-open .flow-header-tools {
  grid-template-columns: minmax(0, 1fr) auto auto;
  width: 100%;
  z-index: 2;
}

#wantedTradeView .flow-picker-header.search-open .flow-header-tools,
#offerTradeView .flow-picker-header.search-open .flow-header-tools,
#feedFilterView .flow-picker-header.search-open .flow-header-tools {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
}

#wantedTradeView .flow-picker-header.search-open .flow-header-search,
#offerTradeView .flow-picker-header.search-open .flow-header-search,
#feedFilterView .flow-picker-header.search-open .flow-header-search {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
}

#wantedTradeView .flow-picker-header.search-open .flow-search-toggle,
#wantedTradeView .flow-picker-header.search-open .flow-header-filter,
#offerTradeView .flow-picker-header.search-open .flow-search-toggle,
#offerTradeView .flow-picker-header.search-open .flow-header-filter,
#feedFilterView .flow-picker-header.search-open .flow-search-toggle,
#feedFilterView .flow-picker-header.search-open .flow-header-filter {
  flex: 0 0 auto;
}

#wantedTradeView .flow-picker-header.search-open,
#offerTradeView .flow-picker-header.search-open,
#feedFilterView .flow-picker-header.search-open {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
}

#wantedTradeView .flow-picker-header.search-open .icon-back-button,
#wantedTradeView .flow-picker-header.search-open .flow-count,
#wantedTradeView .flow-picker-header.search-open .flow-header-next,
#offerTradeView .flow-picker-header.search-open .icon-back-button,
#offerTradeView .flow-picker-header.search-open .flow-count,
#offerTradeView .flow-picker-header.search-open .flow-header-next,
#feedFilterView .flow-picker-header.search-open .icon-back-button,
#feedFilterView .flow-picker-header.search-open .flow-count,
#feedFilterView .flow-picker-header.search-open .flow-header-next {
  flex-shrink: 0;
}

#wantedTradeView .flow-picker-header.search-open .flow-header-title,
#offerTradeView .flow-picker-header.search-open .flow-header-title,
#feedFilterView .flow-picker-header.search-open .flow-header-title {
  display: none;
}

.flow-preview-header {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.flow-header-title {
  min-width: 0;
}

.flow-header h2 {
  font-size: 1.42rem;
  line-height: 1.05;
}

.flow-post-button {
  min-height: 42px;
  border: 0;
  border-radius: 0;
  color: var(--blue);
  background: transparent;
  box-shadow: none;
  padding: 0;
  font-weight: 900;
  white-space: nowrap;
}

.preview-post-button {
  justify-self: end;
  width: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  border: 1px solid var(--blue);
  border-radius: 14px;
  padding: 0 14px;
}

.flow-post-button:hover {
  background: transparent;
  box-shadow: none;
  color: var(--blue);
}

.flow-search-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 0 12px 10px;
}

.flow-search-panel input,
.flow-header-search {
  width: 100%;
  min-height: 42px;
  border-color: rgba(116, 224, 255, 0.24);
  border-radius: 14px;
  background:
    linear-gradient(160deg, rgba(50, 217, 255, 0.11), rgba(255, 79, 216, 0.075)),
    rgba(10, 24, 45, 0.42);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025), 0 8px 20px rgba(0, 0, 0, 0.16);
  font-size: 0.9rem;
}

.flow-picker-header .flow-header-search {
  overflow: hidden;
  border-radius: 999px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flow-header-search::placeholder {
  opacity: 0.58;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flow-header-search[hidden] {
  display: none;
}

.flow-picker-header.search-open .flow-header-search {
  order: 1;
}

.flow-picker-header.search-open .flow-search-toggle {
  order: 2;
  margin-left: 6px;
}

.flow-picker-header.search-open .flow-header-filter {
  order: 3;
}

.flow-picker-header.search-open .flow-clear-button {
  order: 4;
}

.flow-picker-header.search-open .flow-count {
  order: 4;
}

.flow-picker-header.search-open .flow-header-next {
  order: 5;
}

.flow-search-panel .filter-chip,
.flow-header-filter {
  min-height: 42px;
  border-radius: 14px;
  padding: 0 14px;
}

.flow-picker-header .flow-search-toggle,
.flow-picker-header .flow-header-filter,
.flow-picker-header .flow-clear-button,
.flow-picker-header .flow-header-next {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
}

.flow-picker-header .feed-filter-ok-button {
  width: auto;
  min-width: 42px;
  padding: 0 10px;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 900;
}

.flow-picker-header .flow-header-next.feed-filter-ok-button {
  width: auto;
  min-width: 42px;
  padding: 0 10px;
}

.flow-picker-header .filter-icon {
  width: 24px;
  height: 24px;
}

.flow-picker-header .undo-icon,
.flow-picker-header .forward-icon {
  width: 25px;
  height: 25px;
}

.icon-filter-button {
  display: inline-grid;
  place-items: center;
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
}

.icon-undo-button,
.flow-clear-button {
  display: inline-grid;
  place-items: center;
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.flow-header-next {
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  display: inline-grid;
  place-items: center;
  box-shadow: none;
  padding: 0;
}

.flow-search-toggle {
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
}

.flow-header-next:hover {
  background: rgba(255, 255, 255, 0.06);
  box-shadow: none;
  transform: none;
}

.flow-filter-panel[hidden] {
  display: none;
}

.flow-filter-panel {
  padding: 8px max(12px, calc((100vw - var(--container-width)) / 2 + 12px)) 10px;
  border-top: 1px solid var(--line);
}

.flow-back {
  width: 42px;
  min-width: 42px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.86rem;
  font-weight: 900;
  padding: 0;
}

.flow-count {
  min-width: 46px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(114, 255, 182, 0.24);
  border-radius: 999px;
  color: var(--green);
  background: rgba(114, 255, 182, 0.08);
  padding: 0 10px;
  font-size: 0.74rem;
  font-weight: 900;
  white-space: nowrap;
}

.filter-scroll,
.region-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  overflow: visible;
  padding-bottom: 4px;
}

#wantedFilters,
#offerFilters {
  flex-wrap: nowrap;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

.filter-scroll::-webkit-scrollbar,
.region-filter-row::-webkit-scrollbar {
  display: none;
}

.region-filter-row {
  margin-top: 8px;
}

.region-filter-row[hidden] {
  display: none;
}

.filter-chip,
.region-chip {
  flex: 0 0 auto;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025)),
    rgba(10, 24, 45, 0.88);
  padding: 0 10px;
  font-size: 0.72rem;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.14);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.flow-filter-reset,
.feed-filter-reset {
  display: inline-grid;
  place-items: center;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
}

.flow-filter-reset .undo-icon,
.feed-filter-reset .undo-icon {
  width: 24px;
  height: 24px;
}

.clear-all-chip {
  border-color: rgba(255, 79, 216, 0.34);
  background:
    linear-gradient(160deg, rgba(255, 79, 216, 0.14), rgba(50, 217, 255, 0.06)),
    rgba(10, 24, 45, 0.82);
}

.filter-chip.active,
.region-chip.active {
  border-color: rgba(50, 217, 255, 0.58);
  color: #04111f;
  background: linear-gradient(135deg, var(--blue), var(--green));
  box-shadow: 0 0 18px rgba(50, 217, 255, 0.2);
}

.flow-results-meta {
  margin: 8px 0 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.flow-pokemon-grid {
  padding-bottom: 10px;
}

.flow-pokemon-card {
  position: relative;
  width: var(--pokemon-tile-width);
  min-height: auto;
  display: grid;
  grid-template-rows: auto auto;
  align-items: center;
  justify-items: center;
  border: none;
  border-radius: 0;
  color: var(--text);
  background: transparent;
  box-shadow: none;
  overflow: visible;
  padding: 6px;
  text-align: center;
  transition: none;
}

.flow-pokemon-card::before {
  display: none;
}

.pokemon-tile:hover,
.mini-mon:hover,
.flow-pokemon-card:hover {
  transform: none;
  box-shadow: none;
}

.flow-pokemon-card:active {
  transform: scale(0.97);
}

.flow-pokemon-card.selected {
  background: transparent;
  box-shadow: none;
}

.flow-pokemon-card.selected img {
  outline: 2px solid rgba(255, 79, 216, 0.82);
  outline-offset: 2px;
  border-radius: 8px;
  box-shadow: 0 0 22px rgba(255, 79, 216, 0.35);
}

.flow-card-number {
  display: none;
}

.flow-pokemon-card img {
  position: relative;
  z-index: 1;
  width: var(--pokemon-art-size);
  height: var(--pokemon-art-size);
  flex-shrink: 0;
  object-fit: contain;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.38));
}

.flow-card-badges {
  position: relative;
  z-index: 1;
  min-height: 18px;
  display: flex;
  justify-content: center;
  gap: 4px;
  overflow: hidden;
}

.flow-card-badges em {
  max-width: 86px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: var(--text);
  background: rgba(3, 12, 24, 0.58);
  padding: 2px 5px;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.48rem;
  font-style: normal;
  font-weight: 900;
}

.flow-empty {
  grid-column: 1 / -1;
  border: 1px dashed var(--line);
  border-radius: 18px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  padding: 24px 14px;
  text-align: center;
  font-weight: 900;
}

.flow-actions {
  position: fixed;
  right: 0;
  bottom: calc(68px + env(safe-area-inset-bottom));
  left: 0;
  z-index: 18;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  border: 0;
  border-top: 1px solid var(--line);
  background: var(--panel-strong);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.24);
  padding: 10px 12px;
}

.flow-action-button {
  width: auto;
  min-width: 84px;
  min-height: 42px;
  border-radius: 14px;
  padding: 0 14px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}

.flow-action-button.icon-back-button {
  width: 42px;
  min-width: 42px;
  padding: 0;
}

.flow-description {
  display: grid;
  gap: 8px;
  margin: 6px 0 14px;
}

.flow-description span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.flow-description textarea {
  min-height: 74px;
  border-radius: 18px;
  background:
    linear-gradient(160deg, rgba(50, 217, 255, 0.07), rgba(255, 79, 216, 0.055)),
    rgba(3, 12, 24, 0.78);
}

.flow-tag-selector {
  display: grid;
  gap: 10px;
  margin: 6px 0 14px;
}

.flow-tag-group {
  display: grid;
  gap: 6px;
}

.flow-tag-group p {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.flow-tag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.flow-tag-chip {
  min-height: 32px;
  border: 1px solid rgba(116, 224, 255, 0.3);
  border-radius: 999px;
  color: var(--text);
  background: rgba(10, 24, 45, 0.7);
  padding: 0 10px;
  font-size: 0.72rem;
  font-weight: 900;
  white-space: nowrap;
}

.flow-tag-chip.active {
  border-color: rgba(50, 217, 255, 0.62);
  color: #04111f;
  background: linear-gradient(135deg, var(--blue), var(--green));
  box-shadow: 0 0 16px rgba(50, 217, 255, 0.18);
}

.share-preview-card {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(116, 224, 255, 0.24);
  border-radius: 26px;
  background:
    linear-gradient(160deg, rgba(50, 217, 255, 0.1), transparent 38%),
    linear-gradient(340deg, rgba(255, 79, 216, 0.13), transparent 42%),
    rgba(10, 24, 45, 0.88);
  box-shadow: var(--shadow);
  padding: 14px;
}

.share-preview-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.share-preview-head .trainer-orb {
  width: 46px;
  height: 46px;
}

.share-preview-head strong,
.share-preview-head span {
  display: block;
}

.share-preview-head span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.share-preview-caption {
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  padding: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.share-preview-tags {
  margin-bottom: 0;
}

.share-preview-section {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 12px;
}

.share-preview-section.wanted {
  background: rgba(50, 217, 255, 0.07);
}

.share-preview-section.offers {
  background: rgba(255, 79, 216, 0.07);
}

.option-row {
  display: grid;
  grid-template-columns: 1fr 150px;
  margin-bottom: 10px;
}

.max-form-select,
#costumeInput {
  margin-bottom: 10px;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.45);
    opacity: 0.42;
  }
}

@keyframes sparkle {
  0%,
  100% {
    transform: scale(0.8) rotate(0deg);
    opacity: 0.55;
  }
  50% {
    transform: scale(1.35) rotate(18deg);
    opacity: 1;
  }
}

@keyframes maxPulse {
  0%,
  100% {
    transform: scale(0.92);
    opacity: 0.48;
  }
  50% {
    transform: scale(1.08);
    opacity: 0.92;
  }
}

@media (max-width: 1148px) {
  .layout-container {
    width: calc(100% - 24px);
  }
}

@media (max-width: 760px) {

  .app-shell {
    padding: 0 0 calc(70px + env(safe-area-inset-bottom));
  }

  .top-panel {
    grid-template-columns: minmax(0, 1fr) 40px 40px auto;
    gap: 8px;
    min-height: 60px;
    border-radius: 0;
    padding: 8px 10px;
  }

  .app-logo {
    width: 40px;
    height: 40px;
  }

  .top-panel h1 {
    font-size: 1rem;
    line-height: 1.05;
  }

  .top-panel .primary-action {
    grid-column: auto;
    width: auto;
    min-height: 40px;
    padding: 0 10px;
    font-size: 0.72rem;
    white-space: nowrap;
  }

  .top-panel .notification-button,
  .top-panel .theme-toggle-button {
    width: 40px;
    height: 40px;
  }

  .top-panel .eyebrow {
    font-size: 0.54rem;
  }

  .feed-title-row {
    gap: 8px;
  }

  .feed-title-row .trade-search-panel {
    gap: 8px;
  }

  .flow-actions {
    bottom: calc(62px + env(safe-area-inset-bottom));
  }

  .flow-header {
    grid-template-columns: auto minmax(0, 0.64fr) minmax(78px, 1fr) auto auto auto;
    gap: 6px;
    min-height: 48px;
    padding: 4px 10px 8px;
  }

  .flow-toolbar {
    min-height: 60px;
  }

  .flow-step-progress {
    height: 12px;
    padding: 3px 10px 0;
  }

  .flow-filter-panel {
    padding-inline: 10px;
  }

  .flow-step-label {
    font-size: 0.58rem;
  }

  .flow-picker-header {
    grid-template-columns: auto minmax(0, 1fr) auto auto auto;
    column-gap: 2px;
  }

  .flow-picker-header.search-open {
    grid-template-columns: auto minmax(0, 0.55fr) minmax(118px, 1fr) auto auto;
    column-gap: 2px;
  }

  .flow-preview-header {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .flow-header h2 {
    overflow: hidden;
    font-size: 1rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .flow-count {
    padding: 0 8px;
    font-size: 0.64rem;
  }

  .flow-header-title .eyebrow {
    font-size: 0.62rem;
  }

  .flow-post-button {
    min-height: 38px;
    font-size: 0.78rem;
  }

  .flow-search-panel input,
  .flow-search-panel .filter-chip,
  .flow-header-search,
  .flow-header-filter,
  .flow-header-next {
    min-height: 38px;
    font-size: 0.78rem;
  }

  .flow-header-search {
    min-width: 0;
    padding-inline: 9px;
  }

  .flow-header-filter {
    padding-inline: 9px;
  }

  .flow-picker-header .flow-search-toggle,
  .flow-picker-header .flow-header-filter,
  .flow-picker-header .flow-clear-button,
  .flow-picker-header .flow-header-next {
    width: 34px;
    min-width: 34px;
    height: 34px;
    min-height: 34px;
    padding: 0;
  }

  .icon-filter-button {
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
    padding: 0;
  }

  .icon-undo-button,
  .flow-clear-button {
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
    padding: 0;
  }

  .flow-header-next {
    width: 38px;
    min-width: 38px;
    height: 38px;
    padding: 0;
  }

  .flow-search-toggle {
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
  }

  .flow-pokemon-grid,
  .creator-sidebar .pokemon-grid,
  .feed-column .mini-grid,
  .pokemon-grid.large {
    --pokemon-art-size: 52px;
    --pokemon-gap: 8px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: var(--pokemon-gap);
    justify-content: stretch;
  }

  .flow-pokemon-card,
  .creator-sidebar .pokemon-tile,
  .feed-column .mini-mon,
  .pokemon-grid.large .pokemon-tile {
    width: 100%;
    padding: 4px 2px;
  }

  .flow-pokemon-card img,
  .creator-sidebar .pokemon-tile img,
  .feed-column .mini-mon img,
  .pokemon-grid.large .pokemon-tile img {
    width: var(--pokemon-art-size);
    height: var(--pokemon-art-size);
  }

  .creator-sidebar .pokemon-tile span,
  .pokemon-grid.large .pokemon-tile span {
    font-size: 0.58rem;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  #pokedexView .pokedex-search-heading {
    align-items: center;
    flex-direction: row;
    gap: 8px;
  }

  .pokedex-search-panel {
    width: 100%;
    min-width: 0;
    flex: 1 1 auto;
    gap: 6px;
  }

  .pokedex-search-panel .filter-chip {
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
  }

  .trade-sections,
  .creator-layout,
  .messages-layout,
  .dex-controls,
  .compact,
  .option-row {
    grid-template-columns: 1fr;
  }

  .penpal-form-actions {
    grid-template-columns: 1fr;
  }

  .penpal-card-head {
    grid-template-columns: auto 1fr;
  }

  .penpal-vivillon-badge {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .trade-search-panel input {
    min-height: 38px;
    font-size: 0.84rem;
  }

  .feed-column .home-search-input,
  .pokedex-search-panel input {
    min-height: 42px;
    font-size: 0.9rem;
  }

  .dm-rooms {
    max-height: none;
    flex-direction: column;
    overflow-x: auto;
    padding-bottom: 12px;
  }

  .dm-room,
  .empty-room {
    min-width: 210px;
  }

  .dm-thread-head {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding-block: 10px;
  }

  .feed-column .mini-mon span {
    font-size: 0.52rem;
  }

  .trade-actions {
    display: flex;
    grid-template-columns: none;
    gap: 14px;
    padding-left: 14px;
  }

  .trade-actions .ghost-action {
    min-width: 0;
    min-height: 32px;
    padding: 0;
    font-size: 0.92rem;
  }

  .chat-form {
    grid-template-columns: 42px minmax(0, 1fr) 42px;
  }

  .mini-mon span {
    font-size: 0.58rem;
  }

  .dex-load-panel {
    align-items: center;
    flex-direction: row;
    gap: 8px;
    text-align: center;
  }

  .dex-region-nav-button {
    flex: 1 1 0;
    min-width: 0;
    padding: 0 10px;
    font-size: 0.76rem;
  }

  .nav-item {
    min-height: 62px;
    font-size: 1rem;
  }

  .nav-item span {
    font-size: 0.62rem;
  }

  .creator-modal {
    max-height: 100dvh;
  }

  .modal-card {
    min-height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    padding: 14px 12px 112px;
  }

  .modal-header {
    margin: -14px -12px 12px;
    padding: 14px 12px;
    background: rgba(7, 18, 34, 0.94);
    backdrop-filter: blur(18px);
  }

  .segmented {
    padding: 8px 0;
    background: rgba(7, 18, 34, 0.88);
    backdrop-filter: blur(12px);
  }

  .segment {
    min-height: 50px;
    padding: 0 10px;
    font-size: 0.78rem;
  }
}

@media (max-width: 420px) {
  .top-panel {
    grid-template-columns: minmax(0, 1fr) 36px 36px auto;
    gap: 6px;
    padding-inline: 8px;
  }

  .top-panel-brand {
    gap: 7px;
  }

  .app-logo {
    width: 36px;
    height: 36px;
  }

  .top-panel .notification-button,
  .top-panel .theme-toggle-button {
    width: 36px;
    height: 36px;
  }

  .top-panel .primary-action {
    min-height: 36px;
    padding: 0 8px;
    font-size: 0.66rem;
  }

  .top-panel h1 {
    font-size: 0.92rem;
  }

  .feed-title-row,
  .feed-title-row .trade-search-panel {
    gap: 6px;
  }

  .flow-header {
    grid-template-columns: auto minmax(0, 0.58fr) minmax(62px, 1fr) auto auto auto;
    min-height: 48px;
    padding-inline: 8px;
  }

  .flow-step-progress {
    padding-inline: 8px;
  }

  .flow-filter-panel {
    padding-inline: 8px;
  }

  .flow-picker-header {
    grid-template-columns: auto minmax(0, 1fr) auto auto auto;
    column-gap: 1px;
  }

  .flow-picker-header.search-open {
    grid-template-columns: auto minmax(0, 0.42fr) minmax(92px, 1fr) auto auto;
    column-gap: 1px;
  }

  .flow-preview-header {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .flow-back {
    min-width: 42px;
    padding-inline: 8px;
    font-size: 0.72rem;
  }

  .flow-header-search,
  .flow-header-filter,
  .flow-header-next {
    min-height: 36px;
    font-size: 0.72rem;
  }

  .flow-header-filter {
    padding-inline: 8px;
  }

  .icon-filter-button {
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
    padding: 0;
  }

  .icon-undo-button,
  .flow-clear-button {
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
    padding: 0;
  }

  .flow-header-next {
    width: 36px;
    min-width: 36px;
    height: 36px;
    padding: 0;
  }

  .flow-search-toggle {
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
  }

  .flow-count {
    min-height: 34px;
    padding-inline: 6px;
    font-size: 0.58rem;
  }

  .flow-post-button {
    min-height: 36px;
    font-size: 0.72rem;
  }
}

.edit-profile-modal .modal-card {
  overflow: visible;
}

/* Modern DM screens */
#chatView,
#chatThreadView {
  max-width: 760px;
  margin: 0 auto;
}

.dm-rooms {
  gap: 0;
  max-height: none;
  overflow: hidden;
  border-radius: 8px;
  padding: 0;
}

.dm-room {
  min-height: 76px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 12px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.025);
  padding: 12px;
}

.dm-room:last-child {
  border-bottom: 0;
}

.dm-room:hover,
.dm-room.active {
  background: rgba(50, 217, 255, 0.08);
  transform: none;
}

.dm-room-avatar,
.dm-thread-avatar {
  width: 44px;
  height: 44px;
  margin: 0;
  flex: 0 0 auto;
  font-size: 1rem;
}

.dm-room-body {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.dm-room-body strong {
  overflow: hidden;
  font-size: 0.98rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dm-room-body small {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.dm-room time {
  align-self: start;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

.dm-thread-head {
  position: sticky;
  top: 0;
  z-index: 8;
  display: grid;
  grid-template-columns: 42px 44px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  margin-bottom: 0;
  border: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
  background: rgba(7, 18, 34, 0.94);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  padding: 9px 10px;
  backdrop-filter: blur(18px);
}

.dm-thread-profile {
  min-width: 0;
  border: 0;
  color: var(--text);
  background: transparent;
  box-shadow: none;
  padding: 0;
  text-align: left;
}

.dm-thread-profile span {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 1rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-icon-button,
.chat-send-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: none;
  padding: 0;
  font-size: 1.15rem;
  font-weight: 900;
}

.chat-send-button {
  border-color: rgba(114, 255, 182, 0.36);
  color: #04111f;
  background: linear-gradient(135deg, var(--green), var(--blue));
}

.chat-menu-wrap,
.chat-form {
  position: relative;
}

.chat-overflow-menu,
.chat-attach-menu {
  position: absolute;
  right: 0;
  z-index: 12;
  min-width: 184px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}

.chat-overflow-menu {
  top: 48px;
}

.chat-attach-menu {
  right: 56px;
  bottom: 58px;
}

.chat-overflow-menu button,
.chat-attach-menu button {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  background: transparent;
  box-shadow: none;
  padding: 0 14px;
  text-align: left;
  font-size: 0.86rem;
  font-weight: 800;
}

.chat-overflow-menu button:last-child,
.chat-attach-menu button:last-child {
  border-bottom: 0;
}

.chat-thread-shell {
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 8px 8px;
  background: rgba(5, 13, 25, 0.62);
  overflow: hidden;
}

.chat-messages {
  min-height: calc(100dvh - 250px);
  max-height: calc(100dvh - 250px);
  gap: 7px;
  padding: 14px 10px;
}

.chat-date-divider {
  align-self: center;
  margin: 10px 0 6px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.07);
  padding: 5px 10px;
  font-size: 0.7rem;
  font-weight: 900;
}

.chat-row {
  display: flex;
  width: 100%;
}

.chat-row.mine {
  justify-content: flex-end;
}

.chat-row.theirs {
  justify-content: flex-start;
}

.chat-bubble {
  max-width: min(78%, 480px);
  display: grid;
  gap: 4px;
  border-radius: 18px;
  padding: 9px 11px 7px;
  overflow-wrap: anywhere;
  box-shadow: none;
}

.chat-row.theirs .chat-bubble {
  border-bottom-left-radius: 5px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
}

.chat-row.mine .chat-bubble {
  border-bottom-right-radius: 5px;
  color: #06111f;
  background: linear-gradient(135deg, #d8fff0, #7de5ff);
}

.chat-bubble span {
  line-height: 1.35;
  font-size: 0.92rem;
}

.chat-bubble time {
  justify-self: end;
  opacity: 0.74;
  font-size: 0.66rem;
  font-weight: 900;
}

.friend-id-message {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: min(260px, 70vw);
}

.friend-id-copy {
  min-width: 58px;
  min-height: 34px;
  border: 1px solid rgba(3, 17, 31, 0.16);
  border-radius: 999px;
  color: #06111f;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: none;
  padding: 0 10px;
  font-size: 0.76rem;
  font-weight: 900;
}

.chat-row.theirs .friend-id-copy {
  border-color: rgba(255, 255, 255, 0.16);
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.friend-id-text {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.friend-id-text strong,
.friend-id-text span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.friend-id-text strong {
  font-size: 0.82rem;
  font-weight: 900;
}

.friend-id-text span {
  font-size: 0.9rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.chat-sent-pokemon {
  min-width: 116px;
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 2px 0 0;
}

.chat-sent-pokemon img {
  width: 92px;
  height: 92px;
  object-fit: contain;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.28));
}

.chat-sent-pokemon strong {
  max-width: 150px;
  overflow: hidden;
  color: inherit;
  font-size: 0.84rem;
  font-weight: 900;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-form {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  gap: 8px;
  align-items: center;
  margin: 0;
  border-top: 1px solid var(--line);
  background: rgba(7, 18, 34, 0.88);
  padding: 10px;
}

.chat-form input {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  padding: 0 14px;
}

.chat-pokemon-panel {
  border: 1px solid var(--line);
  border-radius: 0 0 8px 8px;
  background: rgba(5, 13, 25, 0.72);
  padding: 10px;
}

.chat-pokemon-head {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.chat-pokemon-head h2 {
  font-size: 1.05rem;
}

.chat-pokemon-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.chat-pokemon-tabs.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.chat-pokemon-tabs button,
.chat-pokemon-all-tools button,
.chat-filter-list button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: none;
  padding: 0 8px;
  font-size: 0.76rem;
  font-weight: 900;
}

.chat-pokemon-tabs button.active,
.chat-filter-list button.active {
  border-color: rgba(114, 255, 182, 0.48);
  color: #04111f;
  background: linear-gradient(135deg, var(--green), var(--blue));
}

.chat-pokemon-all-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px;
  gap: 8px;
  margin-bottom: 10px;
}

.chat-pokemon-all-tools[hidden] {
  display: none !important;
}

.chat-pokemon-all-tools input {
  min-width: 0;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  padding: 0 12px;
}

.chat-filter-sheet[hidden] {
  display: none !important;
}

.chat-filter-sheet {
  position: fixed;
  inset: 0;
  z-index: 55;
}

.chat-filter-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.56);
}

.chat-filter-panel {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  max-height: min(78dvh, 620px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 18px 18px 0 0;
  background: var(--panel-strong);
  box-shadow: 0 -18px 40px rgba(0, 0, 0, 0.36);
  padding: 14px 14px calc(14px + env(safe-area-inset-bottom));
}

.chat-filter-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chat-filter-panel h3 {
  font-size: 1rem;
}

.chat-filter-close {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: none;
  padding: 0;
  font-size: 1.15rem;
}

.chat-filter-list {
  display: grid;
  gap: 8px;
  overflow: auto;
}

.chat-filter-list button {
  justify-content: flex-start;
  width: 100%;
  text-align: left;
}

.chat-pokemon-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-height: calc(100dvh - 290px);
  overflow: auto;
  padding-bottom: 8px;
}

.chat-pokemon-card {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
  box-shadow: none;
  padding: 8px 4px;
}

.chat-pokemon-card img {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.chat-pokemon-card span {
  max-width: 100%;
  overflow: hidden;
  font-size: 0.68rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-pokemon-empty {
  grid-column: 1 / -1;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 24px 12px;
  text-align: center;
  font-weight: 900;
}

.chat-confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.58);
  padding: 18px;
}

.chat-confirm-card {
  width: min(100%, 320px);
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  padding: 12px;
}

.chat-confirm-card .chat-pokemon-card {
  pointer-events: none;
}

.chat-confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

@media (min-width: 640px) {
  .chat-pokemon-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  #chatView,
  #chatThreadView {
    width: 100%;
  }

  .dm-rooms {
    overflow: hidden;
    padding-bottom: 0;
  }

  .dm-room,
  .empty-room {
    min-width: 0;
  }

  .dm-thread-head {
    grid-template-columns: 42px 42px minmax(0, 1fr) 42px;
    align-items: center;
    flex-direction: initial;
    padding-block: 9px;
  }

  .chat-form {
    grid-template-columns: 42px minmax(0, 1fr) 42px;
  }

  .chat-pokemon-tabs.compact,
  .chat-pokemon-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


/* Pen Pal LeekDuck-style board overrides */
.penpal-page {
  width: min(100%, 760px);
  display: flex;
  flex-direction: column;
  margin: 0 auto;
  padding: 18px 14px 104px;
}

.penpal-hero {
  order: 1;
}

.penpal-notice {
  order: 2;
}

.penpal-find {
  order: 4;
}

.penpal-my-post {
  order: 3;
}

.penpal-hero {
  display: grid;
  gap: 8px;
  padding: 10px 2px 18px;
  text-align: center;
}

.penpal-hero h1 {
  margin: 0;
  font-size: 2.15rem;
  line-height: 1;
  letter-spacing: 0;
}

.penpal-hero p:last-child {
  max-width: 560px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.penpal-notice {
  display: grid;
  gap: 4px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 205, 80, 0.38);
  border-radius: 8px;
  background: rgba(255, 205, 80, 0.1);
  color: var(--text);
}

.penpal-notice span {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.penpal-board-section,
.penpal-guide {
  margin: 14px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 18, 34, 0.72);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
}

.penpal-board-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.penpal-find-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.penpal-compose-toggle {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(114, 255, 182, 0.34);
  border-radius: 50%;
  color: #04111f;
  background: linear-gradient(135deg, var(--green), var(--blue));
  box-shadow: none;
  padding: 0;
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1;
}

.penpal-my-post.collapsed {
  padding-block: 10px;
}

.penpal-my-post.collapsed .penpal-board-heading {
  margin-bottom: 0;
}

.penpal-my-post.collapsed #penpalProfilePreview,
.penpal-my-post.collapsed #penpalForm {
  display: none !important;
}

.penpal-board-heading h2,
.penpal-guide h2 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.penpal-status,
.penpal-online-count {
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

.penpal-status.live {
  border-color: rgba(67, 255, 151, 0.36);
  color: #75ffad;
  background: rgba(67, 255, 151, 0.08);
}

.penpal-profile-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.penpal-profile-preview-info {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.penpal-profile-preview-info strong,
.penpal-profile-preview-info span,
.penpal-profile-preview-info code {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.penpal-profile-preview-info code {
  color: var(--blue);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.penpal-compose {
  display: grid;
  gap: 10px;
}

.penpal-compose label,
.penpal-purpose-fieldset {
  display: grid;
  gap: 6px;
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.penpal-compose input,
.penpal-compose select,
.penpal-compose textarea,
.penpal-search {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  background: rgba(2, 9, 19, 0.72);
  font: inherit;
  text-transform: none;
  letter-spacing: 0;
}

.penpal-compose textarea {
  min-height: 70px;
  resize: vertical;
}

#penpalVivillon {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.penpal-vivillon-picker {
  position: relative;
}

.penpal-vivillon-picker-button {
  width: 100%;
  min-height: 46px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(2, 9, 19, 0.72);
  box-shadow: none;
  padding: 8px 12px;
  text-align: left;
}

.penpal-vivillon-picker-button img,
.penpal-vivillon-picker-menu img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.penpal-vivillon-picker-button span,
.penpal-vivillon-picker-menu span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.penpal-vivillon-picker-button:not(.has-value) {
  color: var(--muted);
}

.penpal-vivillon-picker-button:not(.has-value) {
  grid-template-columns: minmax(0, 1fr);
}

.penpal-vivillon-picker-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  z-index: 30;
  max-height: 280px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  padding: 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(50, 217, 255, 0.62) rgba(255, 255, 255, 0.06);
}

.penpal-vivillon-picker-menu[hidden] {
  display: none !important;
}

.penpal-vivillon-picker-menu button {
  width: 100%;
  min-height: 44px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 8px;
  color: var(--text);
  background: transparent;
  box-shadow: none;
  padding: 6px 8px;
  text-align: left;
  font-weight: 800;
}

.penpal-vivillon-picker-menu button:hover,
.penpal-vivillon-picker-menu button.active {
  background: rgba(50, 217, 255, 0.12);
}

.penpal-purpose-fieldset {
  position: relative;
  padding: 0;
  border: 0;
}

.penpal-purpose-under-vivillon {
  margin-top: -2px;
}

.penpal-purpose-fieldset legend {
  padding: 0;
  color: var(--muted);
}

.penpal-purpose-picker-button {
  width: 100%;
  min-height: 46px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(2, 9, 19, 0.72);
  box-shadow: none;
  padding: 8px 12px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.penpal-purpose-picker-button.has-value {
  color: var(--text);
}

.penpal-purpose-picker-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  z-index: 28;
  max-height: 280px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  padding: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(50, 217, 255, 0.62) rgba(255, 255, 255, 0.06);
}

.penpal-vivillon-picker-menu::-webkit-scrollbar,
.penpal-purpose-picker-menu::-webkit-scrollbar {
  width: 8px;
}

.penpal-vivillon-picker-menu::-webkit-scrollbar-track,
.penpal-purpose-picker-menu::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.penpal-vivillon-picker-menu::-webkit-scrollbar-thumb,
.penpal-purpose-picker-menu::-webkit-scrollbar-thumb {
  border: 2px solid rgba(7, 18, 34, 0.92);
  border-radius: 999px;
  background: linear-gradient(180deg, var(--blue), var(--green));
}

.penpal-vivillon-picker-menu::-webkit-scrollbar-thumb:hover,
.penpal-purpose-picker-menu::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--pink), var(--blue));
}

.penpal-purpose-picker-menu[hidden] {
  display: none !important;
}

.penpal-purpose-grid,
.penpal-purpose-chips,
.penpal-vivillon-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.penpal-purpose-chip,
.penpal-vivillon-chip {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 9px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  font-size: 0.78rem;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.penpal-purpose-icon-img {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  object-fit: contain;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 0 0 1px rgba(50, 217, 255, 0.08), 0 4px 10px rgba(0, 0, 0, 0.2);
  padding: 3px;
}

.penpal-purpose-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

#penpalPurposeChips .penpal-purpose-chip,
#penpalPurposeChips .filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

#penpalPurposeChips .penpal-purpose-icon-img {
  width: 24px;
  height: 24px;
}

.penpal-vivillon-chip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  text-align: left;
}

.penpal-vivillon-chip img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.penpal-vivillon-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.penpal-purpose-chip.active,
.penpal-vivillon-chip.active {
  border-color: rgba(50, 217, 255, 0.54);
  background: rgba(50, 217, 255, 0.12);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(50, 217, 255, 0.16);
}

.penpal-form-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.penpal-search-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-bottom: 10px;
}

.penpal-filter-toggle {
  width: auto;
  min-width: 88px;
  height: 42px;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 800;
}

.penpal-filters-panel {
  margin: 0 0 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(2, 9, 19, 0.54);
}

.penpal-filter-section {
  margin-bottom: 12px;
}

.penpal-users-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 0;
}

.penpal-empty {
  grid-column: 1 / -1;
  min-height: 90px;
  display: grid;
  place-items: center;
  padding: 20px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.penpal-user-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  box-shadow: none;
  animation: none;
}

.penpal-user-card:hover {
  transform: none;
  border-color: rgba(50, 217, 255, 0.34);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.16);
}

.penpal-user-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.penpal-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid rgba(50, 217, 255, 0.3);
  background: rgba(50, 217, 255, 0.1);
  font-size: 0.86rem;
  font-weight: 900;
}

.penpal-user-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.penpal-user-title-row {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.penpal-user-name {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.penpal-user-level,
.penpal-user-active {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.penpal-user-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0;
}

.penpal-user-flag {
  font-size: 1.05rem;
  line-height: 1;
}

.penpal-user-vivillon {
  flex: 0 0 auto;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 40px;
  min-height: 40px;
  padding: 4px;
  border: 1px solid rgba(255, 79, 216, 0.28);
  border-radius: 999px;
  background: rgba(255, 79, 216, 0.08);
  font-size: 0.66rem;
  font-weight: 800;
}

.penpal-user-vivillon img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.penpal-user-inline-code {
  width: fit-content;
  max-width: 100%;
  overflow: hidden;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.penpal-user-purposes {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  margin: 0;
  overflow: hidden;
}

.penpal-user-purpose {
  display: inline-flex;
  align-items: center;
  width: 26px;
  height: 26px;
  justify-content: center;
  gap: 0;
  max-width: none;
  overflow: hidden;
  padding: 2px;
  border: 1px solid rgba(50, 217, 255, 0.22);
  border-radius: 999px;
  background: rgba(50, 217, 255, 0.08);
  color: var(--text);
  font-size: 0.6rem;
  font-weight: 800;
}

.penpal-user-purpose .penpal-purpose-icon-img {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  padding: 2px;
}

.penpal-purpose-badge .penpal-purpose-icon-img {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  padding: 2px;
}

.penpal-user-note {
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.penpal-user-footer {
  display: flex;
  justify-content: flex-end;
  margin: 0;
}

.penpal-user-actions {
  display: grid;
  gap: 6px;
  justify-items: stretch;
}

.penpal-user-action {
  min-height: 32px;
  border-radius: 8px;
  padding: 0 9px;
  font-size: 0.72rem;
  font-weight: 900;
  cursor: pointer;
}

.penpal-user-action.primary {
  border: 1px solid rgba(50, 217, 255, 0.38);
  color: var(--text);
  background: rgba(50, 217, 255, 0.12);
}

.penpal-user-action.ghost {
  border: 1px solid var(--line);
  color: var(--text);
  background: transparent;
}

.penpal-guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.penpal-guide-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 800;
}

.penpal-guide-icon {
  width: 22px;
  text-align: center;
  font-size: 1rem;
}

@media (max-width: 520px) {
  .penpal-page {
    padding-inline: 10px;
  }

  .penpal-purpose-grid,
  .penpal-purpose-chips,
  .penpal-vivillon-grid,
  .penpal-guide-grid {
    grid-template-columns: 1fr;
  }

  .penpal-board-heading,
  .penpal-user-header,
  .penpal-form-actions {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .penpal-user-card {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .penpal-user-vivillon {
    width: 40px;
    min-height: 40px;
  }

  .penpal-user-actions {
    grid-column: 1 / 4;
    justify-self: end;
  }

  .penpal-board-heading {
    display: grid;
  }

  .penpal-status,
  .penpal-online-count,
  .penpal-user-active {
    justify-self: start;
  }

  .penpal-find-actions {
    justify-self: stretch;
    justify-content: space-between;
  }
}

/* Pen Pal compact friend-board refinements */
#penPalView .penpal-page {
  width: min(100%, 480px);
  padding: 12px 10px 96px;
}

#penPalView .penpal-hero,
#penPalView .penpal-notice {
  display: none;
}

#penPalView .penpal-board-section {
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(7, 18, 34, 0.72);
  box-shadow: none;
}

#penPalView .penpal-my-post {
  display: grid;
  gap: 0;
  margin-bottom: 0;
  padding: 8px;
  border-color: var(--line);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: rgba(7, 18, 34, 0.72);
}

#penPalView .penpal-find {
  border-top: 0;
  border-radius: 0 0 8px 8px;
  background: rgba(7, 18, 34, 0.72);
}

#penPalView .penpal-board-heading {
  min-height: 34px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

#penPalView .penpal-board-heading h2 {
  display: none;
  align-items: center;
  min-height: 22px;
  margin-left: -2px;
  padding: 2px 7px;
  color: var(--text);
  background: rgba(67, 255, 151, 0.12);
  font-size: 0.78rem;
  letter-spacing: 0;
}

#penPalView .penpal-find .penpal-board-heading h2,
#penPalView .penpal-online-count,
#penPalView .penpal-status {
  display: none;
}

#penPalView .penpal-find .penpal-board-heading {
  display: none;
  min-height: 0;
  padding: 0;
  border: 0;
}

#penPalView .penpal-find-actions {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px;
  gap: 6px;
  margin-top: 0;
}

#penPalView .penpal-compose-toggle {
  width: 100%;
  height: 38px;
  border: 1px solid rgba(50, 217, 255, 0.38);
  border-radius: 8px;
  background: linear-gradient(135deg, var(--green), var(--blue));
  color: #04111f;
  font-size: 1.8rem;
}

#penPalView .penpal-my-post.collapsed #penpalForm {
  display: none !important;
}

#penPalView .penpal-my-post.collapsed #penpalProfilePreview {
  display: flex !important;
}

#penPalView .penpal-profile-preview {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

#penPalView .penpal-profile-preview.has-live-post {
  padding-top: 18px;
}

#penPalView .penpal-profile-preview.has-live-post::before {
  content: "MY POST";
  position: absolute;
  top: -1px;
  left: 8px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 1px 7px;
  border: 1px solid rgba(50, 217, 255, 0.34);
  border-radius: 0 0 6px 6px;
  background: rgba(2, 9, 19, 0.82);
  color: var(--text);
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

#penPalView .penpal-profile-preview > .trainer-orb {
  width: 52px;
  height: 52px;
  margin: 0;
  font-size: 1.1rem;
}

#penPalView .penpal-profile-preview-info {
  min-width: 0;
  align-self: center;
  gap: 4px;
  padding: 0;
}

#penPalView .penpal-profile-name-row,
#penPalView .penpal-profile-meta {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

#penPalView .penpal-profile-name-row strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#penPalView .penpal-profile-level {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 20px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
}

#penPalView .penpal-profile-meta {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
}

#penPalView .penpal-profile-meta span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#penPalView .penpal-profile-code-row {
  min-width: 0;
  display: flex;
  align-items: center;
}

#penPalView .penpal-profile-code-row code {
  min-width: 0;
  max-width: 150px;
  overflow: hidden;
  padding: 2px 6px;
  border: 1px solid rgba(50, 217, 255, 0.2);
  border-radius: 999px;
  background: rgba(2, 9, 19, 0.42);
  color: var(--text);
  font-size: 0.64rem;
  letter-spacing: 0;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#penPalView .penpal-profile-preview .penpal-user-flag,
#penPalView .penpal-profile-preview .penpal-user-flag-img {
  flex: 0 0 auto;
}

#penPalView .penpal-profile-preview .penpal-user-card {
  width: 100%;
  min-height: 52px;
  padding: 0;
  border-bottom: 0;
  background: transparent;
}

#penPalView .penpal-profile-preview .penpal-user-card.is-preview {
  grid-template-columns: 46px minmax(0, 1fr);
}

#penPalView .penpal-profile-preview .penpal-user-card.is-preview .penpal-user-inline-code {
  flex-basis: 118px;
  max-width: 118px;
}

#penPalView .penpal-search-bar {
  grid-template-columns: 52px;
  gap: 5px;
  margin: 0 0 10px;
}

#penPalView .penpal-search {
  min-height: 38px;
  border-color: var(--line);
  border-radius: 8px;
  background: rgba(2, 9, 19, 0.72);
  color: var(--text);
}

#penPalView .penpal-filter-toggle {
  min-width: 0;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(50, 217, 255, 0.42);
  border-radius: 8px;
  background: rgba(50, 217, 255, 0.12);
  color: transparent;
  font-size: 0;
}

#penPalView .penpal-filter-toggle::before {
  content: "☷";
  color: var(--text);
  font-size: 1.35rem;
  line-height: 1;
}

#penPalView .penpal-filter-toggle::before {
  content: none;
}

/* Plain icon buttons */
.notification-button,
.theme-toggle-button,
.flow-back,
.flow-header-next,
.flow-search-toggle,
.home-search-toggle,
.icon-filter-button,
.icon-undo-button,
.flow-clear-button,
.profile-back-button.icon-back-button,
.chat-icon-button.icon-back-button,
.penpal-filter-toggle.icon-filter-button,
#penPalView .penpal-filter-toggle.icon-filter-button,
[data-theme="light"] .notification-button,
[data-theme="light"] .theme-toggle-button,
[data-theme="light"] .flow-header-next,
[data-theme="light"] .penpal-filter-toggle.icon-filter-button,
[data-theme="light"] #penPalView .penpal-filter-toggle.icon-filter-button {
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.notification-button:hover,
.theme-toggle-button:hover,
.flow-back:hover,
.flow-header-next:hover,
.flow-search-toggle:hover,
.home-search-toggle:hover,
.icon-filter-button:hover,
.icon-undo-button:hover,
.flow-clear-button:hover,
.profile-back-button.icon-back-button:hover,
.chat-icon-button.icon-back-button:hover,
.penpal-filter-toggle.icon-filter-button:hover,
#penPalView .penpal-filter-toggle.icon-filter-button:hover,
[data-theme="light"] .notification-button:hover,
[data-theme="light"] .theme-toggle-button:hover,
[data-theme="light"] .flow-header-next:hover,
[data-theme="light"] .penpal-filter-toggle.icon-filter-button:hover,
[data-theme="light"] #penPalView .penpal-filter-toggle.icon-filter-button:hover {
  border: 0;
  background: transparent;
  box-shadow: none;
  transform: none;
}

.icon-filter-button.active,
.icon-filter-button:active,
.icon-filter-button:focus-visible,
.filter-chip.icon-filter-button.active,
.filter-chip.icon-filter-button:active,
.filter-chip.icon-filter-button:focus-visible,
.penpal-filter-toggle.icon-filter-button.active,
#penPalView .penpal-filter-toggle.icon-filter-button.active,
[data-theme="light"] .icon-filter-button.active,
[data-theme="light"] .filter-chip.icon-filter-button.active,
[data-theme="light"] .penpal-filter-toggle.icon-filter-button.active {
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text);
}

.notification-button.active .notification-icon,
.theme-toggle-button.active .theme-icon,
.flow-back.active .back-icon,
.flow-header-next.active .forward-icon,
.flow-search-toggle.active .search-icon,
.icon-filter-button.active .filter-icon,
.penpal-filter-toggle.active .filter-icon,
#penPalView .penpal-filter-toggle.active .filter-icon,
[aria-pressed="true"] .notification-icon,
[aria-pressed="true"] .theme-icon,
[aria-pressed="true"] .back-icon,
[aria-pressed="true"] .forward-icon,
[aria-pressed="true"] .search-icon,
[aria-pressed="true"] .filter-icon,
[aria-pressed="true"] .undo-icon {
  filter: brightness(0) saturate(100%) invert(62%) sepia(99%) saturate(1046%) hue-rotate(157deg) brightness(103%) contrast(102%);
}

#penPalView .penpal-users-grid {
  gap: 0;
  border-top: 0;
}

#penPalView .penpal-user-card {
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 6px;
  min-height: 56px;
  padding: 5px 6px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
}

#penPalView .penpal-user-card.is-mine {
  background: rgba(67, 255, 151, 0.08);
}

#penPalView .penpal-user-card:hover {
  border-color: var(--line);
  box-shadow: none;
}

#penPalView .penpal-user-avatar {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(50, 217, 255, 0.3);
  background: rgba(50, 217, 255, 0.1);
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1;
}

#penPalView .penpal-user-card:nth-child(6n + 2) .penpal-user-avatar { background: rgba(67, 255, 151, 0.1); }
#penPalView .penpal-user-card:nth-child(6n + 3) .penpal-user-avatar { background: rgba(255, 79, 216, 0.1); }
#penPalView .penpal-user-card:nth-child(6n + 4) .penpal-user-avatar { background: rgba(255, 205, 80, 0.1); }
#penPalView .penpal-user-card:nth-child(6n + 5) .penpal-user-avatar { background: rgba(147, 125, 255, 0.12); }
#penPalView .penpal-user-card:nth-child(6n + 6) .penpal-user-avatar { background: rgba(255, 255, 255, 0.06); }

#penPalView .penpal-user-main {
  gap: 2px;
  padding-right: 8px;
}

#penPalView .penpal-user-title-row,
#penPalView .penpal-user-detail-row {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

#penPalView .penpal-user-title-row {
  flex-wrap: nowrap;
}

#penPalView .penpal-user-name {
  color: var(--blue);
  font-size: 0.82rem;
  line-height: 1.1;
  flex: 0 1 auto;
}

#penPalView .penpal-user-level {
  display: inline-grid;
  place-items: center;
  min-width: 23px;
  height: 18px;
  padding: 0 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
}

#penPalView .penpal-user-flag {
  font-size: 0.95rem;
  line-height: 1;
}

#penPalView .penpal-user-flag-img {
  width: 20px;
  height: 14px;
  flex: 0 0 auto;
  border-radius: 2px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
}

#penPalView .penpal-user-detail-row {
  min-height: 24px;
}

#penPalView .penpal-user-vivillon {
  width: 24px;
  min-height: 24px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

#penPalView .penpal-user-vivillon img {
  width: 24px;
  height: 24px;
}

#penPalView .penpal-user-divider {
  width: 2px;
  height: 22px;
  background: rgba(255, 255, 255, 0.46);
}

#penPalView .penpal-user-inline-code {
  flex: 0 1 108px;
  max-width: 108px;
  min-width: 0;
  padding: 2px 5px;
  border: 1px solid rgba(50, 217, 255, 0.2);
  border-radius: 999px;
  background: rgba(2, 9, 19, 0.42);
  color: var(--text);
  font-size: 0.62rem;
  line-height: 1;
  letter-spacing: 0;
}

#penPalView .penpal-user-purposes {
  gap: 2px;
}

#penPalView .penpal-user-note {
  max-width: calc(100% - 8px);
  margin: 1px 0 0;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.64rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#penPalView .penpal-user-purpose {
  width: 21px;
  height: 21px;
  padding: 2px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.22);
}

#penPalView .penpal-user-purpose .penpal-purpose-icon-img,
#penPalView .penpal-purpose-badge .penpal-purpose-icon-img {
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#penPalView .penpal-user-actions {
  grid-template-columns: repeat(auto-fit, 32px);
  gap: 6px;
}

#penPalView .penpal-user-action {
  display: grid;
  place-items: center;
  width: 30px;
  min-height: 30px;
  padding: 0;
  border-radius: 5px;
  font-size: 1rem;
}

#penPalView .penpal-copy-icon,
.penpal-card-code .penpal-copy-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  padding: 3px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.92);
}

#penPalView .penpal-user-action.primary {
  border-color: rgba(67, 255, 151, 0.42);
  background: rgba(67, 255, 151, 0.16);
  color: var(--text);
}

#penPalView .penpal-user-action.ghost {
  border-color: rgba(50, 217, 255, 0.42);
  background: transparent;
  color: var(--blue);
}

#penPalView .penpal-user-action.danger {
  border-color: rgba(255, 79, 116, 0.38);
  background: rgba(255, 79, 116, 0.12);
  color: var(--text);
}

#penPalView .penpal-filters-panel,
#penPalView .penpal-compose {
  margin: 0 0 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(2, 9, 19, 0.54);
  color: var(--text);
}

#penPalView .penpal-note-field {
  min-width: 0;
}

#penPalView .penpal-note-field textarea {
  min-height: 58px;
}

#penPalView .penpal-compose label,
#penPalView .penpal-purpose-fieldset,
#penPalView .penpal-filter-section-title {
  color: var(--text);
  font-size: 0.82rem;
  letter-spacing: 0;
  text-transform: none;
}

#penPalView .penpal-purpose-picker-button,
#penPalView .penpal-vivillon-picker-button {
  display: none;
}

#penPalView .penpal-purpose-picker-menu,
#penPalView .penpal-vivillon-picker-menu {
  position: static;
  display: block !important;
  max-height: none;
  overflow: visible;
  margin-top: 4px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(2, 9, 19, 0.72);
  box-shadow: none;
}

#penPalView .penpal-purpose-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
}

#penPalView .penpal-purpose-chip {
  justify-content: center;
  min-height: 48px;
  padding: 4px;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.08);
}

#penPalView .penpal-purpose-chip span {
  display: none;
}

#penPalView .penpal-purpose-chip .penpal-purpose-icon-img {
  width: 38px;
  height: 38px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.24);
}

#penPalView .penpal-purpose-chip.active {
  border-color: var(--line);
  background: rgba(50, 217, 255, 0.14);
  box-shadow: inset 0 0 0 2px rgba(50, 217, 255, 0.24);
}

#penPalView .penpal-vivillon-picker-menu,
#penPalView .penpal-vivillon-grid {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
}

#penPalView .penpal-vivillon-picker-menu button,
#penPalView .penpal-vivillon-chip {
  min-height: 58px;
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 2px;
  padding: 4px 2px;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  text-align: center;
}

#penPalView .penpal-vivillon-picker-menu button.active,
#penPalView .penpal-vivillon-chip.active {
  background: rgba(50, 217, 255, 0.14);
  box-shadow: inset 0 0 0 2px rgba(50, 217, 255, 0.24);
}

#penPalView .penpal-vivillon-picker-menu img,
#penPalView .penpal-vivillon-chip img {
  width: 36px;
  height: 36px;
  filter: none;
}

#penPalView .penpal-vivillon-picker-menu span,
#penPalView .penpal-vivillon-chip span {
  max-width: 100%;
  font-size: 0.58rem;
  font-weight: 700;
  white-space: normal;
}

#penPalView .penpal-filter-bulk-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  margin: 4px 0;
}

#penPalView .penpal-filter-bulk {
  min-height: 30px;
  border-radius: 4px;
  color: var(--text);
  font-weight: 900;
}

#penPalView .penpal-filter-bulk.select {
  border: 1px solid rgba(67, 255, 151, 0.42);
  background: rgba(67, 255, 151, 0.14);
}

#penPalView .penpal-filter-bulk.deselect {
  border: 1px solid rgba(255, 79, 116, 0.38);
  background: rgba(255, 79, 116, 0.12);
}

#penPalView .penpal-form-actions {
  grid-template-columns: 1fr;
}

#penPalView #penpalPublish {
  min-height: 38px;
  border: 1px solid rgba(50, 217, 255, 0.38);
  border-radius: 8px;
  background: linear-gradient(135deg, var(--green), var(--blue));
  color: #04111f;
  font-weight: 900;
}

#penPalView #penpalRemove {
  display: none !important;
}

@media (max-width: 520px) {
  #penPalView .penpal-page {
    padding-inline: 8px;
  }

  #penPalView .penpal-purpose-grid,
  #penPalView .penpal-vivillon-picker-menu,
  #penPalView .penpal-vivillon-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  #penPalView .penpal-user-actions {
    grid-column: auto;
  }
}

#feedFilterView .flow-header.feed-filter-picker-header {
  position: relative;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  box-sizing: border-box;
  height: 72px;
  min-height: 72px;
  padding-top: 0;
  padding-bottom: 0;
  padding-right: max(244px, calc((100vw - var(--container-width)) / 2 + 244px));
}

#feedFilterView .feed-filter-picker-header .flow-header-title {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-self: center;
  min-width: 0;
}

#feedFilterView .filter-header-actions {
  position: absolute;
  right: max(12px, calc((100vw - var(--container-width)) / 2 + 12px));
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  line-height: 1;
}

#feedFilterView .feed-filter-picker-header .flow-header-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
  line-height: 1;
}

#feedFilterView .filter-header-actions button,
#feedFilterView .filter-header-actions .icon-button,
#feedFilterView .feed-filter-picker-header .flow-search-toggle,
#feedFilterView .feed-filter-picker-header .flow-header-filter {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  margin-top: 0;
  margin-bottom: 0;
}

#feedFilterView .filter-header-actions img,
#feedFilterView .filter-header-actions svg {
  display: block;
}

#feedFilterView .filter-header-actions .selected-count,
#feedFilterView .filter-header-actions .ok-button {
  height: 36px;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  margin-top: 0;
  margin-bottom: 0;
}

#feedFilterView .filter-header-actions .ok-button {
  width: auto;
  min-width: 42px;
  padding: 0 10px;
}

#feedFilterView .flow-picker-header.search-open .filter-header-actions {
  left: max(54px, calc((100vw - var(--container-width)) / 2 + 54px));
}

#feedFilterView .flow-picker-header.search-open .flow-header-tools {
  flex: 1 1 auto;
  min-width: 0;
}

#feedFilterView .flow-picker-header.search-open .flow-header-search {
  flex: 1 1 auto;
  min-width: 0;
}

#wantedTradeView .flow-header,
#offerTradeView .flow-header,
#tradePreviewView .flow-header {
  box-sizing: border-box;
  height: 72px;
  min-height: 72px;
}

.feed-column .section-heading {
  box-sizing: border-box;
  height: auto;
  min-height: 0;
  align-items: center;
  padding: 4px 0 2px;
}

.feed-column .section-heading .eyebrow {
  margin-bottom: 1px;
  line-height: 1;
}

.feed-column .feed-title-row {
  align-items: center;
}

.feed-column .trade-search-panel {
  align-items: center;
}

.feed-column .trade-search-panel .filter-chip {
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  display: inline-grid;
  place-items: center;
  align-self: center;
}

.feed-column .section-heading > div {
  display: grid;
  gap: 3px;
}

.feed-column .section-heading .eyebrow {
  margin: 0;
}

.feed-column .feed-title-row {
  flex-wrap: wrap;
  row-gap: 4px;
  column-gap: 8px;
}

.feed-column .trade-search-panel {
  width: 100%;
  flex: 1 1 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  max-width: none;
  min-width: 0;
  gap: 6px;
  align-items: center;
  justify-content: stretch;
}

.feed-column .home-search-input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  border-radius: 14px;
  padding-inline: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-column .home-search-input::placeholder {
  opacity: 0.58;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-column .feed-filter-panel {
  display: grid;
  gap: 2px;
  margin-top: 2px;
}

.feed-column .feed-category-chip-row {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 4px;
}

.feed-column .feed-tag-filter-section {
  margin-top: 0;
  padding-top: 2px;
}

@media (max-width: 640px) {
  .feed-column .feed-title-row {
    align-items: stretch;
  }

  .feed-column .trade-search-panel {
    width: 100%;
    grid-template-columns: minmax(0, 1fr) 40px 40px;
  }

  .feed-column .feed-category-chip-row {
    display: grid;
    grid-auto-flow: column;
    grid-template-rows: repeat(2, 38px);
    align-items: center;
  }
}
