.market-panel {
  --market-tcgplayer: #7adcd4;
  --market-hobbydb: #fac88b;
  --market-ebay: #b4b8ff;
  --market-collectr: #ff9dbf;
  display: grid;
  gap: .7rem;
  min-width: 0;
  padding: .9rem 1.04rem;
  border-top: 1px solid var(--line);
  color: var(--ink);
  background: var(--bar);
}
[data-theme="light"] .market-panel {
  --market-tcgplayer: #176b60;
  --market-hobbydb: #87501c;
  --market-ebay: #4d4c9b;
  --market-collectr: #923151;
}
.market-panel [data-source="tcgplayer"] { --series: var(--market-tcgplayer); }
.market-panel [data-source="hobbydb"] { --series: var(--market-hobbydb); }
.market-panel [data-source="ebay"] { --series: var(--market-ebay); }
.market-panel [data-source="collectr"] { --series: var(--market-collectr); }
.market-heading, .market-suggestion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
}
.market-heading h3 { margin: 0; font-size: 1.32rem; line-height: 1.1; letter-spacing: -.035em; }
.market-heading p, .market-annotation, .market-status {
  margin: .25rem 0 0;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.4;
}
.market-status:empty { display: none; }
.market-status.is-error { border-left: 2px solid var(--accent); padding-left: .45rem; color: var(--ink); }
.market-button, .market-all, .market-source {
  min-height: 44px;
  padding: .48rem .65rem;
  border: 1px solid var(--line);
  border-radius: .58rem;
  color: var(--ink);
  background: var(--panel);
  font-size: .84rem;
  line-height: 1.25;
  font-weight: 700;
  touch-action: manipulation;
}
.market-button:hover, .market-all:hover, .market-source:hover { border-color: var(--muted); }
.market-button:disabled { opacity: .56; cursor: progress; }
.market-suggestion {
  min-width: 0;
  padding: .65rem .75rem;
  border: 1px solid color-mix(in srgb, var(--lime) 58%, var(--line));
  border-radius: .75rem;
  background: color-mix(in srgb, var(--lime) 7%, var(--panel));
}
.market-suggestion-label { display: flex; align-items: baseline; flex-wrap: wrap; gap: .12rem .55rem; }
.market-suggestion-label strong { color: var(--lime); font-size: 1.25rem; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.market-suggestion-label span { color: var(--ink); font-size: .87rem; }
.market-suggestion-label small { color: var(--muted); font-size: .78rem; }
.market-use { min-width: max-content; }
.market-sources { display: grid; gap: .42rem; }
.market-all { justify-self: start; }
.market-all[aria-pressed="true"] { color: var(--bg); border-color: var(--ink); background: var(--ink); }
.market-source-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .4rem; }
.market-source { display: grid; justify-items: start; gap: .17rem; min-width: 0; text-align: left; }
.market-source[aria-pressed="true"] { border-color: var(--series); background: color-mix(in srgb, var(--series) 8%, var(--panel)); }
.market-source-label { display: flex; align-items: center; gap: .32rem; overflow-wrap: anywhere; }
.market-source-mark { width: .5rem; height: .5rem; flex: 0 0 auto; border-radius: 50%; background: var(--series); }
.market-source strong { color: var(--series); font-size: 1.06rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.market-source small { color: var(--muted); font-size: .75rem; font-weight: 520; overflow-wrap: anywhere; }
.market-plot {
  min-width: 0;
  padding: .42rem .62rem .58rem;
  border: 1px solid var(--line);
  border-radius: .75rem;
  background: var(--panel);
}
.market-chart { display: block; width: 100%; }
.market-grid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.market-axis { fill: var(--muted); font-size: 19px; }
.market-line { stroke: var(--series); stroke-width: 2; fill: none; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.market-line[data-metric="asking"] { stroke-dasharray: 5 4; }
.market-point { fill: var(--series); stroke: var(--panel); stroke-width: 1; vector-effect: non-scaling-stroke; }
.market-hit { fill: transparent; cursor: crosshair; }
.market-hit:focus-visible, .market-hit:hover { outline: none; stroke: var(--series); stroke-width: 2; vector-effect: non-scaling-stroke; }
.market-empty { margin: 0; padding: .7rem .25rem; color: var(--muted); font-size: .87rem; text-align: center; }
.market-history, .market-record { padding: 0 .66rem; border: 1px solid var(--line); border-radius: .65rem; background: var(--panel); }
.market-history summary, .market-record summary { min-height: 44px; padding: .65rem 0; color: var(--ink); font-size: .87rem; font-weight: 700; cursor: pointer; }
.market-history ul { margin: 0 0 .6rem; padding: 0; list-style: none; }
.market-comp {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: .5rem;
  min-height: 2.75rem;
  padding: .25rem 0;
  border-top: 1px solid var(--line);
  font-size: .83rem;
}
.market-comp-label { display: grid; overflow-wrap: anywhere; }
.market-comp-label a { min-height: 1.25rem; padding-block: .12rem; color: var(--lime); text-decoration: underline; text-underline-offset: 3px; }
.market-comp-label small, .market-comp time { color: var(--muted); font-size: .76rem; }
.market-comp strong { font-variant-numeric: tabular-nums; }
.market-record form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; margin: 0 0 .65rem; }
.market-record label { display: grid; min-width: 0; gap: .23rem; color: var(--muted); font-size: .8rem; }
.market-record input, .market-record select {
  min-width: 0;
  width: 100%;
  min-height: 44px;
  padding: .42rem .58rem;
  border: 1px solid var(--line);
  border-radius: .48rem;
  color: var(--ink);
  background-color: var(--bg);
  font-size: 1rem;
}
.market-record select { padding-right: 1.2rem; background-position: calc(100% - 11px) 50%, calc(100% - 6px) 50%; }
.market-url, .market-save { grid-column: 1 / -1; }
.market-save { justify-self: start; }
@media (max-width: 37.5rem) {
  .market-panel { padding-inline: .72rem; }
  .market-source-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .market-plot { padding-inline: .38rem; }
  .market-heading h3 { font-size: 1.2rem; }
}
@media (max-width: 23.5rem) {
  .market-suggestion { align-items: start; flex-direction: column; }
  .market-comp { gap: .35rem; }
}
