/* Trading Post - kid-friendly bazaar UI */

.tp-root {
  position: fixed;
  inset: 0;
  z-index: 12100;
}

.tp-overlay-inner {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
}

.tp-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 50% 20%, rgba(245, 158, 11, 0.18), transparent 55%),
    rgba(15, 23, 42, 0.62);
}

.tp-panel {
  position: relative;
  z-index: 1;
  width: min(1100px, 100%);
  max-height: min(92vh, 920px);
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  overflow: hidden;
  /* Own light palette - ignore dark/seasonal page tokens (cream panel + light text = unreadable) */
  --color-text: #0f172a;
  --color-text-secondary: #475569;
  --color-text-light: #64748b;
  --color-input-bg: #ffffff;
  --color-input-text: #0f172a;
  color: #0f172a;
  background:
    linear-gradient(165deg, #fff8eb 0%, #fff 38%, #f0f9ff 100%);
  border: 2px solid rgba(245, 158, 11, 0.35);
  box-shadow:
    0 28px 70px rgba(15, 23, 42, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.tp-panel--wide {
  width: min(1180px, 100%);
}

.tp-atmosphere {
  pointer-events: none;
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}

.tp-spark {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.55);
  animation: tp-float 6s ease-in-out infinite;
}

.tp-spark--1 { top: 18%; left: 12%; animation-delay: 0s; }
.tp-spark--2 { top: 28%; right: 16%; width: 7px; height: 7px; background: rgba(14, 165, 233, 0.45); animation-delay: 1.2s; }
.tp-spark--3 { bottom: 22%; left: 40%; width: 8px; height: 8px; background: rgba(16, 185, 129, 0.4); animation-delay: 2.4s; }

@keyframes tp-float {
  0%, 100% { transform: translateY(0) scale(1); opacity: 0.55; }
  50% { transform: translateY(-14px) scale(1.25); opacity: 1; }
}

.tp-header,
.tp-body,
.tp-footer {
  position: relative;
  z-index: 1;
}

.tp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid rgba(245, 158, 11, 0.22);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.85), rgba(255, 248, 235, 0.65));
}

.tp-header-main {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.tp-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}

.tp-brand-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #92400e;
  background: linear-gradient(145deg, #fde68a, #f59e0b);
  box-shadow: 0 8px 18px rgba(245, 158, 11, 0.35);
  font-size: 1.2rem;
  flex-shrink: 0;
}

.tp-title {
  margin: 0;
  font-family: Cinzel, Georgia, serif;
  font-size: 1.3rem;
  color: #92400e;
  line-height: 1.15;
}

.tp-subtitle {
  margin: 0.15rem 0 0;
  font-size: 0.85rem;
  color: #475569;
}

.tp-header-side {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.tp-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.75rem;
}

.tp-badge--open {
  background: rgba(16, 185, 129, 0.16);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.tp-badge--closed {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
  border: 1px solid rgba(239, 68, 68, 0.28);
}

.tp-badge--blocked {
  background: rgba(245, 158, 11, 0.18);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.tp-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(255, 255, 255, 0.8);
  color: inherit;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.tp-icon-btn:hover {
  background: #fff;
  border-color: rgba(245, 158, 11, 0.45);
}

.tp-body {
  padding: 1rem 1.1rem 0.5rem;
  overflow: auto;
  flex: 1;
}

.tp-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: flex-end;
  padding: 0.85rem 1.1rem 1.1rem;
  border-top: 1px solid rgba(245, 158, 11, 0.18);
  background: rgba(255, 255, 255, 0.55);
}

.tp-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: none;
  border-radius: 999px;
  padding: 0.7rem 1.25rem;
  font-weight: 800;
  font-size: 0.95rem;
  color: #422006;
  cursor: pointer;
  background: linear-gradient(145deg, #fde68a, #f59e0b 55%, #ea580c);
  box-shadow: 0 10px 22px rgba(234, 88, 12, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tp-cta:hover:not(:disabled) {
  transform: translateY(-1px) scale(1.02);
}

.tp-cta:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Hub tabs + deal cards */
.tp-hub-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tp-hub-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 2px solid transparent;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  font-weight: 700;
  cursor: pointer;
  color: #1e293b;
}

.tp-hub-tab.is-active {
  background: #0ea5e9;
  color: #fff;
  box-shadow: 0 8px 18px rgba(14, 165, 233, 0.3);
}

.tp-hub-count {
  min-width: 1.25rem;
  height: 1.25rem;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: #ef4444;
  color: #fff;
  font-size: 0.7rem;
}

.tp-deal-grid {
  display: grid;
  gap: 0.75rem;
}

.tp-deal-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.85rem;
  align-items: center;
  text-align: left;
  width: 100%;
  border: 2px solid rgba(148, 163, 184, 0.25);
  border-radius: 18px;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.82);
  cursor: pointer;
  color: inherit;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.tp-deal-card:hover {
  transform: translateY(-2px);
  border-color: rgba(245, 158, 11, 0.55);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.tp-deal-card.is-action {
  border-color: rgba(239, 68, 68, 0.45);
  background: linear-gradient(135deg, rgba(254, 226, 226, 0.65), rgba(255, 255, 255, 0.9));
}

.tp-deal-card.is-waiting {
  border-color: rgba(14, 165, 233, 0.35);
}

.tp-deal-top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.75rem;
  align-items: center;
  margin-bottom: 0.45rem;
}

.tp-deal-status {
  font-weight: 800;
  font-size: 0.8rem;
  color: #0369a1;
}

.tp-deal-card.is-action .tp-deal-status { color: #b91c1c; }
.tp-deal-date {
  font-size: 0.75rem;
  color: #475569;
}

.tp-deal-loot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.tp-swap-arrow,
.tp-browse-vs,
.tp-tray-swap,
.tp-round-swap {
  color: #d97706;
  font-size: 1rem;
}

.tp-deal-chevron {
  color: #94a3b8;
}

/* Avatars */
.tp-avatar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.tp-avatar-frame {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(145deg, #e2e8f0, #f8fafc);
  border: 2px solid rgba(245, 158, 11, 0.4);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.12);
}

.tp-avatar--compact .tp-avatar-frame {
  width: 48px;
  height: 48px;
  border-radius: 14px;
}

.tp-avatar-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.tp-avatar-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--color-text-secondary);
  font-size: 1.2rem;
}

.tp-avatar-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.tp-avatar-meta strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #0f172a;
}

.tp-class-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  width: fit-content;
  max-width: 100%;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(14, 165, 233, 0.12);
  color: #0369a1;
  border: 1px solid rgba(14, 165, 233, 0.25);
}

/* Class colors may be pastel (for dark UI); darken for cream panel contrast */
.tp-class-chip[style*="--class-color"] {
  color: color-mix(in srgb, var(--class-color) 72%, #000) !important;
  background: color-mix(in srgb, var(--class-color) 14%, #fff) !important;
  border-color: color-mix(in srgb, var(--class-color) 35%, transparent) !important;
}

.tp-class-chip--muted {
  background: rgba(148, 163, 184, 0.15);
  color: #475569;
  border-color: rgba(148, 163, 184, 0.3);
}

.tp-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tp-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  font-size: 0.75rem;
  font-weight: 700;
}

.tp-chip img {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  object-fit: cover;
}

.tp-chip--offer { background: rgba(16, 185, 129, 0.14); color: #047857; }
.tp-chip--ask { background: rgba(14, 165, 233, 0.14); color: #0369a1; }
.tp-chip--empty { opacity: 0.7; font-weight: 600; }

.tp-empty-stage {
  text-align: center;
  padding: 2.5rem 1rem;
}

.tp-empty-orb {
  width: 84px;
  height: 84px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 2rem;
  color: #92400e;
  background: linear-gradient(145deg, #fde68a, #fbbf24);
  box-shadow: 0 12px 28px rgba(245, 158, 11, 0.35);
  animation: tp-float 4s ease-in-out infinite;
}

.tp-empty-stage h3 {
  margin: 0 0 0.35rem;
  font-family: Cinzel, Georgia, serif;
  color: #92400e;
}

.tp-empty-stage p,
.tp-stage-hint,
.tp-empty-inline,
.tp-inv-empty {
  color: #475569;
}

/* Partner picker */
.tp-partner-stage {
  padding-bottom: 0.5rem;
}

.tp-stage-hint {
  margin: 0 0 0.85rem;
  text-align: center;
  font-weight: 600;
}

.tp-partner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}

.tp-partner-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  text-align: center;
  border: 2px solid rgba(148, 163, 184, 0.28);
  border-radius: 18px;
  padding: 0.85rem 0.65rem;
  background: rgba(255, 255, 255, 0.88);
  cursor: pointer;
  color: inherit;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.tp-partner-card:hover {
  transform: translateY(-3px) scale(1.02);
  border-color: rgba(245, 158, 11, 0.55);
  box-shadow: 0 14px 26px rgba(15, 23, 42, 0.1);
}

.tp-partner-card.is-selected {
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25);
}

.tp-partner-portrait {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  overflow: hidden;
  border: 2px solid rgba(245, 158, 11, 0.4);
  background: #e2e8f0;
}

.tp-partner-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.tp-partner-level {
  font-size: 0.75rem;
  font-weight: 700;
  color: #b45309;
}

/* Browse board */
.tp-browse {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.tp-browse-heads {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.75rem;
  align-items: center;
}

.tp-browse-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.tp-browse-head--you { border-color: rgba(16, 185, 129, 0.35); }
.tp-browse-head--them { border-color: rgba(14, 165, 233, 0.35); }

.tp-side-tag {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #475569;
}

.tp-change-partner {
  margin-left: auto;
  border: none;
  background: transparent;
  color: #0284c7;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.8rem;
}

.tp-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tp-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 2px solid rgba(100, 116, 139, 0.45);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  color: #1e293b;
}

.tp-filter-chip.is-active {
  background: #0f172a;
  border-color: #0f172a;
  color: #fff;
}

.tp-browse-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  min-height: 220px;
}

.tp-inv-col {
  border-radius: 18px;
  padding: 0.65rem;
  background: rgba(255, 255, 255, 0.7);
  border: 2px dashed rgba(148, 163, 184, 0.35);
  max-height: 340px;
  overflow: auto;
}

.tp-inv-col--offer { border-color: rgba(16, 185, 129, 0.4); background: rgba(236, 253, 245, 0.45); }
.tp-inv-col--ask { border-color: rgba(14, 165, 233, 0.4); background: rgba(240, 249, 255, 0.55); }

.tp-loot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 0.55rem;
}

.tp-loot-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  border: 2px solid transparent;
  border-radius: 14px;
  padding: 0.45rem;
  background: #fff;
  cursor: pointer;
  color: inherit;
  text-align: left;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.tp-loot-card:hover {
  transform: translateY(-2px);
}

.tp-loot-card.is-selected {
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.22);
}

.tp-loot-card.is-locked {
  opacity: 0.42;
  cursor: not-allowed;
  filter: grayscale(0.35);
  pointer-events: none;
}

.tp-loot-card.is-locked:hover {
  transform: none;
}

.tp-lane-hint {
  margin: 0 0 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.4;
  color: #9a3412;
  background: rgba(251, 146, 60, 0.16);
  border: 1px solid rgba(249, 115, 22, 0.35);
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
}

.tp-lane-hint--idle {
  color: #4c1d95;
  background: rgba(124, 115, 255, 0.14);
  border-color: rgba(124, 115, 255, 0.35);
}

.tp-lane-hint i {
  margin-top: 0.15rem;
  flex-shrink: 0;
}

html[data-theme="dark"] .tp-lane-hint {
  color: #ffedd5;
  background: rgba(154, 52, 18, 0.55);
  border-color: rgba(251, 146, 60, 0.55);
}

html[data-theme="dark"] .tp-lane-hint--idle {
  color: #ede9fe;
  background: rgba(91, 33, 182, 0.55);
  border-color: rgba(167, 139, 250, 0.55);
}

.tp-loot-media {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(145deg, #f1f5f9, #e2e8f0);
  display: grid;
  place-items: center;
  color: #94a3b8;
  font-size: 1.4rem;
}

.tp-loot-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.tp-loot-card--gold .tp-loot-media {
  background: linear-gradient(145deg, #fef3c7, #fbbf24);
  color: #92400e;
}

.tp-loot-check {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #10b981;
  color: #fff;
  font-size: 0.7rem;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.4);
}

.tp-loot-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  font-size: 0.78rem;
  color: #0f172a;
}

.tp-loot-info strong {
  line-height: 1.2;
  color: #0f172a;
}

.tp-loot-info span {
  color: #475569;
}

.tp-equipped {
  color: #b45309 !important;
  font-weight: 700;
}

.tp-gold-stepper {
  display: grid;
  grid-template-columns: 28px 1fr 28px;
  gap: 0.25rem;
  align-items: center;
}

.tp-gold-stepper button {
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(100, 116, 139, 0.5);
  background: #fff;
  color: #0f172a;
  cursor: pointer;
  font-weight: 800;
}

.tp-gold-stepper input {
  width: 100%;
  text-align: center;
  border-radius: 8px;
  border: 1px solid rgba(100, 116, 139, 0.5);
  padding: 0.2rem;
  font-weight: 700;
  background: #fff;
  color: #0f172a;
}

.tp-inv-empty {
  display: grid;
  place-items: center;
  gap: 0.35rem;
  min-height: 160px;
  text-align: center;
  font-size: 0.9rem;
}

.tp-trade-tray {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.65rem;
  align-items: start;
  padding: 0.75rem;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(254, 243, 199, 0.7), rgba(224, 242, 254, 0.7));
  border: 2px solid rgba(245, 158, 11, 0.3);
}

.tp-tray-side h4 {
  margin: 0 0 0.4rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #92400e;
}

.tp-tray-empty {
  font-size: 0.85rem;
  color: #64748b;
  font-style: italic;
}

.tp-tray-swap {
  align-self: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.1);
  animation: tp-spin-soft 8s linear infinite;
}

@keyframes tp-spin-soft {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Detail */
.tp-detail-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.tp-detail-status {
  font-weight: 800;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.12);
  color: #0369a1;
}

.tp-rounds-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tp-round-card {
  border-radius: 18px;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.82);
  border: 2px solid rgba(148, 163, 184, 0.25);
}

.tp-round-card--pending {
  border-color: rgba(14, 165, 233, 0.45);
  box-shadow: 0 10px 24px rgba(14, 165, 233, 0.1);
}

.tp-round-card--superseded {
  opacity: 0.7;
}

.tp-round-card-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.75rem;
  align-items: center;
  margin-bottom: 0.55rem;
  font-size: 0.85rem;
}

.tp-round-pill {
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: #0f172a;
  color: #fff;
  font-weight: 800;
  font-size: 0.72rem;
}

.tp-round-note {
  margin: 0 0 0.65rem;
  font-style: italic;
  color: #475569;
}

.tp-round-board {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.75rem;
  align-items: start;
}

.tp-round-board h4 {
  margin: 0 0 0.4rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #475569;
}

.tp-item-cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.tp-item-card {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.55rem;
  border-radius: 12px;
  background: rgba(241, 245, 249, 0.9);
  font-size: 0.88rem;
  font-weight: 650;
  color: #0f172a;
}

.tp-item-card img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 10px;
}

@media (max-width: 820px) {
  .tp-browse-columns,
  .tp-browse-heads,
  .tp-trade-tray,
  .tp-round-board {
    grid-template-columns: 1fr;
  }

  .tp-browse-vs,
  .tp-tray-swap,
  .tp-round-swap {
    justify-self: center;
  }

  .tp-inv-col {
    max-height: 260px;
  }

  .tp-deal-card {
    grid-template-columns: auto 1fr;
  }

  .tp-deal-chevron {
    display: none;
  }
}

/* Dark mode - ThemeManager sets html[data-theme="dark"] (incl. seasonal) */
html[data-theme="dark"] .tp-panel {
  --color-text: #e2e8f0;
  --color-text-secondary: #94a3b8;
  --color-text-light: #cbd5e1;
  --color-input-bg: #1e293b;
  --color-input-text: #e2e8f0;
  background: linear-gradient(165deg, #1e293b 0%, #0f172a 55%, #172554 100%);
  border-color: rgba(245, 158, 11, 0.35);
  color: #e2e8f0;
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .tp-header {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.75));
  border-bottom-color: rgba(245, 158, 11, 0.28);
}

html[data-theme="dark"] .tp-footer {
  background: rgba(15, 23, 42, 0.72);
  border-top-color: rgba(245, 158, 11, 0.25);
}

html[data-theme="dark"] .tp-title,
html[data-theme="dark"] .tp-empty-stage h3,
html[data-theme="dark"] .tp-tray-side h4 {
  color: #fde68a;
}

html[data-theme="dark"] .tp-subtitle,
html[data-theme="dark"] .tp-side-tag,
html[data-theme="dark"] .tp-deal-date,
html[data-theme="dark"] .tp-empty-stage p,
html[data-theme="dark"] .tp-stage-hint,
html[data-theme="dark"] .tp-empty-inline,
html[data-theme="dark"] .tp-inv-empty,
html[data-theme="dark"] .tp-loot-info span,
html[data-theme="dark"] .tp-tray-empty,
html[data-theme="dark"] .tp-round-note,
html[data-theme="dark"] .tp-round-board h4,
html[data-theme="dark"] .tp-class-chip--muted,
html[data-theme="dark"] .tp-partner-level,
html[data-theme="dark"] .tp-deal-chevron {
  color: #94a3b8;
}

html[data-theme="dark"] .tp-avatar-meta strong,
html[data-theme="dark"] .tp-loot-info,
html[data-theme="dark"] .tp-loot-info strong,
html[data-theme="dark"] .tp-hub-tab,
html[data-theme="dark"] .tp-filter-chip,
html[data-theme="dark"] .tp-item-card,
html[data-theme="dark"] .tp-partner-card,
html[data-theme="dark"] .tp-deal-card,
html[data-theme="dark"] .tp-icon-btn {
  color: #e2e8f0;
}

html[data-theme="dark"] .tp-icon-btn {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(148, 163, 184, 0.35);
}

html[data-theme="dark"] .tp-icon-btn:hover {
  background: #334155;
  border-color: rgba(245, 158, 11, 0.45);
}

html[data-theme="dark"] .tp-hub-tab,
html[data-theme="dark"] .tp-filter-chip {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(148, 163, 184, 0.35);
}

html[data-theme="dark"] .tp-hub-tab.is-active {
  background: #0ea5e9;
  color: #fff;
  border-color: transparent;
}

html[data-theme="dark"] .tp-filter-chip.is-active {
  background: #f59e0b;
  border-color: #f59e0b;
  color: #422006;
}

html[data-theme="dark"] .tp-browse-head,
html[data-theme="dark"] .tp-detail-hero {
  background: rgba(30, 41, 59, 0.75);
  border-color: rgba(148, 163, 184, 0.3);
}

html[data-theme="dark"] .tp-inv-col {
  background: rgba(15, 23, 42, 0.55);
  border-color: rgba(148, 163, 184, 0.35);
}

html[data-theme="dark"] .tp-inv-col--offer {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(6, 78, 59, 0.25);
}

html[data-theme="dark"] .tp-inv-col--ask {
  border-color: rgba(14, 165, 233, 0.4);
  background: rgba(12, 74, 110, 0.28);
}

html[data-theme="dark"] .tp-loot-card,
html[data-theme="dark"] .tp-partner-card,
html[data-theme="dark"] .tp-deal-card,
html[data-theme="dark"] .tp-round-card {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(148, 163, 184, 0.28);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

html[data-theme="dark"] .tp-deal-card.is-action {
  background: linear-gradient(135deg, rgba(127, 29, 29, 0.45), rgba(30, 41, 59, 0.95));
  border-color: rgba(239, 68, 68, 0.45);
}

html[data-theme="dark"] .tp-loot-media {
  background: linear-gradient(145deg, #334155, #1e293b);
  color: #94a3b8;
}

html[data-theme="dark"] .tp-gold-stepper button,
html[data-theme="dark"] .tp-gold-stepper input {
  background: #0f172a;
  color: #e2e8f0;
  border-color: rgba(148, 163, 184, 0.4);
}

html[data-theme="dark"] .tp-trade-tray {
  background: linear-gradient(135deg, rgba(120, 53, 15, 0.35), rgba(30, 58, 138, 0.35));
  border-color: rgba(245, 158, 11, 0.35);
}

html[data-theme="dark"] .tp-tray-swap {
  background: #1e293b;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .tp-item-card {
  background: rgba(15, 23, 42, 0.85);
}

html[data-theme="dark"] .tp-class-chip {
  background: rgba(14, 165, 233, 0.18);
  color: #7dd3fc;
  border-color: rgba(14, 165, 233, 0.35);
}

html[data-theme="dark"] .tp-class-chip[style*="--class-color"] {
  color: var(--class-color) !important;
  background: color-mix(in srgb, var(--class-color) 18%, transparent) !important;
  border-color: color-mix(in srgb, var(--class-color) 40%, transparent) !important;
}

html[data-theme="dark"] .tp-chip {
  background: rgba(148, 163, 184, 0.18);
  color: #e2e8f0;
}

html[data-theme="dark"] .tp-change-partner {
  color: #38bdf8;
}

html[data-theme="dark"] .tp-avatar-frame,
html[data-theme="dark"] .tp-partner-portrait {
  background: #334155;
  border-color: rgba(245, 158, 11, 0.45);
}
