/* === /app/styles/tokens.css === */
:root {
  color-scheme: light;
  --color-background: #F7F8FA;
  --color-surface: #ffffff;
  --color-text-primary: #172033;
  --color-text-secondary: #737985;
  --color-border: #E1E4E8;
  --color-control-primary: #0875D1;
  --color-control-primary-hover: #0662b3;
  --color-control-primary-active: #055398;
  --color-control-on-primary: #ffffff;
  --color-control-secondary: #e9e9ee;
  --color-control-secondary-hover: #dedee4;
  --color-control-secondary-active: #d2d2da;
  --color-control-tertiary-hover: rgba(0, 102, 204, 0.1);
  --color-control-tertiary-active: rgba(0, 102, 204, 0.18);
  --color-control-danger: #c62828;
  --color-control-danger-hover: #b71c1c;
  --color-control-danger-active: #a31515;
  --color-control-danger-subtle-hover: rgba(198, 40, 40, 0.1);
  --color-control-danger-subtle-active: rgba(198, 40, 40, 0.18);
  --color-control-on-danger: #ffffff;
  --color-control-focus: rgba(0, 102, 204, 0.35);
  --color-control-selected: rgba(0, 102, 204, 0.14);
  --color-control-selected-danger: rgba(198, 40, 40, 0.12);
  --color-presence-online: #34a853;
  --color-presence-away: #e8a33d;
  --color-presence-offline: #9a9aa2;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 16px;
  --shadow-card-subtle: 0 1px 3px color-mix(in srgb, var(--color-text-primary) 10%, transparent);
  --font-size-body: 1rem;
  --font-size-control-sm: 13px;
  --font-size-control-md: 14px;
  --font-size-control-lg: 16px;
  --font-size-overlay-title: 20px;
  --font-weight-control: 600;
  --font-size-title: clamp(2rem, 8vw, 3rem);
  --header-height: 46px;
  --bottom-navigation-bar-height: 54px;
  /* Space reserved at the bottom for the nav chrome. On mobile the nav moves
     to the top, so layout.css sets this to 0 while the bar keeps its height. */
  --bottom-navigation-height: var(--bottom-navigation-bar-height);
  --touch-target-size: 44px;
  --icon-size: 22px;
  --duration-standard: 200ms;
  --duration-loading: 800ms;
  --control-height-compact: 36px;
  --control-height-sm: 44px;
  --control-height-md: 48px;
  --control-height-lg: 52px;
  --control-padding-compact: 12px;
  --control-padding-sm: 12px;
  --control-padding-md: 16px;
  --control-padding-lg: 20px;
  --bottom-action-space: 6px;
  --control-gap: 8px;
  --control-border-width: 1px;
  --control-focus-width: 3px;
  --control-focus-offset: 2px;
  --control-disabled-opacity: 0.45;
  --control-active-scale: 0.98;
  --loading-indicator-size: 18px;
  --loading-indicator-width: 2px;
  --search-height: var(--control-height-sm);
  --search-padding-inline: var(--space-3);
  --search-gap: var(--space-2);
  --color-search-background: var(--color-surface);
  --color-search-border: var(--color-border);
  --color-search-focus: var(--color-control-focus);
  --color-search-placeholder: var(--color-text-secondary);
  --color-search-error: var(--color-control-danger);
  --color-search-icon: var(--color-text-secondary);
  --color-overlay-backdrop: rgba(0, 0, 0, 0.42);
  --overlay-backdrop-blur: 2px;
  --overlay-duration: var(--duration-standard);
  --overlay-easing: cubic-bezier(0.2, 0.8, 0.2, 1);
  --overlay-modal-scale: 0.98;
  --overlay-heading-line-height: 1.25;
  --overlay-shadow-modal: 0 var(--space-2) var(--space-7) rgba(0, 0, 0, 0.18);
  --overlay-shadow-sheet: 0 calc(var(--space-2) * -1) var(--space-7) rgba(0, 0, 0, 0.16);
  --modal-background: var(--color-surface);
  --modal-border: var(--color-border);
  --modal-radius: var(--radius-lg);
  --modal-max-width-small: 360px;
  --modal-max-width-medium: 560px;
  --modal-max-width-large: 760px;
  --modal-padding: var(--space-4);
  --modal-gap: var(--space-3);
  --modal-loading-background: rgba(255, 255, 255, 0.76);
  --sheet-background: var(--color-surface);
  --sheet-border: var(--color-border);
  --sheet-radius: var(--radius-lg);
  --sheet-max-width: 640px;
  --sheet-padding: var(--space-4);
  --sheet-gap: var(--space-3);
  --sheet-handle-width: 32px;
  --sheet-handle-height: 4px;
  --sheet-height-medium: 50dvh;
  --sheet-height-large: 75dvh;
  --sheet-height-fullscreen: 100dvh;
  --sheet-content-max-height: 85dvh;
  --sheet-closed-translate: 100%;
  --sheet-loading-background: rgba(255, 255, 255, 0.76);
  --tab-height: var(--touch-target-size);
  /* Compact segmented track (Have / Wish List family) ≈ 43px total. */
  --tab-height-sm: calc(var(--tab-height) - 8px);
  --tab-gap: var(--space-1);
  --tab-gap-sm: calc(var(--tab-gap) * 0.75);
  --tab-background: var(--color-control-secondary);
  --tab-active: var(--color-surface);
  --tab-border: var(--color-border);
  --tab-indicator: var(--color-control-primary);
  --tab-radius: var(--radius-md);
  --toast-background: var(--color-surface);
  --toast-border: var(--color-border);
  --toast-shadow: 0 var(--space-2) var(--space-7) rgba(0, 0, 0, 0.18);
  --toast-radius: var(--radius-lg);
  --toast-duration: 4000ms;
  --toast-error-duration: 6500ms;
  --toast-transition-duration: var(--duration-standard);
  --toast-max-width: 420px;
  --toast-gap: var(--space-3);
  --toast-accent-info: #0066cc;
  --toast-accent-success: #248a3d;
  --toast-accent-warning: #b36800;
  --toast-accent-error: var(--color-control-danger);
  --loading-size-small: 16px;
  --loading-size-medium: 24px;
  --loading-size-large: 32px;
  --loading-dot-size: 8px;
  --loading-dot-size-small: 6px;
  --loading-dot-size-large: 10px;
  --loading-pulse-opacity: 0.35;
  --loading-gap: var(--space-3);
  --skeleton-background: #e5e5ea;
  --skeleton-highlight: #f4f4f7;
  --skeleton-shimmer-duration: 1200ms;
  --skeleton-background-size: 200% 100%;
  --skeleton-background-end: -200% 0;
  --skeleton-text-height: 14px;
  --skeleton-rectangle-height: 80px;
  --skeleton-card-height: 140px;
  --empty-icon-size: 64px;
  --empty-max-width: 480px;
  --empty-gap: var(--space-3);
  --pokemon-selected-border-color: #0066cc;
  --pokemon-hover-border-color: var(--color-border);
  --pokemon-item-radius: var(--radius-md);
  --pokemon-item-gap: var(--space-2);
  /* Empty tiles blend with page surface (no gray plate behind sprites). */
  --pokemon-media-background: transparent;
  --pokemon-fallback-background: var(--color-border);
  --pokemon-disabled-opacity: 0.55;
  --pokemon-unavailable-opacity: 0.7;
  --pokemon-name-color: var(--color-text-primary);
  --pokemon-metadata-color: var(--color-text-secondary);
  --pokemon-check-offset: var(--space-2);
  --pokemon-image-padding-small: var(--space-2);
  --pokemon-image-padding-medium: var(--space-3);
  --pokemon-image-padding-large: var(--space-4);
  --pokemon-item-transition: var(--duration-standard);
  --pokemon-selection-border-width: 2px;
  --pokemon-media-aspect-ratio: 1 / 1;
  --pokemon-fallback-size: var(--control-height-md);
  --pokemon-badge-background: var(--color-control-secondary);
  --pokemon-badge-color: var(--color-text-secondary);
  --pokemon-unavailable-label-background: var(--color-surface);
  --pokemon-unavailable-label-color: var(--color-text-primary);
  --pokemon-layer-background: 1;
  --pokemon-layer-image: 2;
  --pokemon-layer-status: 3;
  --pokemon-layer-selection: 4;
  --pokemon-grid-gap-small: 2px;
  --pokemon-grid-gap-medium: var(--space-2);
  --pokemon-grid-gap-large: var(--space-3);
  --pokemon-grid-item-min-width: 48px;
  --pokemon-grid-columns-large: 3;
  --pokemon-grid-columns-medium: 4;
  --pokemon-grid-columns-small: 5;
  --pokemon-grid-wide-columns-large: 5;
  --pokemon-grid-wide-columns-medium: 6;
  --pokemon-grid-wide-columns-small: 7;
  --pokemon-grid-transition: var(--duration-standard);
  --pokemon-grid-empty-min-height: 160px;
  --pokemon-grid-loading-min-height: 160px;
  --pokemon-grid-sentinel-size: 1px;
  --app-max-width: 960px;
  --page-padding-inline: 0px;
  --color-brand-accent: #FFC928;
  --safe-area-top: env(safe-area-inset-top, 0px);
  --safe-area-right: env(safe-area-inset-right, 0px);
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --safe-area-left: env(safe-area-inset-left, 0px);
  --z-index-content: 1;
  --z-index-sticky-header: 100;
  --z-index-bottom-navigation: 200;
  --z-index-modal: 500;
  --z-index-toast: 600;
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --color-background: #000000;
  --color-surface: #1c1c1e;
  --color-text-primary: #f5f5f7;
  --color-text-secondary: #98989d;
  --color-border: #38383a;
  --shadow-card-subtle: 0 1px 4px rgba(0, 0, 0, 0.45);
  --color-control-primary: #0066cc;
  --color-control-primary-hover: #1477d4;
  --color-control-primary-active: #0057ad;
  --color-control-secondary: #2c2c2e;
  --color-control-secondary-hover: #3a3a3c;
  --color-control-secondary-active: #48484a;
  --color-control-tertiary-hover: rgba(100, 168, 255, 0.14);
  --color-control-tertiary-active: rgba(100, 168, 255, 0.22);
  --color-control-danger: #b3261e;
  --color-control-danger-hover: #c9362d;
  --color-control-danger-active: #981b16;
  --color-control-danger-subtle-hover: rgba(255, 105, 97, 0.14);
  --color-control-danger-subtle-active: rgba(255, 105, 97, 0.22);
  --color-control-focus: rgba(100, 168, 255, 0.45);
  --color-control-selected: rgba(100, 168, 255, 0.2);
  --color-control-selected-danger: rgba(255, 105, 97, 0.16);
  --color-presence-online: #34a853;
  --color-presence-away: #e8a33d;
  --color-presence-offline: #8a8a90;
  --modal-loading-background: rgba(28, 28, 30, 0.76);
  --sheet-loading-background: rgba(28, 28, 30, 0.76);
  --skeleton-background: #2c2c2e;
  --skeleton-highlight: #3a3a3c;
  --toast-accent-info: #64a8ff;
  --toast-accent-success: #4ac263;
  --toast-accent-warning: #ffb340;
}

/* === /app/styles/reset.css === */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body,
h1,
p {
  margin: 0;
}

body {
  min-height: 100vh;
}

img,
picture {
  display: block;
  max-width: 100%;
}

button,
input,
textarea {
  font: inherit;
}

/* === /app/styles/fonts.css === */
/* Inter Fallback metrics: scripts/inter_fallback_metrics.py
   Inter latin woff2 vs Windows Arial.ttf (Chrome font-fallbacks formulas).
   size-adjust: 107.64%; ascent: 90%; descent: 22.41%; line-gap: 0%. */
@font-face {
  font-family: "Inter Fallback";
  src: local("Arial"), local("Arial MT");
  font-style: normal;
  font-weight: 400 700;
  size-adjust: 107.64%;
  ascent-override: 90%;
  descent-override: 22.41%;
  line-gap-override: 0%;
}

@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/assets/fonts/inter-latin-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/assets/fonts/inter-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: Nunito;
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('/assets/fonts/nunito-latin-ext-800-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: Nunito;
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('/assets/fonts/nunito-latin-800-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* === /app/styles/base.css === */
html { /* lt:nozoom1-text-size */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  background: var(--color-background);
  font-family: Inter, "Inter Fallback", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background: var(--color-background);
  color: var(--color-text-primary);
  font-size: var(--font-size-body);
  line-height: 1.5;
}

button,
input,
textarea {
  color: inherit;
}

a {
  color: inherit;
}

ul,
ol {
  padding-inline-start: var(--space-6);
}

/* minimal-scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--color-text-secondary) 42%, transparent) transparent;
}
*::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--color-text-secondary) 42%, transparent);
  border-radius: 999px;
}
*::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--color-text-secondary) 68%, transparent);
}
*::-webkit-scrollbar-corner {
  background: transparent;
}

/* === /app/styles/layout.css === */
#app {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

.app-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--color-background);
}

.app-shell__header:not([hidden]) {
  grid-row: 1;
  position: relative;
  z-index: var(--z-index-sticky-header);
  min-height: calc(var(--header-height) + var(--safe-area-top));
  padding-top: var(--safe-area-top);
  /* Only the primary top nav stays white; this row blends with page background. */
  background: transparent;
}

.app-shell__viewport {
  grid-row: 2;
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
}

/* Home/Pokédex tabs are prepended here so they scroll away with the page. */
.app-shell__viewport > .app-header {
  position: relative;
  z-index: var(--z-index-content);
  width: 100%;
  max-width: var(--app-max-width);
  margin-inline: auto;
  flex-shrink: 0;
}

/* Bell + menu chrome.
   Desktop: fixed top-right host.
   Mobile Profile: inline in scroll viewport (not sticky).
   Mobile Home: icons live in .mobile-brand-header (also scrolls). */
.notification-bell-host {
  position: fixed;
  z-index: calc(var(--z-index-sticky-header) + 2);
  top: calc(var(--safe-area-top, 0px) + 6px);
  right: max(8px, calc(var(--safe-area-right, 0px) + 8px));
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
  pointer-events: none;
}

@media (max-width: 719.98px) {
  .notification-bell-host:not([data-chrome-visible='true']) {
    display: none;
  }

  /* Profile: same nick row, pushed to the trailing edge. */
  .notification-bell-host[data-chrome-mode='profile'] {
    position: static;
    top: auto;
    right: auto;
    left: auto;
    z-index: auto;
    width: auto;
    max-width: none;
    margin: 0;
    margin-inline-start: auto;
    padding: 0;
    flex: 0 0 auto;
    align-self: center;
    justify-content: flex-end;
  }

  .profile-identity__username-row .notification-bell-host .notification-bell-button,
  .profile-identity__username-row .notification-bell-host .app-menu-button {
    width: 2rem;
    height: 2rem;
  }

  .app-shell__viewport > .mobile-brand-header {
    position: relative;
    z-index: var(--z-index-content);
    flex-shrink: 0;
  }
}

.notification-bell-host > * {
  pointer-events: auto;
  flex: 0 0 auto;
}

.notification-bell-host .notification-bell-button,
.notification-bell-host .app-menu-button {
  position: static;
  width: var(--touch-target-size);
  height: var(--touch-target-size);
  color: var(--color-text-secondary);
  background: transparent;
}

.notification-bell-host .notification-bell-button[data-selected='true'],
.notification-bell-host .app-menu-button[data-selected='true'],
.notification-bell-host .notification-bell-button[aria-expanded='true'],
.notification-bell-host .app-menu-button[aria-expanded='true'] {
  color: var(--color-control-primary);
  background: var(--color-control-selected);
}

@media (min-width: 720px) {
  .notification-bell-host {
    top: calc(
      var(--safe-area-top, 0px)
      + ((var(--bottom-navigation-bar-height, 54px) - var(--touch-target-size)) / 2)
    );
    right: max(var(--space-4), calc((100% - var(--app-max-width)) / 2 + var(--space-1)));
  }
}

@media (min-width: 720px) {
  /* Desktop chrome icons live in .bottom-navigation__actions — hide fixed overlay host. */
  .notification-bell-host {
    display: none !important;
  }
}


.app-shell__content {
  position: relative;
  z-index: var(--z-index-content);
  width: 100%;
  max-width: var(--app-max-width);
  min-height: 100%;
  margin-inline: auto;
}

.app-shell__navigation[hidden] {
  display: none !important;
}

.app-shell__navigation:not([hidden]) {
  grid-row: 3;
  position: relative;
  z-index: var(--z-index-bottom-navigation);
  min-height: calc(var(--bottom-navigation-bar-height, var(--bottom-navigation-height)) + var(--safe-area-bottom));
  padding-bottom: var(--safe-area-bottom);
  background: var(--color-surface);
}

/* Desktop: primary nav sits at the top. Mobile keeps it at the bottom. */
@media (min-width: 720px) {
  :root {
    /* Bottom offsets (toast/footers) no longer reserve nav space. */
    --bottom-navigation-height: 0px;
  }

  .app-shell {
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  .app-shell__navigation:not([hidden]) {
    grid-row: 1;
    z-index: var(--z-index-sticky-header);
    min-height: calc(var(--bottom-navigation-bar-height) + var(--safe-area-top));
    padding-top: var(--safe-area-top);
    padding-bottom: 0;
  }

  .app-shell__header:not([hidden]) {
    grid-row: 2;
    min-height: var(--header-height);
    padding-top: 0;
  }

  .app-shell__viewport {
    grid-row: 3;
  }
}

.page-container {
  width: 100%;
  min-height: 100%;
  padding: 0;
}

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

/* === /app/styles/components/button.css === */
.button {
  --button-background: transparent;
  --button-background-hover: transparent;
  --button-background-active: transparent;
  --button-border: transparent;
  --button-foreground: var(--color-text-primary);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: var(--touch-target-size);
  border: var(--control-border-width) solid var(--button-border);
  border-radius: var(--radius-md);
  background: var(--button-background);
  color: var(--button-foreground);
  font-weight: var(--font-weight-control);
  line-height: 1;
  text-align: center;
  cursor: pointer;
  transition: background-color var(--duration-standard), border-color var(--duration-standard), color var(--duration-standard), transform var(--duration-standard);
}

.button:hover:not(:disabled) {
  background: var(--button-background-hover);
}

.button:active:not(:disabled) {
  background: var(--button-background-active);
  transform: scale(var(--control-active-scale));
}

.button:focus-visible {
  outline: var(--control-focus-width) solid var(--color-control-focus);
  outline-offset: var(--control-focus-offset);
}

.button:disabled {
  opacity: var(--control-disabled-opacity);
  cursor: default;
}

.button--primary {
  --button-background: var(--color-control-primary);
  --button-background-hover: var(--color-control-primary-hover);
  --button-background-active: var(--color-control-primary-active);
  --button-foreground: var(--color-control-on-primary);
}

.button--secondary {
  --button-background: var(--color-control-secondary);
  --button-background-hover: var(--color-control-secondary-hover);
  --button-background-active: var(--color-control-secondary-active);
  --button-border: var(--color-border);
}

.button--tertiary {
  --button-background-hover: var(--color-control-tertiary-hover);
  --button-background-active: var(--color-control-tertiary-active);
  --button-foreground: var(--color-control-primary);
}

.button--danger {
  --button-background: var(--color-control-danger);
  --button-background-hover: var(--color-control-danger-hover);
  --button-background-active: var(--color-control-danger-active);
  --button-foreground: var(--color-control-on-danger);
}

.button--compact {
  min-height: var(--control-height-compact);
  padding-inline: var(--control-padding-compact);
  font-size: var(--font-size-control-sm);
}

.button--small {
  min-height: var(--control-height-sm);
  padding-inline: var(--control-padding-sm);
  font-size: var(--font-size-control-sm);
}

.button--medium {
  min-height: var(--control-height-md);
  padding-inline: var(--control-padding-md);
  font-size: var(--font-size-control-md);
}

.button--large {
  min-height: var(--control-height-lg);
  padding-inline: var(--control-padding-lg);
  font-size: var(--font-size-control-lg);
}

.button--full-width {
  width: 100%;
}

.button__content {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--control-gap);
}

.button__icon {
  flex: 0 0 auto;
  width: var(--icon-size);
  height: var(--icon-size);
}

.button__spinner {
  position: absolute;
  display: none;
  width: var(--loading-indicator-size);
  height: var(--loading-indicator-size);
  border: var(--loading-indicator-width) solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: button-loading var(--duration-loading) linear infinite;
}

.button[data-loading='true'] .button__content {
  visibility: hidden;
}

.button[data-loading='true'] .button__spinner {
  display: block;
}

@keyframes button-loading {
  to {
    transform: rotate(1turn);
  }
}

/* === /app/styles/components/icon-button.css === */
.icon-button {
  --icon-button-background: transparent;
  --icon-button-background-hover: transparent;
  --icon-button-background-active: transparent;
  --icon-button-foreground: var(--color-text-primary);
  --icon-button-hit-size: var(--touch-target-size);
  --icon-button-icon-size: var(--icon-size);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--icon-button-hit-size);
  height: var(--icon-button-hit-size);
  padding: 0;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--icon-button-background);
  color: var(--icon-button-foreground);
  font-weight: var(--font-weight-control);
  line-height: 1;
  cursor: pointer;
  transition: background-color var(--duration-standard), border-color var(--duration-standard), color var(--duration-standard), transform var(--duration-standard);
}

.icon-button:hover:not(:disabled) {
  background: var(--icon-button-background-hover);
}

.icon-button:active:not(:disabled) {
  background: var(--icon-button-background-active);
  transform: scale(var(--control-active-scale));
}

.icon-button:focus-visible {
  outline: var(--control-focus-width) solid var(--color-control-focus);
  outline-offset: var(--control-focus-offset);
}

.icon-button:disabled {
  opacity: var(--control-disabled-opacity);
  cursor: default;
}

.icon-button--plain {
  --icon-button-background-hover: var(--color-control-secondary);
  --icon-button-background-active: var(--color-control-secondary-active);
}

.icon-button--subtle {
  --icon-button-background: var(--color-control-secondary);
  --icon-button-background-hover: var(--color-control-secondary-hover);
  --icon-button-background-active: var(--color-control-secondary-active);
}

.icon-button--filled {
  --icon-button-background: var(--color-control-primary);
  --icon-button-background-hover: var(--color-control-primary-hover);
  --icon-button-background-active: var(--color-control-primary-active);
  --icon-button-foreground: var(--color-control-on-primary);
}

.icon-button--danger {
  --icon-button-background-hover: var(--color-control-danger-subtle-hover);
  --icon-button-background-active: var(--color-control-danger-subtle-active);
  --icon-button-foreground: var(--color-control-danger);
}

.icon-button[data-selected='true'] {
  --icon-button-background: var(--color-control-selected);
  --icon-button-foreground: var(--color-control-primary);
}

.icon-button--with-text {
  width: auto;
  min-width: var(--touch-target-size);
  padding-inline: var(--control-padding-sm);
}

.icon-button__content {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--control-gap);
}

.icon-button__icon {
  flex: 0 0 auto;
  width: var(--icon-button-icon-size);
  height: var(--icon-button-icon-size);
}

.icon-button__text {
  font-size: var(--font-size-control-sm);
}

.icon-button__spinner {
  position: absolute;
  display: none;
  width: var(--loading-indicator-size);
  height: var(--loading-indicator-size);
  border: var(--loading-indicator-width) solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: icon-button-loading var(--duration-loading) linear infinite;
}

.icon-button[data-loading='true'] .icon-button__content {
  visibility: hidden;
}

.icon-button[data-loading='true'] .icon-button__spinner {
  display: block;
}

@keyframes icon-button-loading {
  to {
    transform: rotate(1turn);
  }
}

/* === /app/styles/components/app-header.css === */
.app-header {
  --app-header-background: transparent;
  --app-header-border: transparent;
  width: 100%;
  max-width: var(--app-max-width);
  height: var(--header-height);
  margin-inline: auto;
  position: relative;
  background: var(--app-header-background);
  color: var(--color-text-primary);
  transition: background-color var(--duration-standard), border-color var(--duration-standard), color var(--duration-standard);
}

.app-header::after {
  position: absolute;
  inset-inline: 0;
  inset-block-end: 0;
  height: var(--control-border-width);
  background: var(--app-header-border);
  content: '';
  pointer-events: none;
}

.app-header--sticky {
  position: sticky;
  inset-block-start: 0;
  z-index: var(--z-index-sticky-header);
}

.app-header--transparent {
  --app-header-background: transparent;
  --app-header-border: transparent;
}

.app-header__bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  min-width: 0;
  height: 100%;
  padding-inline: max(var(--page-padding-inline), var(--safe-area-left)) max(var(--page-padding-inline), var(--safe-area-right));
}

.app-header__actions {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: var(--space-1);
}

.app-header__actions--left {
  justify-content: flex-start;
}

.app-header__actions--right {
  justify-content: flex-end;
}

.app-header__action-spacer {
  flex: 0 0 var(--touch-target-size);
  width: var(--touch-target-size);
  height: var(--touch-target-size);
}

.app-header__title-area {
  min-width: 0;
  padding-inline: var(--space-2);
  text-align: center;
}

.app-header__title {
  overflow: hidden;
  color: var(--color-text-primary);
  font-size: var(--font-size-control-lg);
  font-weight: var(--font-weight-control);
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-header__meta {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  gap: var(--space-2);
  margin-block-start: var(--space-1);
  color: var(--color-text-secondary);
  font-size: var(--font-size-control-sm);
  line-height: 1;
}

.app-header__subtitle {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-header__step {
  flex: 0 0 auto;
  white-space: nowrap;
}

.app-header--tabs {
  --app-header-background: transparent;
  --app-header-border: transparent;
  height: auto;
  min-height: calc(var(--tab-height-sm) + (2 * var(--tab-gap-sm)) + (2 * var(--space-2)));
}

.app-header--tabs::after {
  display: none;
}

.app-header--tabs .app-header__bar {
  grid-template-columns: minmax(0, 1fr);
  height: auto;
  min-height: calc(var(--tab-height-sm) + (2 * var(--tab-gap-sm)) + (2 * var(--space-2)));
  /* Top breathing room only — bottom gap to page content is owned by the page. */
  padding-block: var(--space-2) 0;
  padding-inline: max(var(--page-padding-inline), var(--safe-area-left)) max(var(--page-padding-inline), var(--safe-area-right));
}

.app-header--tabs .app-header__actions,
.app-header--tabs .app-header__title-area {
  display: none;
}

.app-header__tabs {
  min-width: 0;
  width: 100%;
  height: auto;
}

.app-header__tabs[hidden] {
  display: none;
}

.app-header__tabs-list {
  display: grid;
  grid-template-columns: repeat(var(--app-header-tab-count, 2), minmax(0, 1fr));
  align-items: stretch;
  gap: var(--tab-gap-sm);
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: auto;
  padding: var(--tab-gap-sm);
  border: var(--control-border-width) solid var(--color-border);
  border-radius: 12px;
  background: #eef0f3;
}

.app-header__tab {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-width: 0;
  height: auto;
  min-height: var(--tab-height-sm);
  padding-inline: var(--space-2);
  border: var(--control-border-width) solid transparent;
  border-radius: calc(var(--tab-radius) - 2px);
  background: transparent;
  color: var(--color-text-secondary);
  font-size: var(--font-size-control-sm, 0.8125rem);
  font-weight: var(--font-weight-control);
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition:
    background-color var(--duration-standard),
    border-color var(--duration-standard),
    color var(--duration-standard);
}

.app-header__tab:hover:not([aria-current='page']) {
  color: var(--color-text-primary);
}

.app-header__tab:focus-visible {
  outline: var(--control-focus-width) solid var(--color-control-focus);
  outline-offset: var(--control-focus-offset);
}

.app-header__tab--active {
  border-color: color-mix(in srgb, var(--color-control-primary) 28%, var(--color-border));
  background: var(--color-surface);
  color: var(--color-control-primary);
  box-shadow: 0 1px 2px rgb(23 32 51 / 8%);
  font-weight: 700;
}

.app-header__tab--active::after {
  content: none;
}

/* desktop: hide Home|Pokédex tabs — top text nav covers this */
@media (min-width: 720px) {
  .app-header__tabs,
  .app-header--tabs {
    display: none !important;
  }
}

/* === /app/styles/components/mobile-brand-header.css === */
/* Mobile-only top brand chrome (Home/Pokédex). Scrolls with page — not sticky. */
.mobile-brand-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  width: 100%;
  max-width: var(--app-max-width);
  margin-inline: auto;
  min-height: 52px;
  padding-top: max(6px, var(--safe-area-top, 0px));
  padding-bottom: 6px;
  padding-inline: max(12px, var(--safe-area-left, 0px)) max(8px, var(--safe-area-right, 0px));
  background: var(--color-surface);
  border-block-end: var(--control-border-width) solid var(--color-border);
  color: var(--color-text-primary);
}

.mobile-brand-header[hidden] {
  display: none;
}

.mobile-brand-header__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  max-width: calc(100% - 6.5rem);
  color: inherit;
  text-decoration: none;
}

.mobile-brand-header__brand:focus-visible {
  outline: var(--control-focus-width) solid var(--color-control-focus);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.mobile-brand-header__logo {
  flex: 0 0 auto;
  display: block;
  width: 36px;
  height: 36px;
  overflow: hidden;
  object-fit: contain;
  object-position: center;
  transform: none;
  transform-origin: center;
  background: transparent;
}

.mobile-brand-header__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.mobile-brand-header__title {
  overflow: hidden;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.mobile-brand-header__tagline {
  overflow: hidden;
  color: var(--color-text-secondary);
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1.15;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.mobile-brand-header__actions {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
}

.mobile-brand-header__actions .notification-bell-button,
.mobile-brand-header__actions .app-menu-button {
  width: var(--touch-target-size);
  height: var(--touch-target-size);
  color: var(--color-text-secondary);
  background: transparent;
}

.mobile-brand-header__actions .notification-bell-button[data-selected='true'],
.mobile-brand-header__actions .app-menu-button[data-selected='true'],
.mobile-brand-header__actions .notification-bell-button[aria-expanded='true'],
.mobile-brand-header__actions .app-menu-button[aria-expanded='true'] {
  color: var(--color-control-primary);
  background: var(--color-control-selected);
}

@media (min-width: 720px) {
  .mobile-brand-header {
    display: none !important;
  }
}

/* === /app/styles/components/auth-session.css === */
.app-shell__header:not([hidden]) {
  display: flex;
  flex-direction: column;
}

.auth-session {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  width: 100%;
  max-width: var(--app-max-width);
  min-height: calc(var(--control-height-compact) + var(--space-2));
  margin-inline: auto;
  padding-block: var(--space-1);
  padding-inline: max(var(--page-padding-inline), var(--safe-area-left)) max(var(--page-padding-inline), var(--safe-area-right));
  border-block-end: var(--control-border-width) solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-primary);
}

/* Inline chrome slot (bell/menu host) — fixed hit size, no border strip. */
.auth-session--chrome {
  width: auto;
  max-width: none;
  min-height: var(--touch-target-size, 44px);
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

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

.auth-session__placeholder {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: var(--touch-target-size, 44px);
  height: var(--touch-target-size, 44px);
}

.auth-session__placeholder-slot {
  display: block;
  width: var(--icon-size, 22px);
  height: var(--icon-size, 22px);
  border-radius: var(--radius-sm, 6px);
  background: color-mix(in srgb, var(--color-text-secondary) 18%, transparent);
}

.auth-session__name {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: var(--font-size-control-sm);
  font-weight: var(--font-weight-control);
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-session__actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: var(--space-2);
}

.auth-session__action {
  min-height: var(--control-height-compact);
  padding-inline: var(--space-3);
}

/* === /app/styles/components/auth-modal.css === */
.auth-modal {
  display: grid;
  gap: var(--space-4);
  min-width: 0;
}

.auth-modal__tabs {
  min-width: 0;
}

.auth-modal__form,
.auth-modal__panel {
  display: grid;
  gap: var(--space-3);
  min-width: 0;
}

.auth-modal__panel[hidden],
.auth-modal__google[hidden],
.auth-modal__tabs[hidden] {
  display: none !important;
}

.auth-modal__field {
  display: grid;
  gap: var(--space-2);
  min-width: 0;
}

.auth-modal__label {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: var(--font-size-control-sm);
  font-weight: var(--font-weight-control);
}

.auth-modal__input {
  box-sizing: border-box;
  width: 100%;
  min-height: var(--control-height-sm);
  padding-block: var(--space-2);
  padding-inline: var(--space-3);
  border: var(--control-border-width) solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text-primary);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.4;
}

.auth-modal__input::placeholder {
  font-size: 14px;
}

#auth-login-identifier,
#auth-login-identifier::placeholder {
  font-size: 14px;
}

.auth-modal__hint,
.auth-modal__error {
  margin: 0;
  color: var(--color-control-danger);
  font-size: var(--font-size-control-sm);
}

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

.auth-modal__summary {
  margin: 0;
  font-size: var(--font-size-control-sm);
}

.auth-modal__hint {
  color: var(--color-text-secondary);
}

.auth-modal__summary {
  color: var(--color-control-danger);
}

.auth-modal__summary--success {
  color: var(--color-text-secondary);
}

.auth-modal__link {
  justify-self: start;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-text-secondary);
  font: inherit;
  font-size: var(--font-size-control-sm);
  text-decoration: underline;
  cursor: pointer;
}

.auth-modal__link:hover,
.auth-modal__link:focus-visible {
  color: var(--color-text-primary);
}

.auth-modal__legal {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: var(--font-size-control-sm);
  line-height: 1.4;
}

.auth-modal__legal-link {
  color: var(--color-control-primary);
  text-decoration: underline;
}

.auth-modal__google {
  display: grid;
  gap: var(--space-3);
  min-width: 0;
}

.auth-modal__google-button {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  min-height: var(--control-height-sm);
}

.auth-modal__google-visual {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  width: 100%;
  min-height: var(--control-height-sm);
  padding-block: var(--space-2);
  padding-inline: var(--space-3);
  border: var(--control-border-width) solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-control-secondary);
  color: var(--color-text-primary);
  font-size: var(--font-size-control-md);
  font-weight: var(--font-weight-control);
  line-height: 1.2;
  pointer-events: none;
  user-select: none;
}

.auth-modal__google-logo {
  display: inline-flex;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

.auth-modal__google-logo svg {
  display: block;
  width: 18px;
  height: 18px;
}

.auth-modal__google-label {
  min-width: 0;
  text-align: center;
}

/*
  Real GIS button (iframe / role=button) sits on top of the visual facade.
  Do NOT stretch the iframe with width/height:100% — that breaks Google's
  internal hit target. We size via renderButton(width) + JS transform scale.
*/
.auth-modal__google-gis {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  overflow: hidden;
  /* opacity:0 can drop pointer events to cross-origin iframes in Chromium */
  opacity: 0.01;
  cursor: pointer;
}

.auth-modal__google-gis > div {
  position: absolute;
  inset: 0 auto auto 0;
  transform-origin: 0 0;
}

.auth-modal__divider {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: 0;
  width: 100%;
  color: var(--color-text-secondary);
  font-size: var(--font-size-control-sm);
  line-height: 1;
  text-align: center;
}

.auth-modal__divider::before,
.auth-modal__divider::after {
  content: '';
  flex: 1 1 auto;
  height: 1px;
  background: var(--color-border);
}

.auth-modal__flight {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-2);
}

.auth-modal__flight .button[aria-pressed='true'] {
  border-color: var(--color-control-primary);
  box-shadow: inset 0 0 0 1px var(--color-control-primary);
  background: var(--color-control-selected);
  color: var(--color-text-primary);
}

@media (max-width: 420px) {
  .auth-modal__google-visual {
    gap: var(--space-2);
    font-size: var(--font-size-control-sm);
  }
}

/* === /app/styles/components/bottom-navigation.css === */
.bottom-navigation {
  --bottom-navigation-background: var(--color-surface);
  --bottom-navigation-border: var(--color-border);
  position: relative;
  width: 100%;
  max-width: var(--app-max-width);
  margin-inline: auto;
  overflow: hidden;
  background: var(--bottom-navigation-background);
  color: var(--color-text-secondary);
  transition: background-color var(--duration-standard), color var(--duration-standard);
}

.bottom-navigation::before {
  position: absolute;
  z-index: var(--z-index-content);
  inset-block-start: 0;
  inset-inline: 0;
  height: var(--control-border-width);
  background: var(--bottom-navigation-border);
  content: '';
  pointer-events: none;
}

.bottom-navigation__items {
  display: grid;
  grid-template-columns: repeat(var(--bottom-navigation-item-count), minmax(0, 1fr));
  width: 100%;
  height: var(--bottom-navigation-bar-height, var(--bottom-navigation-height));
  margin: 0;
  padding: 0;
  list-style: none;
}

.bottom-navigation__item {
  min-width: 0;
  height: 100%;
}

.bottom-navigation__link {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  height: 100%;
  min-height: var(--touch-target-size);
  gap: var(--space-1);
  padding-inline: var(--space-1);
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: background-color var(--duration-standard), color var(--duration-standard);
}

.bottom-navigation__link:hover:not([aria-disabled='true']) {
  background: var(--color-control-tertiary-hover);
}

.bottom-navigation__link:active:not([aria-disabled='true']) {
  background: var(--color-control-tertiary-active);
}

.bottom-navigation__link:focus-visible {
  outline: var(--control-focus-width) solid var(--color-control-focus);
  outline-offset: 0;
}

.bottom-navigation__link[aria-disabled='true'] {
  opacity: var(--control-disabled-opacity);
  cursor: default;
  pointer-events: none;
}

.bottom-navigation__link--active {
  color: var(--color-control-primary);
  font-weight: var(--font-weight-control);
}

.bottom-navigation__link--active::before {
  position: absolute;
  inset-block-start: var(--space-1);
  width: var(--space-6);
  height: var(--space-1);
  border-radius: var(--radius-sm);
  background: currentColor;
  content: '';
}

.bottom-navigation__icon-area {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--icon-size);
  height: var(--icon-size);
}

.bottom-navigation__icon {
  width: var(--icon-size);
  height: var(--icon-size);
}

.bottom-navigation__badge {
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: calc(50% + var(--space-2));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--space-5);
  height: var(--space-5);
  padding-inline: var(--space-1);
  border-radius: var(--radius-lg);
  background: var(--color-control-danger);
  color: var(--color-control-on-danger);
  font-size: var(--font-size-control-sm);
  font-weight: var(--font-weight-control);
  line-height: 1;
  white-space: nowrap;
}

.bottom-navigation__badge--dot {
  width: var(--space-2);
  min-width: var(--space-2);
  height: var(--space-2);
  padding: 0;
  background: var(--color-control-primary);
}

.bottom-navigation__label {
  display: none;
  width: 100%;
  overflow: hidden;
  font-size: var(--font-size-control-sm);
  line-height: 1;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bottom-navigation__brand {
  display: none;
}

.bottom-navigation__actions {
  display: none;
}

/* Desktop top placement: hairline under the bar, active mark along the bottom edge. */
@media (min-width: 720px) {
  .bottom-navigation {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    /* Full-bleed bar; brand + bell align to the 960px content column (red boxes). */
    max-width: none;
    width: 100%;
    margin-inline: 0;
    padding-inline: max(var(--space-4), calc((100% - var(--app-max-width)) / 2));
    column-gap: var(--space-3);
  }

  .bottom-navigation::before {
    inset-block-start: auto;
    inset-block-end: 0;
  }

  .bottom-navigation__brand {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    grid-column: 1;
    justify-self: start;
    min-width: 0;
    max-width: 100%;
    padding-block: var(--space-1);
    color: var(--color-text-primary);
    text-decoration: none;
  }

  .bottom-navigation__brand:focus-visible {
    outline: var(--control-focus-width) solid var(--color-control-focus);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
  }

  .bottom-navigation__brand-logo {
    flex: 0 0 auto;
    display: block;
    width: 40px;
    height: 40px;
    overflow: hidden;
    object-fit: contain;
    object-position: center;
    transform: none;
    transform-origin: center;
  }

  .bottom-navigation__brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
  }

  .bottom-navigation__brand-title {
    overflow: hidden;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .bottom-navigation__brand-tagline {
    overflow: hidden;
    color: var(--color-text-secondary);
    font-size: 0.6875rem;
    font-weight: 500;
    line-height: 1.15;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .bottom-navigation__items {
    grid-column: 2;
    width: max-content;
    max-width: 100%;
    margin: 0;
    grid-template-columns: repeat(var(--bottom-navigation-item-count), 4.5rem);
  }

  .bottom-navigation__actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-1);
    grid-column: 3;
    justify-self: end;
    min-width: 0;
    padding-inline-end: var(--space-1);
  }

  .bottom-navigation__actions .notification-bell-button,
  .bottom-navigation__actions .app-menu-button {
    width: var(--touch-target-size);
    height: var(--touch-target-size);
    color: var(--color-text-secondary);
    background: transparent;
  }

  .bottom-navigation__actions .notification-bell-button[data-selected='true'],
  .bottom-navigation__actions .app-menu-button[data-selected='true'],
  .bottom-navigation__actions .notification-bell-button[aria-expanded='true'],
  .bottom-navigation__actions .app-menu-button[aria-expanded='true'] {
    color: var(--color-control-primary);
    background: var(--color-control-selected);
  }

  .bottom-navigation__link--active::before {
    inset-block-start: auto;
    inset-block-end: var(--space-1);
  }
}


/* Desktop text links (mobile keeps icon bar only). */
.bottom-navigation__text-items {
  display: none;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bottom-navigation__text-item {
  min-width: 0;
}

.bottom-navigation__link--text {
  flex-direction: row;
  gap: 4px;
  width: auto;
  min-height: var(--touch-target-size);
  padding-inline: var(--space-2);
  font-size: var(--font-size-control-sm);
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
}

.bottom-navigation__text-label {
  min-width: 0;
}

.bottom-navigation__link--text .bottom-navigation__badge {
  position: static;
  inset: auto;
  flex: 0 0 auto;
  margin-inline-start: 2px;
}

.bottom-navigation__link--text.bottom-navigation__link--active::before {
  inset-inline: 50%;
  width: var(--space-6);
  transform: translateX(-50%);
}

@media (min-width: 720px) {
  .bottom-navigation__items {
    display: none;
  }

  .bottom-navigation__text-items {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 0;
    grid-column: 2;
    width: max-content;
    max-width: 100%;
    height: var(--bottom-navigation-bar-height, var(--bottom-navigation-height));
    overflow: hidden;
  }

  .bottom-navigation__link--text {
    font-size: 0.8125rem;
    padding-inline: var(--space-2);
  }
}

@media (min-width: 720px) and (max-width: 1100px) {
  .bottom-navigation__link--text {
    font-size: 0.75rem;
    padding-inline: 6px;
  }

  .bottom-navigation {
    column-gap: var(--space-2);
  }
}

@media (min-width: 720px) and (max-width: 860px) {
  .bottom-navigation__link--text {
    font-size: 0.6875rem;
    padding-inline: 4px;
  }

  .bottom-navigation__brand-tagline {
    display: none;
  }
}

/* === /app/styles/components/search-bar.css === */
.search-bar {
  display: inline-grid;
  max-width: 100%;
  gap: var(--search-gap);
  color: var(--color-text-primary);
}

.search-bar--full-width {
  width: 100%;
}

.search-bar__label {
  color: var(--color-text-primary);
  font-size: var(--font-size-control-md);
  font-weight: var(--font-weight-control);
}

.search-bar__control {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: var(--search-height);
  gap: var(--search-gap);
  padding-inline-start: var(--search-padding-inline);
  border: var(--control-border-width) solid var(--color-search-border);
  border-radius: 12px;
  background: var(--color-search-background);
  color: var(--color-text-primary);
  box-shadow: 0 1px 2px rgb(23 32 51 / 4%);
  transition: background-color var(--duration-standard), border-color var(--duration-standard), outline-color var(--duration-standard);
}

.search-bar__control:hover {
  border-color: var(--color-text-secondary);
}

.search-bar__control:focus-within {
  border-color: var(--color-text-secondary);
}

.search-bar[data-error='true'] .search-bar__control {
  border-color: var(--color-search-error);
}

.search-bar[data-disabled='true'] {
  opacity: var(--control-disabled-opacity);
}

.search-bar[data-loading='true'] .search-bar__control {
  cursor: progress;
}

.search-bar__search-icon {
  flex: 0 0 var(--icon-size);
  width: var(--icon-size);
  height: var(--icon-size);
  color: var(--color-search-icon);
}

.search-bar__input {
  min-width: 0;
  width: 100%;
  height: calc(var(--search-height) - (var(--control-border-width) * 2));
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--color-text-primary);
  font-size: var(--font-size-control-lg);
  text-overflow: ellipsis;
}

.search-bar__input::placeholder {
  overflow: hidden;
  color: var(--color-search-placeholder);
  text-overflow: ellipsis;
  opacity: 1;
}

.search-bar__input::-webkit-search-decoration,
.search-bar__input::-webkit-search-cancel-button {
  appearance: none;
}

.search-bar__input:disabled {
  cursor: default;
}

.search-bar__action {
  position: relative;
  flex: 0 0 var(--touch-target-size);
  width: var(--touch-target-size);
  height: var(--touch-target-size);
}

.search-bar__clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--touch-target-size);
  height: var(--touch-target-size);
  padding: 0;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-search-icon);
  cursor: pointer;
  transition: background-color var(--duration-standard), color var(--duration-standard);
}

.search-bar__clear:hover:not(:disabled) {
  background: var(--color-control-tertiary-hover);
  color: var(--color-text-primary);
}

.search-bar__clear:active:not(:disabled) {
  background: var(--color-control-tertiary-active);
}

.search-bar__clear:focus-visible {
  outline: var(--control-focus-width) solid var(--color-search-focus);
  outline-offset: calc(var(--control-focus-offset) * -1);
}

.search-bar__clear-icon {
  width: var(--icon-size);
  height: var(--icon-size);
}

.search-bar__loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--touch-target-size);
  height: var(--touch-target-size);
  color: var(--color-search-icon);
}

.search-bar__spinner {
  width: var(--loading-indicator-size);
  height: var(--loading-indicator-size);
  border: var(--loading-indicator-width) solid currentColor;
  border-block-start-color: transparent;
  border-radius: 50%;
  animation: search-bar-loading var(--duration-loading) linear infinite;
}

.search-bar__error {
  color: var(--color-search-error);
  font-size: var(--font-size-control-sm);
  line-height: 1.4;
}

.search-bar__label[hidden],
.search-bar__search-icon[hidden],
.search-bar__clear[hidden],
.search-bar__loading[hidden],
.search-bar__error[hidden] {
  display: none;
}

@keyframes search-bar-loading {
  to {
    transform: rotate(1turn);
  }
}

@media (prefers-reduced-motion: reduce) {
  .search-bar__spinner {
    animation: none;
    border-block-start-color: currentColor;
  }
}

/* lt:nozoom1 — stop iOS/Android focus zoom when input font-size < 16px */
@media (max-width: 719.98px) {
  .search-bar__input,
  input[type='search'],
  input[type='text'],
  input[type='email'],
  input[type='tel'],
  input[type='url'],
  input[type='password'],
  input:not([type]),
  textarea,
  select {
    font-size: 16px !important;
  }
}

/* === /app/styles/components/overlay.css === */
.overlay-root {
  position: fixed;
  inset: 0;
  z-index: var(--z-index-modal);
  overflow: hidden;
  pointer-events: none;
}

.overlay-root[hidden] {
  display: none;
}

.overlay-layer {
  position: absolute;
  inset: 0;
  z-index: var(--overlay-stack-index);
  display: grid;
  align-items: center;
  justify-items: center;
  min-width: 0;
  min-height: 0;
  padding: max(var(--space-4), var(--safe-area-top)) max(var(--space-4), var(--safe-area-right)) max(var(--space-4), var(--safe-area-bottom)) max(var(--space-4), var(--safe-area-left));
  pointer-events: auto;
}

.overlay-layer[data-placement='bottom'] {
  align-items: end;
  padding-block-end: 0;
}

.overlay-backdrop {
  position: absolute;
  inset: 0;
  background: var(--color-overlay-backdrop);
  opacity: 1;
  backdrop-filter: blur(var(--overlay-backdrop-blur));
  transition: opacity var(--overlay-duration) var(--overlay-easing);
}

.overlay-layer[data-state='opening'] .overlay-backdrop,
.overlay-layer[data-state='closing'] .overlay-backdrop {
  opacity: 0;
}

.app-shell__viewport[data-overlay-scroll-locked='true'] {
  overflow: hidden;
  overscroll-behavior: none;
  padding-inline-end: var(--overlay-scrollbar-compensation);
  touch-action: none;
}

body[data-overlay-scroll-locked='true'] {
  overscroll-behavior: none;
}

/* === /app/styles/components/modal.css === */
.modal {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100%;
  max-height: 100%;
  overflow: hidden;
  border: var(--control-border-width) solid var(--modal-border);
  border-radius: var(--modal-radius);
  background: var(--modal-background);
  color: var(--color-text-primary);
  box-shadow: var(--overlay-shadow-modal);
  opacity: 1;
  transform: scale(1);
  transition: opacity var(--overlay-duration) var(--overlay-easing), transform var(--overlay-duration) var(--overlay-easing);
}

.modal[data-size='small'] {
  max-width: var(--modal-max-width-small);
}

.modal[data-size='medium'] {
  max-width: var(--modal-max-width-medium);
}

.modal[data-size='large'] {
  max-width: var(--modal-max-width-large);
}

.modal[data-size='fullscreen'] {
  position: absolute;
  inset: 0;
  max-width: none;
  max-height: none;
  border: 0;
  border-radius: 0;
}

.modal[data-overlay-state='opening'],
.modal[data-overlay-state='closing'] {
  opacity: 0;
  transform: scale(var(--overlay-modal-scale));
}

.modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  min-width: 0;
  gap: var(--modal-gap);
  padding: var(--modal-padding);
  border-block-end: var(--control-border-width) solid var(--modal-border);
}

.modal__heading {
  min-width: 0;
}

.modal__title {
  margin: 0;
  font-size: var(--font-size-overlay-title);
  line-height: var(--overlay-heading-line-height);
}

.modal__description {
  margin-block-start: var(--space-1);
  color: var(--color-text-secondary);
  font-size: var(--font-size-control-md);
}

.modal__header-end {
  flex: 0 0 auto;
  align-self: center;
  min-width: 0;
  margin-inline-start: auto;
}

.modal__close {
  flex: 0 0 auto;
  margin-inline-start: auto;
}

.modal__header-end:not([hidden]) ~ .modal__close {
  margin-inline-start: 0;
}

.modal__body {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--modal-padding);
  -webkit-overflow-scrolling: touch;
}

.modal__content {
  min-width: 0;
}

.modal__loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--modal-loading-background);
}

.modal__spinner {
  width: var(--loading-indicator-size);
  height: var(--loading-indicator-size);
  border: var(--loading-indicator-width) solid var(--color-text-secondary);
  border-block-start-color: transparent;
  border-radius: 50%;
  animation: modal-loading var(--duration-loading) linear infinite;
}

.modal__footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--modal-gap);
  padding: var(--modal-padding);
  border-block-start: var(--control-border-width) solid var(--modal-border);
}

.modal__header[hidden],
.modal__heading[hidden],
.modal__title[hidden],
.modal__description[hidden],
.modal__header-end[hidden],
.modal__close[hidden],
.modal__loading[hidden],
.modal__footer[hidden] {
  display: none;
}

@keyframes modal-loading {
  to {
    transform: rotate(1turn);
  }
}

/* === /app/styles/components/bottom-sheet.css === */
.bottom-sheet {
  position: relative;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  width: 100%;
  max-width: var(--sheet-max-width);
  max-height: min(var(--sheet-content-max-height), 100%);
  overflow: hidden;
  border: var(--control-border-width) solid var(--sheet-border);
  border-block-end: 0;
  border-radius: var(--sheet-radius) var(--sheet-radius) 0 0;
  background: var(--sheet-background);
  color: var(--color-text-primary);
  box-shadow: var(--overlay-shadow-sheet);
  transform: translateY(0);
  transition: transform var(--overlay-duration) var(--overlay-easing);
}

.bottom-sheet[data-dragging='true'] {
  transition: none;
  touch-action: none;
}

.bottom-sheet[data-snap-point='content'] {
  height: auto;
}

.bottom-sheet[data-snap-point='medium'] {
  height: min(var(--sheet-height-medium), 100%);
}

.bottom-sheet[data-snap-point='large'] {
  height: min(var(--sheet-height-large), 100%);
}

.bottom-sheet[data-snap-point='fullscreen'] {
  position: absolute;
  inset: 0;
  height: min(var(--sheet-height-fullscreen), 100%);
  max-height: none;
  margin-inline: auto;
  border-radius: 0;
}

.bottom-sheet[data-overlay-state='opening'],
.bottom-sheet[data-overlay-state='closing'] {
  transform: translateY(var(--sheet-closed-translate));
}

.bottom-sheet__handle {
  position: relative;
  justify-self: center;
  width: calc(var(--sheet-handle-width) + (var(--space-4) * 2));
  height: calc(var(--sheet-handle-height) + (var(--space-2) * 2));
  margin-block-start: var(--space-1);
  background: transparent;
  touch-action: none;
  cursor: grab;
}

.bottom-sheet__handle::before {
  content: '';
  position: absolute;
  inset-inline-start: 50%;
  inset-block-start: 50%;
  width: var(--sheet-handle-width);
  height: var(--sheet-handle-height);
  border-radius: var(--radius-sm);
  background: var(--color-border);
  transform: translate(-50%, -50%);
}

.bottom-sheet[data-dragging='true'] .bottom-sheet__handle {
  cursor: grabbing;
}

.bottom-sheet__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  gap: var(--sheet-gap);
  padding: var(--sheet-padding);
  border-block-end: var(--control-border-width) solid var(--sheet-border);
  touch-action: none;
}

.bottom-sheet__heading {
  flex: 1 1 auto;
  min-width: 0;
}

.bottom-sheet__title {
  margin: 0;
  overflow: hidden;
  font-size: var(--font-size-overlay-title);
  line-height: var(--overlay-heading-line-height);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bottom-sheet__description {
  margin-block-start: var(--space-1);
  color: var(--color-text-secondary);
  font-size: var(--font-size-control-md);
}

.bottom-sheet__header-end {
  flex: 0 0 auto;
  min-width: 0;
  margin-inline-start: auto;
}

.bottom-sheet__header-action {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-secondary);
  font: inherit;
  font-size: var(--font-size-control-md);
  font-weight: var(--font-weight-control);
  line-height: var(--overlay-heading-line-height);
  cursor: pointer;
}

.bottom-sheet__header-action:hover {
  color: var(--color-text-primary);
}

.bottom-sheet__header-action:disabled {
  color: color-mix(in srgb, var(--color-text-secondary) 45%, transparent);
}

.bottom-sheet__header-action:focus-visible {
  outline: var(--control-focus-width) solid var(--color-control-focus);
  outline-offset: var(--control-focus-offset);
}

.bottom-sheet__close {
  flex: 0 0 auto;
  margin-inline-start: auto;
}

.bottom-sheet__header-end:not([hidden]) ~ .bottom-sheet__close {
  margin-inline-start: 0;
}

.bottom-sheet__body {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--sheet-padding);
  -webkit-overflow-scrolling: touch;
  /* Native vertical scroll; sheet claim via Touch Adapter preventDefault. */
  touch-action: pan-y;
}

.bottom-sheet__content {
  min-width: 0;
}

.bottom-sheet__loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--sheet-loading-background);
}

.bottom-sheet__spinner {
  width: var(--loading-indicator-size);
  height: var(--loading-indicator-size);
  border: var(--loading-indicator-width) solid var(--color-text-secondary);
  border-block-start-color: transparent;
  border-radius: 50%;
  animation: bottom-sheet-loading var(--duration-loading) linear infinite;
}

.bottom-sheet__footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--bottom-action-space);
  padding-inline: var(--bottom-action-space);
  padding-block-start: var(--bottom-action-space);
  padding-block-end: max(var(--bottom-action-space), var(--safe-area-bottom));
  border-block-start: var(--control-border-width) solid var(--sheet-border);
}

.bottom-sheet__footer .button--full-width {
  flex: 1 1 100%;
}

.bottom-sheet__handle[hidden],
.bottom-sheet__header[hidden],
.bottom-sheet__heading[hidden],
.bottom-sheet__title[hidden],
.bottom-sheet__description[hidden],
.bottom-sheet__header-end[hidden],
.bottom-sheet__close[hidden],
.bottom-sheet__loading[hidden],
.bottom-sheet__footer[hidden] {
  display: none;
}

@keyframes bottom-sheet-loading {
  to {
    transform: rotate(1turn);
  }
}

@media (prefers-reduced-motion: reduce) {
  .bottom-sheet {
    transition: none;
  }
}

/* === /app/styles/components/filter-sheet.css === */
.filter-sheet {
  --filter-bg: #f4f8ff;
  --filter-border: #cfd8e8;
  --filter-active: #0b66d0;
  --filter-active-text: #ffffff;
  --filter-exclude-bg: #fde8e8;
  --filter-exclude-border: #d93025;
  display: grid;
  align-content: start;
  gap: var(--space-3);
  min-width: 0;
  padding-block: var(--space-3);
}

.filter-sheet__section {
  display: grid;
  gap: var(--space-2);
  min-width: 0;
}

.filter-sheet__section-title {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: var(--font-size-control-sm);
  font-weight: 700;
  line-height: 1.2;
}

.filter-sheet__options {
  display: grid;
  align-items: stretch;
  gap: var(--space-2);
  min-width: 0;
}

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

.filter-sheet__options:has(> .filter-sheet__option:nth-child(4)) {
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
}

.filter-sheet__option {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: var(--control-height-compact);
  padding: 0 var(--space-2);
  border: 1px solid var(--filter-border);
  border-radius: 8px;
  background: var(--filter-bg);
  color: var(--color-text-primary);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: normal;
  cursor: pointer;
  height: 100%;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

@media (hover: hover) and (pointer: fine) {
  .filter-sheet__option:hover:not(.is-selected):not([data-selected='true']):not([data-filter-state='include']):not([data-filter-state='exclude']) {
    border-color: var(--filter-active);
  }
}

.filter-sheet__option:active {
  outline: none;
}

.filter-sheet__option:focus:not(:focus-visible) {
  outline: none;
}

.filter-sheet__option--stacked {
  min-height: 52px;
}

.filter-sheet__option-content {
  min-width: 0;
  max-width: 100%;
}

.filter-sheet__option-content--stacked {
  display: inline-grid;
  grid-template-columns: minmax(0, max-content);
  justify-items: center;
  justify-content: center;
  align-content: center;
  row-gap: 3px;
}

.filter-sheet__option-content--horizontal {
  display: inline-grid;
  grid-template-columns: 20px auto;
  column-gap: 4px;
  align-items: center;
  justify-items: start;
  justify-content: center;
  width: max-content;
  max-width: 100%;
}

.filter-sheet__option-icon {
  display: block;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  object-fit: contain;
  object-position: center;
}

.filter-sheet__option-icon--monochrome {
  filter: brightness(0);
}

:root[data-theme='dark'] .filter-sheet__option-icon--monochrome {
  filter: none;
}

.filter-sheet__option-icon--color {
  filter: none;
}

.filter-sheet__option-label {
  display: block;
  min-width: 0;
  max-width: 100%;
  font-weight: 600;
  line-height: 1.15;
}

.filter-sheet__option-content--stacked .filter-sheet__option-label {
  text-align: center;
}

.filter-sheet__option-content--horizontal .filter-sheet__option-label {
  text-align: start;
}

.filter-sheet__option-content--plain {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding-inline: 1px;
}

.filter-sheet__option-content--plain .filter-sheet__option-label {
  color: inherit;
  font: inherit;
  font-weight: 600;
  line-height: 1.15;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.filter-sheet__clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--touch-target-size);
  min-height: var(--touch-target-size);
  padding-inline: var(--space-2);
  color: var(--color-control-primary);
  font-weight: 600;
}

.filter-sheet__clear:hover:not(:disabled) {
  color: var(--color-control-primary-hover);
}

.filter-sheet__clear:disabled {
  color: color-mix(in srgb, var(--color-text-secondary) 45%, transparent);
  font-weight: var(--font-weight-control);
  cursor: default;
}

.filter-sheet__result-status {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.bottom-sheet__heading:has(.filter-sheet__result-count) {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.filter-sheet__result-count {
  flex: 0 1 auto;
  min-width: 0;
  color: var(--color-presence-online);
  font-size: var(--font-size-control-sm);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  white-space: nowrap;
}

.bottom-sheet:has(.filter-sheet) {
  max-width: 400px;
}

.bottom-sheet:has(.filter-sheet) .bottom-sheet__handle {
  height: calc(var(--sheet-handle-height) + var(--space-2));
  margin-block-start: 0;
}

.bottom-sheet:has(.filter-sheet) .bottom-sheet__header {
  padding-block: 2px;
  min-height: 0;
}

.bottom-sheet:has(.filter-sheet) .filter-sheet__clear {
  min-height: 36px;
}

.bottom-sheet:has(.filter-sheet)[data-snap-point='content'] .bottom-sheet__body {
  min-height: 0;
  max-height: min(70dvh, calc(var(--sheet-content-max-height) - 7.5rem));
  overflow-y: auto;
}

.filter-sheet__option.is-selected,
.filter-sheet__option[data-selected='true'],
.filter-sheet__option[data-filter-state='include'] {
  border-color: var(--filter-active);
  background: var(--filter-active);
  color: var(--filter-active-text);
  box-shadow: none;
}

.filter-sheet__option.is-selected .filter-sheet__option-icon,
.filter-sheet__option.is-selected .filter-sheet__option-icon--monochrome,
.filter-sheet__option.is-selected .filter-sheet__option-icon--color,
.filter-sheet__option[data-selected='true'] .filter-sheet__option-icon,
.filter-sheet__option[data-selected='true'] .filter-sheet__option-icon--monochrome,
.filter-sheet__option[data-selected='true'] .filter-sheet__option-icon--color,
.filter-sheet__option[data-filter-state='include'] .filter-sheet__option-icon,
.filter-sheet__option[data-filter-state='include'] .filter-sheet__option-icon--monochrome,
.filter-sheet__option[data-filter-state='include'] .filter-sheet__option-icon--color {
  filter: brightness(0) invert(1);
}

.filter-sheet__option.is-selected[data-filter-value='shiny'] .filter-sheet__option-icon,
.filter-sheet__option.is-selected[data-filter-value='legendary'] .filter-sheet__option-icon,
.filter-sheet__option.is-selected[data-filter-value='ultra-beast'] .filter-sheet__option-icon,
.filter-sheet__option[data-selected='true'][data-filter-value='shiny'] .filter-sheet__option-icon,
.filter-sheet__option[data-selected='true'][data-filter-value='legendary'] .filter-sheet__option-icon,
.filter-sheet__option[data-selected='true'][data-filter-value='ultra-beast'] .filter-sheet__option-icon,
.filter-sheet__option[data-filter-state='include'][data-filter-value='shiny'] .filter-sheet__option-icon,
.filter-sheet__option[data-filter-state='include'][data-filter-value='legendary'] .filter-sheet__option-icon,
.filter-sheet__option[data-filter-state='include'][data-filter-value='ultra-beast'] .filter-sheet__option-icon,
.filter-sheet__option.is-selected[data-filter-value='shiny'] .filter-sheet__option-icon--color,
.filter-sheet__option.is-selected[data-filter-value='legendary'] .filter-sheet__option-icon--color,
.filter-sheet__option.is-selected[data-filter-value='ultra-beast'] .filter-sheet__option-icon--color,
.filter-sheet__option[data-selected='true'][data-filter-value='shiny'] .filter-sheet__option-icon--color,
.filter-sheet__option[data-selected='true'][data-filter-value='legendary'] .filter-sheet__option-icon--color,
.filter-sheet__option[data-selected='true'][data-filter-value='ultra-beast'] .filter-sheet__option-icon--color,
.filter-sheet__option[data-filter-state='include'][data-filter-value='shiny'] .filter-sheet__option-icon--color,
.filter-sheet__option[data-filter-state='include'][data-filter-value='legendary'] .filter-sheet__option-icon--color,
.filter-sheet__option[data-filter-state='include'][data-filter-value='ultra-beast'] .filter-sheet__option-icon--color,
.filter-sheet__option[data-filter-state='include'][data-filter-value='legendary'] .filter-sheet__option-icon--color {
  filter: none;
}


.filter-sheet__option[data-filter-state='exclude'] .filter-sheet__option-icon,
.filter-sheet__option[data-filter-state='exclude'] .filter-sheet__option-icon--monochrome,
.filter-sheet__option[data-filter-state='exclude'] .filter-sheet__option-icon--color {
  filter: none;
}

.filter-sheet__option[data-filter-state='exclude'] {
  border-color: var(--filter-exclude-border);
  background: var(--filter-exclude-bg);
  color: var(--color-text-primary);
  box-shadow: none;
}

.filter-sheet__option.is-selected[data-filter-value='event'] .filter-sheet__option-icon,
.filter-sheet__option[data-selected='true'][data-filter-value='event'] .filter-sheet__option-icon,
.filter-sheet__option[data-filter-state='include'][data-filter-value='event'] .filter-sheet__option-icon,
.filter-sheet__option.is-selected[data-filter-value='gigantamax'] .filter-sheet__option-icon,
.filter-sheet__option[data-selected='true'][data-filter-value='gigantamax'] .filter-sheet__option-icon,
.filter-sheet__option[data-filter-state='include'][data-filter-value='gigantamax'] .filter-sheet__option-icon,
.filter-sheet__option.is-selected[data-filter-value='gender'] .filter-sheet__option-icon,
.filter-sheet__option[data-selected='true'][data-filter-value='gender'] .filter-sheet__option-icon,
.filter-sheet__option[data-filter-state='include'][data-filter-value='gender'] .filter-sheet__option-icon {
  filter: none;
}

.filter-sheet__option:focus-visible {
  outline: 2px solid var(--filter-active);
  outline-offset: 2px;
}

:root[data-theme='dark'] .filter-sheet {
  --filter-bg: color-mix(in srgb, #0b66d0 16%, var(--color-surface));
  --filter-border: color-mix(in srgb, #cfd8e8 28%, var(--color-border));
  --filter-active: #0b66d0;
  --filter-active-text: #ffffff;
  --filter-exclude-bg: color-mix(in srgb, #d93025 18%, var(--color-surface));
  --filter-exclude-border: #ff6b61;
}

/* group-by row in filter sheet */
.filter-sheet__section--group-by {
  padding-bottom: var(--space-2);
}

.filter-sheet__group-by-row {
  display: flex;
  align-items: center;
  min-width: 0;
}

.filter-sheet__group-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-text-primary);
  font: inherit;
  font-size: var(--font-size-control-md, 15px);
  font-weight: var(--font-weight-control);
  line-height: 1.2;
  cursor: pointer;
  text-align: start;
}

.filter-sheet__group-toggle:focus-visible {
  outline: 2px solid var(--color-control-primary, #0b66d0);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.filter-sheet__group-toggle-label {
  min-width: 0;
}

.filter-sheet__group-switch {
  position: relative;
  box-sizing: border-box;
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: #c5c9d1;
  flex: 0 0 auto;
  transition: background-color 140ms ease;
}

.filter-sheet__group-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: transform 140ms ease;
}

.filter-sheet__group-toggle--on .filter-sheet__group-switch,
.filter-sheet__group-toggle[data-active='true'] .filter-sheet__group-switch {
  background: #0b66d0;
}

.filter-sheet__group-toggle--on .filter-sheet__group-switch-thumb,
.filter-sheet__group-toggle[data-active='true'] .filter-sheet__group-switch-thumb {
  transform: translateX(14px);
}

@media (min-width: 721px) {
  .filter-sheet__section--group-by {
    display: none;
  }
}

/* === /app/styles/components/tabs.css === */
.tabs {
  display: grid;
  min-width: 0;
  gap: var(--tab-gap);
}

.tabs__list {
  display: flex;
  min-width: 0;
  gap: var(--tab-gap);
}

.tabs[data-orientation='vertical'] {
  grid-template-columns: auto minmax(0, 1fr);
}

.tabs[data-orientation='vertical'] .tabs__list {
  flex-direction: column;
}

.tabs[data-scrollable='true'] .tabs__list {
  overflow: auto hidden;
  scrollbar-width: thin;
}

.tabs[data-equal-width='true'] .tabs__tab {
  flex: 1 1 0;
}

.tabs__tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 0;
  min-height: var(--tab-height);
  gap: var(--space-2);
  padding-inline: var(--space-3);
  border: var(--control-border-width) solid transparent;
  border-radius: var(--tab-radius);
  background: transparent;
  color: var(--color-text-secondary);
  font-size: var(--font-size-control-md);
  font-weight: var(--font-weight-control);
  cursor: pointer;
  transition: background-color var(--duration-standard), border-color var(--duration-standard), color var(--duration-standard);
}

.tabs__tab:hover:not(:disabled) {
  color: var(--color-text-primary);
}

.tabs__tab:focus-visible {
  outline: var(--control-focus-width) solid var(--color-control-focus);
  outline-offset: var(--control-focus-offset);
}

.tabs__tab:disabled {
  opacity: var(--control-disabled-opacity);
  cursor: default;
}

.tabs__tab[aria-selected='true'] {
  color: var(--color-text-primary);
}

.tabs[data-variant='segmented'] .tabs__list {
  gap: var(--tab-gap-sm);
  padding: var(--tab-gap-sm);
  border: var(--control-border-width) solid var(--tab-border);
  border-radius: var(--tab-radius);
  background: var(--tab-background);
}

.tabs[data-variant='segmented'] .tabs__tab {
  min-height: var(--tab-height-sm);
  padding-inline: var(--space-2);
  font-size: var(--font-size-control-sm, 0.8125rem);
}

.tabs[data-variant='segmented'] .tabs__tab[aria-selected='true'] {
  border-color: var(--tab-border);
  background: var(--tab-active);
  box-shadow: 0 1px 2px rgb(0 0 0 / 8%);
}

.tabs[data-variant='underline'] .tabs__list {
  gap: 0;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--color-border, #e2e7ee);
  border-radius: 0;
  background: transparent;
}

.tabs[data-variant='underline'] .tabs__tab {
  min-height: 2.5rem;
  padding-inline: var(--space-2);
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: var(--font-size-control-sm, 0.8125rem);
  font-weight: 500;
}

.tabs[data-variant='underline'] .tabs__tab[aria-selected='true'] {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: var(--color-text-primary);
  font-weight: 650;
}

.tabs[data-variant='underline'] .tabs__tab[aria-selected='true']::after {
  content: '';
  position: absolute;
  inset-inline: 0;
  inset-block-end: -1px;
  height: 2px;
  border-radius: 999px;
  background: var(--color-control-primary, #0a74d0);
}

.tabs__icon {
  width: var(--icon-size);
  height: var(--icon-size);
}

.tabs__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tabs__badge {
  min-width: var(--space-5);
  padding-inline: var(--space-1);
  border-radius: var(--radius-sm);
  background: var(--tab-indicator);
  color: var(--color-control-on-primary);
  font-size: var(--font-size-control-sm);
  text-align: center;
}

.tabs__panels,
.tabs__panel {
  min-width: 0;
}

.tabs__panel[hidden] {
  display: none;
}

/* === /app/styles/components/toast.css === */
.toast-root {
  position: fixed;
  inset: 0;
  z-index: var(--z-index-toast);
  overflow: hidden;
  pointer-events: none;
}

.toast-root[hidden] {
  display: none;
}

.toast-root__region {
  position: absolute;
  inset-inline: max(var(--space-3), var(--safe-area-left)) max(var(--space-3), var(--safe-area-right));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--toast-gap);
}

.toast-root__region[data-position='top'] {
  top: max(var(--space-3), var(--safe-area-top));
}

.toast-root__region[data-position='bottom'] {
  bottom: max(var(--space-3), var(--safe-area-bottom));
  flex-direction: column-reverse;
}

.toast-root[data-navigation-visible='true'] .toast-root__region[data-position='bottom'] {
  bottom: calc(var(--bottom-navigation-height) + var(--safe-area-bottom) + var(--space-3));
}

.toast {
  position: relative;
  display: grid;
  grid-template-columns: var(--space-1) minmax(0, 1fr) auto;
  width: min(100%, var(--toast-max-width));
  overflow: hidden;
  border: var(--control-border-width) solid var(--toast-border);
  border-radius: var(--toast-radius);
  background: var(--toast-background);
  color: var(--color-text-primary);
  box-shadow: var(--toast-shadow);
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  transition: opacity var(--toast-transition-duration) var(--overlay-easing), transform var(--toast-transition-duration) var(--overlay-easing);
}

.toast[data-state='opening'],
.toast[data-state='closing'] {
  opacity: 0;
  transform: translateY(var(--space-2));
}

.toast__accent {
  background: var(--toast-accent-info);
}

.toast[data-type='success'] .toast__accent {
  background: var(--toast-accent-success);
}

.toast[data-type='warning'] .toast__accent {
  background: var(--toast-accent-warning);
}

.toast[data-type='error'] .toast__accent {
  background: var(--toast-accent-error);
}

.toast__content {
  min-width: 0;
  padding: var(--space-3);
}

.toast__title {
  font-weight: var(--font-weight-control);
}

.toast__message {
  color: var(--color-text-secondary);
  font-size: var(--font-size-control-md);
}

.toast__controls {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2);
}

.toast__title[hidden],
.toast__message[hidden],
.toast__controls[hidden] {
  display: none;
}

.toast__badge {
  display: inline-flex;
  align-items: center;
  margin: 0 0 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f3d6c4;
  color: #8a4b2d;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.3;
}

.toast__badge[hidden] {
  display: none;
}

.toast[data-type='warning'] .toast__accent {
  background: var(--toast-accent-warning, #e6a700);
}

/* === /app/styles/components/loading-state.css === */
.loading-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  gap: var(--loading-gap);
  color: var(--color-text-primary);
}

.loading-state[data-full-width='true'] {
  display: flex;
  width: 100%;
}

.loading-state[data-inline='true'] {
  justify-content: flex-start;
}

.loading-state[hidden] {
  display: none;
}

.loading-state__visual {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
}

.loading-state__spinner {
  width: var(--loading-size-medium);
  height: var(--loading-size-medium);
  border: var(--loading-indicator-width) solid var(--color-border);
  border-block-start-color: var(--color-control-primary);
  border-radius: 50%;
  animation: loading-state-spin var(--duration-loading) linear infinite;
}

.loading-state[data-size='small'] .loading-state__spinner {
  width: var(--loading-size-small);
  height: var(--loading-size-small);
}

.loading-state[data-size='large'] .loading-state__spinner {
  width: var(--loading-size-large);
  height: var(--loading-size-large);
}

.loading-state__dots {
  display: inline-flex;
  gap: var(--space-1);
}

.loading-state__dot {
  width: var(--loading-dot-size);
  height: var(--loading-dot-size);
  border-radius: 50%;
  background: var(--color-control-primary);
  animation: loading-state-pulse var(--duration-loading) ease-in-out infinite alternate;
}

.loading-state[data-size='small'] .loading-state__dot {
  width: var(--loading-dot-size-small);
  height: var(--loading-dot-size-small);
}

.loading-state[data-size='large'] .loading-state__dot {
  width: var(--loading-dot-size-large);
  height: var(--loading-dot-size-large);
}

.loading-state__visual:has(.loading-state__skeleton) {
  display: grid;
  width: 100%;
}

.loading-state__skeleton {
  display: block;
  width: 100%;
  height: var(--skeleton-text-height);
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--skeleton-background), var(--skeleton-highlight), var(--skeleton-background));
  background-size: var(--skeleton-background-size);
  animation: loading-state-shimmer var(--skeleton-shimmer-duration) linear infinite;
}

.loading-state__skeleton[data-variant='circle'] {
  width: var(--loading-size-large);
  height: var(--loading-size-large);
  border-radius: 50%;
}

.loading-state__skeleton[data-variant='rectangle'] {
  height: var(--skeleton-rectangle-height);
}

.loading-state__skeleton[data-variant='card'] {
  height: var(--skeleton-card-height);
  border-radius: var(--radius-lg);
}

.loading-state__label {
  font-weight: var(--font-weight-control);
}

.loading-state__description {
  color: var(--color-text-secondary);
  font-size: var(--font-size-control-md);
}

.loading-state__description[hidden] {
  display: none;
}

@keyframes loading-state-spin {
  to { transform: rotate(1turn); }
}

@keyframes loading-state-pulse {
  to { opacity: var(--loading-pulse-opacity); }
}

@keyframes loading-state-shimmer {
  to { background-position: var(--skeleton-background-end); }
}

/* === /app/styles/components/empty-state.css === */
.empty-state {
  display: grid;
  justify-items: center;
  width: 100%;
  max-width: var(--empty-max-width);
  margin-inline: auto;
  gap: var(--empty-gap);
  padding: var(--space-6) var(--space-4);
  color: var(--color-text-primary);
  text-align: center;
}

.empty-state[hidden] {
  display: none;
}

.empty-state[data-compact='true'] {
  padding: var(--space-4);
}

.empty-state[data-align='start'] {
  justify-items: start;
  margin-inline: 0;
  text-align: start;
}

.empty-state__icon {
  display: grid;
  place-items: center;
  width: var(--empty-icon-size);
  height: var(--empty-icon-size);
  color: var(--color-text-secondary);
}

.empty-state__icon[hidden] {
  display: none;
}

.empty-state__icon-graphic {
  width: 100%;
  height: 100%;
}

.empty-state__title {
  margin: 0;
  font-size: var(--font-size-overlay-title);
}

.empty-state__description {
  color: var(--color-text-secondary);
}

.empty-state__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
}

.empty-state[data-align='start'] .empty-state__actions {
  justify-content: flex-start;
}

.empty-state__description[hidden],
.empty-state__actions[hidden] {
  display: none;
}

/* === /app/styles/components/presence-dot.css === */
.presence-dot {
  position: absolute;
  inset-block-end: 0;
  inset-inline-end: 0;
  inset-inline-start: auto;
  box-sizing: border-box;
  width: 0.625rem;
  height: 0.625rem;
  border: 1.5px solid var(--color-surface);
  border-radius: 50%;
  background: var(--color-presence-offline);
  pointer-events: none;
}

.presence-dot--online {
  background: var(--color-presence-online);
}

.presence-dot--away {
  background: var(--color-presence-away);
}

.presence-dot--offline {
  display: none;
}

/* === /app/styles/components/trainer-avatar.css === */
.trainer-avatar {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  box-sizing: border-box;
  /* Visible so presence-dot can sit on the ring edge; size stays fixed via width/height. */
  overflow: visible;
  border: 1px solid var(--color-border, #d8d8dc);
  border-radius: 50%;
  background: linear-gradient(135deg, #58d5ff, #d966ff);
  color: #07101f;
  font-weight: 650;
  line-height: 1;
}

.trainer-avatar--sm {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  font-size: var(--font-size-control-lg);
}

.trainer-avatar--md {
  width: 2.75rem;
  height: 2.75rem;
  font-size: var(--font-size-control-sm);
}

.trainer-avatar--lg {
  width: calc(var(--space-7) * 2.5);
  height: calc(var(--space-7) * 2.5);
  font-size: var(--font-size-overlay-title);
  font-weight: 650;
}

.trainer-avatar--has-avatar {
  border: 0;
  background: transparent;
}

.trainer-avatar__image {
  position: absolute;
  inset: 0;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  padding: 0;
  border-radius: inherit;
  object-fit: cover;
  display: block;
}

.trainer-avatar__image[hidden] {
  display: none;
}

.trainer-avatar__initial {
  position: relative;
  font-weight: 650;
  line-height: 1;
}

.trainer-avatar__initial[hidden] {
  display: none;
}

/* Presence must stay visible when avatar image clips the circle. */
.trainer-avatar--has-avatar .presence-dot {
  z-index: 2;
}

/* === /app/styles/components/pokemon-item.css === */
.pokemon-item {
  --pokemon-current-image-padding: var(--pokemon-image-padding-medium);
  --pokemon-image-scale: 1;
  --pokemon-image-transform-origin: center;
  position: relative;
  display: grid;
  width: 100%;
  min-width: 0;
  padding: 0;
  gap: var(--pokemon-item-gap);
  color: var(--pokemon-name-color);
  background: transparent;
  border: var(--pokemon-selection-border-width) solid transparent;
  border-radius: var(--pokemon-item-radius);
  font: inherit;
  text-align: start;
  transition: border-color var(--pokemon-item-transition);
}

button.pokemon-item {
  cursor: pointer;
}

.pokemon-item [hidden] {
  display: none;
}

.pokemon-item[data-size='small'] {
  --pokemon-current-image-padding: var(--pokemon-image-padding-small);
}

.pokemon-item[data-size='large'] {
  --pokemon-current-image-padding: var(--pokemon-image-padding-large);
}

.pokemon-item[data-selected='true'] {
  border-color: var(--pokemon-selected-border-color);
}

.pokemon-item:focus-visible {
  outline: var(--control-focus-width) solid var(--color-control-focus);
  outline-offset: var(--control-focus-offset);
}

.pokemon-item:disabled {
  cursor: not-allowed;
  opacity: var(--pokemon-disabled-opacity);
}

.pokemon-item[data-unavailable='true']:not(:disabled) {
  cursor: not-allowed;
  opacity: var(--pokemon-unavailable-opacity);
}

.pokemon-item__media {
  position: relative;
  display: grid;
  width: 100%;
  min-width: 0;
  aspect-ratio: var(--pokemon-media-aspect-ratio);
  overflow: hidden;
  place-items: center;
  background: var(--pokemon-media-background);
  border-radius: calc(var(--pokemon-item-radius) - var(--pokemon-selection-border-width));
}

.pokemon-item__layer {
  position: absolute;
}

.pokemon-item__background {
  z-index: var(--pokemon-layer-background);
  inset: 0;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  object-fit: var(--pokemon-background-fit, cover);
  transition: opacity var(--pokemon-item-transition) ease-out;
}

.pokemon-item__image {
  z-index: var(--pokemon-layer-image);
  inset: 0;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  padding: var(--pokemon-current-image-padding);
  object-fit: contain;
  transform: scale(var(--pokemon-image-scale));
  transform-origin: var(--pokemon-image-transform-origin);
  transition: opacity var(--pokemon-item-transition) ease-out;
}

.pokemon-item[data-sprite-fit='contain'] .pokemon-item__image,
.pokemon-item[data-sprite-fit='contain'] .pokemon-item__background,
.pokemon-item[data-sprite-fit='sprite'] .pokemon-item__image {
  transform: translate(calc(50% - var(--pokemon-sprite-x)), calc(50% - var(--pokemon-sprite-y))) scale(var(--pokemon-image-scale));
  transform-origin: var(--pokemon-sprite-x) var(--pokemon-sprite-y);
}

.pokemon-item[data-background-state='ready'][data-sprite-fit='sprite'] .pokemon-item__image {
  transform: translate(calc(50% - var(--pokemon-sprite-x)), calc(100% - var(--pokemon-item-radius) - var(--pokemon-sprite-y) - (var(--pokemon-current-image-padding) + (var(--pokemon-sprite-bottom) / 100%) * (100% - 2 * var(--pokemon-current-image-padding)) - var(--pokemon-sprite-y)) * var(--pokemon-image-scale))) scale(var(--pokemon-image-scale));
  transform-origin: var(--pokemon-sprite-x) var(--pokemon-sprite-y);
}

.pokemon-item[data-image-state='pending'] .pokemon-item__media {
  background: var(--pokemon-fallback-background);
}

.pokemon-item[data-image-state='pending'] .pokemon-item__image,
.pokemon-item[data-background-state='pending'] .pokemon-item__background {
  opacity: 0;
}

.pokemon-item__fallback {
  z-index: var(--pokemon-layer-image);
  display: grid;
  width: var(--pokemon-fallback-size);
  aspect-ratio: 1;
  place-items: center;
  color: var(--pokemon-metadata-color);
  background: var(--pokemon-fallback-background);
  border-radius: 50%;
  font-size: var(--font-size-control-lg);
  font-weight: var(--font-weight-control);
}

.pokemon-item__loading {
  z-index: var(--pokemon-layer-status);
  width: var(--loading-size-medium);
  aspect-ratio: 1;
  border: var(--loading-indicator-width) solid var(--pokemon-fallback-background);
  border-top-color: var(--pokemon-selected-border-color);
  border-radius: 50%;
  animation: pokemon-item-spin var(--duration-loading) linear infinite;
}

.pokemon-item__badge-stack {
  z-index: var(--pokemon-layer-selection);
  display: flex;
  flex-direction: column;
  gap: 2px;
  pointer-events: none;
}

.pokemon-item__badge-stack--leading {
  top: 6px;
  left: 6px;
}

.pokemon-item__badge-stack--trailing {
  top: 6px;
  right: 6px;
}

.pokemon-item__badge-stack--bottom {
  right: 6px;
  bottom: 6px;
}

.pokemon-item__top-badge {
  z-index: var(--pokemon-layer-selection);
  top: 4px;
  left: 50%;
  width: clamp(30px, 46%, 58px);
  height: auto;
  transform: translateX(-50%);
  pointer-events: none;
}

.pokemon-item__top-badge > * {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.pokemon-item__badge-icon {
  flex: 0 0 20px;
  display: block;
  min-width: 20px;
  width: 20px;
  max-width: 20px;
  height: 20px;
  max-height: 20px;
  object-fit: contain;
  pointer-events: none;
}

.pokemon-item__selection {
  z-index: var(--pokemon-layer-selection);
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.pokemon-item__selection > * {
  display: block;
  width: 100%;
  height: 100%;
}

.pokemon-item__unavailable {
  z-index: var(--pokemon-layer-status);
  right: var(--pokemon-check-offset);
  bottom: var(--pokemon-check-offset);
  max-width: calc(100% - (var(--pokemon-check-offset) * 2));
  padding: var(--space-1) var(--space-2);
  overflow: hidden;
  color: var(--pokemon-unavailable-label-color);
  background: var(--pokemon-unavailable-label-background);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-control-sm);
  font-weight: var(--font-weight-control);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pokemon-item__details {
  display: grid;
  min-width: 0;
  gap: var(--space-1);
  padding-inline: var(--space-1);
}

.pokemon-item__text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pokemon-item__number {
  color: var(--pokemon-metadata-color);
  font-size: var(--font-size-control-sm);
}

.pokemon-item__metadata {
  color: var(--pokemon-metadata-color);
  font-size: var(--font-size-control-sm);
}

.pokemon-item__metadata-input {
  width: 100%;
  min-width: 0;
  height: var(--control-height-sm);
  padding-inline: var(--space-1);
  border: var(--control-border-width) solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text-primary);
  font: inherit;
  text-align: center;
}

.pokemon-item__metadata-input:focus-visible {
  outline: var(--control-focus-width) solid var(--color-control-focus);
  outline-offset: var(--control-focus-offset);
}

.pokemon-item__metadata-input[aria-invalid='true'] {
  border-color: var(--color-control-danger);
}

.pokemon-item__name {
  color: var(--pokemon-name-color);
  font-size: var(--font-size-control-md);
  font-weight: var(--font-weight-control);
}

.pokemon-item__badges {
  display: flex;
  min-width: 0;
  gap: var(--space-1);
  overflow: hidden;
}

.pokemon-item__badge {
  min-width: 0;
  padding: var(--space-1) var(--space-2);
  overflow: hidden;
  color: var(--pokemon-badge-color);
  background: var(--pokemon-badge-background);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-control-sm);
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (hover: hover) and (pointer: fine) {
  button.pokemon-item:not(:disabled):not([data-unavailable='true']):not([data-selected='true']):hover {
    border-color: var(--pokemon-hover-border-color);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pokemon-item__image,
  .pokemon-item__background {
    transition: none;
  }
}

@keyframes pokemon-item-spin {
  to {
    rotate: 1turn;
  }
}

/* === /app/styles/components/pokemon-grid.css === */
.pokemon-grid {
  width: 100%;
  min-width: 0;
  container-type: inline-size;
  container-name: pokemon-grid;
}

.pokemon-grid__items {
  --pokemon-grid-current-gap: var(--pokemon-grid-gap-medium);
  --pokemon-grid-current-columns: var(--pokemon-grid-columns-medium);
  display: grid;
  align-content: start;
  grid-template-columns: repeat(var(--pokemon-grid-current-columns), minmax(0, 1fr));
  width: 100%;
  min-width: 0;
  gap: var(--pokemon-grid-current-gap);
  transition: gap var(--pokemon-grid-transition);
}

.pokemon-grid[data-layout='large'] .pokemon-grid__items {
  --pokemon-grid-current-columns: var(--pokemon-grid-columns-large);
}

.pokemon-grid[data-layout='small'] .pokemon-grid__items {
  --pokemon-grid-current-columns: var(--pokemon-grid-columns-small);
}

@container pokemon-grid (min-width: 640px) {
  .pokemon-grid[data-layout='large'] .pokemon-grid__items {
    --pokemon-grid-current-columns: var(--pokemon-grid-wide-columns-large);
  }

  .pokemon-grid[data-layout='medium'] .pokemon-grid__items {
    --pokemon-grid-current-columns: var(--pokemon-grid-wide-columns-medium);
  }

  .pokemon-grid[data-layout='small'] .pokemon-grid__items {
    --pokemon-grid-current-columns: var(--pokemon-grid-wide-columns-small);
  }
}

.pokemon-grid[data-gap='small'] .pokemon-grid__items {
  --pokemon-grid-current-gap: var(--pokemon-grid-gap-small);
}

.pokemon-grid[data-gap='large'] .pokemon-grid__items {
  --pokemon-grid-current-gap: var(--pokemon-grid-gap-large);
}

.pokemon-grid__items[hidden] {
  display: none;
}

.pokemon-grid__cell {
  width: 100%;
  min-width: min(100%, var(--pokemon-grid-item-min-width));
  justify-self: center;
}

.pokemon-grid__sentinel {
  grid-column: 1 / -1;
  width: 100%;
  height: var(--pokemon-grid-sentinel-size);
  pointer-events: none;
}

.pokemon-grid__sentinel[hidden] {
  display: none;
}

.pokemon-grid > .loading-state {
  min-height: var(--pokemon-grid-loading-min-height);
}

.pokemon-grid > .empty-state {
  min-height: var(--pokemon-grid-empty-min-height);
}

@container (min-width: 640px) {
  .pokemon-grid__items {
    box-sizing: border-box;
    padding-inline: var(--page-padding-inline);
  }
}

/* === /app/styles/components/swipe-hint.css === */
.swipe-hint-host {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.swipe-hint-host > .trade-card__pokemon-scroll,
.swipe-hint-host > .home-best-matches__pokemon-scroll,
.swipe-hint-host > .profile-my-matches__pokemon-scroll {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 0;
}

.trade-card[data-presentation='share'] .swipe-hint-host,
.trade-card--export .swipe-hint-host,
.trade-card--collection-share .swipe-hint-host,
.create-trade-export-canvas .swipe-hint-host {
  display: contents;
}

.swipe-hint {
  position: absolute;
  inset-inline-end: 8px;
  inset-block-start: 50%;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 3px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, #1c1c1e 78%, transparent);
  color: var(--color-control-on-primary);
  font-size: 12px;
  font-weight: var(--font-weight-control);
  line-height: 1.2;
  pointer-events: none;
  user-select: none;
  transform: translateY(-50%);
  opacity: 1;
  transition: opacity var(--duration-standard) ease;
}

:root[data-theme='dark'] .swipe-hint {
  background: color-mix(in srgb, #000000 64%, transparent);
  color: var(--color-control-on-primary);
  box-shadow: 0 0 0 1px color-mix(in srgb, #ffffff 22%, transparent);
}

.swipe-hint__icon {
  display: inline-flex;
  width: 12px;
  height: 12px;
  animation: swipe-hint-nudge 1.2s ease-in-out infinite;
}

.swipe-hint__icon svg {
  display: block;
  width: 12px;
  height: 12px;
}

.swipe-hint--out {
  opacity: 0;
}

.trade-card--export .swipe-hint,
.trade-card--collection-share .swipe-hint,
.trade-card[data-presentation='share'] .swipe-hint,
.create-trade-export-canvas .swipe-hint {
  display: none !important;
}

@keyframes swipe-hint-nudge {
  0%,
  100% {
    transform: translateX(0);
  }

  50% {
    transform: translateX(3px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .swipe-hint {
    transition: none;
  }

  .swipe-hint__icon {
    animation: none;
  }
}

/* === /app/styles/components/trade-card.css === */
.trade-card {
  --trade-card-wanted-color: #ff3fd7;
  --trade-card-offered-color: #18d7ff;
  --trade-card-wanted-title-color: #b0158f;
  --trade-card-offered-title-color: #0a7a96;
  /* In-app panels: surface base + 7% tint; share presentation overrides below. */
  --trade-card-wanted-background: color-mix(in srgb, var(--trade-card-wanted-color) 7%, var(--color-surface));
  --trade-card-offered-background: color-mix(in srgb, var(--trade-card-offered-color) 7%, var(--color-surface));
  --trade-card-wanted-border: color-mix(in srgb, var(--trade-card-wanted-color) 36%, var(--color-border));
  --trade-card-offered-border: color-mix(in srgb, var(--trade-card-offered-color) 36%, var(--color-border));
  --trade-card-item-size-m: 84.96px;
  --trade-card-item-size: var(--trade-card-item-size-m);
  --trade-card-item-size-l: 108px;
  --trade-card-item-scale-s: 0.786666667;
  --trade-card-list-gap: 0px;
  --trade-card-list-padding: 6px;
  --trade-card-item-image-padding: 5px;
  --trade-card-note-size: 11px;
  --trade-card-panel-gap: 0;
  --trade-card-panel-radius: 0;
  --trade-card-column-title-font-size: 14px;
  --trade-card-column-title-line-height: 1.1;
  --trade-card-column-title-margin-block-end: 2px;
  --trade-card-column-title-padding-inline-start: 2px;
  --trade-card-header-inline-inset: 2px;
  /* Compact feed/profile trade-card avatar (not profile identity lg). */
  --trade-card-avatar-size: 36px;
  --trade-card-header-height: 36px;
  --trade-card-header-padding-block: 0;
  --trade-card-header-gap: var(--space-3);
  --trade-card-trainer-gap: var(--space-2);
  --trade-card-trainer-line-gap: var(--space-1);
  --trade-card-country-flag-width: 19px;
  --trade-card-country-flag-height: 14px;
  --trade-card-button-height: 34px;
  --trade-card-flight-height: 28px;
  --trade-card-toggle-width: 92px;
  --trade-card-toggle-height: 30px;
  --trade-card-toggle-thumb-size: 22px;
  --trade-card-action-height: 34px;
  --trade-card-metadata-input-height: 27px;
  --trade-card-metadata-input-inline-inset: 4px;
  display: grid;
  width: 100%;
  min-width: 0;
  /* Keep WANTED / FOR TRADE clear of header avatar + presence overlay. */
  gap: 8px;
  padding: 8px 0;
  border-block-start: 1px solid var(--color-border);
  color: var(--color-text-primary);
}

.trade-card[data-layout='l'] {
  --trade-card-item-size: var(--trade-card-item-size-l);
}

.trade-card[data-layout='s'] {
  --trade-card-item-size: calc(var(--trade-card-item-size-m) * var(--trade-card-item-scale-s));
}

.trade-card__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: var(--trade-card-header-gap);
  box-sizing: border-box;
  min-height: var(--trade-card-header-height);
  height: var(--trade-card-header-height);
  min-width: 0;
  padding-block: var(--trade-card-header-padding-block);
  padding-inline: var(--trade-card-header-inline-inset);
  /* Avatar/presence may paint slightly outside the circle; do not cover titles. */
  overflow: visible;
  isolation: isolate;
}

.trade-card__header[data-has-publication-control='true'] {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.trade-card__header[data-has-note-control='true'] {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.trade-card__note-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  grid-column: 2;
  grid-row: 1;
  height: var(--trade-card-toggle-height);
  min-height: var(--trade-card-toggle-height);
  margin: 0;
  padding: 0 12px;
  border: var(--control-border-width) solid color-mix(in srgb, var(--color-border) 86%, var(--color-text-secondary));
  border-radius: 999px;
  background: var(--color-control-secondary);
  color: var(--color-text-primary);
  font: inherit;
  font-size: var(--font-size-control-sm);
  font-weight: var(--font-weight-control);
  white-space: nowrap;
  cursor: pointer;
}

.trade-card__note-toggle[aria-pressed='true'] {
  border-color: var(--color-control-primary);
  background: var(--color-control-selected);
  color: var(--color-control-primary);
}

.trade-card__note-toggle:disabled {
  opacity: var(--control-disabled-opacity);
  cursor: default;
}

.trade-card__note-toggle[hidden] {
  display: none;
}

.trade-card__header[data-has-note-control='true'] .trade-card__publication-toggle {
  grid-column: 3;
}

.trade-card__publication-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  grid-column: 2;
  grid-row: 1;
  justify-content: flex-end;
  width: var(--trade-card-toggle-width);
  min-width: var(--trade-card-toggle-width);
  height: var(--trade-card-toggle-height);
  min-height: var(--trade-card-toggle-height);
  padding: 0 10px 0 calc(var(--trade-card-toggle-thumb-size) + 10px);
  border: var(--control-border-width) solid color-mix(in srgb, var(--color-border) 86%, var(--color-text-secondary));
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-control-secondary) 84%, var(--color-surface));
  color: var(--color-text-secondary);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: background-color var(--duration-standard), border-color var(--duration-standard), color var(--duration-standard), opacity var(--duration-standard);
}

.trade-card__publication-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trade-card__publication-toggle::before {
  position: absolute;
  top: 50%;
  left: 4px;
  width: var(--trade-card-toggle-thumb-size);
  height: var(--trade-card-toggle-thumb-size);
  border-radius: 50%;
  background: var(--color-surface);
  box-shadow: 0 1px 3px color-mix(in srgb, #000000 26%, transparent);
  content: '';
  transform: translateY(-50%);
  transition: left var(--duration-standard), background-color var(--duration-standard), box-shadow var(--duration-standard);
}

.trade-card__publication-toggle[data-state='active'] {
  border-color: var(--color-control-primary);
  background: var(--color-control-selected);
  color: var(--color-control-primary);
  justify-content: flex-start;
  padding: 0 calc(var(--trade-card-toggle-thumb-size) + 10px) 0 10px;
}

.trade-card__publication-toggle[data-state='active']::before {
  left: calc(100% - var(--trade-card-toggle-thumb-size) - 4px);
  background: var(--color-control-primary);
}

.trade-card__publication-toggle:focus-visible {
  outline: var(--control-focus-width) solid var(--color-control-focus);
  outline-offset: var(--control-focus-offset);
}

.trade-card__publication-toggle:disabled {
  opacity: var(--control-disabled-opacity);
  cursor: default;
}

.trade-card__publication-toggle[hidden] {
  display: none;
}

.trade-card__trainer {
  display: flex;
  align-items: center;
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  gap: var(--trade-card-trainer-gap);
}

.trade-card__trainer[hidden],
.trade-card__share-heading[hidden],
.trade-card__share-brand[hidden],
.trade-card__flight[hidden] {
  display: none;
}

.trade-card__avatar {
  /* Visuals come from .trainer-avatar; pin compact size in trade-card context. */
  box-sizing: border-box;
  flex: 0 0 var(--trade-card-avatar-size);
  width: var(--trade-card-avatar-size);
  height: var(--trade-card-avatar-size);
  min-width: var(--trade-card-avatar-size);
  min-height: var(--trade-card-avatar-size);
  max-width: var(--trade-card-avatar-size);
  max-height: var(--trade-card-avatar-size);
}

.trade-card__avatar.trainer-avatar {
  width: var(--trade-card-avatar-size);
  height: var(--trade-card-avatar-size);
}

.trade-card__avatar .trainer-avatar__image {
  object-fit: contain;
}

/* Presence is absolute overlay only — must not expand header layout. */
.trade-card__avatar .presence-dot {
  position: absolute;
  inset-block-end: 0;
  inset-inline-end: 0;
  z-index: 2;
  pointer-events: none;
}

.trade-card__profile {
  display: inline-flex;
  align-items: center;
  flex: 1 1 auto;
  gap: var(--trade-card-trainer-gap);
  min-width: 0;
  max-width: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: pointer;
}

.trade-card__profile:disabled {
  cursor: default;
}

.trade-card__profile:focus-visible {
  outline: var(--control-focus-width) solid var(--color-control-focus);
  outline-offset: var(--control-focus-offset);
  border-radius: var(--radius-sm);
}

.trade-card__trainer-meta {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  min-width: 0;
}

.trade-card__trainer-line {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: var(--trade-card-trainer-line-gap);
  min-width: 0;
  max-width: 100%;
}

.trade-card__trainer-extras {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: var(--trade-card-trainer-line-gap);
  min-width: 0;
}

.trade-card__username {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--color-text-primary);
  font-size: var(--font-size-control-md);
  font-weight: 650;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trade-card__country-flag {
  flex: 0 0 auto;
  width: var(--trade-card-country-flag-width);
  height: var(--trade-card-country-flag-height);
  border-radius: 2px;
  object-fit: cover;
}

.trade-card__country-flag[hidden] {
  display: none;
}

.trade-card__flight-icon {
  flex: 0 0 auto;
  width: 50px;
  max-width: 50px;
  height: var(--trade-card-flight-height);
  aspect-ratio: 2 / 1;
  object-fit: contain;
}

.trade-card__trainer-line .premium-mark__image {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  object-fit: contain;
}

.trade-card__flight {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.trade-card__flight-label {
  display: none;
  font-size: var(--font-size-control-sm);
  font-weight: 800;
  line-height: 1;
}

.trade-card__flight-icon[hidden] {
  display: none;
}

.trade-card__trade-button.button {
  --button-background: #20bd5a;
  --button-background-hover: #18aa4e;
  --button-background-active: #139343;
  --button-foreground: #ffffff;
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  width: auto;
  height: var(--trade-card-button-height);
  min-width: 0;
  min-height: var(--trade-card-button-height);
  padding-inline: 14px;
  flex: 0 0 auto;
}

.trade-card__header[data-has-publication-control='true'] .trade-card__trade-button.button {
  grid-column: 3;
}

.trade-card__trade-button .button__icon,
.trade-card__button-icon {
  object-fit: contain;
  filter: invert(1);
}

.trade-card__content {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--trade-card-panel-gap);
  min-width: 0;
}

.trade-card__column {
  display: grid;
  min-width: 0;
  grid-template-rows: auto 1fr;
}

.trade-card__column--wanted {
  --trade-card-panel-background: var(--trade-card-wanted-background);
  --trade-card-panel-border: var(--trade-card-wanted-border);
  --trade-card-panel-border-radius: var(--trade-card-panel-radius) 0 0 var(--trade-card-panel-radius);
}

.trade-card__column--offered {
  --trade-card-panel-background: var(--trade-card-offered-background);
  --trade-card-panel-border: var(--trade-card-offered-border);
  --trade-card-panel-border-radius: 0 var(--trade-card-panel-radius) var(--trade-card-panel-radius) 0;
}

.trade-card__column-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  margin: 0 0 var(--trade-card-column-title-margin-block-end);
  padding: 0 0 0 var(--trade-card-column-title-padding-inline-start);
  font-size: var(--trade-card-column-title-font-size);
  font-weight: 800;
  letter-spacing: 0;
  line-height: var(--trade-card-column-title-line-height);
  text-transform: uppercase;
  white-space: nowrap;
}

.trade-card__column-title-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trade-card__column-title-count {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: inherit;
  text-transform: none;
  color: var(--color-text-secondary);
}

.trade-card__column-title--wanted {
  color: var(--trade-card-wanted-title-color);
}

.trade-card__column-title--offered {
  color: var(--trade-card-offered-title-color);
  /* Center label in the gap between wanted and offered frames. */
  margin-block: 6px;
}

:root[data-theme='dark'] .trade-card {
  --trade-card-wanted-title-color: #ff3fd7;
  --trade-card-offered-title-color: #18d7ff;
  --trade-card-wanted-background: color-mix(in srgb, var(--trade-card-wanted-color) 8%, var(--color-surface));
  --trade-card-offered-background: color-mix(in srgb, var(--trade-card-offered-color) 8%, var(--color-surface));
  --trade-card-wanted-border: color-mix(in srgb, var(--trade-card-wanted-color) 40%, var(--color-border));
  --trade-card-offered-border: color-mix(in srgb, var(--trade-card-offered-color) 40%, var(--color-border));
}

.trade-card__pokemon-scroll {
  min-width: 0;
  border: 1px solid var(--trade-card-panel-border);
  border-radius: var(--trade-card-panel-border-radius);
  background: var(--trade-card-panel-background);
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  scroll-padding-inline: var(--trade-card-list-padding);
  touch-action: pan-y;
  cursor: default;
  scrollbar-color: color-mix(in srgb, var(--color-text-secondary) 34%, transparent) transparent;
  scrollbar-width: thin;
  user-select: none;
  -webkit-user-select: none;
}

/* Overflowing rails: show scrollbar + allow grab / pan. */
.trade-card__pokemon-scroll[data-can-scroll='true'] {
  overflow-x: auto;
  scrollbar-width: thin;
  cursor: grab;
  touch-action: pan-x pan-y;
}

/* No overflow → hide scrollbar and lock horizontal pan. */
.trade-card__pokemon-scroll[data-can-scroll='false'] {
  overflow-x: hidden;
  scrollbar-width: none;
  cursor: default;
  touch-action: pan-y;
}

.trade-card__pokemon-scroll[data-can-scroll='false']::-webkit-scrollbar {
  height: 0;
}

.trade-card__pokemon-scroll[data-dragging='true'] {
  cursor: grabbing;
}

.trade-card__pokemon-scroll * {
  user-select: none;
  -webkit-user-select: none;
}

.trade-card[data-mode='edit'] .trade-card__pokemon-scroll,
.trade-card[data-mode='edit'] .trade-card__pokemon-scroll * {
  user-select: text;
  -webkit-user-select: text;
}

.trade-card__pokemon-scroll img {
  pointer-events: none;
  user-drag: none;
  -webkit-user-drag: none;
}

.trade-card__pokemon-scroll::-webkit-scrollbar {
  height: 4px;
}

.trade-card__pokemon-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.trade-card__pokemon-scroll::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-text-secondary) 30%, transparent);
}

.trade-card__pokemon-scroll::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--color-text-secondary) 42%, transparent);
}

.trade-card__pokemon-scroll:focus-visible {
  outline: var(--control-focus-width) solid var(--color-control-focus);
  outline-offset: calc(var(--control-focus-offset) * -1);
}

.trade-card__pokemon-list {
  display: grid;
  grid-auto-flow: row;
  grid-template-columns: repeat(auto-fill, var(--trade-card-item-size));
  grid-template-rows: none;
  align-items: start;
  width: 100%;
  min-width: calc(10 * var(--trade-card-item-size) + 9 * var(--trade-card-list-gap) + 2 * var(--trade-card-list-padding));
  padding: var(--trade-card-list-padding);
  gap: var(--trade-card-list-gap);
}

/* Size list to real column count so empty rails do not create fake horizontal scroll.
   Desktop: data-desktop-fit (single row). Mobile: data-mobile-fit / data-mobile-balanced. */
.trade-card:not([data-presentation='share']) .trade-card__pokemon-list[data-desktop-fit='true'],
.trade-card:not([data-presentation='share']) .trade-card__pokemon-list[data-mobile-balanced='true'],
.trade-card:not([data-presentation='share']) .trade-card__pokemon-list[data-mobile-fit='true'] {
  grid-template-columns: repeat(var(--trade-card-list-cols), var(--trade-card-item-size));
  min-width: calc(
    (var(--trade-card-list-cols) * var(--trade-card-item-size))
    + ((var(--trade-card-list-cols) - 1) * var(--trade-card-list-gap))
    + (2 * var(--trade-card-list-padding))
  );
}

.trade-card__pokemon-cell {
  position: relative;
  width: var(--trade-card-item-size);
  min-width: 0;
  max-width: var(--trade-card-item-size);
}

.trade-card__pokemon-cell--overflow {
  display: grid;
  place-items: center;
  align-self: start;
  width: var(--trade-card-item-size);
  min-width: 0;
  max-width: var(--trade-card-item-size);
}

.trade-card__overflow {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 100%;
  aspect-ratio: 1 / 1;
  color: var(--color-text-secondary);
  font-size: var(--font-size-control-md);
  font-weight: var(--font-weight-control);
  border: var(--control-border-width) dashed var(--color-border);
  border-radius: var(--pokemon-item-radius, var(--radius-control));
  background: var(--color-surface);
}

.trade-card__pokemon-cell--add {
  align-self: start;
  width: var(--trade-card-item-size);
  height: var(--trade-card-item-size);
  max-width: var(--trade-card-item-size);
}

.trade-card__pokemon-cell .pokemon-item {
  --pokemon-image-scale: 1.30;
  --pokemon-item-radius: var(--pokemon-selection-border-width);
  --pokemon-current-image-padding: var(--trade-card-item-image-padding);
  --pokemon-item-gap: 4px;
  --pokemon-media-background: transparent;
  --pokemon-media-aspect-ratio: 1 / 1;
  width: 100%;
  min-width: 0;
}

/* Preview taps: no selected/hover/focus chrome on feed tiles. */
.trade-card:not([data-mode='edit']) .trade-card__pokemon-cell .pokemon-item {
  -webkit-tap-highlight-color: transparent;
}

.trade-card:not([data-mode='edit']) .trade-card__pokemon-cell .pokemon-item[data-selected='true'],
.trade-card:not([data-mode='edit']) .trade-card__pokemon-cell .pokemon-item:active {
  border-color: transparent;
}

.trade-card:not([data-mode='edit']) .trade-card__pokemon-cell .pokemon-item:focus,
.trade-card:not([data-mode='edit']) .trade-card__pokemon-cell .pokemon-item:focus-visible {
  outline: none;
  border-color: transparent;
  box-shadow: none;
}

.trade-card:not([data-mode='edit']) .trade-card__pokemon-cell .pokemon-item__selection {
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  .trade-card:not([data-mode='edit']) .trade-card__pokemon-cell button.pokemon-item:not(:disabled):hover,
  .trade-card:not([data-mode='edit']) .trade-card__pokemon-cell button.pokemon-item:not(:disabled):not([data-unavailable='true']):not([data-selected='true']):hover {
    border-color: transparent;
  }
}


.trade-card__pokemon-cell .pokemon-item__media {
  aspect-ratio: 1 / 1;
  width: 100%;
}

.trade-card:not([data-presentation='share']) .trade-card__pokemon-list .pokemon-item__image {
  inset: 0;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.trade-card:not([data-presentation='share']) .trade-card__pokemon-list .pokemon-item[data-background-state='empty'] .pokemon-item__image {
  padding: 0;
}

.trade-card__pokemon-cell .pokemon-item__details {
  padding-inline: 0;
  text-align: center;
}

.trade-card__pokemon-cell .pokemon-item__metadata {
  color: var(--color-text-primary);
  font-size: var(--trade-card-note-size);
  font-weight: var(--font-weight-control);
  line-height: 1.15;
}

.trade-card__pokemon-cell .pokemon-item__metadata-input {
  display: block;
  box-sizing: border-box;
  width: calc(100% - (var(--trade-card-metadata-input-inline-inset) * 2));
  max-width: calc(100% - (var(--trade-card-metadata-input-inline-inset) * 2));
  height: var(--trade-card-metadata-input-height);
  min-height: var(--trade-card-metadata-input-height);
  margin-inline: auto;
  padding-inline: var(--space-2);
  border-width: var(--control-border-width);
  border-radius: var(--radius-sm);
  font-size: var(--trade-card-note-size);
  line-height: 1;
  text-align: center;
}

.trade-card[data-mode='edit'] .trade-card__pokemon-cell .pokemon-item__metadata-input {
  /* ≥16px prevents iOS Safari auto-zoom on focus */
  font-size: 16px;
  width: 100%;
  max-width: 100%;
  height: calc(var(--trade-card-item-size) * 0.34);
  min-height: 0;
  padding-inline: var(--space-1);
  outline: none;
  box-shadow: none;
}

.trade-card[data-mode='edit'] .trade-card__pokemon-cell .pokemon-item__metadata-input:focus,
.trade-card[data-mode='edit'] .trade-card__pokemon-cell .pokemon-item__metadata-input:focus-visible {
  outline: none;
  box-shadow: none;
}

.trade-card__remove-pokemon.icon-button {
  position: absolute;
  z-index: var(--pokemon-layer-selection);
  top: 0;
  right: 0;
  width: calc(var(--touch-target-size) - var(--space-3));
  height: calc(var(--touch-target-size) - var(--space-3));
  border-radius: 50%;
  background: var(--color-control-danger);
  color: var(--color-control-on-danger);
}

.trade-card__remove-pokemon .icon-button__icon {
  width: var(--font-size-control-lg);
  height: var(--font-size-control-lg);
}

.trade-card__add-pokemon.icon-button {
  width: var(--trade-card-item-size);
  height: var(--trade-card-item-size);
  min-width: var(--trade-card-item-size);
  min-height: var(--trade-card-item-size);
  max-width: var(--trade-card-item-size);
  max-height: var(--trade-card-item-size);
  border: var(--control-border-width) dashed var(--color-control-primary);
  color: var(--color-control-primary);
}

.trade-card__feedback {
  margin: 0;
  padding-inline: var(--page-padding-inline);
  color: var(--color-control-danger);
  font-size: var(--font-size-control-sm);
  font-weight: var(--font-weight-control);
}

.trade-card__feedback[hidden] {
  display: none;
}

.trade-card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  width: 100%;
  padding-inline: var(--page-padding-inline);
}

.trade-card__actions[hidden] {
  display: none;
}

.trade-card__action.button {
  flex: 1 1 calc((100% - (var(--trade-card-action-count, 3) - 1) * var(--space-2)) / var(--trade-card-action-count, 3));
  width: auto;
  max-width: 100%;
  height: var(--trade-card-action-height);
  min-height: var(--trade-card-action-height);
  min-width: 0;
  padding-inline: var(--space-1);
  overflow: hidden;
}

.trade-card__action .button__content {
  min-width: 0;
  max-width: 100%;
}

.trade-card__action .button__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trade-card[data-presentation='share'] {
  --share-blue: #1d8fb8;
  --share-panel: #ffffff;
  --share-panel-wanted: #ffffff;
  --share-panel-offered: #ffffff;
  --share-title-bar: #d7f3fb;
  --share-cell: 100px;
  --share-gap: 2px;
  --share-columns: 5;
  --share-inline-pad: 10px;
  --trade-card-wanted-color: #1d5fa8;
  --trade-card-offered-color: #1d5fa8;
  --trade-card-wanted-background: var(--share-panel-wanted);
  --trade-card-offered-background: var(--share-panel-offered);
  --trade-card-wanted-border: transparent;
  --trade-card-offered-border: transparent;
  position: relative;
  isolation: isolate;
  box-sizing: border-box;
  width: 560px;
  max-width: 100%;
  min-height: 0;
  align-content: start;
  gap: 8px;
  padding: 10px;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background-color: #00a8d5;
  background-image: linear-gradient(120deg, #00a8d5 0%, #37edff 100%);
  color: #fff;
}

.trade-card[data-presentation='share']::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    -32deg,
    rgba(255, 255, 255, 0.1) 0 10px,
    rgba(255, 255, 255, 0) 10px 20px
  );
  opacity: 0.45;
}

.trade-card[data-presentation='share'] .trade-card__header {
  position: relative;
  z-index: 1;
  display: grid;
  width: 100%;
  height: auto;
  min-height: 0;
  padding: 0;
  box-sizing: border-box;
}

.trade-card__share-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "legend title mark";
  align-items: center;
  column-gap: 8px;
  row-gap: 0;
  width: 100%;
  min-width: 0;
}

.trade-card__share-copy {
  grid-area: title;
  width: 100%;
  min-width: 0;
  display: grid;
  justify-items: center;
  align-content: center;
}

.trade-card__share-flight-slot {
  grid-area: legend;
  justify-self: start;
  min-width: 0;
}

.trade-card__share-flight {
  display: none;
}

.trade-card__share-flight[hidden] {
  display: none;
}

.trade-card__share-legend {
  display: flex;
  align-items: center;
  gap: 10px;
}

.trade-card__share-legend[hidden] {
  display: none;
}

.trade-card__share-legend-item {
  display: grid;
  justify-items: center;
  gap: 3px;
  min-width: 0;
}

.trade-card__share-legend-item[hidden] {
  display: none !important;
}

.trade-card__share-legend-icon {
  display: block;
  width: 110px;
  height: 70px;
  object-fit: contain;
}

.trade-card__share-legend-item--can .trade-card__share-legend-icon {
  width: 89px;
  height: 70px;
}

.trade-card__share-legend-item--cant .trade-card__share-legend-icon {
  width: 110px;
  height: 70px;
}

.trade-card__share-legend-label {
  display: none;
}

.trade-card__share-title {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: #fff;
  font-family: Nunito, Inter, "Inter Fallback", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trade-card__share-subtitle {
  max-width: 100%;
  min-width: 0;
  margin: 2px 0 0;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.85);
  font-family: Inter, "Inter Fallback", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trade-card__share-mark {
  grid-area: mark;
  justify-self: end;
  display: grid;
  justify-items: center;
  gap: 4px;
  min-width: 0;
}

.trade-card__share-logo {
  display: block;
  width: 56px;
  height: 56px;
  border-radius: 0;
  background: transparent;
  object-fit: contain;
  flex: 0 0 auto;
}

.trade-card__share-domain {
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
}

.trade-card[data-presentation='share'] .trade-card__content {
  position: relative;
  z-index: 1;
  display: grid;
  width: 100%;
  grid-template-columns: minmax(0, 1fr);
  justify-items: stretch;
  gap: 8px;
}

.trade-card[data-presentation='share'] .trade-card__column {
  position: relative;
  z-index: 1;
  display: grid;
  width: 100%;
  grid-template-rows: auto auto;
  justify-items: stretch;
  gap: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 14px;
  background-color: transparent;
  background-image: none;
}

.trade-card[data-presentation='share'] .trade-card__column--wanted,
.trade-card[data-presentation='share'] .trade-card__column--offered {
  background-color: transparent;
  background-image: none;
}

.trade-card[data-presentation='share'] .trade-card__column-title {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin: 0;
  padding: 8px 12px;
  border-radius: 14px 14px 0 0;
  background-color: var(--share-title-bar);
  background-image: none;
  color: var(--share-blue);
  font-family: Nunito, Inter, "Inter Fallback", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.1;
  text-transform: none;
}

.trade-card[data-presentation='share'] .trade-card__column-title-count {
  display: none;
}

.trade-card[data-presentation='share'] .trade-card__column-title--wanted,
.trade-card[data-presentation='share'] .trade-card__column-title--offered {
  color: var(--share-blue);
}

.trade-card[data-presentation='share'] .trade-card__pokemon-scroll {
  border: 0;
  border-radius: 0 0 14px 14px;
  background-color: #ffffff;
  background-image: none;
  overflow: visible;
  cursor: default;
  padding: 6px 8px 10px;
}

.trade-card[data-presentation='share'] .trade-card__column--wanted .trade-card__pokemon-scroll,
.trade-card[data-presentation='share'] .trade-card__column--offered .trade-card__pokemon-scroll {
  border-inline-start: 0;
  background-color: #ffffff;
  background-image: none;
}

.trade-card[data-presentation='share'] .trade-card__pokemon-list {
  width: 100%;
  max-width: none;
  min-width: 0;
  padding: 0;
  grid-auto-columns: var(--share-cell);
  grid-auto-flow: row;
  grid-template-columns: repeat(var(--share-columns), minmax(0, 1fr));
  grid-template-rows: none;
  grid-auto-rows: auto;
  justify-content: center;
  gap: var(--share-gap);
}

.trade-card[data-presentation='share'] .trade-card__pokemon-cell {
  width: auto;
  height: auto;
  max-width: none;
  aspect-ratio: 1;
}

.trade-card[data-presentation='share'] .trade-card__pokemon-cell .pokemon-item,
.trade-card[data-presentation='share'] .trade-card__pokemon-cell .pokemon-item__media {
  width: 100%;
  height: 100%;
}

.trade-card[data-presentation='share'] .trade-card__pokemon-cell .pokemon-item__media {
  border-radius: 12px;
  overflow: hidden;
  background-color: #ffffff;
  background-image: none;
  box-shadow: none;
}

.trade-card[data-presentation='share'] .pokemon-item[data-background-state='empty'] .pokemon-item__image {
  inset: 0;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  padding: 6%;
  object-fit: contain;
}









/* Share badges: same corners as JPG export (cell-relative). */
.trade-card[data-presentation='share'] .trade-card__pokemon-cell .pokemon-item__media {
  overflow: visible;
}

.trade-card[data-presentation='share'] .pokemon-item__background,
.trade-card[data-presentation='share'] .pokemon-item__image,
.trade-card[data-presentation='share'] .pokemon-item__fallback {
  border-radius: inherit;
}

.trade-card[data-presentation='share'] .pokemon-item__badge-stack {
  gap: calc(var(--share-cell) * 0.02);
}

.trade-card[data-presentation='share'] .pokemon-item__badge-stack--leading {
  top: calc(var(--share-cell) * 0.05);
  right: auto;
  bottom: auto;
  left: calc(var(--share-cell) * 0.05);
  align-items: flex-start;
}

.trade-card[data-presentation='share'] .pokemon-item__badge-stack--trailing {
  top: calc(var(--share-cell) * 0.05);
  right: calc(var(--share-cell) * 0.05);
  bottom: auto;
  left: auto;
  align-items: flex-end;
}

.trade-card[data-presentation='share'] .pokemon-item__badge-stack--bottom {
  top: auto;
  right: calc(var(--share-cell) * 0.05);
  bottom: calc(var(--share-cell) * 0.05);
  left: auto;
  align-items: flex-end;
}

.trade-card[data-presentation='share'] .pokemon-item__top-badge {
  top: calc(var(--share-cell) * 0.02);
  right: auto;
  bottom: auto;
  left: 50%;
  width: calc(var(--share-cell) * 0.42);
  transform: translateX(-50%);
}

.trade-card[data-presentation='share'] .pokemon-item__badge-icon,
.trade-card[data-presentation='share'] .pokemon-item__shiny,
.trade-card[data-presentation='share'] .pokemon-item__female {
  flex: 0 0 calc(var(--share-cell) * 0.2);
  box-sizing: border-box;
  width: calc(var(--share-cell) * 0.2);
  min-width: calc(var(--share-cell) * 0.2);
  max-width: calc(var(--share-cell) * 0.2);
  height: calc(var(--share-cell) * 0.2);
  min-height: calc(var(--share-cell) * 0.2);
  max-height: calc(var(--share-cell) * 0.2);
  object-fit: contain;
}

.trade-card[data-presentation='share'] .trade-card__pokemon-cell .pokemon-item {
  --pokemon-item-gap: 0;
  --pokemon-item-radius: 12px;
  border: 0;
  background: transparent;
}

.trade-card[data-presentation='share'] .trade-card__pokemon-cell .pokemon-item__details {
  display: none;
}

.trade-card[data-presentation='share'] .trade-card__pokemon-cell .pokemon-item__metadata {
  display: none;
}

.trade-card[data-presentation='share'] .trade-card__pokemon-cell .pokemon-item__metadata[hidden] {
  display: none;
}

.trade-card[data-presentation='share'] .trade-card__share-brand {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 2px;
  margin: 2px 0 0;
  width: 100%;
  padding: 4px 0 0;
  box-sizing: border-box;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.95);
  font-family: Inter, "Inter Fallback", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
}

.trade-card__share-profile,
.trade-card__share-code {
  margin: 0;
}

.trade-card[data-presentation='share'] .trade-card__share-profile {
  font-size: 14px;
}

.trade-card__share-code {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.trade-card__share-code[hidden] {
  display: none;
}

.trade-card__share-brand {
  align-self: end;
  padding: 7px var(--space-3);
  border: var(--control-border-width) solid var(--color-border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--color-surface) 88%, transparent);
  font-size: var(--font-size-control-sm);
  font-weight: var(--font-weight-control);
  text-align: center;
}


.trade-card[data-presentation='share'] .trade-card__pokemon-list.is-reorderable .trade-card__pokemon-cell:not(.trade-card__pokemon-cell--overflow):not(.trade-card__pokemon-cell--add)::before {
  content: '';
  position: absolute;
  left: 4px;
  bottom: 4px;
  z-index: 3;
  width: 12px;
  height: 8px;
  pointer-events: none;
  opacity: 0.7;
  background:
    radial-gradient(circle closest-side, #fff 45%, transparent 50%) 0 0 / 4px 4px,
    radial-gradient(circle closest-side, #fff 45%, transparent 50%) 4px 0 / 4px 4px,
    radial-gradient(circle closest-side, #fff 45%, transparent 50%) 8px 0 / 4px 4px,
    radial-gradient(circle closest-side, #fff 45%, transparent 50%) 0 4px / 4px 4px,
    radial-gradient(circle closest-side, #fff 45%, transparent 50%) 4px 4px / 4px 4px,
    radial-gradient(circle closest-side, #fff 45%, transparent 50%) 8px 4px / 4px 4px;
  background-repeat: no-repeat;
  filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.45));
}

.trade-card[data-presentation='share'] .trade-card__pokemon-list.is-reordering .trade-card__pokemon-cell {
  cursor: grabbing;
}

.trade-card[data-presentation='share'] .trade-card__pokemon-cell.is-dragging {
  opacity: 0.55;
  transform: scale(1.05);
  z-index: 4;
}

.trade-card[data-presentation='share'] .trade-card__pokemon-cell.is-drop-target {
  outline: 2px solid rgba(255, 255, 255, 0.95);
  outline-offset: 1px;
}

.trade-card[data-presentation='share'] .trade-card__pokemon-list.is-reorderable .trade-card__pokemon-cell:not(.trade-card__pokemon-cell--overflow):not(.trade-card__pokemon-cell--add) {
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  position: relative;
}

.trade-card__drag-handle {
  position: absolute;
  top: 5px;
  left: 5px;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.5);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1;
  pointer-events: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.trade-card[data-presentation='share'] .trade-card__pokemon-list.is-reordering .trade-card__pokemon-cell {
  cursor: grabbing;
}

.trade-card[data-presentation='share'] .trade-card__pokemon-cell.is-drag-source {
  /* Keep the grid track; content is hidden while the ghost follows the pointer. */
  opacity: 1;
}

.trade-card[data-presentation='share'] .trade-card__pokemon-cell.is-reorder-placeholder {
  width: auto;
  min-width: 0;
  max-width: none;
  height: auto;
  aspect-ratio: 1;
  border: 2px dashed rgba(29, 95, 168, 0.55);
  border-radius: 12px;
  background: color-mix(in srgb, #d7f3fb 70%, transparent);
  box-sizing: border-box;
  pointer-events: none;
}

.trade-card[data-presentation='share'] .trade-card__pokemon-cell.is-reorder-placeholder > * {
  visibility: hidden !important;
}

/* === /app/styles/components/pokemon-preview-modal.css === */
.pokemon-preview-modal {
  position: relative;
  display: grid;
  justify-items: center;
  gap: var(--space-3);
  min-width: 0;
  padding-top: 4px;
  text-align: center;
}

.pokemon-preview-modal__close {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 3;
}

.pokemon-preview-modal__media {
  --pokemon-preview-frame-size: 220px; /* fit box varies: 104.8 / 120 / 150 */
  --pokemon-preview-fit-size: 104.8px;
  position: relative;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: min(100%, var(--pokemon-preview-frame-size));
  aspect-ratio: 1 / 1;
  padding: var(--space-2);
  border: 0;
  border-radius: var(--radius-control);
  background: #fff;
  overflow: hidden;
}

.pokemon-preview-modal__media[data-has-background='true'] {
  padding: 0;
  background: #fff;
  align-items: end;
  justify-items: center;
}

.pokemon-preview-modal__media[data-has-background='true'] .pokemon-preview-modal__fit {
  align-self: end;
}

.pokemon-preview-modal__background {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

/* Centered evo fit box inside the 220 frame: 104.8 / 120 / 150. */
.pokemon-preview-modal__fit {
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  width: var(--pokemon-preview-fit-size);
  max-width: var(--pokemon-preview-fit-size);
  height: var(--pokemon-preview-fit-size);
  max-height: var(--pokemon-preview-fit-size);
  margin: 0;
  flex: 0 0 auto;
}

.pokemon-preview-modal__media .pokemon-item {
  --pokemon-image-scale: 1.30;
  --pokemon-item-radius: var(--pokemon-selection-border-width);
  --pokemon-current-image-padding: var(--trade-card-item-image-padding, 5px);
  --pokemon-item-gap: 0;
  --pokemon-media-background: transparent;
  --pokemon-media-aspect-ratio: 1 / 1;
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0;
  transform: none;
}

.pokemon-preview-modal__media .pokemon-item__background {
  display: none;
}

.pokemon-preview-modal__media .pokemon-item__media {
  width: 100%;
  aspect-ratio: 1 / 1;
}

.pokemon-preview-modal__media .pokemon-item__image {
  inset: 0;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pokemon-preview-modal__media .pokemon-item[data-background-state='empty'] .pokemon-item__image {
  padding: 0;
}

.pokemon-preview-modal__media .pokemon-item__details,
.pokemon-preview-modal__media .pokemon-item__selection {
  display: none;
}

/* Keep shiny / dynamax overlays from the Pokémon tile. */
.pokemon-preview-modal__media .pokemon-item__badge-stack,
.pokemon-preview-modal__media .pokemon-item__top-badge {
  z-index: 2;
}

.pokemon-preview-modal__name {
  margin: 0;
  max-width: 100%;
  color: var(--color-text-primary);
  font-size: var(--font-size-overlay-title);
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.pokemon-preview-modal__meta {
  margin: 0;
  max-width: 100%;
  color: var(--color-text-secondary);
  font-size: var(--font-size-control-sm);
  font-weight: var(--font-weight-control);
  letter-spacing: 0.02em;
  line-height: 1.2;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.modal:has(.pokemon-preview-modal) {
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.modal:has(.pokemon-preview-modal) .modal__header {
  display: none;
}

.modal:has(.pokemon-preview-modal) .modal__description:empty {
  display: none;
}

.modal:has(.pokemon-preview-modal) .modal__footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--modal-gap);
  padding: 16px 24px 24px;
  border-block-start: 1px solid #eef0f3;
}

.modal:has(.pokemon-preview-modal) .modal__footer .button {
  width: auto;
  min-width: 220px;
  max-width: 100%;
  padding: 14px 28px;
  border-radius: 14px;
  background: var(--color-control-primary);
  color: var(--color-control-on-primary);
  font-size: 16px;
  font-weight: 700;
}

.modal:has(.pokemon-preview-modal) .modal__footer .button:hover:not(:disabled) {
  background: var(--color-control-primary-hover);
}

.modal:has(.pokemon-preview-modal) .modal__footer .button:active:not(:disabled) {
  background: var(--color-control-primary-active);
}

@media (max-width: 600px) {
  .modal:has(.pokemon-preview-modal) .modal__footer {
    padding: 16px 16px 20px;
  }

  .modal:has(.pokemon-preview-modal) .modal__footer .button {
    width: min(100%, 220px);
    min-width: 0;
  }
}

/* === /app/styles/pages/home-feed.css === */
.home-feed {
  display: grid;
  align-content: start;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding-block: var(--space-2) var(--space-5);
  padding-inline: var(--page-padding-inline);
  gap: var(--space-2);
  overflow-x: hidden;
}

.home-feed__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  min-width: 0;
  gap: var(--space-2);
}

.home-feed__title.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.home-feed__filter-summary {
  min-height: 1.2em;
  margin: 0;
  color: var(--color-text-secondary);
  font-size: var(--font-size-control-sm);
  line-height: 1.2;
}

.home-feed__filter-summary:empty {
  display: none;
}

.home-feed__demo-badge {
  width: fit-content;
  margin: 0;
  padding: 2px 8px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-text-secondary);
  background: var(--color-surface-muted);
  font-size: var(--font-size-control-sm);
  line-height: 1.2;
}

.home-feed__toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: var(--space-1);
  min-width: 0;
  max-width: 100%;
}

.home-feed__toolbar .home-feed__filter[data-active='true'],
.home-feed__toolbar .home-feed__filter[aria-pressed='true'] {
  border-color: var(--color-control-primary);
  color: var(--color-control-primary);
  background: color-mix(in srgb, var(--color-control-primary) 10%, var(--color-surface));
}

.home-feed__search {
  min-width: 0;
  width: 100%;
}

.home-feed__search .search-bar,
.home-feed__search .search-bar__control {
  min-width: 0;
  width: 100%;
}

.home-feed__search .search-bar__label,
.home-feed__search .search-bar__error {
  display: none;
}

.home-feed__search .search-bar__control {
  min-height: 40px;
  border-radius: 12px;
  border-color: var(--color-border);
  background: var(--color-surface);
  box-shadow: 0 1px 2px rgb(23 32 51 / 4%);
}

.home-feed__search .search-bar__input {
  font-size: 14px;
}

.home-seo-guide {
  display: grid;
  gap: 14px;
  margin-block-start: var(--space-5);
  padding: 16px 12px 8px;
  border-top: 1px solid var(--color-border);
  min-width: 0;
}

.home-seo-guide__title {
  margin: 0;
  color: #172033;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.home-seo-guide__lead,
.home-seo-guide__text {
  margin: 0;
  max-width: 650px;
  color: #737985;
  font-size: 14px;
  line-height: 1.5;
}

.home-seo-guide__block {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.home-seo-guide__subtitle {
  margin: 0;
  color: #172033;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.3;
}

.home-seo-guide__text a {
  color: var(--color-control-primary);
  text-decoration: none;
  font-weight: 600;
}

.home-seo-guide__text a:hover {
  text-decoration: underline;
}

.home-seo-guide__list {
  margin: 0;
  padding-inline-start: 1.25rem;
  display: grid;
  gap: 0.35rem;
}

.home-seo-guide__list .home-seo-guide__text {
  margin: 0;
}


@media (min-width: 720px) {
  .home-seo-guide {
    padding-inline: 4px;
    gap: 16px;
  }

  .home-seo-guide__title {
    font-size: 22px;
  }
}

.home-feed__filter,
.home-feed__refresh {
  --icon-button-hit-size: 40px;
  --icon-button-icon-size: 18px;
  flex: 0 0 var(--icon-button-hit-size);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
  box-shadow: 0 1px 2px rgb(23 32 51 / 4%);
}

.home-feed__toolbar-icon {
  display: block;
  object-fit: contain;
}

.home-feed__filter-badge {
  position: absolute;
  right: 2px;
  bottom: 2px;
  display: grid;
  min-width: 16px;
  height: 16px;
  place-items: center;
  padding-inline: 3px;
  border-radius: 999px;
  background: var(--color-control-primary);
  color: var(--color-control-on-primary);
  font-size: 10px;
  font-weight: var(--font-weight-control);
  line-height: 1;
}

.home-feed__filter-badge[hidden] {
  display: none;
}

:root[data-theme='dark'] .home-feed__toolbar-icon {
  filter: invert(1);
}

.home-feed__status {
  /* One-line slot always — clearing "Loading…" must not collapse matches/seo. */
  min-height: 1.2em;
  margin: 0;
  color: var(--color-text-secondary);
  font-size: var(--font-size-control-sm);
  line-height: 1.2;
}

.home-feed__status:empty {
  /* Keep the layout box; visibility only (lt:cls-seobm1). */
  visibility: hidden;
}

/* Wrapper is display:contents so it does not become a CLS attribution box;
   children participate in .home-feed flow. Reservation stays on __initial;
   JS hides __initial only after list cards exist (see home.js render). */
.home-feed__body {
  display: contents;
}

.home-feed__initial {
  display: grid;
  /* 3× skeleton cards while the trade list loads — keeps CLS near 0. */
  min-height: calc((var(--skeleton-card-height, 140px) * 3) + (var(--space-2, 8px) * 2));
  place-items: stretch;
  align-content: start;
  width: 100%;
}

@media (min-width: 720px) {
  .home-feed__initial {
    /* Desktop PSI viewport ~800px: 3 cards left .home-seo-guide peeking at the
       fold (y≈759). 4 cards keep the guide below the first paint viewport. */
    min-height: calc((var(--skeleton-card-height, 140px) * 4) + (var(--space-2, 8px) * 3));
  }
}

.home-feed__initial[hidden] {
  display: none;
}

.home-feed__list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  gap: 0;
}

.home-feed__list[hidden] {
  display: none;
}

.home-feed__card-host {
  min-width: 0;
  overflow: hidden;
}

.home-feed__advertisement-host {
  min-width: 0;
  margin-block: var(--space-4);
}

.home-feed-advertisement {
  display: grid;
  min-width: 0;
  gap: var(--space-2);
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text-primary);
}

.home-feed-advertisement__label,
.home-feed-advertisement__title,
.home-feed-advertisement__description {
  min-width: 0;
  margin: 0;
}

.home-feed-advertisement__label {
  color: var(--color-text-secondary);
  font-size: var(--font-size-control-sm);
  font-weight: 600;
  line-height: 1.1;
  text-transform: uppercase;
}

.home-feed-advertisement__title {
  font-size: var(--font-size-control-lg);
  line-height: 1.2;
}

.home-feed-advertisement__description {
  color: var(--color-text-secondary);
  font-size: var(--font-size-control-sm);
  line-height: 1.35;
}

.home-feed-advertisement__cta {
  justify-self: start;
  min-height: var(--control-height-compact);
  padding: 0 var(--space-3);
  border: 1px solid var(--color-control-primary);
  border-radius: 8px;
  background: var(--color-control-primary);
  color: var(--color-control-on-primary);
  font-size: var(--font-size-control-sm);
  font-weight: 600;
  line-height: var(--control-height-compact);
  text-decoration: none;
}

.home-feed-advertisement__cta:focus-visible {
  outline: 2px solid var(--color-control-focus);
  outline-offset: 2px;
}

.home-feed[data-feed-layout='l'] .home-feed-advertisement {
  padding: var(--space-4);
}

.home-feed__footer {
  display: grid;
  justify-items: center;
  gap: var(--space-2);
  padding-block: var(--space-2);
}

.home-feed__footer[hidden],
.home-feed__load-more-button[hidden],
.home-feed__load-more-retry-button[hidden] {
  display: none;
}

.home-feed__footer-status {
  min-height: 1.2em;
  margin: 0;
  color: var(--color-text-secondary);
  font-size: var(--font-size-control-sm);
  text-align: center;
}

.home-feed-filter-sheet {
  display: grid;
  grid-template-rows: auto minmax(0, auto) auto;
  min-width: 0;
  gap: 0;
}

.home-feed-filter-sheet__country-control,
.home-feed-country-dropdown__option {
  min-height: var(--control-height-compact);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font: inherit;
  line-height: 1.1;
  cursor: pointer;
}

.home-feed-filter-sheet .filter-sheet__options[data-option-group='layout'],
.home-feed-filter-sheet .filter-sheet__options[data-option-group='flightCapability'],
.home-feed-filter-sheet .filter-sheet__options[data-option-group='tradeSide'],
.home-feed-filter-sheet .filter-sheet__options[data-option-group='special'] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.home-feed-filter-sheet .filter-sheet__options[data-option-group='layout'] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.home-feed-filter-sheet__country-control {
  display: flex;
  width: 100%;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: var(--space-1) var(--space-2);
  background: var(--color-surface);
  color: var(--color-text-primary);
  font-size: var(--font-size-control-sm);
  line-height: 1.25;
  text-align: start;
}

.home-feed-filter-sheet__country-control::after {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  margin-left: auto;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  content: '';
}

.home-feed-filter-sheet__country-control[aria-expanded='true']::after {
  transform: translateY(2px) rotate(225deg);
}

.home-feed-filter-sheet__country-label {
  min-width: 0;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-feed-country-flag {
  width: 22px;
  height: 16px;
  flex: 0 0 auto;
  border-radius: 2px;
  object-fit: cover;
}

.home-feed-country-flag[hidden] {
  display: none;
}

.home-feed-filter-sheet__country-control.is-selected,
.home-feed-country-dropdown__option.is-selected {
  border-color: var(--color-control-primary);
  background: var(--color-control-selected);
  color: var(--color-text-primary);
  box-shadow: inset 0 0 0 1px var(--color-control-primary);
}

.home-feed-filter-sheet__country-control:focus-visible,
.home-feed-country-dropdown__option:focus-visible,
.home-feed-country-dropdown__search:focus-visible {
  outline: 2px solid var(--color-control-focus);
  outline-offset: 2px;
}

.home-feed-country-dropdown {
  --country-option-row-height: 44px;
  --country-option-visible-rows: 5;
  display: grid;
  grid-template-rows: auto minmax(0, auto);
  gap: var(--space-2);
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
}

.home-feed-country-dropdown[hidden] {
  display: none;
}

.home-feed-country-dropdown__search {
  min-height: 38px;
  margin: var(--space-2) var(--space-2) 0;
  padding: 0 var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text-primary);
  font: inherit;
  font-size: var(--font-size-control-sm);
}

.home-feed-country-dropdown__list {
  display: grid;
  align-content: start;
  gap: var(--space-1);
  height: calc(
    (var(--country-option-row-height) * var(--country-option-visible-rows))
    + (var(--space-1) * (var(--country-option-visible-rows) - 1))
  );
  min-height: calc(
    (var(--country-option-row-height) * var(--country-option-visible-rows))
    + (var(--space-1) * (var(--country-option-visible-rows) - 1))
  );
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: 0 var(--space-2) var(--space-2);
}

.home-feed-country-dropdown__option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--country-option-row-height);
  padding: var(--space-1) var(--space-2);
  background: var(--color-surface);
  color: var(--color-text-primary);
  font-size: var(--font-size-control-sm);
  line-height: 1.25;
  text-align: start;
}

.home-feed-country-dropdown__flag {
  width: 22px;
  height: 16px;
  object-fit: cover;
}

.home-feed-country-dropdown__name {
  min-width: 0;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-feed-country-dropdown__code {
  color: var(--color-text-secondary);
  font-size: var(--font-size-control-sm);
  line-height: 1.3;
}

.home-feed-country-dropdown__empty {
  margin: 0;
  padding: var(--space-4) var(--space-2);
  color: var(--color-text-secondary);
  font-size: var(--font-size-control-sm);
  text-align: center;
}

@media (min-width: 720px) {
  .home-feed {
    padding-block: var(--space-3) var(--space-5);
    padding-inline: var(--page-padding-inline);
    gap: var(--space-4);
  }
}

/* lt:cls-seobm1 — reserve matches-shortcut line even before mount */
.home-feed__best-matches {
  min-height: calc(1.35em + 0.5rem);
}

.home-feed__best-matches:empty,
.home-feed__best-matches:has(> [hidden]) {
  /* Was display:none — collapsing this slot shifts seo-guide + feed. */
  display: block;
  visibility: hidden;
  pointer-events: none;
  overflow: hidden;
}

.home-matches-shortcut {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.55rem;
  margin: 0;
  padding: 0.15rem 0 0.35rem;
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
  line-height: 1.35;
}

.home-matches-shortcut__label {
  color: var(--color-text-primary);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.home-matches-shortcut__list {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.1rem 0.15rem;
  min-width: 0;
}

.home-matches-shortcut__sep {
  color: var(--color-text-secondary);
  opacity: 0.7;
  user-select: none;
}

.home-matches-shortcut__lane {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0.15rem 0.25rem;
  border: 0;
  border-radius: 0.35rem;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: start;
}

.home-matches-shortcut__lane:hover,
.home-matches-shortcut__lane:focus-visible {
  color: var(--color-control-primary);
  outline: none;
}

.home-matches-shortcut__lane-name {
  color: var(--color-text-primary);
  font-weight: 500;
}

.home-matches-shortcut__lane-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-control-primary) 14%, var(--color-surface));
  color: var(--color-control-primary);
  font-size: 0.6875rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.home-matches-shortcut__lane-count[data-empty='true'] {
  background: color-mix(in srgb, var(--color-text-secondary) 12%, var(--color-surface));
  color: var(--color-text-secondary);
}

.home-matches-shortcut__lane:hover .home-matches-shortcut__lane-name,
.home-matches-shortcut__lane:focus-visible .home-matches-shortcut__lane-name {
  color: var(--color-control-primary);
}

.home-matches-shortcut__lane:hover .home-matches-shortcut__lane-count,
.home-matches-shortcut__lane:focus-visible .home-matches-shortcut__lane-count {
  background: color-mix(in srgb, var(--color-control-primary) 22%, var(--color-surface));
}

.home-matches-shortcut[data-state='loading'] .home-matches-shortcut__lane-count {
  opacity: 0.55;
}

.home-best-matches {
  --match-card-wanted-color: #ff3fd7;
  --match-card-offered-color: #18d7ff;
  --match-card-wanted-title-color: #b0158f;
  --match-card-offered-title-color: #0a7a96;
  --match-card-wanted-background: color-mix(in srgb, var(--match-card-wanted-color) 7%, var(--color-surface));
  --match-card-offered-background: color-mix(in srgb, var(--match-card-offered-color) 7%, var(--color-surface));
  --match-card-wanted-border: color-mix(in srgb, var(--match-card-wanted-color) 36%, var(--color-border));
  --match-card-offered-border: color-mix(in srgb, var(--match-card-offered-color) 36%, var(--color-border));
  /* Same S/M/L tile tokens as trade-card / feed. */
  --match-card-item-size-m: 84.96px;
  --match-card-item-size: var(--match-card-item-size-m);
  --match-card-item-size-l: 108px;
  --match-card-item-scale-s: 0.786666667;
  --match-card-item-image-padding: 5px;
  --match-card-list-gap: 0px;
  --match-card-list-padding: 6px;
  --match-card-panel-gap: 0;
  --match-card-column-title-margin-block-end: 2px;
  --match-card-column-title-padding-inline-start: 2px;
  display: grid;
  gap: var(--space-2);
  min-width: 0;
  color: var(--color-text-primary);
}

.home-best-matches[data-layout='l'] {
  --match-card-item-size: var(--match-card-item-size-l);
}

.home-best-matches[data-layout='s'] {
  --match-card-item-size: calc(var(--match-card-item-size-m) * var(--match-card-item-scale-s));
}

.home-best-matches__card {
  display: grid;
  gap: var(--space-3);
  min-width: 0;
  padding: var(--space-3);
  border: 1px solid color-mix(in srgb, var(--color-control-primary) 28%, var(--color-border));
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--color-control-primary) 6%, var(--color-surface));
}

.home-best-matches__title,
.home-best-matches__message,
.home-best-matches__description,
.home-best-matches__emphasis {
  margin: 0;
}

.home-best-matches__title {
  font-size: var(--font-size-control-md);
  font-weight: var(--font-weight-control);
  line-height: 1.3;
}

.home-best-matches__title--eyebrow {
  color: var(--color-text-secondary);
  font-size: var(--font-size-control-sm);
  font-weight: var(--font-weight-control);
  letter-spacing: 0.02em;
  text-transform: none;
}

.home-best-matches__message,
.home-best-matches__emphasis {
  font-weight: var(--font-weight-control);
  line-height: 1.35;
}

.home-best-matches__description,
.home-best-matches__hint,
.home-best-matches__premium {
  color: var(--color-text-secondary);
  font-size: var(--font-size-control-sm);
  line-height: 1.4;
}

.home-best-matches__hint {
  margin: 0;
}

.home-best-matches__emphasis {
  color: var(--color-text-primary);
  font-size: var(--font-size-control-md);
}

.home-best-matches__body {
  display: grid;
  gap: var(--space-3);
  min-width: 0;
}

:root[data-theme='dark'] .home-best-matches {
  --match-card-wanted-title-color: #ff3fd7;
  --match-card-offered-title-color: #18d7ff;
  --match-card-wanted-background: color-mix(in srgb, var(--match-card-wanted-color) 8%, var(--color-surface));
  --match-card-offered-background: color-mix(in srgb, var(--match-card-offered-color) 8%, var(--color-surface));
  --match-card-wanted-border: color-mix(in srgb, var(--match-card-wanted-color) 40%, var(--color-border));
  --match-card-offered-border: color-mix(in srgb, var(--match-card-offered-color) 40%, var(--color-border));
}

.home-best-matches__peer {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.home-best-matches__head-marks {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  flex: 0 0 auto;
  margin-inline-start: auto;
}

.home-best-matches__count-chip {
  margin: 0;
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-control-secondary);
  color: var(--color-text-secondary);
  font: inherit;
  font-size: 0.6875rem;
  font-weight: var(--font-weight-control);
  line-height: 1.4;
  white-space: nowrap;
  cursor: pointer;
}

.home-best-matches__count-chip:hover,
.home-best-matches__count-chip:focus-visible {
  color: var(--color-text-primary);
  border-color: var(--color-text-secondary);
}

.home-best-matches__trade-button.button {
  --button-background: #20bd5a;
  --button-background-hover: #18aa4e;
  --button-background-active: #139343;
  --button-foreground: #ffffff;
  flex: 0 0 auto;
  width: auto;
  height: 34px;
  min-width: 0;
  min-height: 34px;
  padding-inline: 14px;
}

.home-best-matches__trade-icon {
  width: 1rem;
  height: 1rem;
  object-fit: contain;
  filter: invert(1);
}

.home-best-matches__peer-meta {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
  flex: 1 1 auto;
}

.home-best-matches__name-line {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-width: 0;
  max-width: 100%;
}

.home-best-matches__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: var(--font-weight-control);
}

.home-best-matches__match-badge {
  flex: 0 0 auto;
  margin: 0;
  padding: 0.15rem 0.45rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-control-secondary);
  color: var(--color-text-secondary);
  font-size: var(--font-size-control-sm);
  font-weight: var(--font-weight-control);
  line-height: 1.2;
  white-space: nowrap;
}

.home-best-matches__lanes {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: var(--match-card-panel-gap, 0);
  min-width: 0;
}

.home-best-matches__lane {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
}

.home-best-matches__lane--get {
  --match-card-panel-background: var(--match-card-wanted-background);
  --match-card-panel-border: var(--match-card-wanted-border);
  --match-card-panel-title-color: var(--match-card-wanted-title-color);
}

.home-best-matches__lane--give {
  --match-card-panel-background: var(--match-card-offered-background);
  --match-card-panel-border: var(--match-card-offered-border);
  --match-card-panel-title-color: var(--match-card-offered-title-color);
}

.home-best-matches__lane-title {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  margin: 0 0 var(--match-card-column-title-margin-block-end, 2px);
  padding: 0 0 0 var(--match-card-column-title-padding-inline-start, 2px);
  border: 0;
  background: transparent;
  color: var(--match-card-panel-title-color, var(--color-text-secondary));
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.1;
  text-align: start;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.home-best-matches__lane--give .home-best-matches__lane-title {
  /* Center label in the gap between stacked panels (same as trade-card offered). */
  margin-block: 6px;
}

.home-best-matches__lane-title:hover,
.home-best-matches__lane-title:focus-visible {
  text-decoration: underline;
}

.home-best-matches__pokemon-scroll {
  min-width: 0;
  border: 1px solid var(--match-card-panel-border, var(--color-border));
  border-radius: 0;
  background: var(--match-card-panel-background, var(--color-surface));
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  scroll-padding-inline: var(--match-card-list-padding);
  touch-action: pan-y;
  cursor: default;
  scrollbar-color: color-mix(in srgb, var(--color-text-secondary) 34%, transparent) transparent;
  scrollbar-width: thin;
  user-select: none;
  -webkit-user-select: none;
}

.home-best-matches__pokemon-scroll[data-can-scroll='true'] {
  overflow-x: auto;
  scrollbar-width: thin;
  cursor: grab;
  touch-action: pan-x pan-y;
}

.home-best-matches__pokemon-scroll[data-can-scroll='false'] {
  overflow-x: hidden;
  scrollbar-width: none;
  cursor: default;
  touch-action: pan-y;
}

.home-best-matches__pokemon-scroll[data-can-scroll='false']::-webkit-scrollbar {
  height: 0;
}

.home-best-matches__pokemon-scroll[data-dragging='true'] {
  cursor: grabbing;
}

.home-best-matches__pokemon-scroll img {
  pointer-events: none;
  -webkit-user-drag: none;
}

.home-best-matches__pokemon-scroll::-webkit-scrollbar {
  height: 4px;
}

.home-best-matches__pokemon-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.home-best-matches__pokemon-scroll::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-text-secondary) 30%, transparent);
}

.home-best-matches__pokemon-list {
  display: grid;
  grid-auto-flow: row;
  grid-template-columns: repeat(auto-fill, var(--match-card-item-size));
  grid-template-rows: none;
  align-items: start;
  width: 100%;
  min-width: calc(10 * var(--match-card-item-size) + 9 * var(--match-card-list-gap) + 2 * var(--match-card-list-padding));
  padding: var(--match-card-list-padding);
  gap: var(--match-card-list-gap);
  box-sizing: border-box;
}

.home-best-matches__pokemon-list[data-desktop-fit='true'],
.home-best-matches__pokemon-list[data-mobile-balanced='true'],
.home-best-matches__pokemon-list[data-mobile-fit='true'] {
  grid-template-columns: repeat(var(--match-card-list-cols), var(--match-card-item-size));
  min-width: calc(
    (var(--match-card-list-cols) * var(--match-card-item-size))
    + ((var(--match-card-list-cols) - 1) * var(--match-card-list-gap))
    + (2 * var(--match-card-list-padding))
  );
}

.home-best-matches__poke {
  position: relative;
  display: grid;
  width: var(--match-card-item-size);
  min-width: 0;
  max-width: var(--match-card-item-size);
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
}

.home-best-matches__poke--overflow {
  display: grid;
  place-items: center;
  align-self: start;
  cursor: pointer;
}

.home-best-matches__overflow {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 100%;
  aspect-ratio: 1 / 1;
  color: var(--color-text-secondary);
  font-size: var(--font-size-control-md);
  font-weight: var(--font-weight-control);
  border: var(--control-border-width) dashed var(--color-border);
  border-radius: var(--pokemon-item-radius, var(--radius-control));
  background: var(--color-surface);
}

.home-best-matches__poke > .pokemon-item {
  --pokemon-image-scale: 1.30;
  --pokemon-item-radius: var(--pokemon-selection-border-width);
  --pokemon-current-image-padding: var(--match-card-item-image-padding);
  --pokemon-item-gap: 4px;
  --pokemon-media-background: transparent;
  --pokemon-media-aspect-ratio: 1 / 1;
  display: grid;
  width: 100%;
  min-width: 0;
}

.home-best-matches__poke .pokemon-item__media {
  aspect-ratio: 1 / 1;
  width: 100%;
}

.home-best-matches__poke .pokemon-item__image {
  inset: 0;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.home-best-matches__poke .pokemon-item[data-background-state='empty'] .pokemon-item__image {
  padding: 0;
}

.home-best-matches__poke .pokemon-item__name,
.home-best-matches__poke .pokemon-item__text {
  display: none;
}

.home-best-matches__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  min-width: 0;
}

.home-best-matches__actions,
.home-best-matches__lane-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.home-best-matches__footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  min-width: 0;
  padding-top: var(--space-2);
  border-top: var(--control-border-width) solid var(--color-border);
}

.home-best-matches__lane-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  min-width: 0;
}

.home-best-matches__premium {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  width: fit-content;
  margin-inline-start: auto;
  color: var(--color-text-primary);
  font-weight: var(--font-weight-control);
  text-decoration: none;
}

.home-best-matches__premium:hover,
.home-best-matches__premium:focus-visible {
  text-decoration: underline;
}

.home-best-matches__premium-lock {
  width: 0.9rem;
  height: 0.9rem;
  flex: 0 0 auto;
}

.home-best-matches__sheet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(4.5rem, 1fr));
  gap: var(--space-2);
}

.home-best-matches__skeleton {
  display: grid;
  gap: var(--space-2);
}

.home-best-matches__bone {
  display: block;
  height: var(--space-4);
  border-radius: var(--radius-sm);
  background: var(--color-border);
}

.home-best-matches__bone--wide {
  width: 70%;
}

.home-best-matches__bone--row {
  height: 4.5rem;
}

.home-best-matches__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Mobile pull-to-refresh (home feed). */
.pull-to-refresh {
  --pull-distance: 0px;
  --pull-progress: 0;
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 0;
  inset-inline-end: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  height: 0;
  margin: 0;
  padding: 0;
  overflow: visible;
  pointer-events: none;
  opacity: 0;
  transform: translateY(calc(var(--pull-distance) * 0.85));
  transition: opacity 100ms ease;
}

.pull-to-refresh[data-state='pulling'],
.pull-to-refresh[data-state='ready'],
.pull-to-refresh[data-state='refreshing'] {
  opacity: 1;
}

.pull-to-refresh__spinner {
  box-sizing: border-box;
  width: 34px;
  height: 34px;
  margin-block-start: calc(var(--safe-area-top, 0px) + 14px);
  border: 3px solid color-mix(in srgb, var(--color-text-secondary) 22%, transparent);
  border-top-color: var(--color-control-primary);
  border-radius: 50%;
  background: color-mix(in srgb, var(--color-surface) 92%, transparent);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--color-text-primary) 8%, transparent),
    0 2px 10px color-mix(in srgb, var(--color-text-primary) 16%, transparent);
  transform: rotate(calc(var(--pull-progress) * 240deg)) scale(calc(0.7 + (var(--pull-progress) * 0.3)));
}

.pull-to-refresh[data-state='ready'] .pull-to-refresh__spinner {
  border-top-color: var(--color-control-primary);
  border-right-color: color-mix(in srgb, var(--color-control-primary) 60%, transparent);
}

.pull-to-refresh[data-state='refreshing'] .pull-to-refresh__spinner {
  animation: pull-to-refresh-spin 0.7s linear infinite;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .pull-to-refresh {
    transition: none;
  }

  .pull-to-refresh[data-state='refreshing'] .pull-to-refresh__spinner {
    animation: none;
    opacity: 0.85;
  }
}

@keyframes pull-to-refresh-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Homepage SEO: first-HTML LCP node (#home-seo-static) shares .home-seo-intro metrics. */
.home-seo-static,
.home-seo-intro {
  box-sizing: border-box;
  width: 100%;
  max-width: var(--app-max-width);
  margin-inline: auto;
  padding-block: 10px 6px;
  padding-inline: 12px;
  display: grid;
  gap: 8px;
  min-width: 0;
  flex-shrink: 0;
}

.home-seo-intro[hidden],
.home-seo-static[hidden],
.home-seo-guide[hidden] {
  display: none !important;
}

.home-seo-static h1,
.home-seo-intro__title {
  margin: 0;
  max-width: 760px;
  color: #172033;
  font-size: 27px;
  font-weight: 750;
  line-height: 1.15;
  letter-spacing: -0.025em;
  overflow-wrap: break-word;
  word-break: normal;
  white-space: normal;
}

.home-seo-static > p,
.home-seo-intro__lead {
  margin: 0;
  max-width: 760px;
  color: #737985;
  font-size: 15px;
  line-height: 1.45;
  overflow-wrap: break-word;
}

.app-shell__viewport > .home-seo-intro,
.app-shell__viewport > .home-seo-static {
  position: relative;
  z-index: var(--z-index-content);
}

@media (min-width: 720px) {
  .home-seo-static,
  .home-seo-intro {
    padding-block: 14px 8px;
    padding-inline: 16px;
  }

  .home-seo-static h1,
  .home-seo-intro__title {
    font-size: 34px;
  }
}

.home-seo-static__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.home-seo-static__links a {
  color: #2f6fed;
  text-decoration: none;
  font-size: 14px;
}

.home-seo-static__links a:hover,
.home-seo-static__links a:focus-visible {
  text-decoration: underline;
}

.home-seo-static__block {
  display: grid;
  gap: 6px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.home-seo-static__heading {
  margin: 0;
  max-width: 760px;
  color: #172033;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.home-seo-static__text {
  margin: 0;
  max-width: 760px;
  color: #737985;
  font-size: 15px;
  line-height: 1.45;
  overflow-wrap: break-word;
}

.home-seo-static {
  gap: 12px;
}

.home-seo-static__links {
  margin-block-start: 2px;
  padding-block-start: 4px;
}

@media (min-width: 720px) {
  .home-seo-static__heading {
    font-size: 1.15rem;
  }
}




/* Upper SEO nav: crawlable, not shown in the product UI */
.home-seo-static__links.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}


/* lt:feed-card-sep1 trainer listing card separation */
.home-feed__list {
  gap: 16px;
  padding-inline: 0;
  box-sizing: border-box;
}

@media (min-width: 720px) {
  .home-feed__list {
    gap: 18px;
    padding-inline: 0;
  }
}

.home-feed__card-host {
  min-width: 0;
  overflow: visible;
}

.home-feed__card-host > .trade-card,
.home-feed__list .trade-card:not([data-presentation='share']):not([data-presentation='export']) {
  box-sizing: border-box;
  padding: 12px;
  border: 1px solid #E5E7EB;
  border-block-start: 1px solid #E5E7EB;
  border-radius: 14px;
  background: var(--color-surface, #fff);
  /* Soften WANTED / FOR TRADE wells inside the card */
  --trade-card-panel-radius: 10px;
  --trade-card-wanted-background: color-mix(in srgb, var(--trade-card-wanted-color) 6%, var(--color-surface));
  --trade-card-offered-background: color-mix(in srgb, var(--trade-card-offered-color) 6%, var(--color-surface));
  --trade-card-wanted-border: color-mix(in srgb, var(--trade-card-wanted-color) 22%, #E5E7EB);
  --trade-card-offered-border: color-mix(in srgb, var(--trade-card-offered-color) 22%, #E5E7EB);
  --trade-card-header-inline-inset: 0;
}

:root[data-theme='dark'] .home-feed__card-host > .trade-card,
:root[data-theme='dark'] .home-feed__list .trade-card:not([data-presentation='share']):not([data-presentation='export']) {
  border-color: color-mix(in srgb, var(--color-border) 80%, transparent);
  background: var(--color-surface);
}

/* Stacked rails: each WANTED / FOR TRADE well gets full corner radius (mobile + desktop). */
.home-feed__card-host .trade-card__column--wanted,
.home-feed__list .trade-card__column--wanted {
  --trade-card-panel-border-radius: var(--trade-card-panel-radius);
}

.home-feed__card-host .trade-card__column--offered,
.home-feed__list .trade-card__column--offered {
  --trade-card-panel-border-radius: var(--trade-card-panel-radius);
}

/* /lt:feed-card-sep1 */

/* === /app/styles/pages/create-trade.css === */
.create-trade {
  --create-trade-live-wide-columns-large: 7;
  --create-trade-live-wide-columns-medium: 8;
  --create-trade-live-wide-columns-small: 10;
  display: flex;
  min-width: 0;
  flex-direction: column;
  background: var(--color-background);
  color: var(--color-text-primary);
}

.create-trade__view {
  min-width: 0;
}

.create-trade__view[hidden] {
  display: none;
}

.create-trade[data-active-view='selection'] {
  height: 100%;
  min-height: 0;
}

.create-trade[data-active-view='summary'] {
  height: 100%;
  min-height: 0;
}

.app-shell__content[data-create-trade-view='selection'] {
  height: 100%;
  min-height: 0;
}

.app-shell__content[data-create-trade-view='summary'] {
  height: 100%;
  min-height: 0;
}

.create-trade__view--summary {
  display: grid;
  min-height: 0;
  height: 100%;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
}

.create-trade__title,
.create-trade-selection__title {
  margin: 0;
  font-size: var(--font-size-overlay-title);
  line-height: var(--overlay-heading-line-height);
}

.create-trade__title:focus,
.create-trade-selection__title:focus {
  outline: none;
}

.create-trade__title-row {
  display: grid;
  min-width: 0;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 2px;
}

.create-trade__back {
  --icon-button-hit-size: 40px;
  --icon-button-icon-size: 20px;
  justify-self: start;
  flex: 0 0 var(--icon-button-hit-size);
}

.create-trade__back-icon {
  display: block;
  width: var(--icon-button-icon-size);
  height: var(--icon-button-icon-size);
  object-fit: contain;
}

.create-trade__title-row .create-trade__title {
  min-width: 0;
  overflow: hidden;
  font-size: 18px;
  font-weight: var(--font-weight-control);
  line-height: 1.2;
  text-align: start;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.create-trade__summary-scroll {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-3);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
}

.create-trade__group {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: var(--space-2);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.create-trade__group + .create-trade__group {
  padding-top: var(--space-4);
  border-top: var(--control-border-width) solid var(--color-border);
}

.create-trade__section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.create-trade__section-title {
  margin: 0;
  font-size: var(--font-size-control-lg);
  line-height: 1.2;
}

.create-trade__section-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: var(--space-2);
  margin-inline-start: auto;
}

.create-trade__notes-toggle {
  margin: 0;
  min-height: 2.75rem;
  padding: 0.35rem 0.75rem;
  border: var(--control-border-width) solid var(--color-border-strong, var(--color-border));
  border-radius: var(--radius-sm);
  background: var(--color-surface-raised, var(--color-surface));
  color: var(--color-text-primary);
  font: inherit;
  font-size: var(--font-size-control-sm);
  font-weight: var(--font-weight-control);
  line-height: 1.2;
  cursor: pointer;
}

.create-trade__notes-toggle--active {
  border-color: var(--color-control-primary);
  background: var(--color-control-primary);
  color: var(--color-control-on-primary);
}

.create-trade__notes-toggle:disabled {
  opacity: 0.7;
  cursor: default;
}

.create-trade__section-blurb {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: var(--font-size-control-sm);
  line-height: 1.4;
}

.create-trade__selected-list[data-notes='closed'] .pokemon-item__details {
  display: none;
}

.create-trade__counter {
  flex: 0 0 auto;
  color: var(--color-text-secondary);
  font-size: var(--font-size-control-md);
  font-weight: var(--font-weight-control);
}

.create-trade__validation {
  display: grid;
  min-width: 0;
  gap: var(--space-2);
  padding: var(--space-3);
  border: var(--control-border-width) solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text-secondary);
}

.create-trade__validation--hint {
  border-color: color-mix(in srgb, var(--color-border) 70%, var(--color-text-secondary));
  background: color-mix(in srgb, var(--color-text-secondary) 6%, var(--color-surface));
}

.create-trade__validation[hidden] {
  display: none;
}

.create-trade__validation-title {
  margin: 0;
  font-size: var(--font-size-control-lg);
  line-height: 1.2;
}

.create-trade__validation-list {
  display: grid;
  gap: var(--space-1);
  margin: 0;
  padding-inline-start: var(--space-4);
  color: var(--color-text-secondary);
  font-size: var(--font-size-control-md);
  line-height: 1.35;
}

.create-trade__pokemon-host {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: var(--space-2);
  container-type: inline-size;
  container-name: create-trade-selected-list;
}

.create-trade__selected-list {
  --create-trade-summary-columns: var(--pokemon-grid-columns-medium);
  display: grid;
  align-self: stretch;
  min-width: 0;
  width: 100%;
  grid-template-columns: repeat(var(--create-trade-summary-columns), minmax(0, 1fr));
  gap: 8px;
  padding-top: 10px;
  padding-inline-end: 10px;
}

.create-trade__selected-list[data-layout='small'] {
  --create-trade-summary-columns: var(--pokemon-grid-columns-small);
}

.create-trade__selected-list[data-layout='large'] {
  --create-trade-summary-columns: var(--pokemon-grid-columns-large);
}

@container create-trade-selected-list (min-width: 640px) {
  .create-trade__selected-list[data-layout='large'] {
    --create-trade-summary-columns: var(--create-trade-live-wide-columns-large);
  }

  .create-trade__selected-list[data-layout='medium'] {
    --create-trade-summary-columns: var(--create-trade-live-wide-columns-medium);
  }

  .create-trade__selected-list[data-layout='small'] {
    --create-trade-summary-columns: var(--create-trade-live-wide-columns-small);
  }
}

.create-trade__selected-item {
  position: relative;
  display: grid;
  min-width: 0;
}

/* Selected summary chips: fill the cell like the dashed add tile. */
.create-trade__selected-item .pokemon-item {
  --pokemon-current-image-padding: 2px;
  width: 100%;
  min-width: 0;
}

.create-trade__selected-item .pokemon-item__media {
  width: 100%;
  aspect-ratio: 1 / 1;
}

.create-trade__selected-item .pokemon-item__image.pokemon-item__layer {
  inset: 0;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  object-fit: contain;
}


.create-trade__remove-item {
  position: absolute;
  z-index: calc(var(--pokemon-layer-selection) + 1);
  top: -8px;
  right: -8px;
  display: grid;
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  place-items: center;
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.create-trade__remove-icon {
  display: block;
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.create-trade__remove-item:active .create-trade__remove-icon {
  transform: scale(var(--control-active-scale));
}

.create-trade__add-item {
  display: grid;
  box-sizing: border-box;
  width: calc(100% - (var(--pokemon-selection-border-width) * 2));
  min-width: 0;
  min-height: var(--touch-target-size);
  padding: 0;
  place-items: center;
  justify-self: center;
  align-self: start;
  aspect-ratio: 1 / 1;
  border: var(--control-border-width) dashed var(--color-control-primary);
  border-radius: calc(var(--pokemon-item-radius) - var(--pokemon-selection-border-width));
  background: transparent;
  color: var(--color-control-primary);
  font: inherit;
  line-height: 0;
  cursor: pointer;
}

.create-trade__add-symbol {
  position: relative;
  display: block;
  width: 32%;
  aspect-ratio: 1;
  overflow: hidden;
  color: transparent;
  font-size: 0;
  line-height: 0;
}

.create-trade__add-symbol::before,
.create-trade__add-symbol::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  background: var(--color-control-primary);
  transform: translate(-50%, -50%);
}

.create-trade__add-symbol::before {
  width: 100%;
  height: 2px;
}

.create-trade__add-symbol::after {
  width: 2px;
  height: 100%;
}

.create-trade__add-item:hover {
  background: var(--color-control-tertiary-hover);
}

.create-trade__add-item:active {
  background: var(--color-control-tertiary-active);
  transform: scale(var(--control-active-scale));
}

.create-trade__add-item:focus-visible,
.create-trade__remove-item:focus-visible {
  outline: var(--control-focus-width) solid var(--color-control-focus);
  outline-offset: var(--control-focus-offset);
}

.create-trade__selected-item .pokemon-item__metadata-input {
  box-sizing: border-box;
  height: 30px;
  min-height: 30px;
  padding-inline: var(--space-2);
  border-color: color-mix(in srgb, var(--color-border) 78%, transparent);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--color-surface) 92%, var(--color-background));
  color: var(--color-text-primary);
  font-size: var(--font-size-control-sm);
  line-height: 1;
  text-align: center;
}

.create-trade__selected-item .pokemon-item__metadata-input::placeholder {
  color: var(--color-text-secondary);
  opacity: 0.72;
}

@media (max-width: 390px) {
  .create-trade__view--summary .create-trade__selected-item .pokemon-item__details {
    gap: 2px;
    padding-inline: 0;
  }

  .create-trade__view--summary .create-trade__selected-item .pokemon-item__metadata-input {
    height: 24px;
    min-height: 24px;
    padding-inline: var(--space-1);
    font-size: 11px;
  }
}

.create-trade__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
  padding: var(--bottom-action-space);
  border-top: var(--control-border-width) solid var(--color-border);
  background: var(--color-surface);
}

.create-trade-preview {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: 100%;
  min-width: 0;
  min-height: 0;
  gap: var(--space-2);
  margin-inline: auto;
  overflow: hidden;
}

.create-trade-preview__card {
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: none;
  min-width: 0;
  min-height: 0;
  flex: 1 1 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: auto;
}

.create-trade-preview__frame {
  flex: 0 0 auto;
  overflow: hidden;
}

.create-trade-preview__scale {
  transform-origin: top left;
}

.create-trade-preview__error {
  margin: 0;
  color: var(--color-control-danger);
  font-size: var(--font-size-control-md);
  font-weight: var(--font-weight-control);
  line-height: 1.35;
}

.create-trade-preview__error[hidden] {
  display: none;
}


.create-trade-preview__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  flex: 0 0 auto;
  margin: 0;
  padding: 0 2px;
  box-sizing: border-box;
}

.create-trade-preview__toolbar[hidden] {
  display: none;
}

.create-trade-preview__sort {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  margin: 0;
  padding: 0 14px;
  border: var(--control-border-width, 1px) solid var(--color-border);
  border-radius: var(--radius-md, 10px);
  background: var(--color-surface, #fff);
  color: var(--color-text-primary);
  font: inherit;
  font-size: var(--font-size-control-md);
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
}

.create-trade-preview__sort:hover {
  border-color: color-mix(in srgb, var(--color-control-primary) 45%, var(--color-border));
}

.create-trade-preview__sort:focus-visible {
  outline: 2px solid var(--color-focus, #2f80ed);
  outline-offset: 2px;
}

.create-trade-preview__flight {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin: 0;
  margin-left: auto;
  padding: 0;
  flex: 0 0 auto;
}

.create-trade-preview__flight[hidden] {
  display: none;
}

.create-trade-preview__flight-label {
  color: var(--color-text-primary);
  font-size: var(--font-size-control-md);
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.create-trade-preview__flight-toggle {
  position: relative;
  width: 48px;
  min-width: 48px;
  height: 28px;
  min-height: 28px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--color-border);
  cursor: pointer;
  flex: 0 0 auto;
}

.create-trade-preview__flight-toggle::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: left 0.15s ease;
}

.create-trade-preview__flight-toggle[data-state='on'] {
  background: #2f80ed;
}

.create-trade-preview__flight-toggle[data-state='on']::before {
  left: calc(100% - 25px);
}

.create-trade-preview__flight-toggle:focus-visible {
  outline: 2px solid var(--color-focus, #2f80ed);
  outline-offset: 2px;
}

.create-trade-preview__options {
  display: grid;
  gap: 2px;
  flex: 0 0 auto;
}

.create-trade-preview__friend-code {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  color: var(--color-text-secondary);
  font-size: var(--font-size-control-sm);
  font-weight: var(--font-weight-control);
  line-height: 1.3;
}

.create-trade-preview__friend-code input {
  margin-top: 2px;
}

.create-trade-preview__friend-note {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: var(--font-size-control-sm);
  line-height: 1.3;
}

.create-trade-preview__friend-note[hidden] {
  display: none;
}

.create-trade-preview__copy-fallback {
  width: 100%;
  max-height: 8rem;
  margin: 0;
  padding: var(--space-2);
  border: var(--control-border-width) solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text-primary);
  font: inherit;
  font-size: 12px;
  line-height: 1.35;
  resize: vertical;
}

.create-trade-preview__copy-fallback[hidden] {
  display: none;
}

.create-trade-preview__actions {
  position: static;
  z-index: 2;
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: 0;
  padding: var(--space-3) var(--space-2) calc(var(--space-3) + env(safe-area-inset-bottom, 0px));
  border-top: var(--control-border-width) solid var(--color-border);
  background: var(--color-surface);
}

.create-trade-preview__actions:not(:has(.create-trade-preview__share:not([hidden]))) {
  grid-template-columns: 1fr;
}

.create-trade-preview__share,
.create-trade-preview__download,
.create-trade-preview__copy,
.create-trade-preview__split {
  flex: 1 1 9rem;
  width: auto;
  min-width: 0;
}

.create-trade-preview__share[hidden],
.create-trade-preview__split[hidden] {
  display: none;
}

.modal:has(.create-trade-preview) .modal__header {
  padding: var(--space-3) var(--space-4);
}

.modal:has(.create-trade-preview) .modal__title {
  font-size: var(--font-size-control-lg);
}

.modal:has(.create-trade-preview) .modal__description {
  max-width: 34rem;
  margin-block-start: 2px;
  font-size: var(--font-size-control-sm);
  line-height: 1.3;
}

.modal:has(.create-trade-preview) .modal__body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding: var(--space-3);
}

.modal:has(.create-trade-preview) .modal__content {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

@media (max-width: 600px) {
  .overlay-layer:has(.create-trade-preview) {
    align-items: start;
    padding: max(var(--space-2), var(--safe-area-top)) max(var(--space-1), var(--safe-area-right)) max(var(--space-2), var(--safe-area-bottom)) max(var(--space-1), var(--safe-area-left));
  }

  .modal[data-size='fullscreen']:has(.create-trade-preview) {
    position: absolute;
    inset: 0;
    grid-template-rows: auto minmax(0, 1fr);
    max-height: none;
  }

  .modal:has(.create-trade-preview) .modal__header {
    padding: var(--space-2) var(--space-3);
  }

  .modal:has(.create-trade-preview) .modal__body {
    padding: var(--space-2);
  }

  .create-trade-preview {
    gap: var(--space-2);
  }

  .create-trade-preview__card {
    padding: 0;
  }

  .create-trade-preview__actions {
    justify-content: stretch;
  }
}

.create-trade-export-canvas {
  position: fixed;
  /* Keep off-screen but ABOVE the root stacking context.
     z-index:-1 put the clone behind <html>/body paint and blanked sprites. */
  z-index: 2147483646;
  top: 0;
  left: -10000px;
  width: max-content;
  padding: 0;
  box-sizing: border-box;
  background: var(--color-surface);
  color: var(--color-text-primary);
  pointer-events: none;
  opacity: 1;
}

.create-trade-export-canvas .trade-card--export .trade-card__pokemon-scroll {
  overflow: visible;
}

.create-trade-export-canvas .trade-card--export .trade-card__pokemon-list {
  width: max-content;
  max-width: none;
  min-width: 0;
  grid-auto-columns: var(--share-cell);
  grid-auto-flow: row;
  grid-template-columns: repeat(10, var(--share-cell));
  grid-template-rows: none;
  grid-auto-rows: var(--share-cell);
  justify-content: center;
  gap: var(--share-gap);
}

.create-trade-export-canvas .trade-card--export .trade-card__pokemon-cell {
  width: var(--share-cell);
  height: var(--share-cell);
  max-width: var(--share-cell);
}

.create-trade-selection__header {
  position: relative;
  z-index: calc(var(--z-index-content) + 1);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-2);
  min-height: 56px;
  padding-inline: var(--bottom-action-space, var(--space-2));
  border-bottom: var(--control-border-width) solid var(--color-border);
  background: var(--color-surface);
}


/* mobile: search full-width between header row and chips */
@media (max-width: 720px) {
  .create-trade__view--selection[data-search-open='true'] .create-trade-selection__header {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: auto auto auto;
  }

  .create-trade__view--selection[data-search-open='true'] .create-trade-selection__back,
  .create-trade__view--selection[data-search-open='true'] .create-trade-selection__title,
  .create-trade__view--selection[data-search-open='true'] .create-trade-selection__toolbar {
    grid-row: 1;
  }

  .create-trade__view--selection[data-search-open='true'] .create-trade-selection__title {
    display: block;
  }

  .create-trade__view--selection[data-search-open='true'] .create-trade-selection__search-host {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    max-width: none;
    min-width: 0;
    justify-self: stretch;
    padding-block: 2px 6px;
  }

  .create-trade__view--selection[data-search-open='true'] .create-trade-selection__quick-filters {
    grid-column: 1 / -1;
    grid-row: 3;
  }
}

/* search-open header layout */
.create-trade__view--selection[data-search-open='true'] .create-trade-selection__header {
  grid-template-columns: auto auto minmax(0, 1fr) auto;
}

.create-trade__view--selection[data-search-open='true'] .create-trade-selection__search-host {
  width: auto;
  max-width: none;
  min-width: 0;
  justify-self: stretch;
}

.create-trade__view--selection[data-search-open='true'] .create-trade-selection__quick-filters {
  grid-column: 1 / -1;
}

.create-trade-selection__search-host {
  width: auto;
  max-width: none;
  min-width: 0;
}


.create-trade-selection__quick-filters {
  grid-column: 1 / -1;
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  padding: 6px 2px 8px;
}

.create-trade-selection__quick-filters-scroll {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.create-trade-selection__quick-filters-scroll::-webkit-scrollbar {
  display: none;
}


.create-trade-selection__quick-filters[hidden] {
  display: none;
}

.create-trade-selection__quick-filter {
  flex: 0 0 auto;
  box-sizing: border-box;
  min-height: 30px;
  padding: 0 10px;
  border: var(--control-border-width) solid var(--color-border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-secondary);
  font: inherit;
  font-size: var(--font-size-control-sm);
  font-weight: var(--font-weight-control);
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.create-trade-selection__quick-filter--active {
  border-color: var(--color-control-primary);
  background: var(--color-control-primary);
  color: var(--color-control-on-primary);
}

.create-trade-selection__quick-filter--excluded {
  border-color: #d93025;
  background: #d93025;
  color: #ffffff;
}




.create-trade-selection__group-toggle {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  margin-left: auto;
  gap: 8px;
  min-height: 30px;
  padding: 0 2px 0 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--color-text-secondary);
  font: inherit;
  font-size: var(--font-size-control-sm);
  font-weight: var(--font-weight-control);
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.create-trade-selection__group-toggle:focus-visible {
  outline: 2px solid var(--color-control-primary, #0b66d0);
  outline-offset: 2px;
}

.create-trade-selection__group-label {
  color: var(--color-text-secondary);
}

.create-trade-selection__group-switch {
  position: relative;
  box-sizing: border-box;
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: #c5c9d1;
  flex: 0 0 auto;
  transition: background-color 140ms ease;
}

.create-trade-selection__group-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: transform 140ms ease;
}

.create-trade-selection__group-toggle--on .create-trade-selection__group-switch,
.create-trade-selection__group-toggle[data-active='true'] .create-trade-selection__group-switch {
  background: #0b66d0;
}

.create-trade-selection__group-toggle--on .create-trade-selection__group-switch-thumb,
.create-trade-selection__group-toggle[data-active='true'] .create-trade-selection__group-switch-thumb {
  transform: translateX(14px);
}

.create-trade-selection__quick-filter--clear:disabled {
  opacity: 0.45;
  cursor: default;
}






.create-trade-selection__back {
  justify-self: start;
}

.create-trade-selection__title {
  min-width: 0;
  justify-self: start;
  overflow: hidden;
  font-size: 18px;
  font-weight: var(--font-weight-control);
  line-height: 1.2;
  text-align: start;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.create-trade__view--selection {
  display: grid;
  min-height: 0;
  height: 100%;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  position: relative;
  inset: auto;
}
.create-trade-selection__toolbar {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
}

.create-trade-selection__search-host[hidden],
.create-trade-selection__icon-button[hidden],
.create-trade-selection__layout[hidden],
.create-trade-selection__filter-badge[hidden] {
  display: none;
}

.create-trade-selection__search-host,
.create-trade-selection__grid-host {
  min-width: 0;
  background: var(--color-surface);
}

.create-trade-selection__grid-host,
.create-trade-selection__grid-host .pokemon-grid,
.create-trade-selection__grid-host .pokemon-grid__items {
  background: var(--color-surface);
}


.create-trade-selection__search-host .search-bar,
.create-trade-selection__search-host .search-bar__control {
  min-width: 0;
  width: 100%;
}

.create-trade-selection__search-host .search-bar__label,
.create-trade-selection__search-host .search-bar__error {
  display: none;
}

.create-trade-selection__search-host .search-bar__control {
  min-height: calc(var(--touch-target-size) - 3px);
  height: calc(var(--touch-target-size) - 3px);
}

.create-trade-selection__icon-button {
  --icon-button-hit-size: 40px;
  --icon-button-icon-size: 20px;
  flex: 0 0 var(--icon-button-hit-size);
}

.create-trade-selection__icon {
  display: block;
  object-fit: contain;
}

.create-trade-selection__filter,
.create-trade-selection__sort {
  --icon-button-icon-size: 18px;
}

.create-trade-selection__filter-badge,
.create-trade-selection__sort-direction {
  position: absolute;
  right: 2px;
  bottom: 2px;
  display: grid;
  min-width: 16px;
  height: 16px;
  place-items: center;
  padding-inline: 3px;
  border-radius: 999px;
  background: var(--color-control-primary);
  color: var(--color-control-on-primary);
  font-size: 10px;
  font-weight: var(--font-weight-control);
  line-height: 1;
}

.create-trade-selection__sort-direction {
  min-width: 18px;
  height: 18px;
  font-size: 12px;
  font-weight: 700;
}

:root[data-theme='dark'] .create-trade-selection__icon {
  filter: invert(1);
}

@media (max-width: 420px) {
  .create-trade-selection__title {
    font-size: 17px;
  }
}

.create-trade-selection__grid-host {
  min-height: 0;
  height: auto;
  max-height: 100%;
  margin: 0;
  overflow: hidden;
  align-self: stretch;
  container-type: inline-size;
  container-name: create-trade-selection;
}

.create-trade-selection__grid-host .pokemon-grid {
  display: grid;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  grid-template-rows: minmax(0, 1fr) auto auto;
}

.create-trade-selection__grid-host .pokemon-item {
  --pokemon-media-background: transparent;
}

.create-trade-selection__grid-host .pokemon-item[data-background-state='empty'] .pokemon-item__image {
  inset: 0;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  padding: 0;
  object-fit: contain;
}

.create-trade-selection__grid-host .pokemon-grid__items {
  box-sizing: border-box;
  align-content: start;
  min-height: 0;
  padding-bottom: var(--space-3);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  overflow-anchor: none;
}

@container create-trade-selection (min-width: 640px) {
  .pokemon-grid[data-layout='large'] .pokemon-grid__items {
    --pokemon-grid-current-columns: var(--create-trade-live-wide-columns-large);
  }

  .pokemon-grid[data-layout='medium'] .pokemon-grid__items {
    --pokemon-grid-current-columns: var(--create-trade-live-wide-columns-medium);
  }

  .pokemon-grid[data-layout='small'] .pokemon-grid__items {
    --pokemon-grid-current-columns: var(--create-trade-live-wide-columns-small);
  }
}

.create-trade-selection__check {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.create-trade-selection__footer {
  position: relative;
  z-index: var(--z-index-sticky, 40);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--bottom-action-space, var(--space-2));
  min-height: 48px;
  padding-inline: var(--bottom-action-space, var(--space-2));
  padding-block-start: var(--bottom-action-space, var(--space-2));
  padding-block-end: max(var(--bottom-action-space, var(--space-2)), var(--safe-area-bottom));
  border-top: var(--control-border-width) solid var(--color-border);
  background: var(--color-surface);
  flex: 0 0 auto;
  align-self: stretch;
}







.create-trade-selection__count {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: var(--font-size-control-md);
  font-weight: var(--font-weight-control);
  line-height: 1;
  text-align: start;
}

.create-trade-selection__footer--selection,
.create-trade-selection__footer--membership {
  align-items: stretch;
}

.create-trade-selection__count--selection {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
  width: 100%;
  align-self: center;
  max-width: none;
}

.create-trade-selection__count-top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.75rem 1rem;
  min-width: 0;
}

.create-trade-selection__count-metric {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  min-width: 0;
  line-height: 1.1;
}

.create-trade-selection__count-metric-label,
.create-trade-selection__count-metric-value {
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.create-trade-selection__footer--selection .create-trade-selection__add,
.create-trade-selection__footer--selection .create-trade-selection__add .button__label {
  font-size: 14px;
}

.create-trade-selection__count-metric--list .create-trade-selection__count-metric-label,
.create-trade-selection__count-metric--list .create-trade-selection__count-metric-value {
  color: var(--color-text-primary);
}

.create-trade-selection__count-metric--image .create-trade-selection__count-metric-label,
.create-trade-selection__count-metric--image .create-trade-selection__count-metric-value {
  color: #7c3aed;
}

.create-trade-selection__count--selection.is-full .create-trade-selection__count-metric--list .create-trade-selection__count-metric-label,
.create-trade-selection__count--selection.is-full .create-trade-selection__count-metric--list .create-trade-selection__count-metric-value {
  color: #b45309;
}

.create-trade-selection__count-track {
  display: flex;
  width: 100%;
  max-width: 16rem;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #d7dde8;
}

.create-trade-selection__count-fill {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  height: 100%;
  background: #3b82f6;
  transition: flex-grow 160ms ease;
}

.create-trade-selection__count--selection.is-full:not(.is-over) .create-trade-selection__count-fill:not(.create-trade-selection__count-fill--overflow) {
  background: #b45309;
}

.create-trade-selection__count-fill--overflow {
  background: #7c3aed;
}

.create-trade-selection__meter {
  flex: 0 1 7.5rem;
  min-width: 5.5rem;
  max-width: 9rem;
}

.create-trade-selection__meter--feed {
  margin-inline-end: auto;
}

.create-trade-selection__meter--image {
  flex: 0 1 7.5rem;
  margin-inline-start: auto;
}

.collection-membership-stat[data-stat='feed'] .collection-membership-stat__fill {
  background: var(--color-control-primary);
}

.collection-membership-stat[data-stat='image'] .collection-membership-stat__fill {
  background: #0f9d8a;
}

.create-trade-selection__count--membership {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
  min-width: 0;
  align-self: center;
}

.collection-membership-stat {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.collection-membership-stat__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-1);
  min-width: 0;
}

.collection-membership-stat__label {
  color: var(--color-text-secondary);
  font-size: 0.6875rem;
  font-weight: var(--font-weight-control);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.collection-membership-stat__value {
  color: var(--color-text-primary);
  font-size: 0.75rem;
  font-weight: var(--font-weight-control);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.collection-membership-stat__track {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--color-control-secondary);
}

.collection-membership-stat__fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--color-control-primary);
  transition: width 160ms ease;
}

.collection-membership-stat[data-stat='have'] .collection-membership-stat__fill {
  background: #16a34a;
}

.collection-membership-stat[data-stat='wish'] .collection-membership-stat__fill {
  background: #e11d48;
}

.collection-membership-stat[data-stat='selected'] .collection-membership-stat__fill {
  background: var(--color-control-primary);
}

.create-trade-selection__add {
  width: auto;
  min-width: 160px;
  max-width: 60vw;
}

@media (min-width: 640px) {
  .create-trade__summary-scroll {
    padding-inline: var(--space-4);
  }
}

/* Summary page chrome: no back + New Trade row (nav already provides context). */
.create-trade__title-row,
.create-trade__back {
  display: none !important;
}

.create-trade__view--summary > .create-trade__summary-scroll > .create-trade__title.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.create-trade__limit-note,
.create-trade__cross-nav,
.create-trade__cross-nav-footnote {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: var(--font-size-control-sm);
  line-height: 1.4;
}

.create-trade__cross-nav-link {
  color: var(--color-link, #2f6fed);
  text-decoration: none;
}

.create-trade__cross-nav-link:hover,
.create-trade__cross-nav-link:focus-visible {
  text-decoration: underline;
}



/* Match homepage .home-seo-intro title/lead on Post a Trade List */
.create-trade__title.create-trade__title--page {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
  border: 0;
  max-width: 760px;
  color: #172033;
  font-size: 27px;
  font-weight: 750;
  line-height: 1.15;
  letter-spacing: -0.025em;
  overflow-wrap: break-word;
  word-break: normal;
}

.create-trade__intro {
  display: grid;
  gap: 8px;
  margin: 0 0 var(--space-2);
  min-width: 0;
  max-width: 760px;
}

.create-trade__intro-lead,
.create-trade__intro-limit {
  margin: 0;
  max-width: 760px;
  color: #737985;
  font-size: 15px;
  line-height: 1.45;
  overflow-wrap: break-word;
  opacity: 1;
}

.create-trade__intro-link {
  color: var(--color-link, #2f6fed);
  text-decoration: none;
}

.create-trade__intro-link:hover,
.create-trade__intro-link:focus-visible {
  text-decoration: underline;
}

@media (min-width: 720px) {
  .create-trade__title.create-trade__title--page {
    font-size: 34px;
  }
}

@media (max-width: 420px) {
  .create-trade__intro {
    gap: 6px;
    margin-bottom: var(--space-2);
  }
}

/* generator-action-captions-20261120 */

.create-trade__actions--captions {
  align-items: start;
}

.create-trade__action-cell {
  display: grid;
  gap: 4px;
  min-width: 0;
  align-content: start;
}

.create-trade__action-caption {
  margin: 0;
  color: var(--color-text-muted, var(--color-text-secondary));
  font-size: 0.75rem;
  line-height: 1.3;
  min-height: 1.3em;
}

@media (max-width: 520px) {
  .create-trade__actions--captions {
    grid-template-columns: 1fr;
  }
}


/* phone: group-by lives in filter sheet */
@media (max-width: 720px) {
  .create-trade-selection__group-toggle {
    display: none !important;
  }
}

.create-trade__selected-list.is-reorderable .create-trade__selected-item {
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.create-trade__drag-handle {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.45);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1;
  pointer-events: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.create-trade__selected-list.is-reordering .create-trade__selected-item {
  cursor: grabbing;
}

.create-trade__selected-item.is-drag-source {
  opacity: 0 !important;
}

.create-trade__selected-item.is-reorder-placeholder {
  border: 2px dashed color-mix(in srgb, var(--color-control-primary) 70%, white);
  border-radius: var(--radius-md, 12px);
  background: color-mix(in srgb, var(--color-control-primary) 12%, transparent);
  box-sizing: border-box;
  pointer-events: none;
}

.create-trade__selected-item.is-drag-ghost,
.trade-card__pokemon-cell.is-drag-ghost {
  opacity: 0.96;
  transform: scale(1.04);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.28);
  border-radius: 12px;
  overflow: hidden;
}

body.is-list-reordering {
  cursor: grabbing !important;
  user-select: none !important;
  -webkit-user-select: none !important;
}

body.is-list-reordering * {
  cursor: grabbing !important;
}

/* === /app/styles/pages/trade-test.css === */
/* /trade-test — Wanted / For Trade mockup layout */

.trade-test-page {
  --trade-test-card-radius: 12px;
  --trade-test-title: #172033;
  --trade-test-ink: #17202e;
  --trade-test-muted: #667385;
  --trade-test-line: #e1e7ef;
  --trade-test-wanted-dot: #d9482b;
  --trade-test-offered-dot: #1c9a5f;
  --trade-test-bar-pad-y: 10px;
  --trade-test-bar-pad-x: 16px;
  --trade-test-bar-gap: 10px;
  --trade-test-bar-btn-height: 46px;
  --trade-test-bar-btn-radius: 12px;
  --trade-test-bar-max: 960px;
  gap: var(--space-4);
  padding-block: var(--space-4) var(--space-5);
}

/* SEO band: reuse Home/Pokédex .home-seo-intro metrics (padding + H1/lead). */
.trade-test-page {
  padding-block-start: 0;
}

.trade-test-page > .home-seo-intro.trade-test__hero {
  /* Cancel tools-page inline padding so band matches viewport-level home-seo-intro. */
  box-sizing: border-box;
  width: calc(100% + (2 * var(--page-padding-inline, var(--space-1))));
  max-width: none;
  margin-inline: calc(-1 * var(--page-padding-inline, var(--space-1)));
  flex-shrink: 0;
}

.trade-test__tool-host {
  min-width: 0;
  width: 100%;
}

.trade-test-page .create-trade__intro[hidden] {
  display: none !important;
  margin: 0 !important;
}

.trade-test-page .create-trade__summary-scroll {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
  padding: 0;
}

.trade-test-page .create-trade__title,
.trade-test-page .create-trade__intro,
.trade-test-page .create-trade__validation {
  grid-column: 1 / -1;
}

.trade-test-page .create-trade__group {
  gap: var(--space-2);
  padding: var(--space-4);
  border: var(--control-border-width) solid var(--color-border, var(--trade-test-line));
  border-radius: 16px;
  background: var(--color-surface, #fff);
}

.trade-test-page .create-trade__group + .create-trade__group {
  padding-top: var(--space-4);
  border-top: var(--control-border-width) solid var(--color-border, var(--trade-test-line));
}

.trade-test-page .create-trade__section-title {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--trade-test-title);
  font-weight: 700;
}

.trade-test-page .create-trade__group--wanted .create-trade__section-title::before,
.trade-test-page .create-trade__group--offered .create-trade__section-title::before {
  content: '';
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.trade-test-page .create-trade__group--wanted .create-trade__section-title::before {
  background: var(--trade-test-wanted-dot);
}

.trade-test-page .create-trade__group--offered .create-trade__section-title::before {
  background: var(--trade-test-offered-dot);
}

.trade-test-page .create-trade__counter:not([hidden]) {
  color: var(--trade-test-muted);
  font-variant-numeric: tabular-nums;
}

.trade-test-page .create-trade__section-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.trade-test-page .create-trade__notes-toggle {
  min-height: 2.25rem;
  padding: 0.3rem 0.7rem;
  border-radius: 8px;
  background: transparent;
}

/* Always M layout: 4 columns */
.trade-test-page .create-trade__pokemon-host {
  container-type: normal;
}

.trade-test-page .create-trade__selected-list,
.trade-test-page .create-trade__selected-list[data-layout='small'],
.trade-test-page .create-trade__selected-list[data-layout='medium'],
.trade-test-page .create-trade__selected-list[data-layout='large'] {
  --create-trade-summary-columns: 4 !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

/* Content below the tool (prototype section.content) */
.trade-test__how,
.trade-test__feed,
.trade-test__guides,
.trade-test__faq {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.trade-test__section-title {
  margin: 0;
  color: var(--trade-test-ink);
  font-size: 22px;
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.trade-test__section-lead {
  margin: 0;
  max-width: none;
  color: var(--trade-test-muted);
  font-size: 1rem;
  line-height: 1.5;
}

.trade-test__nowrap {
  white-space: nowrap;
}

@media (max-width: 959px) {
  .trade-test__section-lead {
    max-width: 68ch;
  }
}

.trade-test__steps {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 12px 0 0;
  padding: 0;
  counter-reset: trade-test-step;
}

.trade-test__steps > li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  min-width: 0;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--trade-test-line);
  border-radius: 14px;
  background: var(--color-surface, #fff);
  color: var(--trade-test-muted);
  font-size: 0.9375rem;
  line-height: 1.45;
}

.trade-test__steps > li::before {
  counter-increment: trade-test-step;
  content: counter(trade-test-step);
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-block-start: 0;
  margin-bottom: 0;
  border-radius: 50%;
  background: var(--color-control-primary, #0b72d9);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1;
}

.trade-test__guide-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.trade-test__guide-link {
  display: block;
  padding: 12px 14px;
  border: 1px solid var(--trade-test-line);
  border-radius: 12px;
  background: var(--color-surface, #fff);
  color: var(--trade-test-ink);
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
}

.trade-test__guide-link small {
  display: block;
  margin-top: 2px;
  color: var(--trade-test-muted);
  font-weight: 400;
}

.trade-test__guide-link:hover,
.trade-test__guide-link:focus-visible {
  border-color: var(--color-control-primary, #0b72d9);
}

.trade-test__faq-item {
  overflow: hidden;
  margin: 0 0 8px;
  border: 1px solid var(--trade-test-line);
  border-radius: 12px;
  background: var(--color-surface, #fff);
}

.trade-test__faq-item:last-child {
  margin-bottom: 0;
}

.trade-test__faq-item > summary {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  padding: 12px 14px;
  color: var(--trade-test-ink);
  font-weight: 600;
  line-height: 1.35;
  list-style: none;
}

.trade-test__faq-item > summary::-webkit-details-marker {
  display: none;
}

.trade-test__faq-item > summary::marker {
  content: '';
}

.trade-test__faq-item > summary::before {
  content: '';
  flex: 0 0 auto;
  width: 0;
  height: 0;
  margin-top: 0.35em;
  border-style: solid;
  border-width: 5px 0 5px 7px;
  border-color: transparent transparent transparent var(--trade-test-ink);
  transform-origin: 40% 50%;
  transition: transform 0.15s ease;
}

.trade-test__faq-item[open] > summary::before {
  transform: rotate(90deg);
}

.trade-test__faq-answer {
  margin: 0;
  padding: 0 14px 12px;
  color: var(--trade-test-muted);
  font-size: 0.9375rem;
  line-height: 1.45;
}

/* Action bar: in-flow under Wanted / For Trade (does not follow the viewport). */
.trade-test-page .create-trade__actions,
.trade-test-page .create-trade__actions.create-trade__actions--captions,
.trade-test-page .trade-test__action-bar {
  position: static !important;
  inset: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  top: auto !important;
  z-index: auto !important;
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: var(--trade-test-bar-gap);
  align-items: stretch;
  width: 100% !important;
  max-width: none !important;
  margin: var(--space-3) 0 0 !important;
  box-sizing: border-box;
  padding:
    var(--trade-test-bar-pad-y)
    0
    var(--trade-test-bar-pad-y) !important;
  border-top: 1px solid var(--trade-test-line);
  background: transparent;
  box-shadow: none !important;
}

.trade-test-page .create-trade__action-cell,
.trade-test-page .trade-test__action-bar .create-trade__action-cell {
  display: contents;
}

.trade-test-page .create-trade__action-caption,
.trade-test-page .trade-test__action-bar .create-trade__action-caption {
  grid-column: 1 / -1;
  margin: 0;
  text-align: center;
  font-size: 12px;
  line-height: 1.3;
  color: var(--trade-test-muted);
  order: 10;
}

.trade-test-page .create-trade__actions .button,
.trade-test-page .create-trade__actions .create-trade__action.button,
.trade-test-page .trade-test__action-bar .button {
  height: var(--trade-test-bar-btn-height);
  min-height: var(--trade-test-bar-btn-height);
  border-radius: var(--trade-test-bar-btn-radius);
  font-weight: 700;
}

/* Hide action bar while picking Pokémon */
.trade-test-page:has(.create-trade[data-active-view='selection']) .create-trade__actions,
.trade-test-page:has(.create-trade[data-active-view='selection']) .trade-test__action-bar,
body:has(.trade-test-page .create-trade[data-active-view='selection']) .trade-test__action-bar {
  display: none !important;
}

/* Hide chrome while picking Pokémon */
.trade-test-page:has(.create-trade[data-active-view='selection']) > .home-seo-intro,
.trade-test-page:has(.create-trade[data-active-view='selection']) .trade-test__hero,
.trade-test-page:has(.create-trade[data-active-view='selection']) .trade-test__content {
  display: none !important;
}

@media (min-width: 720px) {
  .trade-test-page .create-trade__summary-scroll {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-4);
    align-items: start;
  }

  .trade-test-page .create-trade__group {
    min-width: 0;
  }

  /* Stacked-only divider — not needed when groups sit side by side */
  .trade-test-page .create-trade__group + .create-trade__group {
    padding-top: var(--space-4);
    border-top: none;
  }

  .trade-test__steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 760px) {
  .trade-test__guide-list {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 419px) {
  .trade-test-page {
    gap: var(--space-3);
  }

  .trade-test-page .create-trade__group {
    padding: var(--space-3);
  }
}

.trade-test__content {
  display: grid;
  gap: 28px;
  min-width: 0;
  box-sizing: border-box;
  padding-block: 28px 8px;
  padding-inline: 12px;
}

/* === /app/styles/pages/tools.css === */
/* Tools landing + trade list generator SEO chrome */

.tools-page {
  display: grid;
  gap: var(--space-4);
  align-content: start;
  min-width: 0;
  width: 100%;
  padding-block: var(--space-4) var(--space-5);
  padding-inline: var(--page-padding-inline, var(--space-1));
}

.tools-seo {
  display: grid;
  gap: var(--space-1);
  max-width: 42rem;
  min-width: 0;
}

.tools-seo__title {
  margin: 0;
  color: var(--color-text-primary, var(--color-text));
  font-size: clamp(1.25rem, 2.4vw, 1.55rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.tools-seo__lead {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: var(--font-size-control-sm);
  line-height: 1.45;
}

.tools-page__list {
  display: grid;
  gap: var(--space-3);
  max-width: 36rem;
}

.tools-page__card {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md, 0.75rem);
  background: var(--color-surface);
  color: inherit;
  text-decoration: none;
  min-width: 0;
}

.tools-page__card:hover {
  border-color: color-mix(in srgb, var(--color-control-primary) 45%, var(--color-border));
}

.tools-page__card:focus-visible {
  outline: 2px solid var(--color-control-primary);
  outline-offset: 2px;
}

.tools-page__card-title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--color-text-primary, var(--color-text));
}

.tools-page__card-lead {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: var(--font-size-control-sm);
  line-height: 1.4;
}

.tools-page__card-cta {
  margin-block-start: var(--space-1);
  color: var(--color-control-primary);
  font-size: var(--font-size-control-sm);
  font-weight: var(--font-weight-control, 650);
}

.tools-page--generator {
  gap: var(--space-3);
  padding-block-end: var(--space-3);
}

.tools-page__tool-host {
  min-width: 0;
  width: 100%;
}

.tools-page__tool-host .create-trade {
  padding-inline: 0;
}

.tools-page__tool-host .create-trade__title.visually-hidden {
  /* Real H1 lives in .tools-seo; keep create title for a11y of the form region only */
}


/* Selection catalog: scroll the whole shell so top site nav scrolls away;
   Wanted/For Trade bar sticks to the top of that scrollport. */
.app-shell:has(.tools-page--generator .create-trade[data-active-view='selection']) {
  display: flex !important;
  flex-direction: column !important;
  height: 100vh !important;
  height: 100dvh !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
}

.app-shell:has(.tools-page--generator .create-trade[data-active-view='selection']) > .app-shell__navigation,
.app-shell:has(.tools-page--generator .create-trade[data-active-view='selection']) > .app-shell__header {
  position: relative !important;
  inset: auto !important;
  top: auto !important;
  flex: 0 0 auto !important;
}

.app-shell:has(.tools-page--generator .create-trade[data-active-view='selection']) > .app-shell__viewport {
  display: block !important;
  flex: 0 0 auto !important;
  height: auto !important;
  min-height: 0 !important;
  overflow: visible !important;
  overflow-y: visible !important;
}

/* Mobile: header → content → bottom nav (DOM order is fine; keep nav last). */
.app-shell:has(.tools-page--generator .create-trade[data-active-view='selection']) > .app-shell__header {
  order: 1;
}
.app-shell:has(.tools-page--generator .create-trade[data-active-view='selection']) > .app-shell__viewport {
  order: 2;
}
.app-shell:has(.tools-page--generator .create-trade[data-active-view='selection']) > .app-shell__navigation {
  order: 3;
}

/* Desktop (≥720px): top nav first, then optional header, then content — scrolls away together. */
@media (min-width: 720px) {
  .app-shell:has(.tools-page--generator .create-trade[data-active-view='selection']) > .app-shell__navigation {
    order: 1;
  }
  .app-shell:has(.tools-page--generator .create-trade[data-active-view='selection']) > .app-shell__header {
    order: 2;
  }
  .app-shell:has(.tools-page--generator .create-trade[data-active-view='selection']) > .app-shell__viewport {
    order: 3;
  }
}

/* Generator catalog: page scroll via .app-shell__viewport (same as Home/Pokédex).
   No nested catalog scrollbar; sticky header/footer stay in view. */
.app-shell__viewport:has(.tools-page--generator .create-trade[data-active-view='selection']) > .site-footer {
  display: none !important;
}


/* Selection catalog: top site nav scrolls away; Wanted/For Trade bar sticks. */
.app-shell__viewport:has(.tools-page--generator .create-trade[data-active-view='selection']) > .app-header,
.app-shell__viewport:has(.tools-page--generator .create-trade[data-active-view='selection']) > .app-header.app-header--sticky,
.app-shell__viewport:has(.tools-page--generator .create-trade[data-active-view='selection']) > .mobile-brand-header {
  position: relative !important;
  inset: auto !important;
  top: auto !important;
}

.app-shell__viewport:has(.tools-page--generator .create-trade[data-active-view='selection']) {
  /* Shell is the scrollport during selection; viewport just flows. */
  display: block;
  overflow: visible;
  overflow-x: visible;
  overflow-y: visible;
  height: auto;
}

.app-shell__content:has(.tools-page--generator .create-trade[data-active-view='selection']) {
  display: block;
  height: auto;
  min-height: 100%;
  overflow: visible;
}

.tools-page--generator:has(.create-trade[data-active-view='selection']) {
  display: block;
  height: auto;
  min-height: 0;
  padding-block: 0;
  overflow: visible;
}

.tools-page--generator:has(.create-trade[data-active-view='selection']) .tools-seo {
  display: none;
}

.tools-page--generator:has(.create-trade[data-active-view='selection']) .tools-page__tool-host,
.tools-page--generator:has(.create-trade[data-active-view='selection']) .create-trade {
  display: block;
  height: auto;
  min-height: 0;
  overflow: visible;
}


.tools-seo__sub {
  font-size: 1.05rem;
  margin: 0.9rem 0 0.35rem;
}

.tools-seo__extra {
  margin-top: 0.35rem;
}

.tools-seo__sub {
  margin: 0;
  color: var(--color-text-primary, var(--color-text));
  font-size: var(--font-size-control);
  font-weight: 700;
  line-height: 1.3;
}

.tools-seo__steps {
  margin: 0;
  padding-inline-start: 1.25rem;
  color: var(--color-text-secondary);
  font-size: var(--font-size-control-sm);
  line-height: 1.45;
  display: grid;
  gap: var(--space-1);
}

.tools-seo__cross-nav,
.tools-seo__how {
  margin: 0;
}

.tools-seo__how {
  display: grid;
  gap: var(--space-2);
  max-width: 42rem;
  padding-block: var(--space-3) var(--space-2);
}

.tools-seo__cross-nav-link,
.tools-generator-seo-static a {
  color: var(--color-link, #2f6fed);
}

.tools-generator-seo-static {
  display: grid;
  gap: var(--space-2);
  max-width: 42rem;
  min-width: 0;
  padding-block: var(--space-2);
  padding-inline: var(--space-3);
}

.tools-generator-seo-static h1 {
  margin: 0;
  font-size: clamp(1.25rem, 2.4vw, 1.55rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--color-text-primary, var(--color-text));
}

.tools-generator-seo-static > p,
.tools-generator-seo-static li {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: var(--font-size-control-sm);
  line-height: 1.45;
}

/* generator-layout-20261120 */

.tools-seo--compact {
  gap: 4px;
  margin-block-end: var(--space-1);
}

.tools-page--generator {
  gap: var(--space-1);
  padding-block-start: var(--space-3);
}

.tools-page--generator > .tools-seo--compact + .tools-page__tool-host {
  margin-block-start: 0;
}

.tools-page--generator .create-trade__intro[hidden] {
  display: none !important;
  margin: 0 !important;
}

.tools-page--generator .create-trade__summary-scroll {
  padding-block-start: var(--space-2);
}

.tools-seo__steps--cards {
  list-style: decimal;
  padding-inline-start: 1.15rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2);
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
  line-height: 1.35;
}

.tools-seo__steps--cards > li {
  margin: 0;
  padding: var(--space-2);
  border: var(--control-border-width) solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  min-width: 0;
}

.tools-seo__how {
  gap: var(--space-2);
  max-width: none;
  padding-block: var(--space-2) var(--space-1);
}

.tools-generator-seo-static {
  gap: var(--space-2);
}

.tools-generator-seo-static ol {
  list-style: decimal;
  padding-inline-start: 1.15rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2);
  margin: 0;
}

.tools-generator-seo-static ol > li {
  margin: 0;
  padding: var(--space-2);
  border: var(--control-border-width) solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
  line-height: 1.35;
}

@media (min-width: 720px) {
  .tools-seo__steps--cards,
  .tools-generator-seo-static ol {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding-inline-start: 0;
    list-style: none;
    counter-reset: how-step;
  }

  .tools-seo__steps--cards > li,
  .tools-generator-seo-static ol > li {
    counter-increment: how-step;
    padding-top: var(--space-2);
  }

  .tools-seo__steps--cards > li::before,
  .tools-generator-seo-static ol > li::before {
    content: counter(how-step) ".";
    display: block;
    margin-bottom: 4px;
    color: var(--color-text-primary, var(--color-text));
    font-weight: 700;
    font-size: 0.75rem;
  }
}

/* generator-summary-scroll-20261124
   Summary used height:100% + overflow:hidden + an unconstrained
   .create-trade__summary-scroll { overflow-y:auto; overscroll-behavior:contain }.
   With SEO chrome above, that inner box never becomes a real scrollport and
   contain blocks scroll chaining to .app-shell__viewport — lists feel frozen
   on mobile and desktop. Use document (viewport) scroll for summary instead. */
.tools-page--generator .create-trade[data-active-view='summary'] {
  height: auto;
  min-height: 0;
}

/* Must not override .create-trade__view[hidden] { display:none } — higher
   specificity without :not([hidden]) kept the Wanted/For Trade summary
   visible under the Pokémon picker. */
.tools-page--generator .create-trade__view--summary:not([hidden]) {
  display: flex;
  flex-direction: column;
  height: auto;
  min-height: 0;
  overflow: visible;
  grid-template-rows: none;
}

.tools-page--generator .create-trade__view--summary[hidden] {
  display: none !important;
}

.tools-page--generator .create-trade__summary-scroll {
  flex: 0 0 auto;
  min-height: 0;
  overflow: visible;
  overscroll-behavior-y: auto;
}

.tools-page--generator .create-trade__actions {
  position: static;
  bottom: auto;
  z-index: auto;
  flex: 0 0 auto;
  padding-block-end: max(var(--bottom-action-space), var(--safe-area-bottom));
}

/* Selection: page scroll + fixed Done bar (sticky bottom cannot lift a footer from below the fold). */
.tools-page--generator .create-trade__view--selection:not([hidden]) {
  display: flex;
  flex-direction: column;
  height: auto;
  min-height: 0;
  overflow: visible;
  background: var(--color-surface);
  position: relative;
  z-index: calc(var(--z-index-content) + 2);
  inset: auto;
  /* room for fixed footer so last rows stay reachable */
  padding-bottom: calc(56px + var(--safe-area-bottom, 0px));
}

.tools-page--generator .create-trade__view--selection:not([hidden]) > .create-trade-selection__header {
  position: sticky;
  top: 0; /* do not set inset:auto — it resets top and kills sticky */
  z-index: calc(var(--z-index-sticky-header, 50) + 2);
  width: auto;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  box-sizing: border-box;
  background: var(--color-surface);
}

.tools-page--generator .create-trade__view--selection:not([hidden]) > .create-trade-selection__header::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  background: var(--color-surface);
  border-bottom: var(--control-border-width) solid var(--color-border);
  z-index: -1;
  pointer-events: none;
}

.tools-page--generator .create-trade__view--selection:not([hidden]) > .create-trade-selection__footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: calc(var(--z-index-bottom-navigation, 100) + 5);
  width: 100%;
  max-width: none;
  margin-inline: 0;
  min-height: 48px;
  box-sizing: border-box;
  /* Full-bleed white bar; keep content aligned to app column via inner wrapper rules. */
  padding-inline: 0;
  padding-block-start: var(--bottom-action-space, var(--space-2));
  padding-block-end: max(var(--bottom-action-space, var(--space-2)), var(--safe-area-bottom, 0px));
  border-top: var(--control-border-width) solid var(--color-border);
  background: var(--color-surface);
  box-shadow: 0 -4px 16px rgb(23 32 51 / 8%);
  /* Place footer children in the same centered column as the page content. */
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  justify-content: center;
  column-gap: var(--bottom-action-space, var(--space-2));
  /* Fake max-width column: pad sides so content sits where it did before. */
  padding-inline: max(
    var(--bottom-action-space, var(--space-2)),
    calc((100% - var(--app-max-width, 960px)) / 2 + var(--bottom-action-space, var(--space-2)))
  );
}

/* When bottom nav is docked under the viewport, sit Done above it. */
body:has(.app-shell__navigation:not([hidden])) .tools-page--generator .create-trade__view--selection:not([hidden]) > .create-trade-selection__footer {
  bottom: 0;
}


/* phone: Done footer flush to screen bottom */
@media (max-width: 720px) {
  .tools-page--generator .create-trade__view--selection:not([hidden]) > .create-trade-selection__footer,
  body:has(.app-shell__navigation:not([hidden])) .tools-page--generator .create-trade__view--selection:not([hidden]) > .create-trade-selection__footer {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    z-index: calc(var(--z-index-bottom-navigation, 100) + 20) !important;
    padding-inline: var(--bottom-action-space, var(--space-2)) !important;
    padding-block-start: var(--bottom-action-space, var(--space-2)) !important;
    padding-block-end: max(
      var(--bottom-action-space, var(--space-2)),
      env(safe-area-inset-bottom, 0px),
      var(--safe-area-bottom, 0px)
    ) !important;
  }

  .tools-page--generator .create-trade__view--selection:not([hidden]),
  body:has(.app-shell__navigation:not([hidden])) .tools-page--generator .create-trade__view--selection:not([hidden]) {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px) + var(--safe-area-bottom, 0px)) !important;
  }

  /* Selection owns the bottom chrome on phone; keep tab bar from reserving a gap. */
  .app-shell:has(.tools-page--generator .create-trade[data-active-view='selection']) > .app-shell__navigation {
    display: none !important;
  }
}

/* Removed max-width:899px footer lift: ≥720 nav is top-docked so bottom
   offset must stay 0; <720 phone rules already pin footer flush. */

.tools-page--generator .create-trade__view--selection:not([hidden]) > .create-trade-selection__grid-host {
  flex: 0 0 auto;
  height: auto;
  max-height: none;
  min-height: 0;
  overflow: visible;
}

.tools-page--generator .create-trade-selection__grid-host .pokemon-grid {
  height: auto;
  max-height: none;
  grid-template-rows: auto;
}

.tools-page--generator .create-trade-selection__grid-host,
.tools-page--generator .create-trade-selection__grid-host .pokemon-grid {
  overflow: visible !important;
  height: auto !important;
  max-height: none !important;
}

.tools-page--generator .create-trade-selection__grid-host .pokemon-grid__items {
  overflow: visible !important;
  overflow-x: visible !important;
  overflow-y: visible !important;
  overscroll-behavior-y: auto;
  height: auto !important;
  max-height: none !important;
  min-height: 0;
}

.tools-page--generator .create-trade__view--selection[hidden] {
  display: none !important;
}

/* === /app/styles/pages/profile.css === */
.profile-page {
  /* Profile-only gutters: global --page-padding-inline is 0 for feed edge-to-edge. */
  --page-padding-inline: var(--space-1);
  display: grid;
  align-content: start;
  gap: var(--space-2);
  min-width: 0;
  min-height: 100%;
  padding-block: var(--space-4) var(--space-5);
  padding-inline: var(--page-padding-inline);
  overflow-x: clip;
}

.profile-identity {
  display: grid;
  justify-items: center;
  gap: var(--space-3);
  width: min(100%, 28rem);
  max-width: 100%;
  margin-inline: auto;
  text-align: center;
}

.profile-page {
  position: relative;
}

/* Old in-page hamburger is retired — menu lives in the primary nav chrome. */
.profile-identity__menu {
  display: none !important;
}

.profile-identity__avatar {
  /* Visuals from .trainer-avatar; keep class for page layout hooks. */
}

.profile-identity__avatar-wrap {
  position: relative;
  display: inline-grid;
  justify-self: center;
  place-items: center;
}

.profile-identity__avatar-wrap--editable .presence-dot {
  inset-inline-end: auto;
  inset-inline-start: 0;
}

.profile-identity__avatar-edit {
  position: absolute;
  inset-block-end: -0.15rem;
  inset-inline-end: -0.15rem;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  margin: 0;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  background: var(--color-surface);
  color: var(--color-text-primary);
  box-shadow: 0 1px 4px color-mix(in srgb, var(--color-text-primary) 16%, transparent);
  cursor: pointer;
}

.profile-identity__avatar-edit svg {
  width: 1rem;
  height: 1rem;
}

.profile-identity__avatar-edit:focus-visible {
  outline: 2px solid var(--color-control-primary);
  outline-offset: 2px;
}

.profile-identity__last-seen {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: var(--font-size-control-sm);
  font-weight: var(--font-weight-control);
  line-height: 1.2;
}

.profile-identity__last-seen[hidden] {
  display: none;
}

.profile-identity__level {
  flex: 0 0 auto;
  min-width: var(--control-height-compact);
  padding: var(--space-1) var(--space-2);
  border-radius: 999px;
  background: var(--color-control-primary);
  color: var(--color-control-on-primary);
  font-size: var(--font-size-control-sm);
  font-weight: var(--font-weight-control);
  line-height: 1.2;
  white-space: nowrap;
}

.profile-identity__username-row {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  max-width: 100%;
  min-width: 0;
}

.profile-identity__username {
  margin: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  color: var(--color-text-primary);
  font-size: var(--font-size-overlay-title);
  font-weight: var(--font-weight-control);
  line-height: 1;
}

.profile-identity__badges {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: var(--space-1);
}

.profile-identity__flag {
  flex: 0 0 auto;
  display: block;
  box-sizing: border-box;
  width: var(--icon-size);
  height: var(--icon-size);
  margin: 0;
  padding: 0;
  object-fit: contain;
  vertical-align: middle;
}

.profile-identity__flight-icon {
  flex: 0 0 auto;
  display: block;
  box-sizing: border-box;
  width: 50px;
  height: 25px;
  margin: 0;
  padding: 0;
  object-fit: contain;
}

.profile-identity__friend-code {
  max-width: 100%;
}


.profile-identity__message {
  width: 100%;
  max-width: 100%;
}

.profile-identity__actions {
  display: grid;
  gap: var(--space-2);
  width: 100%;
  max-width: 100%;
}

.profile-identity__share,
.profile-identity__edit {
  width: 100%;
  max-width: 100%;
}

@media (max-width: 600px) {
  .profile-identity__actions {
    grid-column: 1 / -1;
    grid-row: auto;
  }
}


/* Compact identity — avatar left, name + friend code right (all profile tabs).
   Keep after base identity rules so mobile justify/gap overrides win the cascade. */
@media (max-width: 600px) {
  .profile-identity {
    grid-template-columns: 56px minmax(0, 1fr);
    column-gap: var(--space-2);
    row-gap: var(--space-1);
    justify-items: stretch;
    align-items: center;
    width: 100%;
    max-width: 100%;
    margin-inline: 0;
    text-align: start;
  }

  .profile-identity__avatar-wrap {
    grid-column: 1;
    grid-row: 1 / span 2;
    justify-self: start;
    align-self: center;
  }

  .profile-identity .trainer-avatar--lg {
    width: 56px;
    height: 56px;
    min-width: 56px;
    min-height: 56px;
    font-size: var(--font-size-control-lg);
  }

  .profile-identity__avatar-edit {
    width: 1.5rem;
    height: 1.5rem;
    inset-block-end: -0.1rem;
    inset-inline-end: -0.1rem;
  }

  .profile-identity__avatar-edit svg {
    width: 0.75rem;
    height: 0.75rem;
  }

  .profile-identity__username-row {
    grid-column: 2;
    grid-row: 1;
    flex-wrap: nowrap;
    justify-content: flex-start;
    justify-self: start;
    align-self: end;
    gap: var(--space-1);
    width: 100%;
    max-width: 100%;
  }

  .profile-identity__username-row .notification-bell-host {
    margin-inline-start: auto;
  }

  .profile-identity__username {
    font-size: 1.125rem;
    line-height: 1.2;
  }

  .profile-identity__last-seen {
    grid-column: 2;
    grid-row: 3;
    justify-self: start;
  }

  .profile-identity__friend-code {
    grid-column: 2;
    grid-row: 2;
    justify-self: start;
    align-self: start;
    max-width: 100%;
  }


  .profile-identity__message {
    grid-column: 1 / -1;
    grid-row: auto;
  }
}

.profile-page__identity {
  min-width: 0;
}

.profile-my-trades {
  display: grid;
  gap: var(--space-3);
  min-width: 0;
  width: 100%;
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
}

.profile-my-trades__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  justify-content: stretch;
  gap: var(--space-2);
  min-width: 0;
  width: 100%;
}

.profile-page__sections .profile-my-trades__header {
  justify-content: stretch;
  width: 100%;
}

.profile-page__sections .profile-my-trades__actions:not([hidden]) {
  width: 100%;
}

.profile-page__sections .profile-my-trades__actions > .button {
  width: 100%;
}

.profile-my-trades__actions {
  display: grid;
  flex: 1 1 auto;
  justify-content: stretch;
  width: 100%;
  min-width: 0;
  max-width: none;
}

.profile-my-trades__actions[hidden] {
  display: none;
}

.profile-my-trades__actions > .button {
  width: 100%;
  min-width: 0;
  max-width: none;
  justify-content: center;
}

/* Content-sized CTA — overrides any leftover icon-only add-listing rules. */
.profile-my-trades__add-listing.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: auto;
  min-width: 9rem;
  max-width: 100%;
  height: auto;
  min-height: var(--control-height-sm);
  margin: 0;
  padding-block: 0;
  padding-inline: var(--control-padding-sm, var(--space-3));
  border-style: solid;
  border-width: var(--control-border-width);
  border-radius: var(--radius-control, var(--radius-md));
  cursor: pointer;
}

.profile-my-trades__add-listing.button .button__icon {
  width: 1.125rem;
  height: 1.125rem;
}

.profile-my-trades__add-listing.button .button__icon svg {
  width: 100%;
  height: 100%;
}

.profile-my-trades__title {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--color-text-primary);
  font-size: 17px;
  font-weight: var(--font-weight-control);
  line-height: var(--overlay-heading-line-height);
}

.profile-my-trades__body {
  min-width: 0;
}

.profile-my-trades__list {
  display: grid;
  gap: var(--space-1);
  box-sizing: border-box;
  min-width: 0;
  /* Flush pink/blue panels to content edges like home feed (page padding is profile-only). */
  width: calc(100% + (2 * var(--page-padding-inline)));
  max-width: none;
  margin-inline: calc(-1 * var(--page-padding-inline));
}

.profile-my-trades__card-host {
  min-width: 0;
}

/* Match home feed: pink/blue panels flush L/R; header/actions share a small inset. */
.profile-my-trades .trade-card__header,
.profile-my-trades .trade-card__actions {
  padding-inline: 3px;
}

.profile-my-trades .trade-card__actions {
  display: grid;
  grid-template-columns: repeat(var(--trade-card-action-count, 3), minmax(0, 1fr));
  gap: var(--space-2);
}

.profile-my-trades .trade-card__action.button {
  flex: unset;
  width: 100%;
  min-width: 0;
  max-width: none;
}

.profile-trade-edit-selection {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(100%, var(--app-max-width));
  height: 100%;
  min-width: 0;
  min-height: 0;
  margin-inline: auto;
  background: var(--color-background);
  color: var(--color-text-primary);
}

.profile-trade-edit-selection[hidden] {
  display: none;
}

.overlay-layer:has(> .profile-trade-edit-selection) {
  padding: 0;
  align-items: stretch;
  justify-items: stretch;
}

.profile-trade-edit-selection .create-trade__view--selection {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}

@media (min-width: 640px) {
  .profile-identity,
  .profile-edit {
    width: min(100%, 32rem);
  }
}

.profile-edit {
  display: grid;
  gap: var(--space-5);
  width: min(100%, 28rem);
  max-width: 100%;
  margin-inline: auto;
}

.profile-edit__form {
  display: grid;
  gap: var(--space-5);
}

.profile-edit__fields {
  display: grid;
  gap: var(--space-4);
}

.profile-edit__field {
  display: grid;
  gap: var(--space-2);
  min-width: 0;
}

.profile-edit__label {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: var(--font-size-control-sm);
  font-weight: var(--font-weight-control);
}

.profile-edit__input,
.profile-edit__country,
.profile-edit__country-search {
  box-sizing: border-box;
  width: 100%;
  min-height: var(--control-height-sm);
  padding-block: var(--space-2);
  padding-inline: var(--space-3);
  border: var(--control-border-width) solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text-primary);
  font: inherit;
  font-size: var(--font-size-control-md);
}

.profile-edit__country {
  display: flex;
  align-items: center;
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: start;
}

.profile-edit__input[type='number'] {
  appearance: textfield;
}

.profile-edit__input[type='number']::-webkit-inner-spin-button,
.profile-edit__input[type='number']::-webkit-outer-spin-button {
  appearance: none;
  margin: 0;
}

.profile-edit__error,
.profile-edit__summary {
  margin: 0;
  color: var(--color-control-danger);
  font-size: var(--font-size-control-sm);
}

.profile-edit__flight {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-2);
}

.profile-edit__flight .button[aria-pressed='true'] {
  border-color: var(--color-control-primary);
  box-shadow: inset 0 0 0 1px var(--color-control-primary);
  background: var(--color-control-selected);
  color: var(--color-text-primary);
}

.profile-edit__actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-3);
  padding-bottom: var(--space-4);
}

.profile-edit__country-picker {
  display: grid;
  gap: var(--space-3);
  min-width: 0;
}

.profile-edit__country-list {
  display: grid;
  gap: var(--space-2);
  max-height: 50vh;
  overflow: auto;
}

.profile-edit__country-option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  min-height: var(--control-height-sm);
  padding-inline: var(--space-3);
  border: var(--control-border-width) solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text-primary);
  text-align: start;
}

.profile-edit__country-flag {
  width: var(--icon-size);
  height: var(--icon-size);
  object-fit: contain;
}

.profile-avatar-page {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: var(--space-4);
  min-width: 0;
  min-height: 100%;
  padding-block: var(--space-4) var(--space-5);
  padding-inline: var(--page-padding-inline);
  /* Room for fixed Cancel/Save bar above bottom navigation. */
  padding-bottom: calc(
    var(--space-5)
    + 3.5rem
    + var(--bottom-action-space, 6px) * 2
    + var(--bottom-navigation-height, 54px)
    + var(--safe-area-bottom, 0px)
  );
}

.profile-avatar-page__status {
  min-width: 0;
}

.profile-avatar-page__status[hidden] {
  display: none;
}

.profile-avatar-page__grid {
  min-width: 0;
  min-height: 0;
}

.profile-avatar-page__grid .pokemon-grid {
  --pokemon-item-gap: var(--space-2);
}

.profile-avatar-page__grid .pokemon-item {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  gap: 0;
  padding: var(--space-2);
}

.profile-avatar-page__grid .pokemon-item__media {
  width: 100%;
  aspect-ratio: 1;
}

.profile-avatar-page__grid .pokemon-item__details,
.profile-avatar-page__grid .pokemon-item__badge-stack,
.profile-avatar-page__grid .pokemon-item__top-badge {
  display: none;
}

.profile-avatar-page__footer {
  position: fixed;
  left: 50%;
  bottom: calc(var(--bottom-navigation-height, 54px) + var(--safe-area-bottom, 0px));
  z-index: calc(var(--z-index-bottom-navigation, 200) + 20);
  display: grid;
  gap: var(--space-2);
  box-sizing: border-box;
  width: min(100%, var(--app-max-width, 100%));
  margin: 0;
  padding-inline: var(--page-padding-inline);
  padding-block: var(--bottom-action-space, 6px);
  border-top: var(--control-border-width, 1px) solid var(--color-border);
  background: var(--color-surface);
  box-shadow: 0 -8px 24px rgb(0 0 0 / 6%);
  transform: translateX(-50%);
}

.profile-avatar-page__actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: var(--space-2);
  width: 100%;
}

.profile-avatar-page__action {
  width: 100%;
  min-height: 2.75rem;
  border-radius: 0.85rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.profile-avatar-page__section-title {
  margin: 0;
  color: var(--color-text-primary);
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.profile-avatar-page__custom {
  display: grid;
  gap: var(--space-3);
  min-width: 0;
}

.profile-avatar-page__custom[hidden],
.profile-avatar-page__section-title[hidden] {
  display: none;
}

.profile-avatar-page__custom-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr));
  gap: var(--space-2);
}

.profile-avatar-page__custom-item {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 0.35rem;
  border: 2px solid transparent;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
}

.profile-avatar-page__custom-item.is-selected {
  border-color: var(--color-accent, #2563eb);
}

.profile-avatar-page__custom-image {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  object-fit: cover;
  background: color-mix(in srgb, var(--color-surface) 80%, #111);
}

/* lt:addtrfw1 — Add trade stretches full content width */
.profile-my-trades__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
}

.profile-my-trades__actions:not([hidden]) {
  display: grid;
  width: 100%;
}

.profile-my-trades__add-listing {
  width: 100%;
  max-width: none;
  justify-content: center;
}

/* === /app/styles/pages/profile-menu.css === */
.profile-menu {
  display: grid;
  gap: var(--space-4);
  min-width: 0;
}

.profile-menu--panel .profile-menu__header {
  grid-template-columns: minmax(0, 1fr) var(--control-height-sm);
}

.profile-menu--panel .profile-menu__title {
  text-align: start;
  padding-inline-start: var(--space-1);
}

.profile-menu__header {
  display: grid;
  grid-template-columns: var(--control-height-sm) minmax(0, 1fr) var(--control-height-sm);
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.profile-menu__back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--control-height-sm);
  height: var(--control-height-sm);
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-primary);
  cursor: pointer;
}

.profile-menu__back:hover,
.profile-menu__back:focus-visible {
  background: var(--color-control-secondary);
}

.profile-menu__back svg {
  width: 1.25rem;
  height: 1.25rem;
}

.profile-menu__title {
  margin: 0;
  color: var(--color-text-primary);
  font-size: var(--font-size-overlay-title);
  font-weight: var(--font-weight-control);
  line-height: var(--overlay-heading-line-height);
  text-align: center;
}

.profile-menu__header-spacer {
  width: var(--control-height-sm);
  height: var(--control-height-sm);
}

.profile-menu__list {
  display: grid;
  gap: var(--space-5);
  min-width: 0;
}

.profile-menu__group {
  display: grid;
  gap: var(--space-1);
  min-width: 0;
}

.profile-menu__group-title {
  margin: 0;
  padding-inline: var(--space-3);
  color: var(--color-text-secondary);
  font-size: var(--font-size-control-sm);
  font-weight: var(--font-weight-control);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.profile-menu__group-list {
  display: grid;
  gap: var(--space-1);
  min-width: 0;
}

.profile-menu__group--session {
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
}

.profile-menu__group--danger {
  margin-top: var(--space-2);
}

.profile-menu__theme-option {
  min-width: 3.5rem;
  min-height: 2rem;
  margin: 0;
  padding: 0 var(--space-3);
  border: 0;
  border-radius: calc(var(--radius-sm) - 2px);
  background: transparent;
  color: var(--color-text-secondary);
  font: inherit;
  font-size: var(--font-size-control-sm);
  font-weight: var(--font-weight-control);
  cursor: pointer;
}

.profile-menu__theme-option[aria-checked='true'] {
  background: var(--color-surface);
  color: var(--color-text-primary);
  box-shadow: 0 1px 3px color-mix(in srgb, var(--color-text-primary) 14%, transparent);
}

.profile-menu__row {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  min-height: var(--control-height-sm);
  margin: 0;
  padding-block: var(--space-3);
  padding-inline: var(--space-3);
  border: var(--control-border-width) solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-primary);
  font: inherit;
  font-size: var(--font-size-control-md);
  font-weight: var(--font-weight-control);
  text-align: start;
  cursor: pointer;
}

.profile-menu__row:hover,
.profile-menu__row:focus-visible {
  background: var(--color-control-secondary);
}

.profile-menu__row--danger,
.profile-menu__row--danger .profile-menu__label,
.profile-menu__row--danger .profile-menu__icon {
  color: var(--color-control-danger);
}

.profile-menu__icon {
  display: inline-flex;
  flex-shrink: 0;
  width: var(--icon-size);
  height: var(--icon-size);
  color: var(--color-text-secondary);
}

.profile-menu__icon svg {
  width: 100%;
  height: 100%;
}

.profile-menu__label {
  min-width: 0;
}

.profile-menu__external {
  display: inline-flex;
  color: var(--color-text-secondary);
}

.profile-menu__external svg,
.profile-menu__chevron svg,
.profile-menu__status svg {
  width: 1.1rem;
  height: 1.1rem;
}

.profile-menu__chevron {
  display: inline-flex;
  color: var(--color-text-secondary);
}

.profile-menu__status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text-secondary);
}

.profile-menu__status-label {
  font-size: var(--font-size-control-sm);
}

.profile-menu__appearance {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border-radius: var(--radius-sm);
  background: var(--color-control-secondary);
}

.profile-menu__appearance-label {
  color: var(--color-text-secondary);
  font-size: var(--font-size-control-sm);
}

.profile-menu__switch {
  position: relative;
  box-sizing: border-box;
  width: 2.75rem;
  height: 1.6rem;
  margin: 0;
  padding: 0;
  border: var(--control-border-width) solid var(--color-border);
  border-radius: 999px;
  background: var(--color-control-secondary);
  cursor: pointer;
}

.profile-menu__switch--on {
  border-color: var(--color-control-primary);
  background: var(--color-control-primary);
}

.profile-menu__switch-thumb {
  position: absolute;
  top: 50%;
  left: 0.15rem;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 999px;
  background: var(--color-text-primary);
  transform: translateY(-50%);
  transition: transform var(--duration-standard);
}

.profile-menu__switch--on .profile-menu__switch-thumb {
  transform: translate(1.15rem, -50%);
  background: var(--color-control-on-primary, #fff);
}

.profile-menu__feedback {
  display: grid;
  gap: var(--space-3);
  min-width: 0;
}

.profile-menu__feedback-label {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: var(--font-size-control-sm);
}

.profile-menu__feedback-input {
  box-sizing: border-box;
  width: 100%;
  min-height: 8rem;
  padding: var(--space-3);
  border: var(--control-border-width) solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text-primary);
  font: inherit;
  font-size: var(--font-size-control-md);
  resize: vertical;
}

.profile-menu__delete-account {
  display: grid;
  gap: var(--space-3);
  min-width: 0;
}

.profile-menu__delete-account-warning {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: var(--font-size-control-sm);
}

.profile-menu__delete-account-label {
  margin: 0;
  color: var(--color-text-primary);
  font-size: var(--font-size-control-sm);
  font-weight: var(--font-weight-control);
}

.profile-menu__delete-account-input {
  box-sizing: border-box;
  width: 100%;
  min-height: var(--control-height-sm);
  padding: var(--space-2) var(--space-3);
  border: var(--control-border-width) solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text-primary);
  font: inherit;
  font-size: var(--font-size-control-md);
}

.profile-menu__delete-account-divider {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: var(--font-size-control-sm);
  text-align: center;
}

.profile-menu__delete-account-google {
  min-width: 0;
  min-height: 2.5rem;
}

.profile-menu__change-password,
.profile-menu__google-account {
  display: grid;
  gap: var(--space-3);
  min-width: 0;
}

.profile-blocked-users {
  display: grid;
  gap: var(--space-4);
  min-width: 0;
}

.profile-blocked-users__header {
  display: grid;
  grid-template-columns: var(--control-height-sm) minmax(0, 1fr) var(--control-height-sm);
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.profile-blocked-users__back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--control-height-sm);
  height: var(--control-height-sm);
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-primary);
  cursor: pointer;
}

.profile-blocked-users__back:hover,
.profile-blocked-users__back:focus-visible {
  background: var(--color-control-secondary);
}

.profile-blocked-users__back svg {
  width: 1.25rem;
  height: 1.25rem;
}

.profile-blocked-users__title {
  margin: 0;
  color: var(--color-text-primary);
  font-size: var(--font-size-overlay-title);
  font-weight: var(--font-weight-control);
  line-height: var(--overlay-heading-line-height);
  text-align: center;
}

.profile-blocked-users__header-spacer {
  width: var(--control-height-sm);
  height: var(--control-height-sm);
}

.profile-blocked-users__body {
  min-width: 0;
}

.profile-blocked-users__empty {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-6) var(--space-3);
  text-align: center;
}

.profile-blocked-users__empty-title {
  margin: 0;
  color: var(--color-text-primary);
  font-size: var(--font-size-control-md);
  font-weight: var(--font-weight-control);
}

.profile-blocked-users__empty-copy {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: var(--font-size-control-sm);
}

.profile-blocked-users__list {
  display: grid;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}

.profile-blocked-users__row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--control-height-md);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
}

.profile-blocked-users__identity {
  min-width: 0;
}

.profile-blocked-users__name {
  margin: 0;
  overflow: hidden;
  color: var(--color-text-primary);
  font-size: var(--font-size-control-md);
  font-weight: var(--font-weight-control);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-blocked-users__unblock {
  margin: 0;
  padding: var(--space-2) var(--space-3);
  border: var(--control-border-width) solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-control-secondary);
  color: var(--color-text-primary);
  font: inherit;
  font-size: var(--font-size-control-sm);
  font-weight: var(--font-weight-control);
  cursor: pointer;
}

.profile-blocked-users__unblock:hover,
.profile-blocked-users__unblock:focus-visible {
  background: var(--color-control-secondary-hover);
}

.profile-blocked-users__unblock:disabled {
  opacity: 0.6;
  cursor: default;
}

.notification-settings {
  display: grid;
  gap: var(--space-4);
}

.notification-settings__title {
  margin: 0;
  font-size: var(--font-size-title-sm, 1.125rem);
}

.notification-settings__status {
  margin: 0;
  color: var(--color-text-secondary);
}

.notification-settings__status[hidden] {
  display: none;
}

.notification-settings__list {
  display: grid;
  gap: 0;
}

.notification-settings__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: var(--touch-target-size);
  padding-block: var(--space-2);
  border-bottom: 1px solid var(--color-border);
}

.notification-settings__row:last-child {
  border-bottom: 0;
}

.notification-settings__label {
  color: var(--color-text-primary);
  font-weight: var(--font-weight-control);
}

/* desktop-text-nav-linkrow */

.profile-menu__row--link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.profile-menu__row--link:focus-visible {
  outline: var(--control-focus-width) solid var(--color-control-focus);
  outline-offset: 0;
}

/* === /app/styles/pages/profile-sections.css === */
/* Own-profile section switcher — segmented control (aligned with tabs[data-variant=segmented]) */
.profile-page__sections {
  display: grid;
  gap: var(--space-1);
  min-width: 0;
  width: 100%;
  padding-top: var(--space-1);
  border-top: 1px solid var(--color-border);
  /* Matches sub-tabs stick below this bar (padding + tabs chrome). */
  --profile-section-tabs-sticky-offset: calc(
    var(--safe-area-top, 0px)
    + var(--space-2)
    + var(--tab-height)
    + (2 * var(--tab-gap))
    + var(--space-2)
  );
}

@media (min-width: 900px) {
  .profile-page__sections {
    max-width: var(--app-max-width, 960px);
    margin-inline: auto;
  }
}

/*
 * Sticky chrome inside app-shell__viewport.
 * Profile route hides the app header, so top uses --safe-area-top (0 when header
 * owns the inset). Box-shadow fills the notch gap so scrolled content does not show through.
 */
.profile-page__section-tabs-bar {
  position: sticky;
  top: var(--safe-area-top, 0px);
  z-index: var(--z-index-sticky-header);
  box-sizing: border-box;
  width: calc(100% + (2 * var(--page-padding-inline)));
  max-width: none;
  margin-inline: calc(-1 * var(--page-padding-inline));
  padding: var(--space-2) var(--page-padding-inline);
  background: var(--color-background);
  box-shadow: 0 calc(-1 * var(--safe-area-top, 0px)) 0 var(--safe-area-top, 0px) var(--color-background);
}

.profile-page__section-tabs {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: var(--tab-gap);
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: var(--tab-gap);
  border: var(--control-border-width) solid var(--tab-border);
  border-radius: var(--tab-radius);
  background: var(--tab-background);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.profile-page__section-tab {
  position: relative;
  display: inline-flex;
  flex: 1 1 0;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  box-sizing: border-box;
  margin: 0;
  min-width: 0;
  max-width: 100%;
  min-height: var(--tab-height);
  padding-inline: var(--space-1);
  border: var(--control-border-width) solid transparent;
  border-radius: calc(var(--tab-radius) - 2px);
  background: transparent;
  color: var(--color-text-secondary);
  font: inherit;
  font-size: var(--font-size-control-sm, 0.875rem);
  font-weight: var(--font-weight-control);
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition:
    background-color var(--duration-standard),
    border-color var(--duration-standard),
    color var(--duration-standard);
}

.profile-page__section-tab-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-page__section-tab-count {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  box-sizing: border-box;
  min-width: 1.25rem;
  height: 1.25rem;
  padding-inline: 0.35rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-text-secondary) 16%, transparent);
  color: var(--color-text-secondary);
  font-size: 0.6875rem;
  font-weight: var(--font-weight-control);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.profile-page__section-tab[aria-selected='true'] .profile-page__section-tab-count,
.profile-page__section-tab.is-active .profile-page__section-tab-count {
  background: color-mix(in srgb, var(--color-control-primary) 18%, transparent);
  color: var(--color-text-primary);
}

.profile-page__section-tab:hover:not(:disabled),
.profile-page__section-tab:focus-visible:not(:disabled) {
  color: var(--color-text-primary);
}

.profile-page__section-tab:focus-visible {
  outline: var(--control-focus-width, 2px) solid var(--color-control-focus);
  outline-offset: var(--control-focus-offset, 2px);
}

.profile-page__section-tab:disabled {
  opacity: var(--control-disabled-opacity);
  cursor: default;
}

.profile-page__section-tab[aria-current='true'],
.profile-page__section-tab[aria-selected='true'],
.profile-page__section-tab.is-active {
  border-color: var(--tab-border);
  background: var(--tab-active);
  color: var(--color-text-primary);
  box-shadow: 0 1px 2px rgb(0 0 0 / 8%);
}

/* Compact size — same family for Have / Wish List */
.profile-page__section-tabs--sm {
  padding: var(--tab-gap-sm);
  gap: var(--tab-gap-sm);
}

.profile-page__section-tabs--sm .profile-page__section-tab {
  min-height: var(--tab-height-sm);
  padding-inline: var(--space-2);
  font-size: var(--font-size-control-sm, 0.8125rem);
}

.profile-page__section-panels {
  min-width: 0;
}

.profile-page__section-panel {
  min-width: 0;
}

.profile-page__section-panel[hidden] {
  display: none;
}

/* Tab label is the section title — avoid duplicate H2 chrome inside panels */
.profile-page__sections .profile-my-trades__title,
.profile-page__sections .profile-my-collection__title,
.profile-page__sections .profile-my-matches__title {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.profile-page__sections .profile-my-trades,
.profile-page__sections .profile-my-collection,
.profile-page__sections .profile-my-matches {
  padding-top: 0;
  border-top: 0;
}

/* Title-only headers — tab label already names the section */
.profile-page__sections .profile-my-collection__header,
.profile-page__sections .profile-my-matches__header {
  display: none;
}

/* === /app/styles/pages/profile-my-collection.css === */
.profile-my-collection {
  display: grid;
  gap: var(--space-3);
  min-width: 0;
  width: 100%;
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
}

.profile-my-collection__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-width: 0;
}

.profile-my-collection__title {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--color-text-primary);
  font-size: 17px;
  font-weight: var(--font-weight-control);
  line-height: var(--overlay-heading-line-height);
}

/* Have / Wish use .profile-page__section-tabs(--sm) + .profile-page__section-tab */
.profile-my-collection__tabs[hidden] {
  display: none;
}

.profile-my-collection__toolbar {
  display: grid;
  gap: var(--space-2);
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
}

.profile-my-collection__toolbar[hidden] {
  display: none;
}

.profile-my-collection__visibility {
  display: grid;
  justify-items: start;
  gap: var(--space-1);
  min-width: 0;
}

.profile-my-collection__visibility-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  box-sizing: border-box;
  max-width: 100%;
  min-height: 2.25rem;
  margin: 0;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-text-primary);
  font: inherit;
  font-size: var(--font-size-control-sm, 0.875rem);
  font-weight: var(--font-weight-control);
  line-height: 1.2;
  cursor: pointer;
}

.profile-my-collection__visibility-chip:hover:not(:disabled),
.profile-my-collection__visibility-chip:focus-visible:not(:disabled) {
  background: var(--color-control-secondary);
}

.profile-my-collection__visibility-chip:focus-visible {
  outline: var(--control-focus-width, 2px) solid var(--color-control-focus);
  outline-offset: var(--control-focus-offset, 2px);
}

.profile-my-collection__visibility-chip:disabled {
  opacity: var(--control-disabled-opacity);
  cursor: default;
}

.profile-my-collection__visibility-chip[aria-expanded='true'] {
  border-color: var(--color-control-primary);
  background: var(--color-control-secondary);
}

.profile-my-collection__visibility-chip-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-my-collection__visibility-chip-caret {
  flex: 0 0 auto;
  color: var(--color-text-secondary);
  font-size: 0.75rem;
  line-height: 1;
}

.profile-my-collection__visibility-hint {
  margin: 0;
  max-width: 28rem;
  color: var(--color-text-secondary);
  font-size: 0.75rem;
  line-height: 1.35;
}

.profile-my-collection__visibility-sheet {
  display: grid;
  gap: var(--space-2);
  min-width: 0;
  padding-block: var(--space-1);
}

.profile-my-collection__visibility-options {
  display: grid;
  gap: var(--space-2);
  min-width: 0;
}

.profile-my-collection__visibility-option {
  display: grid;
  gap: var(--space-1);
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text-primary);
  font: inherit;
  text-align: start;
  cursor: pointer;
}

.profile-my-collection__visibility-option:hover,
.profile-my-collection__visibility-option:focus-visible {
  background: var(--color-control-secondary);
}

.profile-my-collection__visibility-option:focus-visible {
  outline: var(--control-focus-width, 2px) solid var(--color-control-focus);
  outline-offset: var(--control-focus-offset, 2px);
}

.profile-my-collection__visibility-option.is-selected {
  border-color: var(--color-control-primary);
  background: var(--color-control-secondary);
  box-shadow: inset 0 0 0 1px var(--color-control-primary);
}

.profile-my-collection__visibility-option-title {
  font-size: var(--font-size-control-md, 0.9375rem);
  font-weight: var(--font-weight-control);
  line-height: 1.25;
}

.profile-my-collection__visibility-option-desc {
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
  line-height: 1.35;
}

.profile-my-collection__stats {
  display: grid;
  gap: var(--space-1);
  min-width: 0;
  width: 100%;
}

.profile-my-collection__count {
  margin: 0;
  min-width: 0;
  color: var(--color-text-primary);
  font-size: var(--font-size-control-sm, 0.875rem);
  font-weight: var(--font-weight-control);
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}

.profile-my-collection__progress {
  box-sizing: border-box;
  width: 100%;
  height: 0.375rem;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-text-secondary) 18%, transparent);
}

.profile-my-collection__progress-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--color-control-primary);
}

.profile-my-collection__actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  width: 100%;
}

.profile-my-collection__actions > .button {
  width: 100%;
  min-width: 0;
  max-width: none;
  height: 44px;
  min-height: 44px;
}

.profile-my-collection__actions .button__content {
  min-width: 0;
  max-width: 100%;
}

.profile-my-collection__actions .button__icon {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
}

.profile-my-collection__actions .button__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-my-collection__actions--readonly {
  grid-template-columns: minmax(0, 1fr);
}

.profile-my-collection__actions--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profile-my-collection__body,
.profile-my-collection__content {
  min-width: 0;
}

.profile-my-collection__content {
  margin-inline: 0;
}

.profile-my-collection__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr));
  gap: 3px;
  box-sizing: border-box;
  margin: 0;
  padding: 0 5px;
  list-style: none;
  min-width: 0;
  max-width: 100%;
}

.profile-my-collection--remove-mode {
  padding-bottom: calc(4.25rem + var(--space-3));
}

.profile-my-collection__grid-item {
  display: grid;
  gap: 0;
  justify-items: stretch;
  min-width: 0;
  isolation: isolate;
}

.profile-my-collection__card {
  position: relative;
  min-width: 0;
  width: 100%;
}

.profile-my-collection__card--selectable {
  cursor: pointer;
}

.profile-my-collection__grid--remove-mode .profile-my-collection__card--selectable:hover {
  outline: 2px solid var(--color-control-focus, #3b82f6);
  outline-offset: 1px;
  border-radius: var(--pokemon-item-radius, 10px);
}

.profile-my-collection__grid-item.is-marked-remove .profile-my-collection__card {
  border-radius: var(--pokemon-item-radius, 10px);
  background: var(--color-control-selected-danger);
}

.profile-my-collection__grid-item.is-marked-remove .pokemon-item,
.profile-my-collection__grid-item.is-marked-remove .pokemon-item__media,
.profile-my-collection__grid-item.is-marked-remove .pokemon-item__image {
  opacity: 0.48;
}

.profile-my-collection__remove-mark {
  position: absolute;
  inset-block-start: 0.2rem;
  inset-inline-end: 0.2rem;
  z-index: 2;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 1.75rem;
  height: 1.75rem;
  pointer-events: none;
  border-radius: 999px;
  background: var(--color-control-danger);
  color: var(--color-control-on-danger);
  box-shadow: 0 0 0 1.5px var(--color-surface, #fff);
}

.profile-my-collection__remove-mark svg {
  width: 1rem;
  height: 1rem;
  display: block;
}

.profile-my-collection__remove-footer {
  position: fixed;
  left: 50%;
  bottom: calc(var(--bottom-navigation-height, 54px) + var(--safe-area-bottom, 0px));
  z-index: calc(var(--z-index-bottom-navigation, 40) - 1);
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  gap: 3px;
  box-sizing: border-box;
  width: min(100%, var(--app-max-width, 100%));
  margin: 0;
  padding: var(--space-2) 5px;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface, var(--color-background, #fff));
  box-shadow: 0 -6px 16px rgba(15, 23, 42, 0.08);
  transform: translateX(-50%);
}

.profile-my-collection__remove-footer .button {
  width: 100%;
  min-width: 0;
}

@media (min-width: 640px) {
  .profile-my-collection__visibility-hint {
    max-width: 36rem;
  }
}

/*
 * Membership badges overlay each tile (no footer strip below).
 * Keep badges OUT of the pokemon-item box model — position:absolute on the cell.
 * Never use display:flex / overflow:hidden / height:100% on the cell or
 * pokemon-item here — that collapses .pokemon-item__media aspect-ratio to ~0.
 *
 * Columns: S=5, M=4, L=3 (tokens). Corner badges are 44px touch / 32px icon.
 */
.profile-trade-edit-selection--membership .pokemon-grid__items {
  align-items: start;
}

.profile-trade-edit-selection--membership .pokemon-grid__cell {
  position: relative;
  align-self: start;
  min-width: 0;
  padding-bottom: 0;
  box-sizing: border-box;
}

.profile-trade-edit-selection--membership .pokemon-grid__cell > .pokemon-item {
  display: block;
  width: 100%;
  height: auto;
  min-width: 0;
  min-height: 0;
}

.profile-trade-edit-selection--membership .pokemon-grid__cell > .pokemon-item .pokemon-item__media {
  width: 100%;
  height: auto;
  aspect-ratio: var(--pokemon-media-aspect-ratio, 1);
  border: 1.5px solid rgba(15, 23, 42, 0.12);
  border-radius: 12px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.profile-trade-edit-selection--membership .pokemon-grid__cell:has(.collection-membership[data-have-active='true']) > .pokemon-item .pokemon-item__media {
  border-color: #16a34a;
  box-shadow: 0 0 0 1px rgba(22, 163, 74, 0.35);
}

.collection-membership--badges {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  pointer-events: none;
}

.collection-membership--badges .collection-membership__btn {
  position: absolute;
  bottom: 0;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
  pointer-events: auto;
  cursor: pointer;
  opacity: 0.38;
  transition: opacity 120ms ease, transform 120ms ease, filter 120ms ease;
}

.collection-membership--badges .collection-membership__btn--have {
  left: 0;
}

.collection-membership--badges .collection-membership__btn--wish {
  right: 0;
}

.collection-membership--badges .collection-membership__btn.is-active {
  opacity: 1;
}

.collection-membership--badges .collection-membership__btn:not(.is-active) .collection-membership__icon {
  filter: grayscale(0.35);
}

.collection-membership--badges .collection-membership__btn:disabled {
  opacity: 0.3;
  cursor: wait;
}

.collection-membership--badges .collection-membership__btn:focus-visible {
  outline: var(--control-focus-width, 2px) solid var(--color-control-focus);
  outline-offset: 1px;
  opacity: 1;
}

.collection-membership__icon {
  width: 32px;
  height: 32px;
  display: block;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.create-trade-selection__footer--membership {
  align-items: stretch;
}

.create-trade-selection__count--membership {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
  min-width: 0;
  align-self: center;
}

.collection-membership-stat {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.collection-membership-stat__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-1);
  min-width: 0;
}

.collection-membership-stat__label {
  color: var(--color-text-secondary);
  font-size: 0.6875rem;
  font-weight: var(--font-weight-control);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.collection-membership-stat__value {
  color: var(--color-text-primary);
  font-size: 0.75rem;
  font-weight: var(--font-weight-control);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.collection-membership-stat__track {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--color-control-secondary);
}

.collection-membership-stat__fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--color-control-primary);
  transition: width 160ms ease;
}

.collection-membership-stat[data-stat='have'] .collection-membership-stat__fill {
  background: #16a34a;
}

.collection-membership-stat[data-stat='wish'] .collection-membership-stat__fill {
  background: #e11d48;
}

/* Offscreen host for collection JPG export (reuses trade export painter). */
.profile-my-collection__download-host {
  position: fixed;
  left: 0;
  top: 0;
  z-index: -1;
  width: min(802px, calc(100vw - 16px));
  opacity: 0;
  pointer-events: none;
}

/* Staging canvas used by createTradeImageExporter (also in create-trade.css). */
.create-trade-export-canvas {
  position: fixed;
  z-index: -1;
  top: 0;
  left: -10000px;
  width: 720px;
  padding: var(--space-4, 1rem);
  box-sizing: border-box;
  background: var(--color-background, #fff);
  color: var(--color-text-primary, #0f172a);
}

.trade-card--collection-share[data-presentation='share'] .trade-card__content {
  grid-template-columns: minmax(0, 1fr);
}

.create-trade-export-canvas .trade-card--collection-share.trade-card--export .trade-card__pokemon-scroll {
  overflow: visible;
}

.create-trade-export-canvas .trade-card--collection-share.trade-card--export .trade-card__pokemon-list {
  width: auto;
  min-width: 0;
  grid-auto-columns: auto;
  grid-auto-flow: row;
  /* Column count comes from inline style on each list (per Have/Wish size). */
  grid-template-rows: none;
}

.create-trade-export-canvas .trade-card--collection-share.trade-card--export .trade-card__pokemon-cell {
  width: auto;
}

/* === /app/styles/pages/profile-my-matches.css === */
.profile-my-matches {
  display: grid;
  gap: var(--space-3);
  min-width: 0;
  width: 100%;
  padding-top: var(--space-4);
  padding-bottom: calc(
    var(--bottom-navigation-height, 54px)
    + var(--safe-area-bottom, 0px)
    + var(--space-4)
  );
  border-top: 1px solid var(--color-border);
}

.profile-my-matches__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-width: 0;
}

.profile-my-matches__title {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--color-text-primary);
  font-size: 17px;
  font-weight: var(--font-weight-control);
  line-height: var(--overlay-heading-line-height);
}

/* Stick below main profile segmented control. */
.profile-my-matches__sticky {
  position: sticky;
  top: var(--profile-section-tabs-sticky-offset, calc(var(--safe-area-top, 0px) + 3.5rem));
  z-index: var(--z-index-sticky-header);
  display: grid;
  gap: var(--space-1);
  box-sizing: border-box;
  width: calc(100% + (2 * var(--page-padding-inline)));
  max-width: none;
  margin-inline: calc(-1 * var(--page-padding-inline));
  padding: var(--space-2) var(--page-padding-inline);
  background: var(--color-background);
  box-shadow: 0 calc(-1 * var(--space-1)) 0 var(--space-1) var(--color-background);
}

.profile-my-matches__tabs {
  /* Segmented family from profile-page__section-tabs(--sm); scroll instead of clipping labels. */
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.profile-my-matches__tabs .profile-page__section-tab {
  flex: 0 0 auto;
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  font-size: 0.75rem;
  padding-inline: var(--space-2);
}

.profile-my-matches__hint {
  margin: 0;
  min-width: 0;
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
  line-height: 1.35;
}

.profile-my-matches__body {
  min-width: 0;
}

.profile-my-matches__content {
  display: grid;
  gap: var(--space-3);
  min-width: 0;
}

.profile-my-matches__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-3);
  min-width: 0;
  align-items: stretch;
}

@media (min-width: 900px) {
  .profile-my-matches__list:not(.profile-my-matches__list--mutual) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.profile-my-matches__card {
  --match-card-wanted-color: #ff3fd7;
  --match-card-offered-color: #18d7ff;
  --match-card-wanted-title-color: #b0158f;
  --match-card-offered-title-color: #0a7a96;
  --match-card-wanted-background: color-mix(in srgb, var(--match-card-wanted-color) 7%, var(--color-surface));
  --match-card-offered-background: color-mix(in srgb, var(--match-card-offered-color) 7%, var(--color-surface));
  --match-card-wanted-border: color-mix(in srgb, var(--match-card-wanted-color) 36%, var(--color-border));
  --match-card-offered-border: color-mix(in srgb, var(--match-card-offered-color) 36%, var(--color-border));
  /* Same S/M/L tile tokens as trade-card. */
  --match-card-item-size-m: 84.96px;
  --match-card-item-size: var(--match-card-item-size-m);
  --match-card-item-size-l: 108px;
  --match-card-item-scale-s: 0.786666667;
  --match-card-item-image-padding: 5px;
  --match-card-list-gap: 0px;
  --match-card-list-padding: 6px;
  --match-card-panel-gap: 0;
  --match-card-column-title-margin-block-end: 2px;
  --match-card-column-title-padding-inline-start: 2px;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
  height: 100%;
  padding: var(--space-3) 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface, transparent);
  isolation: isolate;
}

.profile-my-matches__card[data-layout='l'] {
  --match-card-item-size: var(--match-card-item-size-l);
}

.profile-my-matches__card[data-layout='s'] {
  --match-card-item-size: calc(var(--match-card-item-size-m) * var(--match-card-item-scale-s));
}

:root[data-theme='dark'] .profile-my-matches__card {
  --match-card-wanted-title-color: #ff3fd7;
  --match-card-offered-title-color: #18d7ff;
  --match-card-wanted-background: color-mix(in srgb, var(--match-card-wanted-color) 8%, var(--color-surface));
  --match-card-offered-background: color-mix(in srgb, var(--match-card-offered-color) 8%, var(--color-surface));
  --match-card-wanted-border: color-mix(in srgb, var(--match-card-wanted-color) 40%, var(--color-border));
  --match-card-offered-border: color-mix(in srgb, var(--match-card-offered-color) 40%, var(--color-border));
}

.profile-my-matches__card--ownership {
  border-style: solid;
  background: var(--color-surface, transparent);
}

.profile-my-matches__card--opportunity {
  border-color: color-mix(in srgb, var(--color-control-danger) 28%, var(--color-border));
}

.profile-my-matches__card--mutual {
  gap: var(--space-3);
  border-color: color-mix(in srgb, var(--color-presence-online) 28%, var(--color-border));
}

.profile-my-matches__card-head {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  overflow: hidden;
  padding-block: 0.35rem;
  padding-inline: var(--space-3);
}

.profile-my-matches__head-marks {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  flex: 0 0 auto;
  margin-inline-start: auto;
  margin-block-start: 0;
}

.profile-my-matches__trade-button.button {
  --button-background: #20bd5a;
  --button-background-hover: #18aa4e;
  --button-background-active: #139343;
  --button-foreground: #ffffff;
  flex: 0 0 auto;
  width: auto;
  height: 28px;
  min-width: 0;
  min-height: 28px;
  padding-inline: 10px;
  font-size: 0.8125rem;
}

.profile-my-matches__trade-icon {
  width: 1rem;
  height: 1rem;
  object-fit: contain;
  filter: invert(1);
}

.profile-my-matches__peer {
  display: inline-flex;
  flex: 1 1 auto;
  align-items: flex-start;
  gap: 0.4rem;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-primary);
  font: inherit;
  text-align: start;
  cursor: pointer;
}

.profile-my-matches__peer:hover .profile-my-matches__peer-name,
.profile-my-matches__peer:focus-visible .profile-my-matches__peer-name {
  text-decoration: underline;
}

.profile-my-matches__peer:focus-visible {
  outline: var(--control-focus-width, 2px) solid var(--color-control-focus);
  outline-offset: var(--control-focus-offset, 2px);
}

.profile-my-matches__peer-avatar {
  flex: 0 0 auto;
}

.profile-my-matches__peer-meta {
  display: grid;
  justify-items: start;
  gap: 0.15rem;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.profile-my-matches__peer-meta > .profile-my-matches__badge {
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0.08rem 0.32rem;
  font-size: 0.5625rem;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.profile-my-matches__peer-name-line {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.profile-my-matches__peer-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.8125rem;
  line-height: 1.2;
  font-weight: var(--font-weight-control);
}

.profile-my-matches__peer-flag {
  flex: 0 0 auto;
  width: 0.875rem;
  height: 0.875rem;
  object-fit: contain;
}

.profile-my-matches__peer-flight {
  flex: 0 0 auto;
  width: 22px;
  height: 11px;
  object-fit: contain;
}

.profile-my-matches__match-badge {
  flex: 0 0 auto;
  margin: 0;
  padding: 0.15rem 0.45rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-control-secondary);
  color: var(--color-text-secondary);
  font-size: 0.6875rem;
  font-weight: var(--font-weight-control);
  line-height: 1.2;
  white-space: nowrap;
}

.profile-my-matches__badge {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm, 4px);
  border: 1px solid var(--color-border);
  background: var(--color-control-secondary);
  color: var(--color-text-secondary);
  font-size: 0.6875rem;
  font-weight: var(--font-weight-control);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Wish / WANTED — pinkish from danger token (readable light + dark). */
.profile-my-matches__badge--opportunity {
  border-color: color-mix(in srgb, var(--color-control-danger) 45%, var(--color-border));
  background: color-mix(in srgb, var(--color-control-danger) 14%, var(--color-surface));
  color: var(--color-control-danger);
}

/* Mutual — green/blue from presence + primary. */
.profile-my-matches__badge--mutual {
  border-color: color-mix(in srgb, var(--color-presence-online) 40%, var(--color-control-primary));
  background: color-mix(in srgb, var(--color-presence-online) 16%, var(--color-surface));
  color: var(--color-text-primary);
}

/* Ownership — neutral, no italic. */
.profile-my-matches__badge--ownership {
  text-transform: none;
  letter-spacing: 0;
  font-style: normal;
  border-color: var(--color-border);
  background: var(--color-control-secondary);
  color: var(--color-text-secondary);
}

.profile-my-matches__peer-meta > .profile-my-matches__badge--ownership {
  font-size: 0.5625rem;
}

.profile-my-matches__lanes {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--match-card-panel-gap, 0);
  min-width: 0;
  flex: 1 1 auto;
}

.profile-my-matches__card > .profile-my-matches__lane {
  flex: 1 1 auto;
}

.profile-my-matches__lane {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
}

.profile-my-matches__lane--get {
  --match-card-panel-background: var(--match-card-wanted-background);
  --match-card-panel-border: var(--match-card-wanted-border);
  --match-card-panel-title-color: var(--match-card-wanted-title-color);
  --match-card-panel-radius: 0;
}

.profile-my-matches__lane--give {
  --match-card-panel-background: var(--match-card-offered-background);
  --match-card-panel-border: var(--match-card-offered-border);
  --match-card-panel-title-color: var(--match-card-offered-title-color);
  --match-card-panel-radius: 0;
}

.profile-my-matches__lane-title {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  margin: 0 0 var(--match-card-column-title-margin-block-end, 2px);
  padding: 0 0 0 var(--match-card-column-title-padding-inline-start, 2px);
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--match-card-panel-title-color, var(--color-text-secondary));
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.1;
  text-align: start;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.profile-my-matches__lane--give .profile-my-matches__lane-title {
  /* Center label in the gap between stacked panels (same as trade-card offered). */
  margin-block: 6px;
}

.profile-my-matches__lane-title:hover,
.profile-my-matches__lane-title:focus-visible {
  text-decoration: underline;
}

.profile-my-matches__lane-title:focus-visible {
  outline: var(--control-focus-width, 2px) solid var(--color-control-focus);
  outline-offset: var(--control-focus-offset, 2px);
}

.profile-my-matches__pokemon-scroll {
  min-width: 0;
  border: 1px solid var(--match-card-panel-border, var(--color-border));
  border-radius: var(--match-card-panel-radius, 0);
  background: var(--match-card-panel-background, var(--color-surface));
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  scroll-padding-inline: var(--match-card-list-padding);
  touch-action: pan-y;
  cursor: default;
  scrollbar-color: color-mix(in srgb, var(--color-text-secondary) 34%, transparent) transparent;
  scrollbar-width: thin;
  user-select: none;
  -webkit-user-select: none;
}

.profile-my-matches__pokemon-scroll[data-can-scroll='true'] {
  overflow-x: auto;
  scrollbar-width: thin;
  cursor: grab;
  touch-action: pan-x pan-y;
}

.profile-my-matches__pokemon-scroll[data-can-scroll='false'] {
  overflow-x: hidden;
  scrollbar-width: none;
  cursor: default;
  touch-action: pan-y;
}

.profile-my-matches__pokemon-scroll[data-can-scroll='false']::-webkit-scrollbar {
  height: 0;
}

.profile-my-matches__pokemon-scroll[data-dragging='true'] {
  cursor: grabbing;
}

.profile-my-matches__pokemon-scroll * {
  user-select: none;
  -webkit-user-select: none;
}

.profile-my-matches__pokemon-scroll img {
  pointer-events: none;
  user-drag: none;
  -webkit-user-drag: none;
}

.profile-my-matches__pokemon-scroll::-webkit-scrollbar {
  height: 4px;
}

.profile-my-matches__pokemon-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.profile-my-matches__pokemon-scroll::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-text-secondary) 30%, transparent);
}

.profile-my-matches__pokemon-scroll:focus-visible {
  outline: var(--control-focus-width) solid var(--color-control-focus);
  outline-offset: calc(var(--control-focus-offset) * -1);
}

.profile-my-matches__pokemon-list {
  display: grid;
  grid-auto-flow: row;
  grid-template-columns: repeat(auto-fill, var(--match-card-item-size));
  grid-template-rows: none;
  align-items: start;
  width: 100%;
  min-width: calc(10 * var(--match-card-item-size) + 9 * var(--match-card-list-gap) + 2 * var(--match-card-list-padding));
  padding: var(--match-card-list-padding);
  gap: var(--match-card-list-gap);
  box-sizing: border-box;
}

.profile-my-matches__pokemon-list[data-desktop-fit='true'],
.profile-my-matches__pokemon-list[data-mobile-balanced='true'],
.profile-my-matches__pokemon-list[data-mobile-fit='true'] {
  grid-template-columns: repeat(var(--match-card-list-cols), var(--match-card-item-size));
  min-width: calc(
    (var(--match-card-list-cols) * var(--match-card-item-size))
    + ((var(--match-card-list-cols) - 1) * var(--match-card-list-gap))
    + (2 * var(--match-card-list-padding))
  );
}

.profile-my-matches__poke {
  position: relative;
  display: grid;
  justify-items: stretch;
  box-sizing: border-box;
  width: var(--match-card-item-size);
  min-width: 0;
  max-width: var(--match-card-item-size);
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: start;
}

.profile-my-matches__poke--overflow {
  display: grid;
  place-items: center;
  align-self: start;
  cursor: pointer;
}

.profile-my-matches__poke--overflow:focus-visible {
  outline: var(--control-focus-width, 2px) solid var(--color-control-focus);
  outline-offset: var(--control-focus-offset, 2px);
  border-radius: var(--pokemon-item-radius, 10px);
}

.profile-my-matches__overflow {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 100%;
  aspect-ratio: 1 / 1;
  color: var(--color-text-secondary);
  font-size: var(--font-size-control-md);
  font-weight: var(--font-weight-control);
  border: var(--control-border-width) dashed var(--color-border);
  border-radius: var(--pokemon-item-radius, var(--radius-control));
  background: var(--color-surface);
}

.profile-my-matches__poke > .pokemon-item {
  --pokemon-image-scale: 1.30;
  --pokemon-item-radius: var(--pokemon-selection-border-width);
  --pokemon-current-image-padding: var(--match-card-item-image-padding);
  --pokemon-item-gap: 4px;
  --pokemon-media-background: transparent;
  --pokemon-media-aspect-ratio: 1 / 1;
  display: grid;
  width: 100%;
  min-width: 0;
}

.profile-my-matches__poke .pokemon-item__media {
  aspect-ratio: 1 / 1;
  width: 100%;
}

.profile-my-matches__poke .pokemon-item__image {
  inset: 0;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.profile-my-matches__poke .pokemon-item[data-background-state='empty'] .pokemon-item__image {
  padding: 0;
}

.profile-my-matches__poke .pokemon-item__details {
  padding-inline: 0;
  gap: 0;
}

.profile-my-matches__poke .pokemon-item__name,
.profile-my-matches__poke .pokemon-item__text {
  display: none;
}

.profile-my-matches__sheet-grid .pokemon-item__name,
.profile-my-matches__sheet-grid .pokemon-item__text {
  display: block;
  color: var(--color-text-secondary);
  font-size: 12px;
  font-weight: var(--font-weight-control);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

.profile-my-matches__poke-count {
  position: absolute;
  top: 0;
  inset-inline-start: 0;
  z-index: 1;
  min-width: 1.25rem;
  padding: 0.05rem 0.3rem;
  border-radius: 999px;
  background: var(--color-control-primary);
  color: var(--color-control-on-primary);
  font-size: 0.6875rem;
  font-weight: var(--font-weight-control);
  line-height: 1.2;
  text-align: center;
  pointer-events: none;
}


/* Collection match — primary/blue, distinct from mutual green. */
.profile-my-matches__badge--collection-mutual {
  border-color: color-mix(in srgb, var(--color-control-primary) 55%, var(--color-border));
  background: color-mix(in srgb, var(--color-control-primary) 16%, var(--color-surface));
  color: var(--color-control-primary);
}

.profile-my-matches__pick-hint {
  margin: 0;
  padding-inline: var(--space-3);
  padding-bottom: var(--space-3);
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
  line-height: 1.4;
}

.profile-my-matches__locked {
  display: grid;
  gap: var(--space-3);
  margin-block-start: var(--space-4);
  padding-block-start: var(--space-3);
  border-top: var(--control-border-width) solid var(--color-border);
  pointer-events: none;
  user-select: none;
}

.profile-my-matches__locked-list {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.profile-my-matches__locked-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: var(--space-3);
  min-height: 4.5rem;
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--color-control-secondary) 55%, transparent);
  filter: blur(1.5px);
  opacity: 0.72;
}

.profile-my-matches__locked-icon {
  font-size: 1.25rem;
  line-height: 1;
  filter: none;
  opacity: 1;
}

.profile-my-matches__locked-skeleton {
  display: block;
  height: 2.5rem;
  border-radius: var(--radius-sm);
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--color-border) 70%, transparent) 0%,
    color-mix(in srgb, var(--color-control-secondary) 80%, transparent) 50%,
    color-mix(in srgb, var(--color-border) 70%, transparent) 100%
  );
}

.profile-my-matches__premium-band {
  display: flex;
  justify-content: flex-end;
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
  line-height: 1.4;
  pointer-events: none;
}

.profile-my-matches__premium-link {
  color: var(--color-text-primary);
  font-weight: var(--font-weight-control);
  pointer-events: auto;
  text-decoration: underline;
}

.profile-my-matches__footer {
  display: flex;
  justify-content: center;
  min-width: 0;
}

.profile-my-matches__footer[hidden] {
  display: none;
}

.profile-my-matches__tools {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.profile-my-matches__tools[hidden] {
  display: none;
}

.profile-my-matches__search-label {
  flex: 1 1 auto;
  min-width: 0;
}

.profile-my-matches__search-label-text.visually-hidden,
.profile-my-matches .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.profile-my-matches__search-field {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 2.25rem;
  padding: 0.35rem 0.7rem;
  border: var(--control-border-width) solid var(--color-search-border);
  border-radius: var(--radius-md);
  background: var(--color-search-background);
  color: var(--color-text-primary);
}

.profile-my-matches__search-field:focus-within {
  border-color: var(--color-text-secondary);
}

.profile-my-matches__search-icon {
  flex: 0 0 var(--icon-size, 1rem);
  width: var(--icon-size, 1rem);
  height: var(--icon-size, 1rem);
  color: var(--color-search-icon, var(--color-text-secondary));
}

.profile-my-matches__search {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-text-primary);
  font: inherit;
  font-size: 0.875rem;
  outline: none;
}

.profile-my-matches__online {
  flex: 0 0 auto;
}

.profile-my-matches__online.is-pressed {
  background: var(--color-text-primary);
  color: var(--color-background);
  border-color: var(--color-text-primary);
}

.profile-my-matches__sheet {
  min-width: 0;
}

.profile-my-matches__sheet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(4.5rem, 1fr));
  gap: var(--space-2);
  min-width: 0;
}

.profile-my-matches__skeleton {
  display: grid;
  gap: var(--space-3);
  min-width: 0;
}

.profile-my-matches__skeleton-card {
  display: grid;
  gap: var(--space-2);
  min-width: 0;
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface, transparent);
}

.profile-my-matches__bone {
  display: block;
  height: var(--space-4);
  border-radius: var(--radius-sm);
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--color-border) 70%, transparent) 0%,
    color-mix(in srgb, var(--color-control-secondary) 80%, transparent) 50%,
    color-mix(in srgb, var(--color-border) 70%, transparent) 100%
  );
}

.profile-my-matches__bone--head {
  width: 55%;
}

.profile-my-matches__bone--row {
  height: 4.5rem;
}

.profile-my-matches__bone--actions {
  width: 70%;
}

.profile-my-matches__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* === /app/styles/pages/premium.css === */
.premium-page {
  display: grid;
  align-content: start;
  gap: var(--space-4);
  min-width: 0;
  padding-block: var(--space-4) var(--space-5);
  padding-inline: var(--space-3);
}

.premium-page__title {
  margin: 0;
  font-size: var(--font-size-overlay-title);
  line-height: 1.2;
}

.premium-page__status {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 0.875rem;
  line-height: 1.3;
}

.premium-page__caption {
  margin: 0 0 var(--space-2);
  text-align: start;
  font-size: 0.875rem;
  font-weight: var(--font-weight-control);
}

.premium-page__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  line-height: 1.4;
}

.premium-page__table th,
.premium-page__table td {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--color-border);
  text-align: start;
  vertical-align: top;
}

.premium-page__note {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 0.875rem;
  line-height: 1.4;
}

.premium-mark,
.profile-identity__premium-mark {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  line-height: 0;
  text-decoration: none;
}

.premium-mark[hidden],
.profile-identity__premium-mark[hidden] {
  display: none;
}

.premium-mark__image,
.profile-identity__premium-mark-image,
.premium-page__mark {
  display: block;
  width: 1.05em;
  height: 1.05em;
  object-fit: contain;
}

.profile-identity__premium-mark-image,
.premium-page__mark {
  width: 1.25rem;
  height: 1.25rem;
}

.profile-my-matches__peer-name-line,
.messages-conversation-header__name-row {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
  max-width: 100%;
}

.messages-conversation-header__name-row .messages-conversation-header__name,
.profile-my-matches__peer-name-line .profile-my-matches__peer-name {
  min-width: 0;
}

.profile-blocked-users__name,
.trade-proposal-recipient__text {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
}

.premium-page__status[hidden] {
  display: none;
}

/* === /app/styles/pages/pokedex.css === */
.pokedex-page {
  display: grid;
  align-content: start;
  width: 100%;
  min-width: 0;
  min-height: 100%;
  padding-block: var(--space-3) var(--space-5);
  padding-inline: var(--page-padding-inline);
  gap: var(--space-3);
}

.pokedex-page__title.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.pokedex-page__toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: var(--space-1);
  min-width: 0;
}

.pokedex-page__search {
  min-width: 0;
}

.pokedex-page__search .search-bar,
.pokedex-page__search .search-bar__control {
  min-width: 0;
  width: 100%;
}

.pokedex-page__search .search-bar__label,
.pokedex-page__search .search-bar__error {
  display: none;
}

.pokedex-page__search .search-bar__control {
  min-height: var(--touch-target-size);
}

.pokedex-page__filter,
.pokedex-page__sort {
  --icon-button-hit-size: 40px;
  --icon-button-icon-size: 18px;
  flex: 0 0 var(--icon-button-hit-size);
}

.pokedex-page__toolbar-icon {
  display: block;
  object-fit: contain;
}

.pokedex-page__filter-badge,
.pokedex-page__sort-direction {
  position: absolute;
  right: 2px;
  bottom: 2px;
  display: grid;
  min-width: 16px;
  height: 16px;
  place-items: center;
  padding-inline: 3px;
  border-radius: 999px;
  background: var(--color-control-primary);
  color: var(--color-control-on-primary);
  font-size: 10px;
  font-weight: var(--font-weight-control);
  line-height: 1;
}

.pokedex-page__sort-direction {
  min-width: 18px;
  height: 18px;
  font-size: 12px;
  font-weight: 700;
}

.pokedex-page__filter-badge[hidden] {
  display: none;
}

:root[data-theme='dark'] .pokedex-page__toolbar-icon {
  filter: invert(1);
}

.pokedex-page__status {
  min-width: 0;
}

.pokedex-page__grid {
  min-width: 0;
}

/* Match trade-create selection density: tighter cells + fuller sprites. */
.pokedex-page__grid .pokemon-grid {
  --pokemon-grid-current-gap: var(--pokemon-grid-gap-small);
}

.pokedex-page__grid .pokemon-item {
  --pokemon-current-image-padding: 2px;
  --pokemon-item-gap: 2px;
}

.pokedex-page__grid .pokemon-item__image.pokemon-item__layer {
  inset: 0;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pokedex-page__grid .pokemon-item[data-background-state='empty'] .pokemon-item__image {
  padding: 0;
}


.pokedex-page__grid .pokemon-item {
  --pokedex-card-track: calc(
    (100cqi - (var(--pokemon-grid-current-columns) - 1) * var(--pokemon-grid-current-gap))
    / var(--pokemon-grid-current-columns)
  );
  content-visibility: auto;
  contain-intrinsic-size:
    auto var(--pokedex-card-track)
    auto calc(var(--pokedex-card-track) + var(--pokemon-item-gap) + var(--space-1) + var(--font-size-control-sm) + var(--font-size-control-md));
}

/* === /app/styles/pages/pokemon-detail.css === */
.pokemon-detail-page {
  display: grid;
  align-content: start;
  width: 100%;
  min-width: 0;
  min-height: 100%;
  overflow-x: hidden;
  padding-block: var(--space-4) var(--space-5);
  padding-inline: var(--page-padding-inline);
  gap: var(--space-3);
}

.pokemon-detail-page__status {
  min-width: 0;
  overflow-wrap: anywhere;
}

.pokemon-detail-page__foundation {
  display: grid;
  min-width: 0;
  gap: var(--space-4);
}

.pokemon-detail-trades {
  display: grid;
  min-width: 0;
  gap: var(--space-4);
}

.pokemon-detail-trades__tabs {
  min-width: 0;
}

.pokemon-detail-trades__tabs .tabs__panels {
  display: none;
}

.pokemon-detail-trades__body,
.pokemon-detail-trades__results {
  display: grid;
  min-width: 0;
  gap: var(--space-4);
  overflow-wrap: anywhere;
}

.pokemon-detail-trades__card-host {
  min-width: 0;
}


.pokemon-detail-presentation__nav {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
  width: 100%;
}

.pokemon-detail-presentation__nav-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  box-sizing: border-box;
  min-width: 0;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-text-primary);
  font: inherit;
  text-align: start;
  cursor: pointer;
}

.pokemon-detail-presentation__nav-button:hover:not(:disabled) {
  background: color-mix(in srgb, var(--color-control-primary) 6%, var(--color-surface));
}

.pokemon-detail-presentation__nav-button:focus-visible {
  outline: var(--control-focus-width) solid var(--color-control-focus);
  outline-offset: var(--control-focus-offset);
}

.pokemon-detail-presentation__nav-button:disabled {
  opacity: var(--control-disabled-opacity, 0.45);
  cursor: default;
}

.pokemon-detail-presentation__nav-arrow {
  flex: 0 0 auto;
  align-self: center;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  color: var(--color-text-primary);
}

.pokemon-detail-presentation__nav-arrow svg {
  display: block;
  width: 100%;
  height: 100%;
}

.pokemon-detail-presentation__nav-entity {
  display: inline-flex;
  align-items: center;
  align-self: center;
  gap: 8px;
  min-width: 0;
  max-width: calc(100% - 26px);
  line-height: 1;
}

.pokemon-detail-presentation__nav-button--prev .pokemon-detail-presentation__nav-entity {
  justify-content: flex-end;
  margin-inline-start: auto;
}

.pokemon-detail-presentation__nav-button--next .pokemon-detail-presentation__nav-entity {
  justify-content: flex-start;
  margin-inline-end: auto;
}

.pokemon-detail-presentation__nav-image {
  display: block;
  flex: 0 0 34px;
  align-self: center;
  box-sizing: border-box;
  width: 34px;
  height: 34px;
  margin: 0;
  object-fit: contain;
  object-position: center center;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.pokemon-detail-presentation__nav-name {
  display: block;
  align-self: center;
  min-width: 0;
  overflow: hidden;
  color: var(--color-text-primary);
  font-size: var(--font-size-control-md);
  font-weight: 600;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pokemon-detail-presentation {
  --pokemon-detail-rail-item-size: 80px;
  --pokemon-detail-art-size: 220px;
  --pokemon-detail-fit-size: 104.8px;
  display: grid;
  min-width: 0;
  gap: var(--space-2);
}

.pokemon-detail-presentation__hero {
  display: grid;
  grid-template-columns: minmax(0, var(--pokemon-detail-art-size)) minmax(0, 1fr);
  align-items: start;
  min-width: 0;
  gap: var(--space-3);
}

.pokemon-detail-presentation__identity {
  justify-self: start;
  min-width: 0;
  padding-block-start: var(--space-3);
}

.pokemon-detail-presentation__dex {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: var(--font-size-control-md);
  font-weight: var(--font-weight-control);
}

.pokemon-detail-presentation__costume,
.pokemon-detail-presentation__background {
  margin: var(--space-1) 0 0;
  color: var(--color-text-secondary);
  font-size: var(--font-size-control-md);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.pokemon-detail-presentation__name {
  margin: 0;
  min-width: 0;
  color: var(--color-text-primary);
  font-size: clamp(1.5rem, 6vw, 1.75rem);
  font-weight: 700;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.pokemon-detail-presentation__art {
  position: relative;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: min(100%, var(--pokemon-detail-art-size));
  max-width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: var(--radius-control);
  background: transparent;
}

.pokemon-detail-presentation__art[data-has-background='true'] {
  background: transparent;
  align-items: end;
  justify-items: center;
}

.pokemon-detail-presentation__art[data-has-background='true'] .pokemon-item {
  align-self: end;
}

.pokemon-detail-presentation__art-background {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.pokemon-detail-presentation__art .pokemon-item {
  --pokemon-image-scale: 1.30;
  --pokemon-item-radius: var(--pokemon-selection-border-width);
  --pokemon-current-image-padding: var(--trade-card-item-image-padding, 5px);
  --pokemon-item-gap: 0;
  --pokemon-media-background: transparent;
  --pokemon-media-aspect-ratio: 1 / 1;
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  width: var(--pokemon-detail-fit-size);
  max-width: var(--pokemon-detail-fit-size);
  height: var(--pokemon-detail-fit-size);
  max-height: var(--pokemon-detail-fit-size);
  margin: 0;
  transform: none;
}

.pokemon-detail-presentation__art .pokemon-item__background {
  display: none;
}

.pokemon-detail-presentation__art .pokemon-item__media {
  width: 100%;
  aspect-ratio: 1 / 1;
}

.pokemon-detail-presentation__art .pokemon-item__image {
  inset: 0;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pokemon-detail-presentation__art .pokemon-item[data-background-state='empty'] .pokemon-item__image {
  padding: 0;
}

.pokemon-detail-presentation__rail {
  display: flex;
  gap: var(--space-2);
  min-width: 0;
  margin-inline: calc(var(--page-padding-inline) * -1);
  padding-block: var(--space-3);
  padding-inline: var(--page-padding-inline);
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.pokemon-detail-presentation__rail.is-dragging {
  cursor: grabbing;
  scroll-behavior: auto;
}

.pokemon-detail-presentation__rail-item {
  flex: 0 0 var(--pokemon-detail-rail-item-size);
  width: var(--pokemon-detail-rail-item-size);
  height: var(--pokemon-detail-rail-item-size);
  user-select: none;
  -webkit-user-drag: none;
}

.pokemon-detail-presentation__rail-item .pokemon-item {
  --pokemon-current-image-padding: 0;
  width: var(--pokemon-detail-rail-item-size);
  height: var(--pokemon-detail-rail-item-size);
}

.pokemon-detail-presentation__rail-item .pokemon-item__image {
  padding: 0;
}

/* art frame locked to 220px on all viewports (preview-compatible). */

@media (max-width: 640px) {
  .pokemon-detail-presentation__rail {
    container-type: inline-size;
    margin-inline: 0;
    padding-inline: 16px;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 16px;
    scrollbar-width: none;
  }
  .pokemon-detail-presentation__rail::-webkit-scrollbar {
    display: none;
  }
  .pokemon-detail-presentation__rail-item {
    scroll-snap-align: start;
  }
}

.pokemon-detail-presentation__rail-more {
  flex: 0 0 var(--pokemon-detail-rail-item-size);
  width: var(--pokemon-detail-rail-item-size);
  height: var(--pokemon-detail-rail-item-size);
  display: grid;
  place-items: center;
  gap: 2px;
  margin: 0;
  padding: var(--space-1);
  border: var(--control-border-width) dashed var(--color-border);
  border-radius: var(--pokemon-item-radius, var(--radius-control));
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font: inherit;
  cursor: pointer;
  scroll-snap-align: start;
}

.pokemon-detail-presentation__rail-more:hover,
.pokemon-detail-presentation__rail-more:focus-visible {
  color: var(--color-text);
  border-color: var(--color-text-secondary);
  outline: none;
}

.pokemon-detail-presentation__rail-more:focus-visible {
  box-shadow: 0 0 0 2px var(--color-focus-ring, Highlight);
}

.pokemon-detail-presentation__rail-more-label {
  font-size: var(--font-size-control-sm, 0.75rem);
  font-weight: var(--font-weight-control, 600);
  line-height: 1.1;
}

.pokemon-detail-presentation__rail-more-count {
  font-size: var(--font-size-control-sm, 0.75rem);
  line-height: 1.1;
  opacity: 0.85;
}

.pokemon-detail-presentation__sheet {
  min-width: 0;
}

.pokemon-detail-presentation__sheet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(4.5rem, 1fr));
  gap: var(--space-2);
}

.pokemon-detail-presentation__sheet-item {
  min-width: 0;
}

/* === /app/styles/components/trainer-card.css === */
.trainer-card {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: clamp(0.5rem, 0.35rem + 0.6vw, 0.75rem);
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  padding-block: clamp(0.625rem, 0.5rem + 0.5vw, 0.75rem);
  padding-inline: clamp(0.5rem, 0.35rem + 0.6vw, 0.75rem);
  border: 0;
  border-bottom: 1px solid var(--color-border);
  border-radius: 0;
  background: var(--color-surface);
}

.trainer-card--interactive {
  cursor: pointer;
  transition: border-color 120ms ease, background-color 120ms ease, box-shadow 120ms ease;
}


.trainer-card--interactive:focus-visible {
  border-color: var(--color-control-primary);
  box-shadow: 0 0 0 3px var(--color-control-focus);
  outline: none;
}

.trainer-card__habitat-wrap {
  position: relative;
  flex: 0 0 auto;
  width: clamp(3.25rem, 2.6rem + 2.8vw, 4.5rem);
  height: clamp(3.25rem, 2.6rem + 2.8vw, 4.5rem);
}

.trainer-card__habitat {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.trainer-card__habitat[hidden] {
  visibility: hidden;
}

.trainer-card__level {
  position: static;
  flex: 0 0 auto;
  min-width: 1.5rem;
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
  background: var(--color-control-primary);
  color: var(--color-control-on-primary);
  font-size: clamp(0.6875rem, 0.62rem + 0.25vw, 0.8125rem);
  font-weight: var(--font-weight-control);
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}

.trainer-card__main {
  display: grid;
  flex: 1 1 auto;
  align-content: center;
  min-width: 0;
  gap: clamp(0.35rem, 0.25rem + 0.4vw, 0.5rem);
}

.trainer-card__identity-main {
  display: flex;
  align-items: center;
  gap: clamp(0.35rem, 0.25rem + 0.4vw, 0.5rem);
  min-width: 0;
  max-width: 100%;
}

.trainer-card__side {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  align-self: center;
  gap: var(--space-2);
  margin-inline-start: auto;
  min-width: 0;
}

.trainer-card__username {
  flex: 1 1 auto;
  margin: 0;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  color: var(--color-text-primary);
  font-size: clamp(0.75rem, 0.68rem + 0.35vw, 0.9375rem);
  font-weight: var(--font-weight-control);
  line-height: 1.2;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow-wrap: normal;
  word-break: normal;
}

.trainer-card__flag {
  flex: 0 0 auto;
  width: clamp(1rem, 0.85rem + 0.5vw, 1.25rem);
  height: clamp(0.7rem, 0.6rem + 0.35vw, 0.875rem);
  margin: 0;
  padding: 0;
  object-fit: cover;
}

.trainer-card__flag[hidden] {
  display: none;
}

.trainer-card__friend-code {
  flex: 0 0 auto;
  align-self: center;
}

.trainer-card__friend-code.icon-button {
  --icon-button-hit-size: 1rem;
  --icon-button-icon-size: 1rem;
  --icon-button-background: var(--color-control-secondary);
  --icon-button-background-hover: var(--color-control-secondary-hover);
  --icon-button-background-active: var(--color-control-secondary-active);
  --icon-button-foreground: var(--color-text-primary);
  width: auto;
  min-width: 0;
  height: auto;
  min-height: 0;
  padding: 3px 6px;
  border-radius: var(--radius-sm);
  color: var(--color-text-primary);
}

.trainer-card__friend-code .icon-button__content {
  gap: 0.25rem;
}

.trainer-card__friend-code .icon-button__text {
  font-size: 13px;
  font-weight: var(--font-weight-control);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  white-space: nowrap;
}

.trainer-card__message {
  flex: 0 0 auto;
}

.trainer-card__reasons {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: clamp(0.2rem, 0.15rem + 0.2vw, 0.25rem);
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: clamp(1.125rem, 0.95rem + 0.55vw, 1.5rem);
  margin: 0;
  padding: 0;
  overflow: hidden;
  list-style: none;
}

.trainer-card__reasons[hidden] {
  display: flex;
  visibility: hidden;
  pointer-events: none;
}

.trainer-card__reason,
.trainer-card__reason-more {
  flex: 0 0 auto;
}

.trainer-card__reason-image {
  display: block;
  width: clamp(1.125rem, 0.95rem + 0.55vw, 1.5rem);
  height: clamp(1.125rem, 0.95rem + 0.55vw, 1.5rem);
  object-fit: contain;
}

.trainer-card__reason-more {
  color: var(--color-text-secondary);
  font-size: clamp(0.6875rem, 0.62rem + 0.25vw, 0.8125rem);
  font-weight: var(--font-weight-control);
  line-height: clamp(1.125rem, 0.95rem + 0.55vw, 1.5rem);
  white-space: nowrap;
}

.trainer-card__actions {
  display: flex;
  flex-wrap: wrap;
  flex: 1 0 100%;
  gap: var(--space-2);
}

/* === /app/styles/pages/trainer-hub.css === */
.trainer-hub-page {
  display: grid;
  align-content: start;
  width: 100%;
  min-width: 0;
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  padding-block: var(--space-4) var(--space-5);
  padding-inline: var(--page-padding-inline);
  gap: var(--space-3);
}

.trainer-hub-page__title.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.trainer-hub-page__search-row {
  display: flex;
  align-items: center;
  min-width: 0;
  width: 100%;
  gap: var(--space-2);
}

.trainer-hub-page__search {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
}

.trainer-hub-page__post {
  flex: 0 0 auto;
  --icon-button-foreground: var(--color-control-primary);
  color: var(--color-control-primary);
}

.trainer-hub-page__search .search-bar,
.trainer-hub-page__search .search-bar__control {
  min-width: 0;
  width: 100%;
}

.trainer-hub-page__search .search-bar__label,
.trainer-hub-page__search .search-bar__error {
  display: none;
}

.trainer-hub-habitat-rail {
  display: flex;
  gap: var(--space-2);
  min-width: 0;
  width: auto;
  max-width: none;
  margin-inline: calc(var(--page-padding-inline) * -1);
  padding-block: var(--space-1);
  padding-inline: var(--page-padding-inline);
  overflow-x: auto;
  overflow-y: hidden;
  --rail-fade-start: 0px;
  --rail-fade-end: 28px;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--rail-fade-start), #000 calc(100% - var(--rail-fade-end)), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 var(--rail-fade-start), #000 calc(100% - var(--rail-fade-end)), transparent 100%);
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.trainer-hub-habitat-rail::-webkit-scrollbar {
  display: none;
}

.trainer-hub-habitat-rail.is-dragging {
  cursor: grabbing;
  scroll-behavior: auto;
}

.trainer-hub-habitat-rail__chip {
  display: grid;
  flex: 0 0 auto;
  justify-items: center;
  align-content: center;
  gap: var(--space-1);
  box-sizing: border-box;
  padding: var(--space-2);
  border: var(--control-border-width) solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text-primary);
  font-size: 12px;
  cursor: pointer;
}

.trainer-hub-habitat-rail__chip--text-only {
  /* Match icon+label chip height; center the lone label both axes. */
  place-items: center;
  min-height: calc(
    (var(--space-2) * 2)
    + 2.25rem
    + var(--space-1)
    + (1.2em)
  );
}

.trainer-hub-habitat-rail__chip.is-selected {
  border-color: var(--color-control-primary);
  background: color-mix(in srgb, var(--color-control-primary) 18%, var(--color-surface));
  box-shadow: inset 0 0 0 1px var(--color-control-primary);
}

.trainer-hub-habitat-rail__image {
  display: block;
  width: 2.25rem;
  height: 2.25rem;
  object-fit: contain;
}

.trainer-hub-habitat-rail__image[hidden] {
  visibility: hidden;
}

.trainer-hub-habitat-rail__label {
  max-width: 100%;
  overflow: hidden;
  font-weight: var(--font-weight-control);
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}

.trainer-hub-page__body {
  display: grid;
  min-width: 0;
  width: 100%;
  gap: var(--space-4);
}

.trainer-hub-page__list {
  display: grid;
  gap: 0;
  width: 100%;
  max-width: 100%;
  margin-block: 0;
  margin-inline: 0;
  padding: 0;
  list-style: none;
}

.trainer-hub-page__item {
  min-width: 0;
}

.trainer-hub-share-sheet {
  display: grid;
  gap: var(--space-4);
  min-width: 0;
}

.bottom-sheet:has(.trainer-hub-share-sheet) {
  --sheet-padding: var(--space-3);
}

.bottom-sheet:has(.trainer-hub-share-sheet) .bottom-sheet__header {
  padding: var(--space-1);
}

.trainer-hub-share-sheet__profile,
.trainer-hub-share-sheet__section {
  display: grid;
  gap: var(--space-2);
  min-width: 0;
}

.trainer-hub-share-sheet__status {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: var(--font-size-control-sm);
}

.trainer-hub-share-sheet__identity {
  min-width: 0;
}

.trainer-hub-share-sheet__card.trainer-card {
  width: 100%;
  padding-block: clamp(0.35rem, 0.25rem + 0.4vw, 0.5rem);
  padding-inline: 0;
  border-bottom: 0;
  background: transparent;
}

.trainer-hub-share-sheet__delete-row {
  display: flex;
  justify-content: flex-start;
  min-width: 0;
}

.trainer-hub-share-sheet__delete-row[hidden] {
  display: none;
}

.trainer-hub-share-sheet__section-title {
  margin: 0;
  font-size: var(--font-size-control-sm);
  font-weight: var(--font-weight-control);
}

.trainer-hub-share-sheet__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: clamp(0.35rem, 0.25rem + 0.4vw, 0.5rem);
  min-width: 0;
}

.trainer-hub-share-sheet__grid--habitats {
  gap: clamp(0.25rem, 0.15rem + 0.3vw, 0.4rem);
}

.trainer-hub-share-sheet__option {
  display: grid;
  justify-items: center;
  gap: var(--space-1);
  min-width: 0;
  padding: clamp(0.35rem, 0.25rem + 0.4vw, 0.5rem);
  border: var(--control-border-width) solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text-primary);
  cursor: pointer;
}

.trainer-hub-share-sheet__habitat {
  align-content: center;
  box-sizing: border-box;
  min-height: calc(48px + 1.2em + var(--space-1) + 0.5rem);
  padding: clamp(0.2rem, 0.1rem + 0.25vw, 0.35rem);
  gap: var(--space-1);
}

.trainer-hub-share-sheet__option.is-selected {
  border-color: var(--color-control-primary);
  background: color-mix(in srgb, var(--color-control-primary) 18%, var(--color-surface));
  box-shadow: inset 0 0 0 1px var(--color-control-primary);
}

.trainer-hub-share-sheet__option-image {
  display: block;
  width: clamp(1.75rem, 1.4rem + 1.1vw, 2.25rem);
  height: clamp(1.75rem, 1.4rem + 1.1vw, 2.25rem);
  object-fit: contain;
}

.trainer-hub-share-sheet__habitat .trainer-hub-share-sheet__option-image {
  width: 48px;
  height: 48px;
  max-width: 100%;
}

.trainer-hub-share-sheet__option-image[hidden] {
  visibility: hidden;
}

.trainer-hub-share-sheet__option-label {
  max-width: 100%;
  overflow: hidden;
  font-size: 10px;
  font-weight: var(--font-weight-control);
  line-height: 1.2;
  text-align: center;
  text-overflow: ellipsis;
  white-space: normal;
}

.trainer-hub-share-sheet__map-section,
.trainer-hub-share-sheet__map,
.trainer-hub-share-sheet__map-frame {
  min-width: 0;
}

.trainer-hub-share-sheet__map-toggle {
  width: fit-content;
  color: var(--color-control-primary);
  cursor: pointer;
  font-size: var(--font-size-control-sm);
  font-weight: var(--font-weight-control);
}

.trainer-hub-share-sheet__map-frame {
  position: relative;
  overflow: hidden;
  min-height: 12rem;
  touch-action: none;
  user-select: none;
}

.trainer-hub-share-sheet__map-controls {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  z-index: 1;
  display: grid;
  gap: var(--space-1);
}

.trainer-hub-share-sheet__map-zoom {
  box-sizing: border-box;
  width: var(--touch-target-size);
  height: var(--touch-target-size);
  padding: 0;
  border: var(--control-border-width) solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text-primary);
  font-size: var(--font-size-control-md);
  font-weight: var(--font-weight-control);
  line-height: 1;
  cursor: pointer;
}

.trainer-hub-share-sheet__map-image {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  transform-origin: center center;
}

@media (max-width: 22.5rem) {
  .trainer-hub-share-sheet__grid {
    gap: var(--space-1);
  }

  .trainer-hub-share-sheet__grid--habitats {
    gap: 0.2rem;
  }

  .trainer-hub-share-sheet__option {
    padding: var(--space-1);
  }

  .trainer-hub-share-sheet__habitat {
    padding: 0.15rem;
    min-height: calc(48px + 1.2em + var(--space-1) + 0.3rem);
  }
}

/* === /app/styles/pages/messages.css === */
.app-shell__viewport:has(.messages-page) > .site-footer {
  display: none !important;
}

.messages-page { /* lt:msgbleed1 */
  --messages-page-padding-inline: 0px;
  display: grid;
  align-content: start;
  width: 100%;
  min-width: 0;
  min-height: 100%;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow-x: hidden;
  padding-block: var(--space-4) var(--space-5);
  padding-inline: var(--messages-page-padding-inline);
  gap: var(--space-3);
}

.messages-page__title.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.messages-page__toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  justify-items: stretch;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  padding-inline: 0;
  border-bottom: 0;
}

.messages-page__tabs {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  height: auto;
  padding-block-end: 0;
}

.messages-page__tabs-control.tabs,
.messages-page__tabs-control > .tabs__panels[hidden] {
  height: auto;
}

.messages-page__tabs-control > .tabs__panels[hidden] {
  display: none !important;
}

.messages-page__delete-host {
  display: none;
  justify-self: end;
  margin-inline-end: calc(var(--messages-page-padding-inline) * -1);
}

.messages-page__tabs-control { /* lt:segeq1 */
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding-inline: 0;
  margin-inline: 0;
}

.messages-page__tabs-control .tabs__list {
  display: flex;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  align-items: stretch;
}

.messages-page__tabs-control .tabs__tab {
  flex: 1 1 0;
  box-sizing: border-box;
  min-width: 0;
  color: var(--color-text-secondary);
  font-weight: var(--font-weight-control);
}

.messages-page__tabs-control .tabs__tab:hover:not(:disabled) {
  color: var(--color-text-primary);
}

.messages-page__tabs-control .tabs__tab[aria-selected='true'] {
  color: var(--color-text-primary);
}

.messages-page__tabs-control[data-variant='underline'] .tabs__list,
.messages-page__tabs-control.tabs[data-variant='underline'] .tabs__list {
  border-bottom: 1px solid var(--color-border, #e2e7ee);
  background: transparent;
  box-shadow: none;
}

.messages-page__tabs-control[data-variant='underline'] .tabs__tab[aria-selected='true'],
.messages-page__tabs-control.tabs[data-variant='underline'] .tabs__tab[aria-selected='true'] {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.messages-page__delete-mode-icon {
  width: 1.25rem;
  height: 1.25rem;
  display: block;
  object-fit: contain;
  opacity: 1;
}

/* PNG cannot use currentColor — tint red while delete mode is active. */
.messages-page__delete.icon-button--danger .messages-page__delete-mode-icon,
.messages-page__delete[data-selected='true'] .messages-page__delete-mode-icon {
  opacity: 1;
  filter: invert(18%) sepia(90%) saturate(2800%) hue-rotate(346deg) brightness(0.92);
}

.messages-page__body {
  min-width: 0;
  margin-block-start: 2px;
}

.messages-page__body:has(.empty-state) {
  display: grid;
  align-content: center;
  min-height: calc(100dvh - var(--bottom-navigation-height) - 6.5rem);
}

.messages-page__skip-confirm {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  color: var(--color-text-primary);
  font-size: var(--font-size-control-sm);
  cursor: pointer;
}

.messages-page__skip-confirm input {
  width: 1.125rem;
  height: 1.125rem;
  margin: 0;
  accent-color: var(--color-control-primary);
}

.messages-conversation-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.messages-conversation-list__item {
  min-width: 0;
  border-bottom: 0;
}

.messages-conversation {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  min-width: 0;
}

.messages-conversation__open {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  min-width: 0;
  margin: 0;
  padding-block: 8px;
  padding-inline: var(--space-4);
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: start;
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
}

.messages-conversation__open:active {
  background: var(--color-control-secondary);
}

.messages-conversation__open:focus-visible,
.messages-conversation__hide:focus-visible {
  outline: var(--control-focus-width) solid var(--color-control-focus);
  outline-offset: var(--control-focus-offset);
}

.messages-conversation__actions {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  flex: 0 0 auto;
  margin-inline-end: calc(var(--messages-page-padding-inline) * -1);
}

.messages-conversation__hide {
  display: inline-grid;
  place-items: center;
  width: var(--touch-target-size);
  height: var(--touch-target-size);
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--color-control-danger-subtle-hover);
  color: var(--color-control-danger);
  cursor: pointer;
}

.messages-conversation__hide:hover {
  background: var(--color-control-danger-subtle-active);
  color: var(--color-control-danger-hover);
}

.messages-conversation__action-icon {
  width: 1.25rem;
  height: 1.25rem;
  display: block;
  object-fit: contain;
  filter: invert(18%) sepia(90%) saturate(2800%) hue-rotate(346deg) brightness(0.92);
}

.messages-conversation__menu {
  display: none;
}

.messages-conversation__open .messages-peer-avatar {
  width: 56px;
  height: 56px;
  min-width: 56px;
  min-height: 56px;
}

.messages-conversation__body {
  display: grid;
  gap: var(--space-1);
  min-width: 0;
}

.messages-conversation__name {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.messages-conversation__preview {
  margin: 0;
}

.messages-conversation__name-row {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
}

.messages-conversation__name {
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
}

.messages-conversation__favorite {
  flex: 0 0 auto;
  width: 0.8rem;
  height: 0.8rem;
  fill: var(--color-control-primary);
}

.messages-conversation__preview {
  display: flex;
  align-items: baseline;
  min-width: 0;
  color: var(--color-text-secondary);
  font-size: var(--font-size-control-sm);
}

.messages-conversation__preview-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.messages-conversation__preview-sep {
  flex: 0 0 auto;
  margin-inline: 0.35em;
  color: var(--color-text-secondary);
  font-size: inherit;
  font-weight: 400;
  white-space: nowrap;
}

.messages-conversation__time {
  flex: 0 0 auto;
  color: var(--color-text-secondary);
  font-size: inherit;
  font-weight: 400;
  white-space: nowrap;
}

.messages-conversation__name--unread,
.messages-conversation__preview--unread .messages-conversation__preview-text {
  font-weight: 650;
}

.messages-conversation__meta {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: var(--space-1);
  flex: 0 0 auto;
  min-width: 0;
}

.messages-conversation__unread-dot {
  width: var(--space-2);
  height: var(--space-2);
  border-radius: 50%;
  background: var(--color-control-primary);
  flex: 0 0 auto;
}

.messages-page__pane {
  display: none;
}

@media (max-width: 719.98px) {
  /* Mobile: one column — tabs + conversation list only. */
  .messages-page {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto minmax(0, 1fr);
    width: 100%;
    max-width: none;
    padding-inline: 0;
  }

  .messages-page__inbox {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-width: 0;
    width: 100%;
  }

  .messages-page__toolbar {
    min-width: 0;
    width: 100%;
    padding-inline: var(--space-4);
  }

  .messages-page__body {
    min-width: 0;
    width: 100%;
    padding-inline: 0;
  }

  .messages-page__pane {
    display: none !important;
  }
}

.messages-conversation-list__item--active .messages-conversation__open {
  background: var(--color-control-secondary);
}


.messages-conversation-swipe {
  position: relative;
  overflow: hidden;
  touch-action: pan-y;
  border-radius: 0;
}

.messages-conversation-swipe__action {
  position: absolute;
  inset-block: 0;
  z-index: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 6.5rem;
  padding-inline: var(--space-2);
  color: #fff;
  font-size: var(--font-size-control-sm, 0.8125rem);
  font-weight: 700;
  letter-spacing: 0.01em;
  user-select: none;
  pointer-events: none;
}

.messages-conversation-swipe__action--favorite {
  left: 0;
  background: #0a7a4a;
}

.messages-conversation-swipe__action--delete {
  right: 0;
  background: var(--color-control-danger, #b42318);
}

.messages-conversation-swipe__content {
  position: relative;
  z-index: 1;
  background: var(--color-surface, #fff);
  will-change: transform;
}

.messages-conversation-list__item.is-swiping .messages-conversation-swipe__content {
  cursor: grabbing;
}

@media (min-width: 720px) {
  .messages-conversation-swipe__action {
    display: none;
  }

  .messages-conversation-swipe__content {
    transform: none !important;
    transition: none !important;
  }
}

@media (min-width: 720px) {

  /* Desktop: delete via conversation ⋮ menu only */
  .messages-page__delete-host {
    display: none !important;
  }

  .app-shell__viewport:has(.messages-page),
  .app-shell__viewport:has(.messages-conversation-page-root) {
    overflow: hidden;
  }

  .app-shell__content:has(.messages-page) {
    height: 100%;
    max-height: 100%;
    overflow: hidden;
  }

  .messages-page {
    --messages-page-padding-inline: var(--space-4);
    grid-template-columns: minmax(220px, 34%) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    height: 100%;
    max-height: 100%;
    min-height: 0;
    padding: 0;
    gap: 0;
    overflow: hidden;
  }

  .messages-page__inbox {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-width: 0;
    min-height: 0;
    height: 100%;
    overflow: hidden;
    border-inline-end: 1px solid var(--color-border);
    padding-block: var(--space-4) 0;
    padding-inline: var(--space-2);
  }

  .messages-page__toolbar {
    padding-block-end: 0;
    padding-inline: 0;
  }

  .messages-page__toolbar,
  .messages-page__tabs,
  .messages-page__tabs-control,
  .messages-page__tabs-control .tabs__list {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .messages-page__body {
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding-inline: 0;
    margin-block-start: var(--space-1);
  }

  .messages-page__body:has(.empty-state) {
    min-height: 0;
    align-content: start;
    padding-block-start: var(--space-6);
  }

  .messages-page__pane {
    display: grid;
    place-items: center;
    min-width: 0;
    min-height: 0;
    height: 100%;
    padding: var(--space-6);
    background: var(--color-background);
  }

  .messages-page__pane-copy {
    display: grid;
    gap: var(--space-2);
    max-width: 16rem;
    text-align: center;
  }

  .messages-page__pane-title {
    margin: 0;
    color: var(--color-text-primary);
    font-size: var(--font-size-body);
    font-weight: 650;
  }

  .messages-page__pane-text {
    margin: 0;
    color: var(--color-text-secondary);
    font-size: var(--font-size-control-sm);
    line-height: 1.4;
  }

  .messages-conversation-list {
    gap: 0.125rem;
  }

  .messages-conversation-list__item {
    border-bottom: 0;
    border-radius: 0.5rem;
  }

  .messages-conversation-swipe,
  .messages-conversation-swipe__content {
    width: 100%;
    border-radius: inherit;
    background: transparent;
  }

  .messages-conversation {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
  }

  .messages-conversation__open {
    width: 100%;
    padding-block: 0.625rem;
    padding-inline: 0.75rem;
    border-radius: 0.5rem;
    background: transparent;
  }

  .messages-conversation-list__item:hover .messages-conversation__open,
  .messages-conversation__open:active,
  .messages-conversation-list__item--active .messages-conversation__open {
    background: #efefef;
  }

  .messages-conversation:not(.messages-conversation--delete-mode) {
    position: relative;
  }

  .messages-conversation:not(.messages-conversation--delete-mode) .messages-conversation__menu {
    display: flex;
    align-items: center;
    position: absolute;
    inset-block: 0;
    inset-inline-end: 0.65rem;
    z-index: 3;
  }

  .messages-conversation__menu-trigger {
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--color-text-secondary);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 120ms ease;
  }

  .messages-conversation-list__item:hover .messages-conversation__menu-trigger,
  .messages-conversation__menu--open .messages-conversation__menu-trigger,
  .messages-conversation__menu-trigger:focus-visible {
    opacity: 1;
    pointer-events: auto;
    background: transparent;
  }

  .messages-conversation__menu-trigger:hover,
  .messages-conversation__menu-trigger:focus-visible {
    background: transparent;
    color: var(--color-text-primary);
  }

  .messages-conversation__menu-trigger:focus-visible {
    outline: var(--control-focus-width) solid var(--color-control-focus);
    outline-offset: var(--control-focus-offset);
  }

  .messages-conversation__menu-icon {
    width: 1.15rem;
    height: 1.15rem;
    display: block;
  }

  .messages-conversation-list__item:hover .messages-conversation__preview-sep,
  .messages-conversation-list__item:hover .messages-conversation__time,
  .messages-conversation-list__item:has(.messages-conversation__menu--open) .messages-conversation__preview-sep,
  .messages-conversation-list__item:has(.messages-conversation__menu--open) .messages-conversation__time {
    opacity: 1;
  }

  .messages-conversation__menu-panel {
    gap: 0.2rem;
    min-width: 13.5rem;
    padding: 0.5rem;
    border: 1px solid var(--color-border);
    border-radius: 0.85rem;
    background: var(--color-background);
    box-shadow: 0 12px 32px color-mix(in srgb, #000 16%, transparent);
  }

  .messages-conversation__menu-panel[hidden] {
    display: none;
  }

  .messages-conversation__menu-panel:not([hidden]) {
    display: grid;
  }

  .messages-conversation__menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    margin: 0;
    padding: 0.7rem 0.75rem;
    border: 0;
    border-radius: 0.6rem;
    background: transparent;
    color: var(--color-text-primary);
    font: inherit;
    font-size: var(--font-size-control-sm);
    text-align: start;
    cursor: pointer;
  }

  .messages-conversation__menu-item-label {
    min-width: 0;
  }

  .messages-conversation__menu-item-icon {
    width: 1.15rem;
    height: 1.15rem;
    flex: 0 0 auto;
    display: block;
  }

  .messages-conversation__menu-item:hover {
    background: var(--color-control-secondary);
  }

  .messages-conversation__menu-item--danger {
    color: var(--color-control-danger);
  }
}




.messages-offers {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: var(--space-2);
}

.messages-offers__filters {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding-inline: 0;
  padding-block: 0;
  margin-inline: 0;
}

.messages-offers__filters-list {
  display: flex;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  gap: var(--tab-gap-sm, 4px);
  padding: var(--tab-gap-sm, 4px);
  border: var(--control-border-width, 1px) solid var(--tab-border, var(--color-border, #d8dee6));
  border-radius: var(--tab-radius, 0.75rem);
  background: var(--tab-background, var(--color-control-secondary, #eef2f6));
}

.messages-offers__filter {
  flex: 1 1 0;
  min-width: 0;
  min-height: var(--tab-height-sm, 2rem);
  margin: 0;
  padding-inline: var(--space-1);
  border: var(--control-border-width, 1px) solid transparent;
  border-radius: calc(var(--tab-radius, 0.75rem) - 2px);
  background: transparent;
  color: var(--color-text-secondary);
  font: inherit;
  font-size: 12px;
  font-weight: var(--font-weight-control, 650);
  cursor: pointer;
}

.messages-offers__filter:hover {
  color: var(--color-text-primary);
}

.messages-offers__filter:focus-visible {
  outline: var(--control-focus-width, 2px) solid var(--color-control-focus, #0b6bcb);
  outline-offset: var(--control-focus-offset, 2px);
}

.messages-offers__filter.is-active,
.messages-offers__filter[aria-selected='true'] {
  border-color: var(--tab-border, var(--color-border, #d8dee6));
  background: var(--tab-active, #fff);
  color: var(--color-text-primary);
  box-shadow: 0 1px 2px rgb(0 0 0 / 8%);
}

.messages-offers-list {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 0;
  padding: 0;
}

.messages-offers__empty {
  margin: 0;
  padding: var(--space-4) var(--space-3);
  color: var(--color-text-secondary);
  font-size: var(--font-size-control-sm);
}

.messages-offers__card {
  display: grid;
  gap: var(--space-3);
  width: 100%;
  margin: 0;
  padding: var(--space-3);
  border: 0;
  border-bottom: 1px solid var(--color-border, #d8dee6);
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: pointer;
}

.messages-offers__card:hover,
.messages-offers__card:focus-visible {
  background: var(--color-control-secondary, #eef2f6);
  outline: none;
}

.messages-offers__card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  min-width: 0;
}

.messages-offers__identity {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  column-gap: var(--space-2);
  min-width: 0;
}

.messages-offers__avatar {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: var(--color-control-secondary);
}

.messages-offers__avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.messages-offers__avatar-fallback {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-text-secondary);
}

.messages-offers__identity-text {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.messages-offers__card-peer {
  min-width: 0;
  overflow: hidden;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.messages-offers__card-time {
  min-width: 0;
  overflow: hidden;
  color: var(--color-text-secondary);
  font-size: var(--font-size-control-sm, 0.8125rem);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.messages-offers__status {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}

.messages-offers__status--pending {
  color: #9a6700;
  border-color: color-mix(in srgb, #9a6700 28%, transparent);
  background: color-mix(in srgb, #9a6700 12%, transparent);
}

.messages-offers__status--accepted {
  color: #0a7a4a;
  border-color: color-mix(in srgb, #0a7a4a 28%, transparent);
  background: color-mix(in srgb, #0a7a4a 12%, transparent);
}

.messages-offers__status--declined {
  color: #b42318;
  border-color: color-mix(in srgb, #b42318 28%, transparent);
  background: color-mix(in srgb, #b42318 12%, transparent);
}

.messages-offers__pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: start;
  gap: var(--space-2);
  width: 100%;
}

.messages-offers__side {
  display: grid;
  justify-items: center;
  gap: var(--space-1);
  min-width: 0;
}

.messages-offers__poke-art {
  box-sizing: border-box;
  width: 5.5rem;
  height: 5.5rem;
  display: grid;
  place-items: center;
  border-radius: var(--radius-control, 0.75rem);
  background: var(--color-surface, #fff);
  overflow: hidden;
}

.messages-offers__poke-art > .pokemon-item {
  --pokemon-current-image-padding: var(--space-2);
  --pokemon-media-background: transparent;
  --pokemon-item-gap: 0;
  width: 100%;
  height: 100%;
  border-width: 0;
  border-radius: inherit;
  align-content: stretch;
}

.messages-offers__poke-art > .pokemon-item .pokemon-item__media {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  border-radius: inherit;
  background: transparent;
}

.messages-offers__poke-art > .pokemon-item .pokemon-item__image {
  object-fit: contain;
}

.messages-offers__owner {
  max-width: 100%;
  overflow: hidden;
  color: var(--color-text-secondary);
  font-size: var(--font-size-control-sm, 0.8125rem);
  font-weight: 650;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.messages-offers__swap {
  align-self: center;
  color: var(--color-text-secondary);
  font-size: 1.1rem;
  line-height: 1;
  user-select: none;
}

/* Delete-mode toolbar icon removed — swipe (mobile) / ⋮ menu (desktop). */
.messages-page__delete-host,
.messages-page__delete {
  display: none !important;
}

/* lt:tabgap2 tabs-to-filters gap */
.messages-page__body {
  margin-block-start: 2px !important;
}
@media (min-width: 720px) {
  .messages-desktop-inbox__header {
    min-height: 0 !important;
    height: auto !important;
    padding-block-end: 2px !important;
  }
  .messages-desktop-inbox__list {
    padding-block-start: 0 !important;
  }
}

/* lt:filtfull2 offers filters outside scroller */
@media (min-width: 720px) {
  /* /messages desktop inbox: body becomes a column; only cards scroll */
  .messages-page__inbox .messages-page__body:has(.messages-offers) {
    display: flex;
    flex-direction: column;
    overflow: hidden !important;
    scrollbar-gutter: auto;
    padding-inline-end: 0 !important;
    min-height: 0;
  }

  .messages-page__inbox .messages-offers {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
    gap: var(--space-2);
  }

  .messages-page__inbox .messages-offers__filters {
    flex: 0 0 auto;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .messages-page__inbox .messages-offers__filters-list {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .messages-page__inbox .messages-offers__chip-row {
    display: flex !important;
    justify-content: center !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding-inline: 0 !important;
  }

  .messages-page__inbox .messages-offers__chip-row .messages-offers__chips {
    display: flex !important;
    justify-content: center !important;
    align-items: stretch !important;
    width: max-content !important;
    max-width: 100% !important;
    margin-inline: auto !important;
    column-gap: 0.5rem !important;
    box-sizing: border-box !important;
  }

  .messages-page__inbox .messages-offers__chip-row .messages-offers__chip {
    width: 96px !important;
    min-width: 96px !important;
    max-width: 96px !important;
    flex: 0 0 96px !important;
  }

  .messages-page__inbox .messages-offers-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-gutter: stable;
    padding-inline-end: 2px;
  }

  .messages-page__inbox .messages-page__tabs-control,
  .messages-page__inbox .messages-page__tabs-control .tabs__list {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .messages-page__inbox .messages-page__tabs-control .tabs__list {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  /* conversation desktop inbox */
  .messages-desktop-inbox__list:has(.messages-offers) {
    display: flex;
    flex-direction: column;
    overflow: hidden !important;
    scrollbar-gutter: auto;
    padding-inline-end: var(--messages-inbox-inline, var(--space-2)) !important;
    min-height: 0;
  }

  .messages-desktop-inbox__list .messages-offers {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
    gap: var(--space-2);
  }

  .messages-desktop-inbox__list .messages-offers__filters {
    flex: 0 0 auto;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .messages-desktop-inbox__list .messages-offers__filters-list {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .messages-desktop-inbox__list .messages-offers__chip-row {
    display: flex !important;
    justify-content: center !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding-inline: 0 !important;
  }

  .messages-desktop-inbox__list .messages-offers__chip-row .messages-offers__chips {
    display: flex !important;
    justify-content: center !important;
    align-items: stretch !important;
    width: max-content !important;
    max-width: 100% !important;
    margin-inline: auto !important;
    column-gap: 0.5rem !important;
    box-sizing: border-box !important;
  }

  .messages-desktop-inbox__list .messages-offers__chip-row .messages-offers__chip {
    width: 96px !important;
    min-width: 96px !important;
    max-width: 96px !important;
    flex: 0 0 96px !important;
  }

  .messages-desktop-inbox__list .messages-offers-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-gutter: stable;
    padding-inline-end: 2px;
  }

  .messages-desktop-inbox__header .messages-page__tabs-control,
  .messages-desktop-inbox__header .messages-page__tabs-control .tabs__list {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .messages-desktop-inbox__header .messages-page__tabs-control .tabs__list {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

/* Step 1 mobile tools + compact offers */
.messages-page__tools {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  padding: 0.625rem 0.75rem;
}

.messages-page__tools[hidden] {
  display: none !important;
}

.messages-page__fav-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.messages-offers {
  --offers-chip: color-mix(in srgb, var(--color-control-secondary, #eef2f6) 88%, var(--color-border, #e2e7ee));
  --offers-pending: #e8a33d;
  --offers-pending-bg: #fdecd2;
  --offers-accepted: #2e9e57;
  --offers-accepted-bg: #dff3e5;
  --offers-declined: #c93a52;
  --offers-declined-bg: #fbe1e6;
  --offers-seg: var(--color-text-primary, #1c1c22);
  --offers-seg-ink: #fff;
}

.messages-offers__chips {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 0.5rem;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.messages-page__fav-chip {
  margin: 0;
  min-height: 2.25rem;
  padding: 0.5rem 1.125rem;
  border: 1px solid var(--color-border, #e2e7ee);
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 650;
  line-height: 1.2;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.messages-page__fav-chip.is-active {
  background: var(--color-control-primary, #0a74d0);
  border-color: var(--color-control-primary, #0a74d0);
  color: var(--color-control-primary-contrast, #fff);
}

.messages-offers__chip {
  --offers-chip-accent: var(--color-border, #e3e3e8);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  margin: 0;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 2.375rem;
  padding: 0.5rem 0.5rem;
  border: 1px solid var(--color-border, #e3e3e8);
  border-radius: 0.75rem;
  background: var(--color-surface, #fff);
  color: var(--color-text-primary, #1c1c22);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.messages-offers__chip-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--offers-chip-accent);
  flex: 0 0 auto;
}

.messages-offers__chip-count {
  font-weight: 600;
  color: var(--color-text-secondary, #6b6b76);
  font-variant-numeric: tabular-nums;
}

.messages-offers__chip.is-active {
  border-color: var(--offers-chip-accent);
  color: var(--color-text-primary, #1c1c22);
}

.messages-offers__chip.is-active .messages-offers__chip-count {
  color: var(--color-text-primary, #1c1c22);
}

.messages-offers__chip--pending {
  --offers-chip-accent: var(--offers-pending);
}

.messages-offers__chip--pending.is-active {
  background: var(--offers-pending-bg);
}

.messages-offers__chip--accepted {
  --offers-chip-accent: var(--offers-accepted);
}

.messages-offers__chip--accepted.is-active {
  background: var(--offers-accepted-bg);
}

.messages-offers__chip--declined {
  --offers-chip-accent: var(--offers-declined);
}

.messages-offers__chip--declined.is-active {
  background: var(--offers-declined-bg);
}

.messages-page__fav-chip:focus-visible,
.messages-offers__chip:focus-visible {
  outline: 2px solid var(--color-control-focus, #0a74d0);
  outline-offset: 2px;
}

.messages-conversation__pending-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 0.45rem;
  background: color-mix(in srgb, var(--color-presence-away, #a85d00) 18%, transparent);
  color: var(--color-presence-away, #a85d00);
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}

.messages-offers__chip-row {
  display: block;
  box-sizing: border-box;
  flex: 0 0 auto;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 0.5rem 0.75rem 0;
}

.messages-offers__chip-row .messages-offers__chips {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  width: 100%;
  max-width: 100%;
}

.messages-offers__chip-row .messages-offers__chip {
  width: 100%;
  min-width: 0;
  max-width: none;
}

.messages-offers__direction-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 0.5rem;
  box-sizing: border-box;
  flex: 0 0 auto;
  width: 100%;
  padding: 0.35rem 0.75rem;
  min-height: 0;
}

.messages-offers__seg {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  min-width: 0;
  width: 100%;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--color-border, #e2e7ee);
  border-radius: 0;
  background: transparent;
}

.messages-offers__seg-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  margin: 0;
  min-width: 0;
  min-height: 2rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--color-text-secondary, #6b6b76);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 650;
  line-height: 1.2;
  padding: 0.3rem 0.2rem;
  white-space: nowrap;
  cursor: pointer;
}

.messages-offers__seg-count {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.messages-offers__seg-btn.is-active {
  background: transparent;
  color: var(--color-text-primary, #1c1c22);
}

.messages-offers__seg-btn:not(.is-active) {
  color: var(--color-text-secondary, #6b6b76);
  /* Same weight as active — only color/underline change, no width jump */
  font-weight: 650;
  opacity: 0.62;
}

.messages-offers__seg-btn.is-active::after {
  content: '';
  position: absolute;
  inset-inline: 0.15rem;
  inset-block-end: -1px;
  height: 2px;
  border-radius: 999px;
  background: var(--color-control-primary, #0a74d0);
}

.messages-offers__cancel-all {
  margin: 0;
  align-self: center;
  justify-self: end;
  flex: 0 0 auto;
  box-sizing: border-box;
  min-height: 30px;
  height: 30px;
  border: 1px solid var(--offers-declined, #c93a52);
  border-radius: 0.625rem;
  background: var(--color-surface, #fff);
  color: var(--offers-declined, #c93a52);
  font: inherit;
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1;
  padding: 0 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  cursor: pointer;
}

.messages-offers__cancel-all.is-ghost {
  visibility: hidden;
  pointer-events: none;
}

.messages-offers__cancel-all:hover:not(:disabled):not(.is-ghost) {
  background: var(--offers-declined-bg, #fbe1e6);
}

.messages-offers__cancel-all:focus-visible {
  outline: 2px solid var(--color-control-focus, #0a74d0);
  outline-offset: 2px;
}

.messages-offers__section {
  padding: 0.625rem 0.75rem 0.25rem;
  color: var(--color-text-secondary);
  font-size: 0.75rem;
  font-weight: 650;
  background: var(--color-surface-muted, var(--color-control-secondary, #f4f6f9));
}

.messages-offers__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  margin: 0;
  padding: 0.75rem 0.75rem 0.9rem;
  border: 0;
  border-bottom: 1px solid var(--color-border, #e2e7ee);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: center;
  cursor: pointer;
}

.messages-offers__item:focus-visible {
  outline: 2px solid var(--color-control-focus, #0a74d0);
  outline-offset: -2px;
}

.messages-offers__item-peer {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.4rem;
  min-width: 0;
  max-width: 100%;
}

.messages-offers__item-peer-name {
  min-width: 0;
  overflow: hidden;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.messages-offers__item-peer-meta {
  flex: 0 0 auto;
  color: var(--color-text-secondary);
  font-size: 0.6875rem;
  font-weight: 600;
}

.messages-offers__item .messages-trade-offer-card {
  --messages-offer-card-width: 14.75rem;
  width: var(--messages-offer-card-width);
  max-width: min(var(--messages-offer-card-width), 100%);
}

.messages-offers__item:has(.messages-trade-offer-card__actions) .messages-trade-offer-card {
  --messages-offer-card-width: 17.25rem;
}

@media (max-width: 700px) {
  .messages-page__toolbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .messages-page__tabs {
    padding-inline: 0.75rem;
    padding-top: 0.75rem;
  }
}

/* === /app/styles/pages/messages-conversation.css === */
.app-shell__content:has(.messages-conversation-page-root) {
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}

/* Mobile chat room only: hide bottom nav so it does not cover the composer.
   Desktop keeps the primary site nav (logo + links) so opening a thread
   does not jump the chrome. */
@media (max-width: 719.98px) {
  .app-shell:has(.messages-conversation-page-root) .bottom-navigation,
  body:has(.messages-conversation-page-root) .bottom-navigation {
    display: none !important;
  }

  .app-shell:has(.messages-conversation-page-root) {
    --bottom-navigation-height: 0px;
  }
}

.app-shell__viewport:has(.messages-conversation-page-root) > .site-footer {
  display: none !important;
}

.messages-conversation-page-root {
  --messages-page-padding-inline: var(--space-4);
  display: grid;
  align-content: stretch;
  width: min(100%, 51.25rem);
  min-width: 0;
  min-height: 100%;
  height: 100%;
  max-height: 100%;
  margin-inline: auto;
  overflow: hidden;
}

.messages-desktop-inbox {
  display: none;
}

.messages-conversation-page__title.visually-hidden,
.messages-conversation-composer .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.messages-conversation-page__body {
  display: grid;
  min-width: 0;
  min-height: 0;
  height: 100%;
}

.messages-conversation-page {
  display: grid;
  /* header | scrollable thread | composer (pending strip removed) */
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}

.messages-conversation-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
  padding-block: var(--space-3);
  padding-inline: var(--messages-page-padding-inline);
  border-bottom: 1px solid var(--color-border);
}

.messages-conversation-header__main {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.messages-conversation-header__back,
.messages-conversation-header__avatar,
.messages-conversation-header__name {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: pointer;
}

.messages-conversation-header__avatar {
  position: relative;
  display: inline-grid;
  place-items: center;
  overflow: visible;
}

.messages-conversation-header__avatar .messages-peer-avatar,
.messages-conversation-header__avatar .trainer-avatar {
  overflow: visible;
}

.messages-conversation-header__avatar .presence-dot {
  z-index: 2;
}

.messages-conversation-header__back {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 2.5rem;
  height: 2.5rem;
  margin-inline-start: calc(var(--messages-page-padding-inline) * -1);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
}

.messages-conversation-header__back:hover {
  background: var(--color-control-tertiary-hover);
}

.messages-conversation-header__back-icon {
  width: 1.35rem;
  height: 1.35rem;
}

.messages-conversation-header__back:focus-visible,
.messages-conversation-header__avatar:focus-visible,
.messages-conversation-header__name:focus-visible,
.messages-conversation-header__favorite:focus-visible,
.messages-conversation-header__block:focus-visible,
.messages-conversation-composer__input:focus-visible,
.messages-conversation-composer__location:focus-visible,
.messages-conversation-composer__trade:focus-visible,
.messages-conversation-composer__send:focus-visible,
.messages-conversation-header__friend-code:focus-visible,
.messages-pending-offer-strip__view:focus-visible,
.messages-trade-offer-card__details-btn:focus-visible,
.messages-trade-offer-card__action:focus-visible {
  outline: var(--control-focus-width) solid var(--color-control-focus);
  outline-offset: var(--control-focus-offset);
}

.messages-conversation-header__identity {
  display: grid;
  gap: var(--space-1);
  min-width: 0;
}

.messages-conversation-header__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--font-size-body);
  font-weight: 600;
}

.messages-conversation-header__last-seen {
  margin: 0;
  overflow: hidden;
  color: var(--color-text-secondary);
  font-size: var(--font-size-control-sm);
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.messages-conversation-header__last-seen[hidden] {
  display: none;
}

.messages-conversation-header__friend-code {
  display: inline-flex;
  align-items: center;
  align-self: start;
  justify-self: start;
  flex: 0 0 auto;
  gap: 0.25rem;
  width: auto;
  height: auto;
  min-height: 0;
  margin: 0;
  padding: 3px 6px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--color-control-secondary);
  color: var(--color-text-primary);
  font: inherit;
  cursor: pointer;
}

.messages-conversation-header__friend-code:hover {
  background: var(--color-control-secondary-hover);
}

.messages-conversation-header__friend-code:active {
  background: var(--color-control-secondary-active);
}

.messages-conversation-header__friend-code-icon {
  flex: 0 0 auto;
  width: 1rem;
  height: 1rem;
}

.messages-conversation-header__friend-code-text {
  font-size: 13px;
  font-weight: var(--font-weight-control);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  white-space: nowrap;
}

.messages-conversation-header__actions {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
}

.messages-conversation-header__favorite,
.messages-conversation-header__block {
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
}

.messages-conversation-header__favorite:hover,
.messages-conversation-header__block:hover {
  background: var(--color-control-tertiary-hover);
  color: var(--color-text-primary);
}

.messages-conversation-header__block:hover {
  color: var(--color-control-danger);
}

.messages-conversation-header__favorite--active {
  color: var(--color-control-primary);
}

.messages-conversation-header__favorite-icon {
  width: 1.25rem;
  height: 1.25rem;
  fill: currentColor;
  opacity: 0.7;
}

.messages-conversation-header__favorite--active .messages-conversation-header__favorite-icon {
  opacity: 1;
}

.messages-conversation-header__block-icon {
  width: 1.25rem;
  height: 1.25rem;
}

.messages-conversation-page__thread {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.messages-conversation-page__thread-loading {
  display: grid;
  place-items: center;
  align-self: stretch;
  justify-self: stretch;
  min-height: 0;
  padding: var(--space-6);
}

.messages-conversation-page__spinner {
  box-sizing: border-box;
  width: var(--loading-size-medium);
  height: var(--loading-size-medium);
  border: var(--loading-indicator-width) solid var(--color-border);
  border-block-start-color: var(--color-control-primary);
  border-radius: 50%;
  animation: messages-conversation-spin var(--duration-loading) linear infinite;
}

@keyframes messages-conversation-spin {
  to {
    transform: rotate(1turn);
  }
}

.messages-conversation-page__empty {
  min-height: 0;
  overflow: auto;
  padding-inline: var(--messages-page-padding-inline);
  padding-block: var(--space-4);
}

.messages-message-list {
  display: grid;
  align-content: start;
  align-self: stretch;
  gap: var(--space-3);
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  max-height: 100%;
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-inline: var(--messages-page-padding-inline);
  padding-block: var(--space-3);
  padding-bottom: var(--space-4);
}

.messages-message {
  display: grid;
  gap: var(--space-1);
  max-width: min(80%, 22rem);
  min-width: 0;
}

.messages-message--incoming {
  justify-self: start;
  justify-items: start;
}

.messages-message--outgoing {
  justify-self: end;
  justify-items: end;
}

.messages-message--incoming:has(.messages-message__bubble--trade-offer),
.messages-message--outgoing:has(.messages-message__bubble--trade-offer),
.messages-message--offer {
  /* 2-control (status + Details): tighter fixed width.
     3+ controls (with Accept/Decline/Cancel): wider fixed width.
     Details open/close must not change either frame. */
  --messages-offer-card-width: 14.75rem;
  width: var(--messages-offer-card-width);
  max-width: min(var(--messages-offer-card-width), 90%);
}

.messages-message--incoming:has(.messages-trade-offer-card__actions),
.messages-message--outgoing:has(.messages-trade-offer-card__actions),
.messages-message--offer:has(.messages-trade-offer-card__actions) {
  --messages-offer-card-width: 17.25rem;
}

.messages-message--outgoing .messages-message__meta {
  justify-content: flex-end;
}

.messages-message__bubble {
  margin: 0;
  max-width: 100%;
  min-width: 0;
  padding: var(--space-2) var(--space-3);
  border-radius: 1rem;
  background: var(--color-control-secondary);
  color: var(--color-text-primary);
  overflow-wrap: anywhere;
}

.messages-message--outgoing .messages-message__bubble:not(.messages-message__bubble--trade-offer) {
  background: var(--color-control-primary);
  color: var(--color-control-on-primary);
}

.messages-message__bubble--trade-offer {
  display: grid;
  gap: 0;
  justify-items: stretch;
  box-sizing: border-box;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--color-text-primary);
}

.messages-message--outgoing .messages-message__bubble--trade-offer {
  background: transparent;
  border-color: transparent;
  color: var(--color-text-primary);
}

.messages-message--pending {
  opacity: 0.72;
}

.messages-message--pending .messages-message__time {
  font-style: italic;
}

.messages-message--failed .messages-message__bubble {
  outline: 1px solid color-mix(in srgb, var(--color-danger, #c0392b) 55%, transparent);
}

.messages-message--failed .messages-message__time {
  color: var(--color-danger, #c0392b);
}

.messages-message__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1);
  min-width: 0;
}

.messages-message__time,
.messages-message__status {
  color: var(--color-text-secondary);
  font-size: var(--font-size-control-sm);
  line-height: 1;
}

.messages-message__status {
  letter-spacing: 0.02em;
}

.messages-message__status--sent {
  color: var(--color-text-secondary);
}

.messages-message__status--read {
  color: var(--color-control-primary);
}

.messages-day-separator {
  display: grid;
  justify-items: center;
  width: 100%;
  max-width: none;
  margin-block: var(--space-2);
  grid-column: 1 / -1;
  justify-self: stretch;
}

.messages-day-separator__label {
  padding: var(--space-1) var(--space-3);
  border-radius: 999px;
  background: var(--color-control-secondary);
  color: var(--color-text-secondary);
  font-size: var(--font-size-control-sm);
  font-weight: var(--font-weight-control);
  line-height: 1.2;
}

.messages-message__bubble--location {
  padding: var(--space-3);
}

.messages-location-card {
  display: grid;
  gap: var(--space-2);
  min-width: 0;
}

.messages-location-card__title-row {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.messages-location-card__icon {
  flex: 0 0 auto;
  width: 1.25rem;
  height: 1.25rem;
}

.messages-location-card__title {
  min-width: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.messages-location-card__coords {
  margin: 0;
  min-width: 0;
  color: var(--color-text-primary);
  font-size: var(--font-size-control-md);
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.messages-message--outgoing .messages-message__bubble--location .messages-location-card__coords {
  color: var(--color-control-on-primary);
}

.messages-location-card__open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  margin: 0;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--color-control-primary);
  color: var(--color-control-on-primary);
  font-size: var(--font-size-control-sm);
  font-weight: var(--font-weight-control);
  text-decoration: none;
}

.messages-location-card__open:hover {
  background: var(--color-control-primary-hover);
}

.messages-message--outgoing .messages-message__bubble--location .messages-location-card__open {
  background: var(--color-surface);
  color: var(--color-control-primary);
}

.messages-message--outgoing .messages-message__bubble--location .messages-location-card__open:hover {
  background: var(--color-control-secondary);
}

.messages-conversation-composer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: var(--space-2);
  flex: 0 0 auto;
  z-index: 2;
  padding-inline: var(--messages-page-padding-inline);
  padding-block: var(--space-3);
  padding-bottom: max(var(--space-3), var(--safe-area-bottom));
  border-top: 1px solid var(--color-border);
  background: var(--color-background);
  position: relative;
  min-height: calc(2.75rem + (var(--space-3) * 2));
}

.messages-conversation-composer__trade {
  width: 2.375rem;
  height: 2.375rem;
  border-radius: 50%;
  color: var(--color-control-primary);
  background: color-mix(in srgb, var(--color-control-primary) 14%, transparent);
}

.messages-conversation-composer__trade:focus-visible {
  outline: 2px solid var(--color-control-focus, #0a74d0);
  outline-offset: 2px;
}

.messages-conversation-composer__input {
  width: 100%;
  min-width: 0;
  min-height: 2.75rem;
  max-height: 7.5rem;
  resize: none;
  margin: 0;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: 1.25rem;
  background: var(--color-surface);
  color: inherit;
  font: inherit;
  overflow-wrap: anywhere;
}

.messages-conversation-composer__input:disabled,
.messages-conversation-composer__send:disabled {
  cursor: not-allowed;
}

.messages-conversation-composer__send {
  color: var(--color-text-secondary);
  opacity: 0.55;
}

.messages-conversation-composer__send--ready:not(:disabled) {
  color: var(--color-control-primary);
  opacity: 1;
}

.messages-conversation-composer__send:disabled {
  opacity: 0.45;
}

/* Offer redesign tokens — on card so Offers list + chat both resolve */
.messages-conversation-page,
.messages-conversation-page-root,
.messages-page,
.messages-offers,
.messages-trade-offer-card {
  --msg-offer-status-waiting-fg: #c48a14;
  --msg-offer-status-waiting-bg: #fff8e8;
  --msg-offer-status-waiting-border: #e0a32e;
  --msg-offer-status-accepted-fg: var(--color-presence-online, #14774f);
  --msg-offer-status-accepted-bg: color-mix(in srgb, var(--msg-offer-status-accepted-fg) 18%, transparent);
  --msg-offer-status-declined-fg: #c93a52;
  --msg-offer-status-declined-bg: #fbe1e6;
  --msg-offer-mine-bg: color-mix(in srgb, var(--color-control-primary) 14%, var(--color-surface));
  --msg-offer-mine-border: transparent;
  --msg-offer-recv-bg: var(--color-control-secondary);
  --msg-offer-recv-border: var(--color-border);
}

.messages-pending-offer-strip {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-width: 0;
  padding: 0.5rem var(--messages-page-padding-inline);
  border-bottom: 1px solid var(--color-border);
  background: color-mix(in srgb, var(--color-control-primary) 10%, var(--color-surface));
  color: var(--color-text-primary);
  font-size: var(--font-size-control-sm);
  line-height: 1.35;
}

.messages-pending-offer-strip[hidden] {
  display: none !important;
}

.messages-pending-offer-strip__icon {
  flex: 0 0 auto;
}

.messages-pending-offer-strip__copy {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.messages-pending-offer-strip__view {
  flex: 0 0 auto;
  margin: 0;
  margin-inline-start: auto;
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-control-primary);
  font: inherit;
  font-size: var(--font-size-control-sm);
  font-weight: 600;
  cursor: pointer;
}

.messages-system-line {
  align-self: center;
  justify-self: center;
  max-width: 100%;
  margin-block: var(--space-1);
  color: var(--color-text-secondary);
  font-size: var(--font-size-control-sm);
  line-height: 1.35;
  text-align: center;
}

.messages-trade-offer-card {
  display: grid;
  justify-items: center;
  gap: 0.45rem;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-height: 0;
  margin: 0;
  padding: 0.5rem 0.55rem;
  border: 1px solid var(--msg-offer-recv-border);
  border-radius: 0.875rem;
  background: var(--msg-offer-recv-bg);
  color: var(--color-text-primary);
}

.messages-trade-offer-card--mine {
  background: var(--msg-offer-mine-bg);
  border-color: var(--msg-offer-mine-border);
}

.messages-trade-offer-card[data-offer-status="declined"],
.messages-trade-offer-card[data-offer-status="cancelled"] {
  opacity: 0.65;
}

.messages-trade-offer-card--flash {
  outline: 2px solid var(--color-control-primary, #0a74d0);
  outline-offset: 2px;
}

.messages-trade-offer-card__swap {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0.3rem;
  min-width: 0;
  width: max-content;
  max-width: 100%;
}

.messages-trade-offer-card__side {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.25rem;
  min-width: 0;
  max-width: 6.25rem;
}

.messages-trade-offer-card__art {
  flex: 0 0 auto;
  box-sizing: border-box;
  width: calc(4.25rem + 15px);
  height: calc(4.25rem + 15px);
  display: grid;
  place-items: center;
  border-radius: 0.625rem;
  background: var(--color-surface);
  overflow: hidden;
}

.messages-trade-offer-card__art > .pokemon-item {
  --pokemon-current-image-padding: 0.2rem;
  --pokemon-media-background: transparent;
  --pokemon-item-gap: 0;
  width: 100%;
  height: 100%;
  border-width: 0;
  border-radius: inherit;
  align-content: stretch;
}

.messages-trade-offer-card__art > .pokemon-item .pokemon-item__media {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  border-radius: inherit;
  background: transparent;
}

.messages-trade-offer-card__art > .pokemon-item .pokemon-item__image {
  object-fit: contain;
}

.messages-trade-offer-card__side-copy {
  width: 100%;
  min-width: 0;
}

.messages-trade-offer-card__role,
.messages-trade-offer-card__variant {
  display: block;
  color: var(--color-text-secondary);
  font-size: 0.6875rem;
  line-height: 1.2;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.messages-trade-offer-card__name {
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
  white-space: normal;
}

.messages-trade-offer-card__x {
  flex: 0 0 auto;
  align-self: flex-start;
  margin-block-start: calc(2.125rem + 7.5px - 0.5em);
  color: var(--color-text-secondary);
  font-size: 1rem;
  line-height: 1;
}

.messages-trade-offer-card__meta {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: max-content;
  max-width: 100%;
  min-width: 0;
  min-height: 2rem;
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
  overflow-x: auto;
  position: relative;
}

.messages-trade-offer-card__status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 2rem;
  padding: 0.375rem 0.85rem;
  border-radius: 0.625rem;
  font-weight: 650;
  font-size: 0.8125rem;
  line-height: 1.2;
  white-space: nowrap;
}

.messages-trade-offer-card__status--waiting {
  border: 1px solid var(--msg-offer-status-waiting-border, #e0a32e);
  background: var(--msg-offer-status-waiting-bg, #fff8e8);
  color: var(--msg-offer-status-waiting-fg, #c48a14);
}

.messages-trade-offer-card__status--accepted {
  background: var(--msg-offer-status-accepted-bg);
  color: var(--msg-offer-status-accepted-fg);
}

.messages-trade-offer-card__status--declined {
  background: var(--msg-offer-status-declined-bg);
  color: var(--msg-offer-status-declined-fg);
}

.messages-trade-offer-card__count {
  color: var(--color-text-secondary);
}

.messages-trade-offer-card__details-btn {
  margin: 0;
  box-sizing: border-box;
  min-height: 2rem;
  padding: 0.375rem 0.85rem;
  border: 1px solid color-mix(in srgb, var(--color-control-primary) 35%, var(--color-border));
  border-radius: 0.625rem;
  background: var(--color-surface);
  color: var(--color-control-primary);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 650;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.messages-trade-offer-card__time {
  position: static;
  flex: 0 0 auto;
  align-self: center;
  margin: 0;
  margin-inline-start: 0.15rem;
  padding: 0;
  border: 0;
  background: none;
  white-space: nowrap;
  color: var(--color-text-secondary);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  text-shadow: none;
  transform: none;
}

.messages-trade-offer-card__details {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0.4rem 0.45rem;
  border-radius: 0.5rem;
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: 0.6875rem;
  line-height: 1.3;
  overflow-x: auto;
}

.messages-trade-offer-card__details[hidden] {
  display: none !important;
}

.messages-trade-offer-card__dust {
  width: 100%;
  max-width: 100%;
}

.messages-trade-offer-card__dust-caption {
  margin: 0 0 0.25rem;
  color: var(--color-text-secondary);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.messages-trade-offer-card__dust-table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  table-layout: fixed;
}

.messages-trade-offer-card__dust-table th,
.messages-trade-offer-card__dust-table td {
  padding: 0.12rem 0.28rem;
  border-bottom: 1px solid color-mix(in srgb, var(--color-border) 70%, transparent);
  text-align: end;
  font-variant-numeric: tabular-nums;
  vertical-align: middle;
  white-space: nowrap;
}

.messages-trade-offer-card__dust-table thead th {
  color: var(--color-text-secondary);
  font-size: 0.625rem;
  font-weight: 600;
}

.messages-trade-offer-card__dust-table thead th:first-child,
.messages-trade-offer-card__dust-table tbody th {
  width: 34%;
  padding-inline: 0.15rem 0.35rem;
  text-align: start;
  font-weight: 600;
  color: var(--color-text-primary);
}

.messages-trade-offer-card__dust-table thead th:not(:first-child),
.messages-trade-offer-card__dust-table tbody td {
  width: 33%;
  padding-inline: 0.28rem;
}

.messages-trade-offer-card__dust-level {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  min-width: 0;
}

.messages-trade-offer-card__dust-hearts {
  display: inline-flex;
  align-items: center;
  gap: 0.05rem;
  flex: 0 0 auto;
}

.messages-trade-offer-card__dust-heart {
  display: inline-grid;
  place-items: center;
  width: 0.7rem;
  height: 0.7rem;
  line-height: 0;
}

.messages-trade-offer-card__dust-heart-icon {
  width: 100%;
  height: 100%;
  display: block;
}

.messages-trade-offer-card__dust-heart--filled {
  color: #f08a2e;
}

.messages-trade-offer-card__dust-heart--empty {
  color: color-mix(in srgb, #f08a2e 28%, var(--color-border));
}

.messages-trade-offer-card__dust-level-name {
  min-width: 0;
}

.messages-trade-offer-card__dust-table tbody tr[data-level='ultra'] th,
.messages-trade-offer-card__dust-table tbody tr[data-level='ultra'] td {
  color: var(--color-control-primary);
}

.messages-trade-offer-card__dust-table tbody tr[data-level='ultra'] .messages-trade-offer-card__dust-heart--filled {
  color: #f08a2e;
}

.messages-trade-offer-card__dust-table tr:last-child th,
.messages-trade-offer-card__dust-table tr:last-child td {
  border-bottom: 0;
}

.messages-trade-offer-card__actions {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.375rem;
  flex: 0 0 auto;
}

.messages-trade-offer-card__action {
  margin: 0;
  min-height: 2rem;
  padding: 0.375rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: 0.625rem;
  background: var(--color-surface);
  color: var(--color-text-primary);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 650;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.messages-trade-offer-card__action--accept {
  border-color: var(--color-presence-online, #1f9d6b);
  background: var(--color-presence-online, #1f9d6b);
  color: #fff;
}

.messages-trade-offer-card__action--decline,
.messages-trade-offer-card__action--cancel {
  border-color: var(--msg-offer-status-declined-fg, #c93a52);
  background: var(--color-surface, #fff);
  color: var(--msg-offer-status-declined-fg, #c93a52);
}

.messages-trade-offer-card__action--cancel:hover:not(:disabled) {
  background: var(--msg-offer-status-declined-bg, #fbe1e6);
}

.messages-trade-offer-card__action:disabled {
  opacity: 0.6;
  cursor: default;
}

.messages-conversation-header__friend-code--copied {
  color: var(--color-presence-online, #14774f);
}

.messages-conversation__report {
  display: grid;
  gap: var(--space-2);
}

.messages-conversation__report-label {
  margin: 0;
  color: var(--color-text-primary);
  font-size: var(--font-size-control-sm);
}

.messages-conversation__report-input {
  width: 100%;
  min-height: 6rem;
  margin: 0;
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-background);
  color: inherit;
  font: inherit;
  resize: vertical;
}

@media (min-width: 720px) {
  .messages-conversation-page-root {
    --messages-split-header-height: 4.75rem;
    width: 100%;
    max-width: none;
    margin-inline: 0;
    grid-template-columns: minmax(220px, 34%) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    grid-template-areas: "inbox thread";
    align-content: stretch;
  }

  .messages-conversation-page-root > .messages-conversation-page__title {
    display: none;
  }

  .messages-desktop-inbox {
    grid-area: inbox;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-width: 0;
    min-height: 0;
    height: 100%;
    overflow: hidden;
    border-inline-end: 1px solid var(--color-border);
    background: var(--color-background);
  }


  .messages-desktop-inbox__header {
    display: grid;
    align-items: start;
    justify-items: stretch;
    box-sizing: border-box;
    min-height: 0;
    height: auto;
    /* Match list inline inset; 2px under tabs underline before list */
    padding-block: var(--space-2) 2px;
    padding-inline: var(--space-2);
    border-bottom: 0;
  }

  .messages-desktop-inbox__header .messages-page__toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  .messages-desktop-inbox__header .messages-page__tabs,
  .messages-desktop-inbox__header .messages-page__tabs-control,
  .messages-desktop-inbox__header .messages-page__tabs-control .tabs__list {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .messages-desktop-inbox__header .messages-page__tabs-control .tabs__list {
    display: flex;
    align-items: stretch;
  }

  .messages-desktop-inbox__header .messages-page__tabs-control .tabs__tab {
    flex: 1 1 0;
    min-width: 0;
    box-sizing: border-box;
  }

  .messages-desktop-inbox__title {
    display: none;
  }


  .messages-desktop-inbox__list {
    min-width: 0;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    /* Same as mobile .messages-page__body margin-block-start */
    padding-block: var(--space-1);
    padding-inline: var(--space-2);
  }

  .messages-desktop-inbox__list .messages-offers {
    /* filters sit flush under the space-1 gap; keep space-2 only before cards */
    gap: var(--space-2);
  }

  .messages-desktop-inbox__list .messages-conversation-list {
    gap: 0.125rem;
  }

  .messages-desktop-inbox__list .messages-conversation-list__item {
    border-bottom: 0;
    border-radius: 0.5rem;
  }

  .messages-desktop-inbox__list .messages-conversation-swipe,
  .messages-desktop-inbox__list .messages-conversation-swipe__content {
    width: 100%;
    border-radius: inherit;
    background: transparent;
  }

  .messages-desktop-inbox__list .messages-conversation {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
  }

  .messages-desktop-inbox__list .messages-conversation__open {
    width: 100%;
    padding-block: 0.625rem;
    padding-inline: 0.75rem;
    border-radius: 0.5rem;
    background: transparent;
  }

  .messages-desktop-inbox__list .messages-conversation-list__item:hover .messages-conversation__open,
  .messages-desktop-inbox__list .messages-conversation__open:active,
  .messages-desktop-inbox__list .messages-conversation-list__item--active .messages-conversation__open {
    background: #efefef;
  }

  .messages-desktop-inbox__empty {
    margin: 0;
    padding: var(--space-4) 0;
    color: var(--color-text-secondary);
    font-size: var(--font-size-control-sm);
  }

  .messages-conversation-page__body {
    grid-area: thread;
    min-width: 0;
    min-height: 0;
    height: 100%;
  }

  .messages-conversation-page__body > .messages-conversation-page > .messages-conversation-header,
  .messages-conversation-page__body .messages-conversation-header {
    box-sizing: border-box;
    height: var(--messages-split-header-height);
    min-height: var(--messages-split-header-height);
    padding-block: 0;
    align-content: center;
  }

  .messages-conversation-header__back {
    display: none;
  }

  .messages-conversation-header__main {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .messages-conversation-list__item--active {
    background: transparent;
  }
}

/* lt:h-cachefix62015 desktop inbox tabs = offers filters width + mobile gap */
@media (min-width: 720px) {
  .messages-desktop-inbox {
    --messages-inbox-inline: var(--space-2);
  }
  .messages-desktop-inbox__header {
    display: grid !important;
    justify-items: stretch !important;
    align-items: start !important;
    box-sizing: border-box !important;
    min-height: 0 !important;
    height: auto !important;
    padding-block: var(--space-2) 2px !important;
    padding-inline: var(--messages-inbox-inline) !important;
  }
  .messages-desktop-inbox__header .messages-page__toolbar,
  .messages-desktop-inbox__header .messages-page__tabs,
  .messages-desktop-inbox__header .messages-page__tabs-control {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
  .messages-desktop-inbox__header .messages-page__tabs-control .tabs__list {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    gap: var(--tab-gap-sm, 4px) !important;
  }
  .messages-desktop-inbox__header .messages-page__tabs-control .tabs__tab {
    width: auto !important;
    min-width: 0 !important;
    justify-content: center !important;
  }
  .messages-desktop-inbox__list {
    padding-block: var(--space-1) !important;
    padding-inline: var(--messages-inbox-inline) !important;
  }
  .messages-desktop-inbox__list .messages-offers__filters,
  .messages-desktop-inbox__list .messages-offers__filters-list {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  .messages-desktop-inbox__list .messages-offers__filters-list {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: var(--tab-gap-sm, 4px) !important;
  }
}

/* lt:tabgap2 tabs-to-filters gap */
.messages-page__body {
  margin-block-start: 2px !important;
}
@media (min-width: 720px) {
  .messages-desktop-inbox__header {
    min-height: 0 !important;
    height: auto !important;
    padding-block-end: 2px !important;
  }
  .messages-desktop-inbox__list {
    padding-block-start: 0 !important;
  }
}

/* lt:filtfull2 offers filters outside scroller */
@media (min-width: 720px) {
  /* /messages desktop inbox: body becomes a column; only cards scroll */
  .messages-page__inbox .messages-page__body:has(.messages-offers) {
    display: flex;
    flex-direction: column;
    overflow: hidden !important;
    scrollbar-gutter: auto;
    padding-inline-end: 0 !important;
    min-height: 0;
  }

  .messages-page__inbox .messages-offers {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
    gap: var(--space-2);
  }

  .messages-page__inbox .messages-offers__filters {
    flex: 0 0 auto;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .messages-page__inbox .messages-offers__filters-list {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .messages-page__inbox .messages-offers-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-gutter: stable;
    padding-inline-end: 2px;
  }

  .messages-page__inbox .messages-page__tabs-control,
  .messages-page__inbox .messages-page__tabs-control .tabs__list {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .messages-page__inbox .messages-page__tabs-control .tabs__list {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  /* conversation desktop inbox */
  .messages-desktop-inbox__list:has(.messages-offers) {
    display: flex;
    flex-direction: column;
    overflow: hidden !important;
    scrollbar-gutter: auto;
    padding-inline-end: var(--messages-inbox-inline, var(--space-2)) !important;
    min-height: 0;
  }

  .messages-desktop-inbox__list .messages-offers {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
    gap: var(--space-2);
  }

  .messages-desktop-inbox__list .messages-offers__filters {
    flex: 0 0 auto;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .messages-desktop-inbox__list .messages-offers__filters-list {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .messages-desktop-inbox__list .messages-offers-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-gutter: stable;
    padding-inline-end: 2px;
  }

  .messages-desktop-inbox__header .messages-page__tabs-control,
  .messages-desktop-inbox__header .messages-page__tabs-control .tabs__list {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .messages-desktop-inbox__header .messages-page__tabs-control .tabs__list {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 719.98px) {
  /* Mobile: single-panel chat room only (list lives on /messages). */
  .messages-conversation-page-root {
    width: 100%;
    max-width: none;
    margin-inline: 0;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    grid-template-areas: "thread";
  }

  .messages-desktop-inbox {
    display: none !important;
  }

  .messages-conversation-page__body {
    grid-area: auto;
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 699px) {
  .messages-message--incoming:has(.messages-message__bubble--trade-offer),
  .messages-message--outgoing:has(.messages-message__bubble--trade-offer),
  .messages-message--offer {
    width: var(--messages-offer-card-width, 14.75rem);
    max-width: min(var(--messages-offer-card-width, 14.75rem), 92%);
  }
}

/* === /app/styles/pages/notifications.css === */
.notification-bell-button[hidden] {
  display: none;
}

.notification-bell-button[data-selected='true'],
.notification-bell-button[aria-expanded='true'] {
  color: var(--color-control-primary);
  background: var(--color-control-selected);
}

.notification-bell {
  position: relative;
  display: inline-flex;
  width: 1.25rem;
  height: 1.25rem;
}

.notification-bell svg {
  width: 100%;
  height: 100%;
}

.notification-bell__badge {
  position: absolute;
  top: -0.4rem;
  right: -0.45rem;
  min-width: 1rem;
  padding: 0 0.2rem;
  border-radius: 999px;
  background: var(--color-control-danger);
  color: var(--color-control-on-primary);
  font-size: 0.65rem;
  font-weight: var(--font-weight-control);
  line-height: 1rem;
  text-align: center;
}

.notification-panel[hidden] {
  display: none;
}

.notification-panel {
  position: fixed;
  z-index: var(--z-index-overlay, 40);
  display: grid;
  gap: var(--space-2);
  max-height: min(28rem, 75vh);
  overflow: auto;
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-overlay, 0 8px 24px rgb(0 0 0 / 18%));
}

.notification-panel__heading {
  margin: 0;
  padding-inline: var(--space-1);
  color: var(--color-text-primary);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
}

.notification-panel__list {
  display: grid;
  gap: 2px;
}

.notification-panel__item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  margin: 0;
  padding: var(--space-2) var(--space-2);
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-text-primary);
  font: inherit;
  text-align: start;
  cursor: pointer;
}

.notification-panel__item:hover {
  background: color-mix(in srgb, var(--color-text-primary) 5%, transparent);
}

.notification-panel__item--unread {
  background: color-mix(in srgb, var(--color-control-primary) 6%, transparent);
}

.notification-panel__avatar {
  flex: 0 0 auto;
}

.notification-panel__content {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.notification-panel__text {
  margin: 0;
  color: var(--color-text-primary);
  font-size: 0.875rem;
  line-height: 1.35;
}

.notification-panel__nick {
  font-weight: 700;
}

.notification-panel__action {
  font-weight: 400;
  color: var(--color-text-primary);
}

.notification-panel__time,
.notification-panel__empty {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: var(--font-size-control-sm);
  line-height: 1.2;
}

.notification-panel__dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: var(--color-control-primary);
}

.notification-panel__empty {
  padding: var(--space-3) var(--space-1);
}

/* === /app/styles/pages/app-menu.css === */
.app-menu-button[hidden] {
  display: none;
}

.app-menu-button svg {
  width: 22px;
  height: 22px;
  display: block;
}

.app-menu-button[data-selected='true'],
.app-menu-button[aria-expanded='true'] {
  color: var(--color-control-primary);
  background: var(--color-control-selected);
}

/* Inherits .notification-panel look; only tighten menu spacing inside. */
.app-menu-panel.notification-panel {
  max-height: min(32rem, 80vh);
}

.app-menu-panel .profile-menu {
  gap: var(--space-3);
}

.app-menu-panel .profile-menu__list {
  gap: var(--space-4);
}

/* Mobile profile: full-page menu (not a popover). */
.app-menu-panel.app-menu-panel--fullscreen {
  inset: 0;
  top: 0 !important;
  left: 0 !important;
  right: 0;
  bottom: 0;
  width: 100% !important;
  max-width: none;
  max-height: none;
  height: 100%;
  height: 100dvh;
  margin: 0;
  padding:
    max(var(--space-3), var(--safe-area-top, 0px))
    max(var(--space-3), var(--safe-area-right, 0px))
    max(var(--space-4), var(--safe-area-bottom, 0px))
    max(var(--space-3), var(--safe-area-left, 0px));
  border: 0;
  border-radius: 0;
  box-shadow: none;
  z-index: calc(var(--z-index-modal, 50) + 2);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.app-menu-panel--fullscreen .profile-menu {
  width: 100%;
  max-width: var(--app-max-width);
  margin-inline: auto;
  gap: var(--space-4);
}

.app-menu-panel--fullscreen .profile-menu__list {
  gap: var(--space-5);
}

body[data-app-menu-scroll-locked='true'] {
  overflow: hidden;
  overscroll-behavior: none;
}

/* === /app/styles/pages/trade-proposal.css === */
.trade-proposal-page-root {
  display: block;
  width: min(100%, 1000px);
  min-width: 0;
  margin-inline: auto;
}

.trade-proposal-page__body {
  min-width: 0;
}

.trade-proposal-page {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  padding: var(--space-3) var(--space-4) calc(
    62px
    + var(--bottom-navigation-height, 0px)
    + var(--safe-area-bottom, 0px)
  );
}

.trade-proposal-page__title.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.trade-proposal-recipient {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  margin-bottom: var(--space-3);
  color: var(--color-text-secondary);
  font-size: var(--font-size-control-sm, 0.875rem);
}

.trade-proposal-recipient[hidden] {
  display: none;
}

.trade-proposal-recipient__text {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--color-text-secondary);
  font-size: inherit;
  font-weight: 400;
}

.trade-proposal-recipient__text span {
  color: var(--color-text-primary);
  font-weight: 600;
}

.trade-proposal-recipient__badges {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  flex: 0 0 auto;
}

.trade-proposal-recipient__flag {
  display: block;
  width: 1.15rem;
  height: 0.85rem;
  object-fit: cover;
  border-radius: 2px;
}

.trade-proposal-recipient__flight {
  display: block;
  width: 50px;
  height: 25px;
  object-fit: contain;
}

.trade-proposal-recipient__active {
  color: var(--color-text-secondary);
  font-size: 0.75rem;
  white-space: nowrap;
}

.trade-proposal-page__hint {
  margin: 0 0 var(--space-3);
  color: var(--color-text-secondary);
  font-size: var(--font-size-control-sm, 0.875rem);
}

/* Sticky summary bar */
.trade-proposal-summary {
  position: sticky;
  top: 0;
  z-index: var(--z-index-sticky-header, 20);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
}

.trade-proposal-summary__slot {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 1;
  min-width: 0;
}

.trade-proposal-summary__art {
  display: block;
  flex: none;
  width: 64px;
  height: 64px;
  overflow: hidden;
  border: 1.5px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-background);
  color: var(--color-text-primary);
  font-size: 1.25rem;
  font-weight: 700;
}

.trade-proposal-summary__art--empty {
  display: grid;
  place-items: center;
  border-style: dashed;
  color: var(--color-text-secondary);
  font-size: 0.75rem;
  font-weight: 400;
  text-align: center;
  padding: 4px;
}

.trade-proposal-summary__pokemon.pokemon-item,
.trade-proposal-summary__art .pokemon-item {
  --pokemon-image-scale: 1.30;
  --pokemon-item-radius: 0px;
  --pokemon-current-image-padding: 3px;
  --pokemon-item-gap: 0;
  --pokemon-media-background: transparent;
  --pokemon-media-aspect-ratio: 1 / 1;
  width: 100%;
  height: 100%;
  min-width: 0;
  pointer-events: none;
}

.trade-proposal-summary__art .pokemon-item__media {
  width: 100%;
  height: 100%;
  border-radius: 8px;
}

.trade-proposal-summary__copy {
  min-width: 0;
}

.trade-proposal-summary__label,
.trade-proposal-summary__meta {
  display: block;
  color: var(--color-text-secondary);
  font-size: 0.75rem;
  line-height: 1.3;
}

.trade-proposal-summary__title {
  display: block;
  overflow: hidden;
  color: var(--color-text-primary);
  font-size: 0.875rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trade-proposal-summary__title--muted {
  color: var(--color-text-secondary);
  font-weight: 400;
}

.trade-proposal-summary__clear {
  margin-left: auto;
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-text-secondary);
  font: inherit;
  font-size: 1.125rem;
  line-height: 1;
  cursor: pointer;
}

.trade-proposal-summary__arrow {
  flex: none;
  color: var(--color-text-secondary);
  font-size: 1.25rem;
}

/* Two columns */
.trade-proposal-page__columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  min-width: 0;
}

.trade-proposal-page__columns[hidden],
.trade-proposal-page__status[hidden] {
  display: none !important;
}

.trade-proposal-page__status {
  min-width: 0;
  padding-block: var(--space-4);
}

.trade-proposal-column {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
}

.trade-proposal-column__header {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  min-width: 0;
}

.trade-proposal-column__title {
  margin: 0;
  color: var(--color-text-primary);
  font-size: 1rem;
  font-weight: 700;
}

.trade-proposal-column__count {
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
}

.trade-proposal-column__hint {
  margin: 0 0 10px;
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
  line-height: 1.4;
}

.trade-proposal-column__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.trade-proposal-column__chip {
  margin: 0;
  padding: 2px 12px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: transparent;
  color: var(--color-text-primary);
  font: inherit;
  font-size: 0.8125rem;
  cursor: pointer;
}

.trade-proposal-column__chip.is-active {
  border-color: var(--color-control-primary);
  background: var(--color-control-primary);
  color: var(--color-control-on-primary);
}

.trade-proposal-column__tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px;
  max-height: 56vh;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 2px;
}

.trade-proposal-column__empty {
  grid-column: 1 / -1;
  padding: 10px;
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
}

/* Tiles */
.trade-proposal-tile {
  position: relative;
  display: block;
  min-width: 0;
  margin: 0;
  padding: 4px;
  border: 2px solid transparent;
  border-radius: 10px;
  background: var(--color-background);
  color: var(--color-text-primary);
  font: inherit;
  text-align: center;
  cursor: pointer;
}

.trade-proposal-tile:hover {
  border-color: var(--color-border);
}

.trade-proposal-tile.is-selected {
  border-color: var(--color-control-primary);
  background: var(--color-control-selected);
}

.trade-proposal-tile.is-selected::after {
  content: "✓";
  position: absolute;
  top: 3px;
  right: 3px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-control-primary);
  color: var(--color-control-on-primary);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.trade-proposal-tile__media {
  display: block;
  width: 100%;
  margin: 0;
  overflow: hidden;
  border-radius: 8px;
  background: transparent;
  aspect-ratio: 1 / 1;
}

.trade-proposal-tile__pokemon.pokemon-item,
.trade-proposal-tile__media .pokemon-item {
  --pokemon-image-scale: 1.30;
  --pokemon-item-radius: 0px;
  --pokemon-current-image-padding: 5px;
  --pokemon-item-gap: 0;
  --pokemon-media-background: transparent;
  --pokemon-media-aspect-ratio: 1 / 1;
  width: 100%;
  min-width: 0;
  pointer-events: none;
}

.trade-proposal-tile__media .pokemon-item__media {
  border-radius: 8px;
}

/* Fixed bottom bar — sit above bottom nav on mobile */
.trade-proposal-page__footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--bottom-navigation-height, 0px) + var(--safe-area-bottom, 0px));
  z-index: var(--z-index-sticky-header, 20);
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
  padding: 0;
}

.trade-proposal-page__footer-inner {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: var(--space-2);
  box-sizing: border-box;
  width: min(100%, 1000px);
  height: 50px;
  min-height: 50px;
  max-height: 50px;
  margin-inline: auto;
  padding-inline: var(--space-4);
}

.trade-proposal-page__footer-status {
  margin: 0;
  margin-right: auto;
  overflow: hidden;
  color: var(--color-text-secondary);
  font-size: 0.75rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trade-proposal-page__actions {
  display: flex;
  flex: none;
  gap: var(--space-2);
  align-items: center;
}

.trade-proposal-page__actions .button {
  min-height: 34px;
  height: 34px;
  padding-block: 0;
}

.trade-proposal-summary__clear:focus-visible,
.trade-proposal-column__chip:focus-visible,
.trade-proposal-tile:focus-visible {
  outline: 2px solid var(--color-control-primary);
  outline-offset: 2px;
}

@media (max-width: 820px) {
  .trade-proposal-page__columns {
    grid-template-columns: 1fr;
  }

  .trade-proposal-summary {
    gap: var(--space-2);
  }

  .trade-proposal-summary__slot {
    min-width: 0;
  }

  .trade-proposal-page__footer-inner {
    flex-wrap: nowrap;
  }

  .trade-proposal-page__footer-status {
    min-width: 0;
    flex: 1 1 auto;
  }

  .trade-proposal-page__actions {
    flex: 0 0 auto;
  }
}

/* === /app/styles/pages/reset-password.css === */
.reset-password-page {
  display: grid;
  gap: var(--space-4);
  width: min(100%, 28rem);
  margin-inline: auto;
  padding-block: var(--space-6);
  padding-inline: var(--space-4);
}

.reset-password-page__title {
  margin: 0;
  color: var(--color-text-primary);
  font-size: var(--font-size-title-sm, 1.25rem);
  font-weight: var(--font-weight-control);
}

.reset-password-page__lead {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: var(--font-size-control-sm);
}

.reset-password-page .auth-modal__form {
  gap: var(--space-3);
}

/* === /app/styles/pages/admin.css === */
.admin-page {
  --admin-content-max: 72rem;
  --admin-inline-pad: clamp(1rem, 2.5vw, 2rem);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 100%;
  background:
    radial-gradient(1200px 420px at 10% -10%, color-mix(in srgb, var(--color-control-primary) 10%, transparent), transparent 60%),
    var(--color-background, #f7f7f9);
}

.admin-page__top {
  position: sticky;
  top: 0;
  z-index: 8;
  border-bottom: 1px solid color-mix(in srgb, var(--color-border) 80%, transparent);
  background: color-mix(in srgb, var(--color-surface) 92%, transparent);
  backdrop-filter: blur(10px);
}

.admin-page__top-inner {
  display: grid;
  gap: 0.65rem;
  width: min(100%, var(--admin-content-max));
  margin-inline: auto;
  padding: 0.85rem var(--admin-inline-pad) 0;
}

.admin-page__brand-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 1rem;
  min-width: 0;
}

.admin-page__brand {
  margin: 0;
  color: var(--color-text-primary);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: none;
}

.admin-page__meta {
  margin: 0;
  margin-inline-end: auto;
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
}

.admin-page__nav {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.15rem 0.35rem;
  min-width: 0;
}

.admin-page__nav-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: auto;
  min-height: 2.5rem;
  margin: 0;
  padding: 0.45rem 0.7rem 0.7rem;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--color-text-secondary);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  opacity: 1;
}

.admin-page__nav-item:not(:disabled):hover,
.admin-page__nav-item:not(:disabled):focus-visible {
  color: var(--color-text-primary);
  outline: none;
}

.admin-page__nav-item[aria-current='true'] {
  color: var(--color-text-primary);
  border-bottom-color: var(--color-control-primary);
}

.admin-page__nav-item:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.admin-page__nav-soon {
  color: var(--color-text-secondary);
  font-size: 0.6875rem;
  font-weight: 500;
}

.admin-page__main {
  display: grid;
  min-width: 0;
  width: min(100%, var(--admin-content-max));
  margin-inline: auto;
  padding: 1.5rem var(--admin-inline-pad) 2.5rem;
}

.admin-page__panel-host {
  display: grid;
  min-width: 0;
}

.admin-page__panel {
  display: grid;
  gap: 1rem;
  max-width: 42rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.admin-page__panel--overview {
  gap: 1.15rem;
  padding-block: 0.5rem 1rem;
}

.admin-page__panel-title {
  margin: 0;
  color: var(--color-text-primary);
  font-size: clamp(1.5rem, 3vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.admin-page__panel-body {
  margin: 0;
  max-width: 38rem;
  color: var(--color-text-secondary);
  font-size: 0.95rem;
  line-height: 1.55;
}

.admin-page__quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.admin-page__quick-link,
.admin-page__home {
  min-height: 2.35rem;
  margin: 0;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: 0.55rem;
  background: var(--color-surface);
  color: var(--color-text-primary);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.admin-page__quick-link:hover,
.admin-page__home:hover {
  border-color: color-mix(in srgb, var(--color-control-primary) 45%, var(--color-border));
  background: color-mix(in srgb, var(--color-control-primary) 8%, var(--color-surface));
}

.admin-page__quick-link:focus-visible,
.admin-page__home:focus-visible {
  outline: 2px solid var(--color-control-primary);
  outline-offset: 2px;
}

.admin-page__home {
  margin-inline-start: auto;
  background: var(--color-control-secondary);
}

.admin-analytics {
  display: grid;
  gap: 1.5rem;
  min-width: 0;
  padding-block: 0.25rem 1rem;
}

.admin-analytics__status {
  margin: 0;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text-primary);
  font-size: var(--font-size-control-md);
}

.admin-analytics__meta,
.admin-analytics__note {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: var(--font-size-control-sm);
}

.admin-analytics__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
}

.admin-analytics__stat,
.admin-analytics__panel {
  display: grid;
  gap: var(--space-3);
  min-width: 0;
  padding: var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}

.admin-analytics__stat-label,
.admin-analytics__stat-hint,
.admin-analytics__event-code {
  color: var(--color-text-secondary);
  font-size: var(--font-size-control-sm);
}

.admin-analytics__stat-value,
.admin-analytics__event-value {
  font-size: 1.5rem;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.admin-analytics__title {
  margin: 0;
  color: var(--color-text-primary);
  font-size: var(--font-size-control-md);
  font-weight: 650;
}

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

.admin-analytics__table {
  width: 100%;
  min-width: 22rem;
  border-collapse: collapse;
  font-size: var(--font-size-control-sm);
}

.admin-analytics__table th,
.admin-analytics__table td {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--color-border);
  text-align: start;
  vertical-align: top;
  white-space: nowrap;
}

.admin-analytics__table th {
  background: var(--color-control-secondary);
  color: var(--color-text-primary);
  font-weight: var(--font-weight-control);
}

.admin-analytics__table tr:last-child td {
  border-bottom: 0;
}

.admin-analytics__table th.admin-analytics__num,
.admin-analytics__table td.admin-analytics__num {
  text-align: end;
  font-variant-numeric: tabular-nums;
}

.admin-analytics__empty {
  color: var(--color-text-secondary);
  white-space: normal;
}

.admin-analytics__events {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
}

.admin-analytics__event {
  display: grid;
  gap: var(--space-1);
  min-width: 0;
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.admin-analytics__event-mark {
  width: 1.5rem;
  height: 0.25rem;
  border-radius: var(--radius-sm);
  background: var(--color-control-primary);
}

.admin-analytics__event--trade .admin-analytics__event-mark {
  background: var(--color-presence-online);
}

.admin-analytics__event--message .admin-analytics__event-mark {
  background: var(--color-presence-away);
}

.admin-analytics__event--trainer .admin-analytics__event-mark {
  background: var(--color-control-danger);
}

.admin-analytics__event--accept .admin-analytics__event-mark {
  background: var(--color-presence-online);
}

.admin-analytics__event--decline .admin-analytics__event-mark {
  background: var(--color-control-danger);
}

.admin-analytics__event-label {
  color: var(--color-text-primary);
  font-size: var(--font-size-control-sm);
  font-weight: var(--font-weight-control);
}

@media (max-width: 720px) {
  .admin-analytics__stats,
  .admin-analytics__events {
    grid-template-columns: 1fr;
  }

  .admin-page__brand-row {
    gap: 0.4rem 0.75rem;
  }

  .admin-page__home {
    margin-inline-start: 0;
  }
}
/* admin-statistics */
.admin-statistics { display: grid; gap: 1.5rem; min-width: 0; margin-left: 0; padding-bottom: var(--space-6); }
.admin-statistics__status { margin: 0; padding: var(--space-3) var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); color: var(--color-text-primary); }
.admin-statistics__heading { margin: 0; color: var(--color-text-primary); font-size: 1.5rem; line-height: 1.2; font-weight: 650; letter-spacing: -0.02em; }
.admin-statistics__title { margin: 0.35rem 0 0; color: var(--color-text-primary); font-size: 1rem; line-height: 1.3; font-weight: 650; }
.admin-statistics__subtitle { margin: 0.75rem 0 0; color: var(--color-text-primary); font-size: 0.92rem; font-weight: 650; }
.admin-statistics__note { margin: 0; color: var(--color-text-secondary); font-size: var(--font-size-control-sm); line-height: 1.45; }
.admin-statistics__divider { width: 100%; height: 1px; margin: 0.35rem 0; border: 0; background: var(--color-border); }
.admin-statistics__callout { display: grid; gap: 0.2rem; margin: 0; padding: var(--space-3) var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius-md); background: color-mix(in srgb, #b54708 8%, var(--color-surface)); }
.admin-statistics__callout strong { color: var(--color-text-primary); font-size: var(--font-size-control-sm); font-weight: 650; }
.admin-statistics__callout p { margin: 0; color: var(--color-text-secondary); font-size: var(--font-size-control-sm); line-height: 1.45; }
.admin-statistics__stats { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1.25rem 2rem; }
.admin-statistics__stat, .admin-statistics__member { display: grid; gap: 0.35rem; align-content: start; min-width: 0; }
.admin-statistics__stat { min-width: 8.5rem; }
.admin-statistics__stat-value { color: var(--color-text-primary); font-size: 1.75rem; line-height: 1.1; font-weight: 650; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.admin-statistics__stat-label { color: var(--color-text-secondary); font-size: var(--font-size-control-sm); line-height: 1.35; }
.admin-statistics__members { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; align-items: start; }
.admin-statistics__split, .admin-statistics__stack { display: grid; gap: 0.65rem; min-width: 0; align-content: start; }
.admin-statistics__split { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.admin-statistics__frame { min-width: 0; overflow: auto; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); }
.admin-statistics__pokemon-scroll { max-height: 24.75rem; }
.admin-statistics__table { width: 100%; border-collapse: collapse; font-size: var(--font-size-control-sm); }
.admin-statistics__table th, .admin-statistics__table td { padding: 0 var(--space-3); height: 2.25rem; box-sizing: border-box; border-bottom: 1px solid var(--color-border); text-align: start; vertical-align: middle; }
.admin-statistics__table th { position: sticky; top: 0; z-index: 1; background: color-mix(in srgb, var(--color-text-primary) 6%, var(--color-surface)); color: var(--color-text-primary); font-weight: 650; }
.admin-statistics__table tbody tr:last-child td { border-bottom: 0; }
.admin-statistics__table tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--color-text-primary) 4%, transparent); }
.admin-statistics__num { text-align: end; font-variant-numeric: tabular-nums; }
.admin-statistics__name { max-width: 18rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-statistics__message { white-space: normal; height: auto; min-height: 2.25rem; padding-top: var(--space-2); padding-bottom: var(--space-2); }
@media (max-width: 960px) {
  .admin-statistics__members, .admin-statistics__split { grid-template-columns: 1fr; }
}
.admin-community { display: grid; gap: 1.25rem; min-width: 0; margin-left: 0; padding-bottom: var(--space-6); }
.admin-community__heading { margin: 0; color: var(--color-text-primary); font-size: 1.5rem; line-height: 1.2; font-weight: 650; letter-spacing: -0.02em; }
.admin-community__status, .admin-community__note, .admin-community__meta { margin: 0; color: var(--color-text-secondary); font-size: var(--font-size-control-sm); line-height: 1.45; }
.admin-community__tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.admin-community__tab { min-height: 2.25rem; padding: 0.35rem 0.8rem; border: 1px solid var(--color-border); border-radius: 999px; background: transparent; color: var(--color-text-primary); font: inherit; cursor: pointer; }
.admin-community__tab[aria-current='true'] { background: var(--color-text-primary); color: var(--color-surface); }
.admin-community__stack, .admin-community__list, .admin-community__panel { display: grid; gap: 0.75rem; min-width: 0; }
.admin-community__frame { max-height: 24.75rem; overflow: auto; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); }
.admin-community__table { width: 100%; border-collapse: collapse; font-size: var(--font-size-control-sm); }
.admin-community__table th, .admin-community__table td { padding: 0 var(--space-3); height: 2.25rem; box-sizing: border-box; border-bottom: 1px solid var(--color-border); text-align: start; vertical-align: middle; }
.admin-community__table th { position: sticky; top: 0; z-index: 1; background: color-mix(in srgb, var(--color-text-primary) 6%, var(--color-surface)); font-weight: 650; }
.admin-community__table tbody tr:last-child td { border-bottom: 0; }
.admin-community__action { justify-self: start; min-height: 2.25rem; padding: 0.35rem 0.9rem; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-text-primary); color: var(--color-surface); font: inherit; cursor: pointer; }
.admin-community__card { display: grid; gap: 0.55rem; padding: var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); }
.admin-community__message, .admin-community__reply { margin: 0; white-space: pre-wrap; line-height: 1.45; }
.admin-community__reply { color: var(--color-text-secondary); }
.admin-community__input { width: 100%; min-height: 4.5rem; padding: var(--space-2) var(--space-3); border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); color: var(--color-text-primary); font: inherit; resize: vertical; }
.notification-panel__item { flex-wrap: wrap; }
.notification-panel__body { flex: 1 0 100%; color: var(--color-text-secondary); font-size: var(--font-size-control-sm); font-weight: 400; white-space: normal; }

/* === /app/styles/pages/admin-catalog.css === */
.admin-catalog {
  display: grid;
  gap: var(--space-5);
  min-width: 0;
}

.admin-catalog__header {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
  padding-bottom: 0.25rem;
}

.admin-catalog__page-title {
  margin: 0;
  color: var(--color-text-primary);
  font-size: clamp(1.45rem, 2.6vw, 1.8rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.admin-catalog__page-lead {
  margin: 0;
  max-width: 40rem;
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.admin-catalog__status {
  margin: 0;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: 0.65rem;
  background: var(--color-surface);
  color: var(--color-text-primary);
  font-size: var(--font-size-control-md);
}

.admin-catalog__status--error {
  border-color: color-mix(in srgb, var(--color-danger, #b42318) 45%, var(--color-border));
  color: var(--color-danger, #b42318);
}

.admin-catalog__section {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}

.admin-catalog__block {
  display: grid;
  gap: 0.85rem;
  min-width: 0;
  padding: 1rem 0 0.25rem;
  border-top: 1px solid color-mix(in srgb, var(--color-border) 85%, transparent);
}

.admin-catalog__block:first-of-type {
  padding-top: 0.35rem;
  border-top: 0;
}

.admin-catalog__panel--species {
  gap: 0.75rem;
}

.admin-catalog__library-browser--full {
  min-width: 0;
}

.admin-catalog__panel--species .admin-catalog__picker-grid,
.admin-catalog__panel--species .admin-catalog__species-grid {
  height: min(70vh, 46rem);
  min-height: 28rem;
}

.admin-catalog__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.admin-catalog__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.85rem;
}

.admin-catalog__toolbar-label {
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
  font-weight: 600;
}

.admin-catalog__segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.2rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-surface) 88%, var(--color-text-secondary));
}

.admin-catalog__segment {
  min-height: 1.9rem;
  padding: 0.2rem 0.75rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
}

.admin-catalog__segment[aria-pressed='true'] {
  background: var(--color-surface);
  color: var(--color-text-primary);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--color-text-primary) 12%, transparent);
}

.admin-catalog__details {
  min-width: 0;
}

.admin-catalog__details-summary {
  cursor: pointer;
  color: var(--color-control-primary);
  font-size: 0.8125rem;
  font-weight: 600;
  list-style: none;
}

.admin-catalog__details-summary::-webkit-details-marker {
  display: none;
}

.admin-catalog__details[open] .admin-catalog__details-summary {
  margin-bottom: 0.35rem;
}

.admin-catalog__section-title {
  margin: 0;
  color: var(--color-text-primary);
  font-size: 1.2rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.admin-catalog__subhead {
  margin: var(--space-2) 0 0;
  color: var(--color-text-primary);
  font-size: var(--font-size-control-md);
  font-weight: 650;
}

.admin-catalog__help,
.admin-catalog__hint,
.admin-catalog__deploy-note {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: var(--font-size-body);
  line-height: 1.45;
}

.admin-catalog__image-format-options {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  max-width: none;
}

.admin-catalog__deploy-note {
  padding: var(--space-3);
  border-left: 3px solid var(--color-control-primary);
  background: color-mix(in srgb, var(--color-control-primary) 8%, transparent);
}

.admin-catalog__manual-box {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-left: 3px solid #b54708;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, #b54708 8%, var(--color-surface));
}

.admin-catalog__manual-box[hidden] {
  display: none;
}

.admin-catalog__manual-title {
  margin: 0;
  color: var(--color-text-primary);
  font-size: var(--font-size-control-md);
  font-weight: 650;
}

.admin-catalog__pending {
  display: grid;
  gap: 0.55rem;
  min-width: 0;
}

.admin-catalog__pending-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr));
  gap: 0.55rem;
}

.admin-catalog__pending-card {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
  padding: 0.45rem;
  border: 1px solid var(--color-border);
  border-radius: 0.65rem;
  background: var(--color-surface);
}

.admin-catalog__pending-thumb {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  width: 100%;
  overflow: hidden;
  border-radius: 0.45rem;
  background: color-mix(in srgb, var(--color-text-secondary) 8%, var(--color-surface));
}

.admin-catalog__pending-thumb--empty {
  background: color-mix(in srgb, var(--color-text-secondary) 14%, var(--color-surface));
}

.admin-catalog__pending-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.admin-catalog__pending-name {
  overflow: hidden;
  color: var(--color-text-secondary);
  font-size: 0.6875rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-catalog__drop {
  display: grid;
  place-items: center;
  min-height: 5.5rem;
  padding: var(--space-4);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--color-surface) 88%, var(--color-text-secondary));
  color: var(--color-text-secondary);
  font-size: var(--font-size-control-md);
  font-weight: var(--font-weight-control);
  cursor: pointer;
  position: relative;
}

.admin-catalog__drop--active {
  border-color: var(--color-control-primary);
  color: var(--color-text-primary);
}

.admin-catalog__file {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.admin-catalog__list {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.admin-catalog__list-item {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--font-size-control-sm);
}

.admin-catalog__list-item strong {
  color: var(--color-text-primary);
}

.admin-catalog__list-item span {
  color: var(--color-text-secondary);
  word-break: break-word;
}

.admin-catalog__list-item--error {
  border-color: color-mix(in srgb, var(--color-danger, #b42318) 40%, var(--color-border));
}

.admin-catalog__list-item--warn {
  border-color: color-mix(in srgb, #b54708 40%, var(--color-border));
}

.admin-catalog__form {
  display: grid;
  gap: var(--space-2);
}

.admin-catalog__input {
  width: 100%;
  min-height: var(--touch-target-size);
  margin: 0;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text-primary);
  font: inherit;
  font-size: var(--font-size-control-md);
}

.admin-catalog__variants {
  display: grid;
  gap: var(--space-2);
  max-height: 16rem;
  overflow: auto;
  padding: var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.admin-catalog__check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  margin: 0;
  color: var(--color-text-primary);
  font-size: var(--font-size-control-sm);
  cursor: pointer;
}

.admin-catalog__check input {
  margin-block-start: 0.45rem;
}

.admin-catalog__thumb {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--color-text-primary) 8%, var(--color-surface));
}

.admin-catalog__thumb-image {
  display: block;
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.admin-catalog__zoom {
  position: fixed;
  z-index: 80;
  box-sizing: border-box;
  width: 100px;
  height: 100px;
  margin: 0;
  padding: 0;
  pointer-events: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: 0 8px 24px rgb(0 0 0 / 28%);
}

.admin-catalog__zoom[hidden] {
  display: none;
}

.admin-catalog__zoom-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.admin-catalog__btn {
  justify-self: start;
  min-height: var(--touch-target-size);
  margin: 0;
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-control-secondary);
  color: var(--color-text-primary);
  font: inherit;
  font-size: var(--font-size-control-md);
  font-weight: var(--font-weight-control);
  cursor: pointer;
}

.admin-catalog__btn:hover {
  background: var(--color-control-secondary-hover);
}

.admin-catalog__btn:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.admin-catalog__btn--primary {
  border-color: transparent;
  background: var(--color-control-primary);
  color: var(--color-control-primary-fg, #fff);
}

.admin-catalog__btn--primary:hover {
  filter: brightness(0.96);
}

.admin-catalog__row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.admin-catalog__unknown {
  display: grid;
  gap: var(--space-3);
  position: relative;
  z-index: 5;
}

.admin-catalog__unknown-row {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-3);
  border: 1px solid color-mix(in srgb, #b54708 35%, var(--color-border));
  border-radius: var(--radius-md);
  position: relative;
  z-index: 5;
}

.admin-catalog__unknown-row .admin-catalog__btn {
  position: relative;
  z-index: 6;
  pointer-events: auto;
}

.admin-catalog__log {
  margin: 0;
  max-height: 18rem;
  overflow: auto;
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--color-surface) 90%, #000);
  color: var(--color-text-secondary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.75rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.admin-page__nav-item:not(:disabled) {
  cursor: pointer;
  opacity: 1;
}

.admin-catalog__switch-btn {
  min-height: 2.1rem;
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-text-primary);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}
.admin-catalog__switch-btn[aria-current="true"] {
  border-color: var(--color-control-primary);
  background: color-mix(in srgb, var(--color-control-primary) 12%, var(--color-surface));
}
.admin-catalog__switch {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.15rem 0.25rem;
  margin: 0.15rem 0 0.35rem;
  border-bottom: 1px solid color-mix(in srgb, var(--color-border) 85%, transparent);
}
.admin-catalog__switch > .admin-catalog__switch-btn {
  min-height: 2.4rem;
  padding: 0.45rem 0.7rem 0.7rem;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--color-text-secondary);
}
.admin-catalog__switch > .admin-catalog__switch-btn:hover,
.admin-catalog__switch > .admin-catalog__switch-btn:focus-visible {
  color: var(--color-text-primary);
  outline: none;
}
.admin-catalog__switch > .admin-catalog__switch-btn[aria-current="true"] {
  color: var(--color-text-primary);
  border-bottom-color: var(--color-control-primary);
  background: transparent;
}
.admin-catalog__panel[hidden], .admin-catalog__preview[hidden] { display: none; }
.admin-catalog__preview { display: flex; gap: var(--space-4); align-items: center; }
.admin-catalog__preview-image, .admin-catalog__library-shot { width: 7.5rem; height: 7.5rem; object-fit: cover; border-radius: var(--radius-md); background: color-mix(in srgb, var(--color-text-secondary) 12%, var(--color-surface)); }
.admin-catalog__library-shot { width: 4.5rem; height: 4.5rem; }
.admin-catalog__preview-meta { display: grid; gap: var(--space-2); min-width: 0; }
.admin-catalog__live-title { margin: 0; color: var(--color-text-primary); font-size: var(--font-size-overlay-title); font-weight: 700; line-height: 1.25; }
.admin-catalog__label { display: grid; gap: var(--space-2); color: var(--color-text-primary); font-weight: 650; }
.admin-catalog__choices { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.admin-catalog__choice { display: inline-flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3); border: 1px solid var(--color-border); border-radius: var(--radius-md); cursor: pointer; }
.admin-catalog__results, .admin-catalog__chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.admin-catalog__species { display: grid; gap: var(--space-2); width: 100%; }
.admin-catalog__result, .admin-catalog__chip { display: inline-flex; align-items: center; gap: var(--space-2); padding: var(--space-1) var(--space-2); border: 1px solid var(--color-border); border-radius: 999px; background: var(--color-surface); color: var(--color-text-primary); font: inherit; }
.admin-catalog__chip-remove { border: 0; background: transparent; color: var(--color-text-secondary); font: inherit; cursor: pointer; }
.admin-catalog__library { display: grid; gap: var(--space-3); }
.admin-catalog__library-row { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr) auto; gap: var(--space-3); align-items: center; padding-bottom: var(--space-3); border-bottom: 1px solid var(--color-border); }

.admin-catalog [hidden] { display: none !important; }

.admin-catalog__picker-tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.admin-catalog__picker-search { flex: 1 1 auto; min-width: 0; }
.admin-catalog__picker-grid { height: 26rem; border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-surface); }

.admin-catalog__picker-tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.admin-catalog__picker-search { flex: 1 1 auto; min-width: 0; }
.admin-catalog__picker-grid { height: 26rem; border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-surface); }
.admin-catalog__picker-grid .pokemon-grid__items { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@container create-trade-selection (min-width: 520px) {
  .admin-catalog__picker-grid .pokemon-grid__items { grid-template-columns: repeat(7, minmax(0, 1fr)); }
}

.admin-catalog__library-tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.admin-catalog__library-search { flex: 1 1 12rem; min-width: 10rem; }
.admin-catalog__library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: var(--space-3); }
.admin-catalog__library-card { display: grid; gap: var(--space-2); padding: var(--space-2); border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-surface); color: var(--color-text-primary); font: inherit; text-align: left; cursor: pointer; }
.admin-catalog__library-card-image { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-md); background: color-mix(in srgb, var(--color-text-secondary) 12%, var(--color-surface)); }
.admin-catalog__detail { display: grid; gap: var(--space-3); }
.admin-catalog__detail-bar { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); }
.admin-catalog__detail-image { width: 100%; max-height: 18rem; object-fit: cover; border-radius: var(--radius-md); background: color-mix(in srgb, var(--color-text-secondary) 12%, var(--color-surface)); }
.admin-catalog__detail-picker { display: grid; gap: var(--space-3); }

.admin-catalog__remove-list { display: grid; gap: var(--space-2); }
.admin-catalog__remove-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-2); border: 1px solid var(--color-border); border-radius: var(--radius-md); }
.admin-catalog__remove-copy { display: grid; gap: 0.15rem; min-width: 0; }
.admin-catalog__btn--danger { border-color: color-mix(in srgb, var(--color-danger, #b42318) 45%, var(--color-border)); color: var(--color-danger, #b42318); }
.admin-catalog__species-image { object-fit: contain; background: color-mix(in srgb, var(--color-text-secondary) 8%, var(--color-surface)); }
.admin-catalog__species-list { max-height: 26rem; overflow: auto; border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-surface); }
.admin-catalog__species-rows { display: grid; }
.admin-catalog__species-row { display: grid; grid-template-columns: 4.75rem minmax(0, 1fr); gap: var(--space-3); align-items: stretch; width: 100%; min-height: 4.75rem; margin: 0; padding: 0; border: 0; border-bottom: 1px solid var(--color-border); background: transparent; color: var(--color-text-primary); font: inherit; text-align: left; cursor: pointer; }
.admin-catalog__species-row .admin-catalog__thumb { flex: none; width: 100%; height: 100%; align-self: stretch; border-radius: 0; }
.admin-catalog__species-row .admin-catalog__thumb-image { width: 100%; height: 100%; object-fit: cover; transform: scale(1.4); }
.admin-catalog__species-copy { align-self: center; padding-inline-end: var(--space-3); }
.admin-catalog__species-row:hover { background: color-mix(in srgb, var(--color-control-primary) 8%, var(--color-surface)); }
.admin-catalog__species-row[aria-pressed='true'] { background: color-mix(in srgb, var(--color-control-primary) 14%, var(--color-surface)); box-shadow: inset 3px 0 0 var(--color-control-primary); }
.admin-catalog__species-delete { border-color: color-mix(in srgb, var(--color-danger, #b42318) 45%, var(--color-border)); color: var(--color-danger, #b42318); }
.admin-catalog__species-copy { display: grid; gap: 0.1rem; min-width: 0; }
.admin-catalog__species-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-catalog__species-message { margin: 0; padding: var(--space-4); }
.admin-catalog__sort { position: relative; }
.admin-catalog__sort-menu { position: absolute; z-index: 6; top: calc(100% + 0.35rem); right: 0; display: grid; min-width: 16rem; padding: 0.25rem; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); box-shadow: 0 8px 24px rgb(0 0 0 / 18%); }
.admin-catalog__sort-option { margin: 0; padding: var(--space-2) var(--space-3); border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--color-text-primary); font: inherit; text-align: left; cursor: pointer; }
.admin-catalog__sort-option:hover { background: color-mix(in srgb, var(--color-control-primary) 8%, var(--color-surface)); }
.admin-catalog__sort-option[aria-current='true'] { font-weight: 700; background: color-mix(in srgb, var(--color-control-primary) 12%, var(--color-surface)); }

/* admin-catalog-canvas-theme: matches the background screen mock */
.admin-catalog {
  gap: 1.15rem;
  padding-block: 0.25rem 1rem;
}
.admin-catalog__section.admin-catalog__panel {
  gap: 0.85rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.admin-catalog__section-title {
  font-size: 1.15rem;
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: -0.02em;
}
.admin-catalog__subhead {
  font-size: 0.95rem;
  font-weight: 650;
  line-height: 1.35;
}
.admin-catalog__help {
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--color-text-secondary);
}
.admin-catalog__hint {
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--color-text-secondary);
}
.admin-catalog__drop {
  min-height: 0;
  padding: 1.6rem 1rem;
  border-radius: 0.75rem;
  border: 1px dashed color-mix(in srgb, var(--color-control-primary) 28%, var(--color-border));
  background: color-mix(in srgb, var(--color-control-primary) 5%, var(--color-surface));
  color: var(--color-text-primary);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
}
.admin-catalog__input {
  border-radius: 8px;
  font-size: 14px;
}
.admin-catalog__live-title {
  font-size: 16px;
  font-weight: 590;
  line-height: 22px;
}
.admin-catalog__btn {
  border-radius: 8px;
  font-size: 14px;
  font-weight: 590;
}
.admin-catalog__btn--primary {
  border-color: transparent;
}
.admin-catalog__library-tools {
  gap: 8px;
}
.admin-catalog__library-grid {
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 12px;
}
@media (min-width: 900px) {
  .admin-catalog__library-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.admin-catalog__library-card {
  gap: 8px;
  padding: 8px;
  border-radius: 10px;
  background: var(--color-surface);
}
.admin-catalog__library-card:hover {
  border-color: var(--color-control-primary);
}
.admin-catalog__library-card-image {
  height: 92px;
  aspect-ratio: auto;
  border-radius: 8px;
}
.admin-catalog__library-card strong {
  font-size: 12px;
  font-weight: 590;
  line-height: 16px;
}
.admin-catalog__detail {
  gap: 12px;
  width: min(640px, 100%);
  margin-inline: auto;
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
}
.admin-catalog__detail-image {
  max-height: 220px;
  border-radius: 8px;
}
.admin-catalog__picker-grid {
  border-radius: 10px;
}
.admin-catalog__picker-grid .pokemon-item {
  border-radius: 8px;
  background: var(--color-surface);
}
.admin-catalog__picker-grid .pokemon-item[data-selected='true'] {
  border-color: var(--color-control-primary);
  background: color-mix(in srgb, var(--color-control-primary) 10%, var(--color-surface));
}
.admin-catalog__species-list,
.admin-catalog__sort-menu {
  border-radius: 10px;
  box-shadow: none;
}
.admin-catalog__chip {
  border-radius: 999px;
}

/* admin-page-top-nav */
.app-shell:has(.admin-page) {
  max-width: none;
}
.app-shell:has(.admin-page) .app-header,
.app-shell:has(.admin-page) .bottom-navigation {
  max-width: none;
}
.app-shell:has(.admin-page) > .app-shell__header {
  height: 0;
  min-height: 0;
  padding-top: 0;
  overflow: hidden;
  border: 0;
  visibility: hidden;
  pointer-events: none;
}
.app-shell:has(.admin-page) .app-shell__viewport {
  background: transparent;
}
.app-shell:has(.admin-page) .app-shell__content {
  max-width: none;
}

/* admin-desktop-no-nav-gap: collapse CLS-reserved desktop nav track on /admin */
@media (min-width: 720px) {
  .app-shell:has(.admin-page) {
    grid-template-rows: minmax(0, 1fr) !important;
  }

  .app-shell:has(.admin-page) > .app-shell__header,
  .app-shell:has(.admin-page) > [data-app-shell-header] {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  .app-shell:has(.admin-page) > .app-shell__navigation,
  .app-shell:has(.admin-page) > [data-app-shell-navigation],
  .app-shell:has(.admin-page) > [data-app-shell-navigation][hidden] {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  .app-shell:has(.admin-page) > .app-shell__viewport {
    grid-row: 1 !important;
  }
}


/* admin-catalog-species-grid-labels */
.admin-catalog__species-grid .pokemon-item__details {
  justify-items: center;
  padding: 0 4px 6px;
  text-align: center;
}
.admin-catalog__species-grid .pokemon-item__name,
.admin-catalog__species-grid .pokemon-item__metadata {
  width: 100%;
  white-space: normal;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.2;
  text-align: center;
}
.admin-catalog__species-grid .pokemon-item__name {
  font-size: 12px;
  font-weight: 590;
}
.admin-catalog__species-grid .pokemon-item__metadata {
  font-size: 10px;
  word-break: break-word;
}

/* admin-catalog-layout-sizes */
.admin-catalog__picker-grid .pokemon-grid[data-layout='small'] .pokemon-grid__items {
  --admin-catalog-tile: 132px;
}
.admin-catalog__picker-grid .pokemon-grid[data-layout='medium'] .pokemon-grid__items {
  --admin-catalog-tile: 150px;
}
.admin-catalog__picker-grid .pokemon-grid[data-layout='large'] .pokemon-grid__items {
  --admin-catalog-tile: 178px;
}
.admin-catalog__picker-grid .pokemon-grid[data-layout] .pokemon-grid__items {
  grid-template-columns: repeat(auto-fill, var(--admin-catalog-tile, 132px));
  justify-content: start;
}

/* admin-catalog-costume-names */
.admin-catalog__costume-list {
  display: grid;
  gap: var(--space-2);
  max-height: 70vh;
  overflow: auto;
}
.admin-catalog__costume-row {
  display: grid;
  grid-template-columns: 4.75rem minmax(0, 1fr) minmax(10rem, 16rem);
  gap: var(--space-3);
  align-items: stretch;
  min-height: 4.75rem;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  overflow: hidden;
}
.admin-catalog__costume-row .admin-catalog__thumb {
  width: 100%;
  height: 100%;
  align-self: stretch;
  border-radius: 0;
}
.admin-catalog__costume-row .admin-catalog__thumb-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.4);
}
.admin-catalog__costume-copy {
  display: grid;
  gap: 0.15rem;
  align-self: center;
  min-width: 0;
  padding-inline: var(--space-2);
}
.admin-catalog__costume-row .admin-catalog__input {
  align-self: center;
  margin-inline-end: var(--space-3);
}
.admin-catalog__costume-copy strong,
.admin-catalog__costume-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-catalog__selected.create-trade__selected-list {
  --admin-selected-item-size: 72px;
  grid-template-columns: repeat(auto-fill, minmax(var(--admin-selected-item-size), 1fr));
}
.admin-catalog__selected[data-layout='medium'] {
  --admin-selected-item-size: 96px;
}
.admin-catalog__selected[data-layout='large'] {
  --admin-selected-item-size: 128px;
}
.admin-catalog__selected[hidden] {
  display: none;
}

.admin-profile-avatars {
  display: grid;
  gap: var(--space-4);
  min-width: 0;
}

.admin-profile-avatars__list {
  display: grid;
  gap: var(--space-2);
  max-height: 70vh;
  overflow: auto;
}

.admin-profile-avatars__card {
  display: grid;
  grid-template-columns: auto 4.5rem minmax(0, 1fr) auto;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  cursor: grab;
}

.admin-profile-avatars__card.is-dragging {
  opacity: 0.55;
}

.admin-profile-avatars__handle {
  color: var(--color-text-secondary);
  font-size: 1rem;
  letter-spacing: -0.08em;
  user-select: none;
}

.admin-profile-avatars__thumb {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 999px;
  object-fit: cover;
  background: #111;
}

.admin-profile-avatars__meta {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.admin-profile-avatars__meta strong,
.admin-profile-avatars__meta .admin-catalog__hint {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-profile-avatars__crop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: var(--space-4);
  background: color-mix(in srgb, #000 55%, transparent);
}

.admin-profile-avatars__crop[hidden] {
  display: none;
}

.admin-profile-avatars__crop-dialog {
  display: grid;
  gap: var(--space-3);
  width: min(42rem, 100%);
  max-height: min(92vh, 48rem);
  overflow: auto;
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}

.admin-profile-avatars__crop-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-4);
  align-items: start;
}

.admin-profile-avatars__crop-stage {
  touch-action: none;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #111;
  cursor: grab;
}

.admin-profile-avatars__crop-canvas {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}

.admin-profile-avatars__crop-preview {
  display: grid;
  gap: var(--space-2);
  justify-items: center;
  min-width: 8rem;
}

.admin-profile-avatars__preview-circle {
  width: 8rem;
  height: 8rem;
  border-radius: 999px;
  overflow: hidden;
  border: 2px solid var(--color-border);
  background: #111;
}

.admin-profile-avatars__preview-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.admin-profile-avatars__zoom {
  display: grid;
  gap: 0.35rem;
}

.admin-profile-avatars__zoom-input {
  width: 100%;
}

@media (max-width: 640px) {
  .admin-profile-avatars__crop-body {
    grid-template-columns: 1fr;
  }

  .admin-profile-avatars__card {
    grid-template-columns: auto 3.5rem minmax(0, 1fr);
  }

  .admin-profile-avatars__card .admin-catalog__btn--danger {
    grid-column: 1 / -1;
  }
}

/* === /app/styles/components/pokemon-item-size-control.css === */
/* Segmented S / M / L Pokémon item size control (site-wide). */
.home-feed__layout,
.pokedex-page__layout,
.create-trade-selection__layout,
.create-trade-filter-sheet__layout-control,
.profile-settings__size-options {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: stretch;
  gap: 0;
  box-sizing: border-box;
  height: 32px;
  padding: 0;
  overflow: hidden;
  border: var(--control-border-width) solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
}

.create-trade-filter-sheet__layout-control,
.profile-settings__size-options {
  display: flex;
  width: min(100%, 12rem);
  height: 36px;
}

.home-feed__layout-option,
.pokedex-page__layout-option,
.create-trade-selection__layout-option,
.create-trade-filter-sheet__layout-option,
.profile-settings__size-option,
.create-trade-filter-sheet__layout-control > .button,
.profile-settings__size-options > .button {
  box-sizing: border-box;
  display: inline-flex;
  flex: 0 0 30px;
  align-items: center;
  justify-content: center;
  width: 30px;
  min-width: 30px;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent;
  color: var(--color-text-primary);
  box-shadow: none !important;
  font: inherit;
  font-size: var(--font-size-control-sm);
  font-weight: var(--font-weight-control);
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.create-trade-filter-sheet__layout-control > .button,
.profile-settings__size-options > .button,
.create-trade-filter-sheet__layout-option,
.profile-settings__size-option {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
}

.home-feed__layout-option:hover:not(.home-feed__layout-option--active),
.pokedex-page__layout-option:hover:not(.pokedex-page__layout-option--active),
.create-trade-selection__layout-option:hover:not(.create-trade-selection__layout-option--active),
.create-trade-filter-sheet__layout-control > .button--secondary:hover,
.profile-settings__size-options > .button--secondary:hover {
  background: color-mix(in srgb, var(--color-text-primary) 6%, transparent);
}

.home-feed__layout-option--active,
.pokedex-page__layout-option--active,
.create-trade-selection__layout-option--active,
.create-trade-filter-sheet__layout-control > .button--primary,
.profile-settings__size-options > .button--primary,
.create-trade-filter-sheet__layout-option.button--primary,
.profile-settings__size-option.button--primary {
  background: var(--color-control-primary) !important;
  color: var(--color-control-on-primary) !important;
  font-weight: 700;
}

.home-feed__layout-option:focus-visible,
.pokedex-page__layout-option:focus-visible,
.create-trade-selection__layout-option:focus-visible,
.create-trade-filter-sheet__layout-control > .button:focus-visible,
.profile-settings__size-options > .button:focus-visible {
  outline: 2px solid var(--color-control-primary);
  outline-offset: -2px;
  z-index: 1;
}

/* === /app/styles/lt-runtime-patches.css === */
/* lt:seo1 seo landing pre-hydration only */
/* lt:seofaq modern footer-band SEO + FAQ */
.seo-landing {
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  color: var(--color-text-primary);
  font-family: inherit;
  line-height: 1.55;
  border-top: 1px solid color-mix(in srgb, var(--color-border) 78%, transparent);
  background:
    radial-gradient(120% 80% at 0% 0%, color-mix(in srgb, var(--color-control-primary) 14%, transparent), transparent 55%),
    radial-gradient(90% 70% at 100% 100%, color-mix(in srgb, #1f9d8a 10%, transparent), transparent 50%),
    color-mix(in srgb, var(--color-surface, var(--color-background)) 94%, var(--color-text-primary) 6%);
}

.seo-landing__inner {
  box-sizing: border-box;
  width: 100%;
  max-width: var(--app-max-width);
  margin: 0 auto;
  padding: 16px 12px 8px;
}

.seo-landing__eyebrow {
  margin: 0 0 0.35rem;
  color: color-mix(in srgb, var(--color-control-primary) 80%, var(--color-text-primary));
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.seo-landing__title {
  margin: 0 0 0.55rem;
  color: var(--color-text-primary);
  font-size: clamp(1.35rem, 2.8vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.seo-landing__lead {
  margin: 0 0 1.25rem;
  max-width: 40rem;
  color: var(--color-text-secondary);
  font-size: 0.95rem;
}

.seo-landing__grid {
  display: grid;
  gap: 0.85rem;
  margin: 0 0 1.15rem;
}

@media (min-width: 720px) {
  .seo-landing__grid {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
}

.seo-landing__panel {
  min-width: 0;
  padding: 0.9rem 1rem;
  border: 1px solid color-mix(in srgb, var(--color-border) 85%, transparent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--color-background, #fff) 72%, transparent);
  backdrop-filter: blur(6px);
}

.seo-landing__panel-title {
  margin: 0 0 0.55rem;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.seo-landing__list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--color-text-secondary);
  font-size: 0.88rem;
}

.seo-landing__list li {
  margin: 0.28rem 0;
}

.seo-landing__list--steps {
  list-style: decimal;
}

.seo-landing__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  margin: 0 0 1.35rem;
}

.seo-landing__links a {
  color: var(--color-control-primary);
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
}

.seo-landing__links a:hover,
.seo-landing__links a:focus-visible {
  text-decoration: underline;
}

.seo-landing__faq {
  scroll-margin-top: 5.5rem;
  padding-top: 0.25rem;
}

.seo-landing__faq-title {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.seo-landing__faq-list {
  display: grid;
  gap: 0.55rem;
}

.seo-landing__faq-item {
  border: 1px solid color-mix(in srgb, var(--color-border) 88%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--color-background, #fff) 78%, transparent);
  overflow: clip;
}

.seo-landing__faq-item > summary {
  cursor: pointer;
  list-style: none;
  padding: 0.85rem 1rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--color-text-primary);
}

.seo-landing__faq-item > summary::-webkit-details-marker {
  display: none;
}

.seo-landing__faq-item > summary::after {
  content: '+';
  float: right;
  color: var(--color-text-secondary);
  font-weight: 700;
}

.seo-landing__faq-item[open] > summary::after {
  content: '–';
}

.seo-landing__faq-item > p,
.seo-landing__faq-item p {
  margin: 0;
  padding: 0 1rem 0.9rem;
  color: var(--color-text-secondary);
  font-size: 0.88rem;
}

.seo-landing__faq-item a {
  color: var(--color-control-primary);
  font-weight: 650;
}

.seo-landing--tools {
  margin-top: 0;
}

.seo-landing h1 {
  margin: 0 0 0.55rem;
  font-size: clamp(1.35rem, 2.8vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.seo-landing h2 {
  font-size: 1.05rem;
  margin: 1rem 0 0.45rem;
  font-weight: 800;
}

.seo-landing h3 {
  font-size: 0.95rem;
  margin: 0.75rem 0 0.3rem;
  font-weight: 750;
}

.seo-landing p {
  margin: 0 0 0.7rem;
  color: var(--color-text-secondary);
  font-size: 0.92rem;
}

.seo-landing a {
  color: var(--color-control-primary);
}

/* lt:varh1 variant H1 */
.pokemon-detail-presentation__name {
  font-size: clamp(1.15rem, 4.6vw, 1.65rem);
  line-height: 1.2;
}

/* lt:hdrmrq1 header title left, centered, mobile marquee */
.app-header__title-area {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  align-self: stretch;
  box-sizing: border-box;
  height: 100%;
  min-height: 0;
  min-width: 0;
  padding-inline: var(--space-2);
  text-align: left;
}

.app-header__title {
  display: block;
  max-width: 100%;
  margin: 0;
  overflow: hidden;
  color: var(--color-text-primary);
  font-size: var(--font-size-control-lg);
  font-weight: var(--font-weight-control);
  line-height: 1;
  text-align: left;
  white-space: nowrap;
}

.app-header__title-text {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  will-change: transform;
}

.app-header__title--marquee .app-header__title-text {
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  animation: app-header-title-marquee var(--app-header-marquee-duration, 8s) ease-in-out infinite alternate;
}

@keyframes app-header-title-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(var(--app-header-marquee-distance, 0px)); }
}

.app-header__meta {
  justify-content: flex-start;
  margin-block-start: 2px;
}

.pokemon-detail-presentation__seo-heading.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 720px) {
  .app-header__title--marquee .app-header__title-text {
    animation: none;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-header__title--marquee .app-header__title-text {
    animation: none;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* lt:heroctr1 detail hero: no side copy; center art on mobile */
.pokemon-detail-presentation__hero {
  grid-template-columns: minmax(0, 1fr);
  justify-items: start;
  gap: 0;
}

.pokemon-detail-presentation__identity {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.pokemon-detail-presentation__dex,
.pokemon-detail-presentation__name,
.pokemon-detail-presentation__costume,
.pokemon-detail-presentation__background {
  display: none !important;
}

@media (max-width: 719.98px) {
  .pokemon-detail-presentation__hero {
    justify-items: center;
  }

  .pokemon-detail-presentation__art {
    justify-self: center;
    margin-inline: auto;
  }
}
/* lt:dustside1 stardust panel beside detail art */
.pokemon-detail-presentation__hero:has(.pokemon-stardust-costs) {
  grid-template-columns: minmax(0, var(--pokemon-detail-art-size)) minmax(0, 1fr);
  align-items: start;
  justify-items: stretch;
  gap: var(--space-3);
}

.pokemon-detail-presentation__hero:has(.pokemon-stardust-costs) .pokemon-detail-presentation__identity {
  position: static;
  width: auto;
  height: auto;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
  justify-self: stretch;
}

.pokemon-detail-presentation__hero:has(.pokemon-stardust-costs) .pokemon-detail-presentation__art {
  justify-self: start;
  margin-inline: 0;
}

@media (max-width: 719.98px) {
  .pokemon-detail-presentation__hero:has(.pokemon-stardust-costs) {
    grid-template-columns: minmax(0, min(52vw, 11.5rem)) minmax(0, 1fr);
    gap: var(--space-2);
  }
}

/* lt:dustpol1 stardust panel polish */
.pokemon-stardust-costs {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

.pokemon-stardust-costs[hidden] {
  display: none !important;
}

.pokemon-stardust-costs__title {
  margin: 0 0 0.65rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}

.pokemon-stardust-costs__note,
.pokemon-stardust-costs__source {
  display: none !important;
}

.pokemon-stardust-costs__table {
  width: max-content;
  max-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.78rem;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--color-border) 85%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--color-surface, var(--color-background)) 92%, var(--color-text-primary) 8%);
}

.pokemon-stardust-costs__table thead th {
  padding: 0.45rem 0.55rem;
  border-bottom: 1px solid color-mix(in srgb, var(--color-border) 90%, transparent);
  background: color-mix(in srgb, var(--color-surface, var(--color-background)) 70%, var(--color-text-primary) 30%);
  color: var(--color-text-secondary);
  font-size: 0.62rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: left;
  white-space: nowrap;
}

.pokemon-stardust-costs__table thead th:not(:first-child),
.pokemon-stardust-costs__table td {
  text-align: right;
}

.pokemon-stardust-costs__table tbody th,
.pokemon-stardust-costs__table tbody td {
  padding: 0.48rem 0.55rem;
  border-bottom: 1px solid color-mix(in srgb, var(--color-border) 70%, transparent);
  vertical-align: middle;
}

.pokemon-stardust-costs__table tbody tr:last-child th,
.pokemon-stardust-costs__table tbody tr:last-child td {
  border-bottom: none;
}

.pokemon-stardust-costs__table tbody tr:hover td,
.pokemon-stardust-costs__table tbody tr:hover th {
  background: color-mix(in srgb, var(--color-surface, var(--color-background)) 88%, var(--color-text-primary) 12%);
}

.pokemon-stardust-costs__level {
  display: inline-flex;
  align-items: center;
  min-height: 1.35rem;
  padding: 0.1rem 0.45rem;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: var(--color-text-primary);
  background: color-mix(in srgb, var(--color-border) 55%, transparent);
}

.pokemon-stardust-costs__level[data-level="good"] {
  background: color-mix(in srgb, #5b9bd5 22%, transparent);
}

.pokemon-stardust-costs__level[data-level="great"] {
  background: color-mix(in srgb, #6fbf73 22%, transparent);
}

.pokemon-stardust-costs__level[data-level="ultra"] {
  background: color-mix(in srgb, #c9a227 24%, transparent);
}

.pokemon-stardust-costs__level[data-level="best"] {
  background: color-mix(in srgb, #d27bb8 24%, transparent);
}

.pokemon-stardust-costs__value {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--color-text-primary);
  letter-spacing: -0.01em;
}

.pokemon-stardust-costs__value--high {
  color: color-mix(in srgb, var(--color-text-primary) 82%, #c45c26 18%);
}

.pokemon-detail-presentation__identity > .pokemon-stardust-costs {
  width: max-content;
  max-width: 100%;
  padding: 0;
  justify-self: start;
  align-self: start;
}

.pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__title {
  font-size: 0.68rem;
}

.pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table {
  width: max-content;
  max-width: 100%;
  font-size: 0.74rem;
}

.pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table thead th {
  padding: 0.4rem 0.45rem;
}

.pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table tbody th,
.pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table tbody td {
  padding: 0.4rem 0.45rem;
}

/* lt:dustw1 stardust table intrinsic width beside art */
.pokemon-detail-presentation__identity > .pokemon-stardust-costs {
  width: max-content;
  max-width: 100%;
  justify-self: start;
  align-self: start;
}

.pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table {
  width: max-content;
  max-width: 100%;
}

.pokemon-stardust-costs__table {
  width: max-content;
  max-width: 100%;
}

.pokemon-stardust-costs__table thead th,
.pokemon-stardust-costs__table tbody th,
.pokemon-stardust-costs__table tbody td {
  white-space: nowrap;
}

/* lt:dusthrt1 friendship orange hearts in stardust table */
.pokemon-stardust-costs__level {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 1.35rem;
  padding: 0;
  border-radius: 0;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: var(--color-text-primary);
  background: transparent;
}

.pokemon-stardust-costs__level[data-level="good"],
.pokemon-stardust-costs__level[data-level="great"],
.pokemon-stardust-costs__level[data-level="ultra"],
.pokemon-stardust-costs__level[data-level="best"] {
  background: transparent;
}

.pokemon-stardust-costs__level-name {
  line-height: 1;
}

.pokemon-stardust-costs__hearts {
  display: inline-flex;
  align-items: center;
  gap: 0.12rem;
  flex-shrink: 0;
}

.pokemon-stardust-costs__heart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0.92rem;
  height: 0.92rem;
  border-radius: 50%;
  box-sizing: border-box;
}

.pokemon-stardust-costs__heart--filled {
  color: #fff;
  background: linear-gradient(160deg, #ff9a3c 0%, #ff6a00 55%, #e85a00 100%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #ff6a00 35%, transparent);
}

.pokemon-stardust-costs__heart--empty {
  color: transparent;
  background: color-mix(in srgb, var(--color-border) 70%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-border) 90%, transparent);
}

.pokemon-stardust-costs__heart-icon {
  display: block;
  width: 0.55rem;
  height: 0.55rem;
}

.pokemon-stardust-costs__heart--empty .pokemon-stardust-costs__heart-icon {
  display: none;
}

/* lt:dustmob1 mobile minimal stardust table (desktop unchanged) */
.pokemon-stardust-costs__h-short {
  display: none;
}

@media (max-width: 719.98px) {
  .pokemon-detail-presentation__hero:has(.pokemon-stardust-costs) {
    grid-template-columns: minmax(0, min(52vw, 11.5rem)) minmax(0, 1fr);
    gap: 0.45rem;
    align-items: stretch;
  }

  .pokemon-detail-presentation__identity > .pokemon-stardust-costs {
    width: 100%;
    max-width: 100%;
  }

  .pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__title {
    margin: 0 0 0.35rem;
    font-size: 0.58rem;
    letter-spacing: 0.06em;
  }

  .pokemon-stardust-costs__h-full {
    display: none;
  }

  .pokemon-stardust-costs__h-short {
    display: inline;
  }

  .pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table,
  .pokemon-stardust-costs__table {
    width: 100%;
    max-width: 100%;
    font-size: 0.62rem;
    border-radius: 8px;
  }

  .pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table thead th,
  .pokemon-stardust-costs__table thead th {
    padding: 0.28rem 0.28rem;
    font-size: 0.52rem;
    letter-spacing: 0.03em;
  }

  .pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table tbody th,
  .pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table tbody td,
  .pokemon-stardust-costs__table tbody th,
  .pokemon-stardust-costs__table tbody td {
    padding: 0.26rem 0.28rem;
  }

  .pokemon-stardust-costs__level {
    gap: 0;
  }

  .pokemon-stardust-costs__level-name {
    display: none;
  }

  .pokemon-stardust-costs__hearts {
    gap: 0.06rem;
  }

  .pokemon-stardust-costs__heart--empty {
    display: inline-flex;
  }

  .pokemon-stardust-costs__heart {
    width: 0.7rem;
    height: 0.7rem;
  }

  .pokemon-stardust-costs__heart-icon {
    width: 0.4rem;
    height: 0.4rem;
  }

  .pokemon-stardust-costs__value {
    font-size: 0.62rem;
    font-weight: 650;
  }
}

/* lt:dustht1 stardust panel height = art; Caught/New columns */
.pokemon-detail-presentation__hero:has(.pokemon-stardust-costs) {
  align-items: stretch;
}

.pokemon-detail-presentation__hero:has(.pokemon-stardust-costs) .pokemon-detail-presentation__identity {
  display: flex;
  flex-direction: column;
  align-self: stretch;
  height: auto;
  min-height: 0;
}

.pokemon-detail-presentation__identity > .pokemon-stardust-costs {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  width: max-content;
  max-width: 100%;
  height: 100%;
  min-height: 100%;
}

.pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__title {
  flex: 0 0 auto;
}

.pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table {
  flex: 1 1 auto;
  width: max-content;
  max-width: 100%;
  height: 100%;
  min-height: 0;
}

.pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table tbody tr {
  height: 25%;
}

.pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table tbody th,
.pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table tbody td {
  height: inherit;
}

@media (max-width: 719.98px) {
  .pokemon-detail-presentation__identity > .pokemon-stardust-costs {
    width: 100%;
    max-width: 100%;
  }

  .pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table {
    width: 100%;
  }

  .pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table thead th,
  .pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table tbody th,
  .pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table tbody td {
    padding-block: 0.2rem;
  }
}

/* lt:dustph1 real-phone stardust height = art (Safari-safe) */
.pokemon-detail-presentation__hero:has(.pokemon-stardust-costs) {
  align-items: stretch !important;
}

.pokemon-detail-presentation__hero:has(.pokemon-stardust-costs) .pokemon-detail-presentation__identity {
  display: flex !important;
  flex-direction: column;
  align-self: stretch !important;
  justify-self: stretch;
  height: auto;
  min-height: 0;
}

.pokemon-detail-presentation__identity > .pokemon-stardust-costs {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  align-self: stretch !important;
  width: max-content;
  max-width: 100%;
  height: 100%;
  min-height: var(--pokemon-detail-art-size);
}

.pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__title {
  flex: 0 0 auto;
}

.pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  width: max-content;
  max-width: 100%;
  height: auto;
  min-height: 0;
  border-collapse: separate;
}

.pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table thead {
  display: block;
  flex: 0 0 auto;
}

.pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table tbody {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table thead tr,
.pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table tbody tr {
  display: grid;
  grid-template-columns: minmax(4.2rem, max-content) minmax(3.2rem, max-content) minmax(3.2rem, max-content);
  align-items: center;
  width: 100%;
  height: auto;
}

.pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table tbody tr {
  flex: 1 1 0;
}

.pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table thead th,
.pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table tbody th,
.pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table tbody td {
  display: flex;
  align-items: center;
  height: auto;
  min-height: 0;
}

.pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table thead th:not(:first-child),
.pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table tbody td {
  justify-content: flex-end;
}

@media (max-width: 719.98px) {
  .pokemon-detail-presentation__hero:has(.pokemon-stardust-costs) {
    align-items: stretch !important;
    grid-template-columns: minmax(0, min(52vw, 11.5rem)) minmax(0, 1fr);
  }

  .pokemon-detail-presentation__identity > .pokemon-stardust-costs {
    width: 100%;
    max-width: 100%;
    min-height: min(52vw, 11.5rem);
    height: 100%;
  }

  .pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table {
    width: 100%;
  }

  .pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table thead tr,
  .pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table tbody tr {
    grid-template-columns: minmax(2.4rem, 1fr) minmax(2.6rem, 1fr) minmax(2.6rem, 1fr);
  }
}

/* lt:dustbal1 mobile art wider, table lightly compressed */
@media (max-width: 719.98px) {
  .pokemon-detail-presentation__hero:has(.pokemon-stardust-costs) {
    grid-template-columns: minmax(0, min(52vw, 11.5rem)) minmax(0, 1fr) !important;
    gap: 0.55rem;
    align-items: stretch !important;
  }

  .pokemon-detail-presentation__hero:has(.pokemon-stardust-costs) .pokemon-detail-presentation__art {
    width: 100%;
    max-width: none;
  }

  .pokemon-detail-presentation__identity > .pokemon-stardust-costs {
    width: 100%;
    max-width: 100%;
    min-height: min(52vw, 11.5rem);
  }

  .pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__title {
    margin: 0 0 0.4rem;
    font-size: 0.6rem;
    letter-spacing: 0.05em;
  }

  .pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table,
  .pokemon-stardust-costs__table {
    width: 100%;
    max-width: 100%;
    font-size: 0.68rem;
    border-radius: 8px;
  }

  .pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table thead th,
  .pokemon-stardust-costs__table thead th {
    padding: 0.34rem 0.38rem;
    font-size: 0.56rem;
  }

  .pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table tbody th,
  .pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table tbody td,
  .pokemon-stardust-costs__table tbody th,
  .pokemon-stardust-costs__table tbody td {
    padding: 0.32rem 0.38rem;
  }

  .pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table thead tr,
  .pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table tbody tr {
    grid-template-columns: minmax(2.8rem, 1.05fr) minmax(3rem, 1fr) minmax(3rem, 1fr) !important;
  }

  .pokemon-stardust-costs__heart {
    width: 0.78rem;
    height: 0.78rem;
  }

  .pokemon-stardust-costs__heart-icon {
    width: 0.46rem;
    height: 0.46rem;
  }

  .pokemon-stardust-costs__value {
    font-size: 0.68rem;
    font-weight: 650;
  }
}

/* lt:dustline1 continuous stardust row rules (mobile + flex/grid table) */
.pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table tbody th,
.pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table tbody td {
  border-bottom: none !important;
  box-shadow: none !important;
}

.pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table thead tr {
  border-bottom: 1px solid color-mix(in srgb, var(--color-border) 90%, transparent);
}

.pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table tbody tr {
  border-bottom: 1px solid color-mix(in srgb, var(--color-border) 70%, transparent);
}

.pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table tbody tr:last-child {
  border-bottom: none;
}

.pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table thead th {
  border-bottom: none !important;
}

@media (max-width: 719.98px) {
  .pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table tbody tr {
    border-bottom: 1px solid color-mix(in srgb, var(--color-border) 75%, transparent);
  }

  .pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table tbody th,
  .pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table tbody td {
    border-bottom: none !important;
    align-self: stretch;
  }
}

/* lt:dustempty1 show empty grey heart slots on mobile */
@media (max-width: 719.98px) {
  .pokemon-stardust-costs__heart--empty {
    display: inline-flex !important;
    color: transparent;
    background: color-mix(in srgb, var(--color-border) 70%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-border) 90%, transparent);
  }

  .pokemon-stardust-costs__heart--empty .pokemon-stardust-costs__heart-icon {
    display: none;
  }
}

/* lt:dustdesk2 desktop: full NEW column, table grows to fit 1,000,000 */
@media (min-width: 720px) {
  .pokemon-detail-presentation__identity > .pokemon-stardust-costs {
    width: max-content !important;
    max-width: none !important;
    overflow: visible !important;
  }

  .pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table {
    width: max-content !important;
    min-width: 22rem !important;
    max-width: none !important;
    overflow: visible !important;
  }

  .pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table thead,
  .pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table tbody {
    width: max-content;
    min-width: 22rem;
  }

  .pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table thead tr,
  .pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table tbody tr {
    /* friendship | caught (20,000) | new (1,000,000) */
    grid-template-columns: 8.25rem 5.75rem 7.25rem !important;
    width: 22rem !important;
    min-width: 22rem !important;
    max-width: none !important;
    box-sizing: border-box;
  }

  .pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table thead th,
  .pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table tbody th,
  .pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table tbody td {
    overflow: visible !important;
    min-width: 0;
    padding-inline: 0.5rem !important;
  }

  .pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table thead th:not(:first-child),
  .pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table tbody td {
    justify-content: flex-end;
    text-align: right;
  }

  .pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__value {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
  }

  .pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__value--high {
    min-width: 9ch;
  }
}

/* lt:dusthead1 desktop thead bar fills full table width */
@media (min-width: 720px) {
  .pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table thead {
    display: block;
    width: 100%;
    min-width: 22rem;
    background: color-mix(in srgb, var(--color-surface, var(--color-background)) 70%, var(--color-text-primary) 30%);
  }

  .pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table thead tr {
    width: 100% !important;
    min-width: 22rem !important;
    background: transparent;
  }

  .pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table thead th {
    background: transparent !important;
  }
}

/* lt:dustrad1 rounded top corners on stardust thead */
.pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table {
  overflow: hidden;
  border-radius: 10px;
}

.pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table thead {
  border-radius: 10px 10px 0 0;
  overflow: hidden;
}

.pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table thead tr {
  border-radius: 10px 10px 0 0;
}

.pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table thead th:first-child {
  border-top-left-radius: 10px;
}

.pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table thead th:last-child {
  border-top-right-radius: 10px;
}

@media (min-width: 720px) {
  .pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table {
    overflow: hidden !important;
    border-radius: 10px;
  }

  .pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table thead {
    border-radius: 10px 10px 0 0;
    overflow: hidden;
  }
}

/* lt:dustgap1 mobile 3px right inset for stardust panel */
@media (max-width: 719.98px) {
  .pokemon-detail-presentation__identity > .pokemon-stardust-costs {
    margin-right: 3px;
    max-width: calc(100% - 3px);
  }
}

/* lt:dustfit1 mobile: fit Caught width, narrower table, larger art */
@media (max-width: 719.98px) {
  .pokemon-detail-presentation__hero:has(.pokemon-stardust-costs) {
    grid-template-columns: minmax(0, min(58vw, 13rem)) minmax(0, 1fr) !important;
    gap: 0.45rem;
  }

  .pokemon-detail-presentation__identity > .pokemon-stardust-costs {
    min-height: min(58vw, 13rem);
  }

  .pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table thead tr,
  .pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table tbody tr {
    /* hearts | caught (fit) | new */
    grid-template-columns: max-content max-content max-content !important;
    justify-content: space-between;
    width: 100%;
    column-gap: 0.35rem;
  }

  .pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table thead th:nth-child(2),
  .pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table tbody td:nth-child(2) {
    width: max-content;
    min-width: 0;
    padding-inline: 0.22rem !important;
    justify-content: flex-end;
  }

  .pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table thead th:nth-child(3),
  .pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table tbody td:nth-child(3) {
    width: max-content;
    min-width: 0;
    padding-inline: 0.22rem !important;
    justify-content: flex-end;
  }

  .pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table thead th:first-child,
  .pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table tbody th:first-child {
    padding-inline: 0.22rem !important;
  }

  .pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__value {
    min-width: 0 !important;
  }
}

/* lt:dusthdrclr1 restore dark grey stardust thead bar */
.pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table thead {
  background: color-mix(in srgb, var(--color-surface, var(--color-background)) 70%, var(--color-text-primary) 30%) !important;
}

.pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table thead tr {
  background: color-mix(in srgb, var(--color-surface, var(--color-background)) 70%, var(--color-text-primary) 30%) !important;
}

.pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table thead th {
  background: transparent !important;
  color: var(--color-text-secondary);
}

@media (max-width: 719.98px) {
  .pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table thead,
  .pokemon-detail-presentation__identity > .pokemon-stardust-costs .pokemon-stardust-costs__table thead tr {
    background: color-mix(in srgb, var(--color-surface, var(--color-background)) 70%, var(--color-text-primary) 30%) !important;
  }
}

/* lt:hdrnoright1 no empty right header; back+title same plane; title 18px */
.app-header--no-right:not(.app-header--tabs) .app-header__bar {
  grid-template-columns: auto minmax(0, 1fr);
}

.app-header--no-right .app-header__actions--right,
.app-header__actions--right[hidden] {
  display: none !important;
}

.app-header__bar {
  align-items: center;
}

.app-header__actions--left {
  align-self: center;
}

.app-header__title-area {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-self: center;
  height: auto;
  min-height: var(--touch-target-size);
}

.app-header__title {
  display: flex;
  align-items: center;
  font-size: 18px;
  line-height: 1.2;
}

.app-header__title-text {
  font-size: 18px;
  line-height: 1.2;
}

/* lt:hdrtabfix1 restore Home/Pokédex tab size; scope no-right away from tabs mode */
.app-header--no-right:not(.app-header--tabs) .app-header__bar {
  grid-template-columns: auto minmax(0, 1fr);
}

.app-header--no-right.app-header--tabs .app-header__bar,
.app-header--tabs.app-header--no-right .app-header__bar {
  grid-template-columns: minmax(0, 1fr) !important;
}

.app-header--tabs .app-header__tabs {
  grid-column: 1 / -1;
  width: 100%;
}

.app-header--tabs .app-header__tabs-list {
  width: 100%;
  min-height: var(--tab-height-sm);
  padding: var(--tab-gap-sm);
}

.app-header--tabs .app-header__tab {
  min-height: var(--tab-height-sm);
  height: auto;
  padding-block: 0.45rem;
  padding-inline: var(--space-2);
  font-size: var(--font-size-control-sm, 0.8125rem);
  line-height: 1.2;
}

/* lt:sitefoot1 site-wide legal footer */
.site-footer {
  box-sizing: border-box;
  width: 100%;
  max-width: var(--app-max-width);
  margin: 0 auto;
  padding: var(--space-5) max(var(--page-padding-inline), var(--safe-area-right, 0px))
    calc(var(--space-5) + var(--safe-area-bottom, 0px))
    max(var(--page-padding-inline), var(--safe-area-left, 0px));
  border-top: 1px solid color-mix(in srgb, var(--color-border) 80%, transparent);
  background: color-mix(in srgb, var(--color-surface, var(--color-background)) 92%, var(--color-text-primary) 8%);
  color: var(--color-text-secondary);
  flex-shrink: 0;
}

.site-footer__inner {
  display: grid;
  gap: 0.55rem;
  max-width: 42rem;
}

.site-footer__brand {
  margin: 0;
  color: var(--color-text-primary);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.site-footer__copy {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.35;
}

.site-footer__disclaimer {
  margin: 0;
  font-size: 0.68rem;
  line-height: 1.45;
  color: var(--color-text-secondary);
  opacity: 0.92;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.45rem;
  margin-top: 0.15rem;
}

.site-footer__link {
  color: var(--color-text-primary);
  font-size: 0.72rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.site-footer__link:hover {
  opacity: 0.85;
}

.site-footer__sep {
  color: var(--color-text-secondary);
  font-size: 0.72rem;
  opacity: 0.7;
}

@media (max-width: 719.98px) {
  .site-footer {
    padding-bottom: calc(var(--space-5) + var(--safe-area-bottom, 0px) + 4.5rem);
  }
}

/* lt:sitefootfull1 site footer full-bleed grey bar (no 100vw left-clip) */
.site-footer {
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  padding-inline: 0;
  border-top: 1px solid color-mix(in srgb, var(--color-border) 80%, transparent);
  background: color-mix(in srgb, var(--color-surface, var(--color-background)) 92%, var(--color-text-primary) 8%);
  box-shadow: 0 0 0 100vmax color-mix(in srgb, var(--color-surface, var(--color-background)) 92%, var(--color-text-primary) 8%);
  clip-path: inset(0 -100vmax);
}

.site-footer__inner {
  box-sizing: border-box;
  width: 100%;
  max-width: var(--app-max-width);
  margin-inline: auto;
  padding: var(--space-5) max(var(--page-padding-inline), var(--safe-area-right, 0px))
    calc(var(--space-5) + var(--safe-area-bottom, 0px))
    max(var(--page-padding-inline), var(--safe-area-left, 0px));
}

@media (max-width: 719.98px) {
  .site-footer__inner {
    padding-bottom: calc(var(--space-5) + var(--safe-area-bottom, 0px) + 4.5rem);
  }
}

/* lt:tproseo1 public trainer profile SEO intro */
.trainer-profile-seo {
  box-sizing: border-box;
  width: 100%;
  margin: 0 0 var(--space-3);
  padding: 0;
}

.trainer-profile-seo__title {
  margin: 0 0 0.35rem;
  color: var(--color-text-primary);
  font-size: clamp(1.15rem, 4.6vw, 1.65rem);
  font-weight: 700;
  line-height: 1.2;
}

.trainer-profile-seo__lead {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: var(--font-size-control-sm, 0.8125rem);
  line-height: 1.45;
  max-width: 42rem;
}




/* FAQ help "?" icon removed sitewide — footer already links to FAQ. */
.faq-help-button {
  display: none !important;
}

/* lt:faqpage help button + faq page (unused; kept for safety) */
.faq-help-button {
  display: inline-grid;
  place-items: center;
  box-sizing: border-box;
  width: 2.35rem;
  height: 2.35rem;
  margin: 0;
  margin-inline-start: 0.2rem;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--color-border) 85%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-surface, var(--color-background)) 88%, transparent);
  color: var(--color-text-primary);
  cursor: pointer;
  box-shadow: 0 1px 2px color-mix(in srgb, #000 12%, transparent);
}

.faq-help-button:hover,
.faq-help-button:focus-visible {
  border-color: color-mix(in srgb, var(--color-control-primary) 45%, var(--color-border));
  color: var(--color-control-primary);
  outline: none;
}

.faq-help-button[aria-current='page'],
.faq-help-button[data-selected='true'] {
  border-color: color-mix(in srgb, var(--color-control-primary) 55%, var(--color-border));
  color: var(--color-control-primary);
}

.faq-help-button__glyph {
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1;
  font-family: inherit;
}

.notification-bell-host .faq-help-button,
.mobile-brand-header__actions .faq-help-button {
  flex: 0 0 auto;
}

.mobile-brand-header__actions .faq-help-button {
  width: var(--touch-target-size);
  height: var(--touch-target-size);
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: var(--color-text-secondary);
}

/* Mobile non-home: keep FAQ reachable even when bell/menu host is otherwise hidden */
@media (max-width: 719.98px) {
  .notification-bell-host:not([data-chrome-visible='true']) {
    display: flex;
  }
  .notification-bell-host:not([data-chrome-visible='true']) > :not(.faq-help-button) {
    display: none !important;
  }
}

.faq-page {
  min-width: 0;
}

.seo-landing--faq-page {
  border-top: 0;
  background:
    radial-gradient(120% 80% at 0% 0%, color-mix(in srgb, var(--color-control-primary) 14%, transparent), transparent 55%),
    radial-gradient(90% 70% at 100% 20%, color-mix(in srgb, #1f9d8a 10%, transparent), transparent 52%),
    var(--color-background, transparent);
}

.seo-landing--faq-page .seo-landing__inner {
  padding: 16px 12px 8px;
}

.faq-page__answer {
  margin: 0;
  padding: 0 1rem 0.9rem;
  color: var(--color-text-secondary);
  font-size: 0.88rem;
}

.faq-page__answer p {
  margin: 0;
}

.faq-page__answer a {
  color: var(--color-control-primary);
  font-weight: 650;
}

/* Crawler SEO shells outside #app — do NOT broaden to all .visually-hidden (breaks page titles). */
#seo-landing.visually-hidden,
#tools-seo-body.visually-hidden,
#faq-seo-body.visually-hidden,
#trainers-seo-body.visually-hidden,
.seo-landing--home-slim.visually-hidden,
.seo-landing--tools.visually-hidden,
.seo-landing--faq-page.visually-hidden,
.seo-landing--trainers.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* lt:homehero3 premium home hero + guide */
:root {
  --color-background: #F7F8FA;
  --color-surface: #ffffff;
  --color-text-primary: #172033;
  --color-text-secondary: #737985;
  --color-border: #E1E4E8;
  --color-control-primary: #0875D1;
  --color-control-primary-hover: #0662b3;
  --color-control-primary-active: #055398;
  --color-control-focus: rgba(8, 117, 209, 0.35);
  --color-control-selected: rgba(8, 117, 209, 0.14);
  --color-control-tertiary-hover: rgba(8, 117, 209, 0.1);
  --color-control-tertiary-active: rgba(8, 117, 209, 0.18);
  --app-max-width: 960px;
  --color-brand-accent: #FFC928;
}

.home-seo-intro {
  box-sizing: border-box;
  width: 100%;
  max-width: var(--app-max-width);
  margin-inline: auto;
  padding-block: 10px 6px;
  padding-inline: 12px;
  display: grid;
  gap: 8px;
  min-width: 0;
  flex-shrink: 0;
}

.home-seo-intro[hidden] {
  display: none !important;
}

.home-seo-intro__title {
  margin: 0;
  max-width: 760px;
  color: #172033;
  font-size: 27px;
  font-weight: 750;
  line-height: 1.15;
  letter-spacing: -0.025em;
  overflow-wrap: break-word;
  word-break: normal;
  white-space: normal;
}

.home-seo-intro__lead {
  margin: 0;
  max-width: 760px;
  color: #737985;
  font-size: 15px;
  line-height: 1.45;
  overflow-wrap: break-word;
}

.app-shell__viewport > .home-seo-intro {
  position: relative;
  z-index: var(--z-index-content);
}

@media (min-width: 720px) {
  .home-seo-intro {
    padding-block: 14px 8px;
    padding-inline: 16px;
  }

  .home-seo-intro__title {
    font-size: 34px;
  }
}

.app-header__tabs-list {
  border-color: var(--color-border);
  border-radius: 12px;
  background: #eef0f3;
}

.app-header__tab--active {
  border-color: color-mix(in srgb, var(--color-control-primary) 28%, var(--color-border));
  background: var(--color-surface);
  color: var(--color-control-primary);
  box-shadow: 0 1px 2px rgb(23 32 51 / 8%);
  font-weight: 700;
}

.home-feed {
  gap: var(--space-2);
  padding-block: var(--space-2) var(--space-5);
}

.home-feed__search .search-bar__control {
  min-height: 40px;
  border-radius: 12px;
  border-color: var(--color-border);
  background: var(--color-surface);
  box-shadow: 0 1px 2px rgb(23 32 51 / 4%);
}

.home-feed__search .search-bar__input {
  font-size: 14px;
}

.home-feed__filter,
.home-feed__refresh {
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
  box-shadow: 0 1px 2px rgb(23 32 51 / 4%);
}

.home-feed__toolbar .home-feed__filter[data-active='true'],
.home-feed__toolbar .home-feed__filter[aria-pressed='true'] {
  border-color: var(--color-control-primary);
  color: var(--color-control-primary);
  background: color-mix(in srgb, var(--color-control-primary) 10%, var(--color-surface));
}

.trade-card {
  gap: 8px;
  padding: 8px 0;
}

.home-seo-guide {
  display: grid;
  gap: 14px;
  margin-block-start: var(--space-5);
  padding: 16px 12px 8px;
  border-top: 1px solid var(--color-border);
  min-width: 0;
}

.home-seo-guide__title {
  margin: 0;
  color: #172033;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.home-seo-guide__lead,
.home-seo-guide__text {
  margin: 0;
  max-width: 650px;
  color: #737985;
  font-size: 14px;
  line-height: 1.5;
}

.home-seo-guide__block {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.home-seo-guide__subtitle {
  margin: 0;
  color: #172033;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.3;
}

.home-seo-guide__text a {
  color: var(--color-control-primary);
  text-decoration: none;
  font-weight: 600;
}

.home-seo-guide__text a:hover {
  text-decoration: underline;
}

@media (min-width: 720px) {
  .home-seo-guide {
    padding-inline: 4px;
    gap: 16px;
  }

  .home-seo-guide__title {
    font-size: 22px;
  }
}

/* Match homepage .home-seo-intro title/lead on Post a Trade List */
.create-trade__title.create-trade__title--page {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
  border: 0;
  max-width: 760px;
  color: #172033;
  font-size: 27px;
  font-weight: 750;
  line-height: 1.15;
  letter-spacing: -0.025em;
  overflow-wrap: break-word;
  word-break: normal;
}

.create-trade__intro {
  display: grid;
  gap: 8px;
  margin: 0 0 var(--space-2);
  min-width: 0;
  max-width: 760px;
}

.create-trade__intro-lead,
.create-trade__intro-limit {
  margin: 0;
  max-width: 760px;
  color: #737985;
  font-size: 15px;
  line-height: 1.45;
  overflow-wrap: break-word;
  opacity: 1;
}

.create-trade__intro-link {
  color: var(--color-link, #2f6fed);
  text-decoration: none;
}

.create-trade__intro-link:hover,
.create-trade__intro-link:focus-visible {
  text-decoration: underline;
}

@media (min-width: 720px) {
  .create-trade__title.create-trade__title--page {
    font-size: 34px;
  }
}

@media (max-width: 420px) {
  .create-trade__intro {
    gap: 6px;
    margin-bottom: var(--space-2);
  }
}



/* generator-layout-20261120 */

.tools-seo--compact {
  gap: 4px;
  margin-block-end: var(--space-1);
}

.tools-page--generator {
  gap: var(--space-1);
  padding-block-start: var(--space-3);
}

.tools-page--generator > .tools-seo--compact + .tools-page__tool-host {
  margin-block-start: 0;
}

.tools-page--generator .create-trade__intro[hidden] {
  display: none !important;
  margin: 0 !important;
}

.tools-page--generator .create-trade__summary-scroll {
  padding-block-start: var(--space-2);
}

.tools-seo__steps--cards {
  list-style: decimal;
  padding-inline-start: 1.15rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2);
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
  line-height: 1.35;
}

.tools-seo__steps--cards > li {
  margin: 0;
  padding: var(--space-2);
  border: var(--control-border-width) solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  min-width: 0;
}

.tools-seo__how {
  gap: var(--space-2);
  max-width: none;
  padding-block: var(--space-2) var(--space-1);
}

.tools-generator-seo-static {
  gap: var(--space-2);
}

.tools-generator-seo-static ol {
  list-style: decimal;
  padding-inline-start: 1.15rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2);
  margin: 0;
}

.tools-generator-seo-static ol > li {
  margin: 0;
  padding: var(--space-2);
  border: var(--control-border-width) solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
  line-height: 1.35;
}

@media (min-width: 720px) {
  .tools-seo__steps--cards,
  .tools-generator-seo-static ol {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding-inline-start: 0;
    list-style: none;
    counter-reset: how-step;
  }

  .tools-seo__steps--cards > li,
  .tools-generator-seo-static ol > li {
    counter-increment: how-step;
    padding-top: var(--space-2);
  }

  .tools-seo__steps--cards > li::before,
  .tools-generator-seo-static ol > li::before {
    content: counter(how-step) ".";
    display: block;
    margin-bottom: 4px;
    color: var(--color-text-primary, var(--color-text));
    font-weight: 700;
    font-size: 0.75rem;
  }
}

/* generator-action-captions-20261120 */

.create-trade__actions--captions {
  align-items: start;
}

.create-trade__action-cell {
  display: grid;
  gap: 4px;
  min-width: 0;
  align-content: start;
}

.create-trade__action-caption {
  margin: 0;
  color: var(--color-text-muted, var(--color-text-secondary));
  font-size: 0.75rem;
  line-height: 1.3;
  min-height: 1.3em;
}

@media (max-width: 520px) {
  .create-trade__actions--captions {
    grid-template-columns: 1fr;
  }
}

/* lt:seolinkshide1 crawler links stay in HTML; hide from SPA chrome (fixes top-link CLS) */
.home-seo-static__links {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* lt:cls-shell1 — SEO lives inside #app shell on first paint; keep one viewport stack */
body:has(> #app > [data-app-shell]) {
  margin: 0;
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
}

body:has(> #app > [data-app-shell]) > #app {
  min-height: 0;
  height: 100%;
}

/* lt:cls-tradeimg1 — trade-card header + sprite decode boxes (desktop CLS ~0.196) */
.trade-card__flight-icon {
  flex: 0 0 auto;
  width: 50px;
  max-width: 50px;
  height: var(--trade-card-flight-height, 28px);
  aspect-ratio: 2 / 1;
  object-fit: contain;
}

.trade-card__trainer-line .premium-mark__image {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  object-fit: contain;
}

.pokemon-item__background,
.pokemon-item__image {
  inset: 0;
  box-sizing: border-box;
}

.pokemon-item__badge-icon {
  aspect-ratio: 1;
}

/* lt:cls-desnava1 — desktop: reserve top nav track while [hidden] so unhide does not shrink viewport */
@media (min-width: 720px) {
  .app-shell:has(> [data-app-shell-navigation]) {
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  .app-shell > [data-app-shell-navigation] {
    grid-row: 1;
    box-sizing: border-box;
    min-height: calc(var(--bottom-navigation-bar-height, 54px) + var(--safe-area-top, 0px));
    padding-top: var(--safe-area-top, 0px);
    background: var(--color-surface, #fff);
  }

  .app-shell > [data-app-shell-navigation][hidden] {
    display: block !important;
    visibility: hidden;
    pointer-events: none;
    overflow: hidden;
    border: 0;
  }

  .app-shell > [data-app-shell-header] {
    grid-row: 2;
  }

  .app-shell > .app-shell__viewport {
    grid-row: 3;
  }
}

/* lt:cls-seobm1 — desktop CLS ~0.196: status collapse + matches mount + seo-guide fold peek */
.home-feed__status {
  min-height: 1.2em;
  line-height: 1.2;
}

.home-feed__status:empty {
  visibility: hidden;
  display: block !important;
}

.home-feed__best-matches {
  min-height: calc(1.35em + 0.5rem);
}

.home-feed__best-matches:empty,
.home-feed__best-matches:has(> [hidden]) {
  display: block !important;
  visibility: hidden;
  pointer-events: none;
  overflow: hidden;
}

@media (min-width: 720px) {
  .home-feed__initial {
    min-height: calc((var(--skeleton-card-height, 140px) * 4) + (var(--space-2, 8px) * 3));
  }
}

/* lt:pokedex-hub-adopt */
#pokedex-hub-seo-body.home-seo-guide,
.pokedex-page > #pokedex-hub-seo-body,
[data-app-shell-content] > #pokedex-hub-seo-body {
  position: static !important;
  inset: auto !important;
  z-index: auto !important;
  flex-shrink: 0;
  margin-block-start: var(--space-5);
  border-top: 1px solid var(--color-border);
  background: transparent;
}
#pokedex-hub-seo-body[hidden] {
  display: none !important;
}

/* lt:pokedex-hub-adopt-v2 */
#pokedex-hub-seo-body {
  position: static !important;
  inset: auto !important;
  z-index: auto !important;
  width: 100%;
  max-width: none;
  flex-shrink: 0;
}
#pokedex-hub-seo-body[hidden],
#pokedex-hub-seo-body.visually-hidden {
  display: none !important;
  position: static !important;
  width: auto !important;
  height: auto !important;
  clip: auto !important;
}
.app-shell__viewport > #pokedex-hub-seo-body {
  margin-block-start: var(--space-5);
  border-top: 1px solid var(--color-border);
  background: transparent;
}

/* lt:pokedex-hub-under-intro (superseded) */
.app-shell__viewport > #pokedex-hub-seo-body {
  position: static !important;
  box-sizing: border-box;
  width: 100%;
  max-width: var(--app-max-width);
  margin: 0 auto;
  padding: 0 max(var(--page-padding-inline), var(--safe-area-left)) var(--space-3);
  border-top: 0;
  background: transparent;
}
.app-shell__viewport > #pokedex-hub-seo-body .seo-landing__inner {
  max-width: none;
  padding: 16px 12px 8px;
}

/* lt:pokedex-hub-footer-band */
.app-shell__viewport > #pokedex-hub-seo-body {
  position: static !important;
  inset: auto !important;
  z-index: auto !important;
  box-sizing: border-box;
  width: 100%;
  max-width: var(--app-max-width);
  margin: var(--space-5) auto 0;
  padding: var(--space-4) max(var(--page-padding-inline), var(--safe-area-left)) var(--space-3);
  border-top: 1px solid var(--color-border);
  background: transparent;
}

/* generator-summary-scroll-20261124
   Summary used height:100% + overflow:hidden + an unconstrained
   .create-trade__summary-scroll { overflow-y:auto; overscroll-behavior:contain }.
   With SEO chrome above, that inner box never becomes a real scrollport and
   contain blocks scroll chaining to .app-shell__viewport — lists feel frozen
   on mobile and desktop. Use document (viewport) scroll for summary instead. */
.tools-page--generator .create-trade[data-active-view='summary'] {
  height: auto;
  min-height: 0;
}

/* Must not override .create-trade__view[hidden] { display:none } — higher
   specificity without :not([hidden]) kept the Wanted/For Trade summary
   visible under the Pokémon picker. */
.tools-page--generator .create-trade__view--summary:not([hidden]) {
  display: flex;
  flex-direction: column;
  height: auto;
  min-height: 0;
  overflow: visible;
  grid-template-rows: none;
}

.tools-page--generator .create-trade__view--summary[hidden] {
  display: none !important;
}

.tools-page--generator .create-trade__summary-scroll {
  flex: 0 0 auto;
  min-height: 0;
  overflow: visible;
  overscroll-behavior-y: auto;
}

.tools-page--generator .create-trade__actions {
  position: sticky;
  bottom: 0;
  z-index: var(--z-index-content);
  flex: 0 0 auto;
  padding-block-end: max(var(--bottom-action-space), var(--safe-area-bottom));
}

/* Selection fills the generator host and paints over page chrome. */
.tools-page--generator .create-trade__view--selection:not([hidden]) {
  background: var(--color-background);
  position: relative;
  z-index: calc(var(--z-index-content) + 2);
}

/* lt:feed-card-sep1-detail */
.pokemon-detail-trades__list,
.profile-my-trades__list,
.profile-trades__list {
  display: grid;
  gap: 16px;
}

.pokemon-detail-trades__list > .trade-card,
.profile-my-trades__list > .trade-card,
.profile-trades__list > .trade-card,
.pokemon-detail-trades__item > .trade-card,
.profile-my-trades__item > .trade-card {
  box-sizing: border-box;
  padding: 12px;
  border: 1px solid #E5E7EB;
  border-block-start: 1px solid #E5E7EB;
  border-radius: 14px;
  background: var(--color-surface, #fff);
  --trade-card-panel-radius: 10px;
  --trade-card-wanted-background: color-mix(in srgb, var(--trade-card-wanted-color) 6%, var(--color-surface));
  --trade-card-offered-background: color-mix(in srgb, var(--trade-card-offered-color) 6%, var(--color-surface));
  --trade-card-wanted-border: color-mix(in srgb, var(--trade-card-wanted-color) 22%, #E5E7EB);
  --trade-card-offered-border: color-mix(in srgb, var(--trade-card-offered-color) 22%, #E5E7EB);
  --trade-card-header-inline-inset: 0;
}
/* /lt:feed-card-sep1-detail */

.pokemon-detail-page__form-index {
  margin: 0;
  width: 100%;
  max-width: 960px;
  color: var(--color-text-muted, #5c6570);
  font-size: var(--font-size-body-sm, 0.875rem);
  line-height: 1.5;
}

.pokemon-detail-page__form-heading {
  margin: 0;
  font-size: var(--font-size-body-sm, 0.875rem);
  font-weight: var(--font-weight-control, 600);
  line-height: 1.3;
}

.pokemon-detail-page__form-table {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.35rem 0.75rem;
  margin-top: var(--space-2);
}

.pokemon-detail-page__form-table span {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 10px;
  line-height: 1.35;
}

@media (max-width: 800px) {
  .pokemon-detail-page__form-table {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
