/* Roat Pkz Marketplace. Builds on the item list styles (.item-catalog-*) in main.css. */

.market-page {
	--market-panel: rgba(0, 34, 51, .94);
	--market-sunk: rgba(0, 25, 39, .78);
	--market-line: rgba(152, 254, 253, .14);
	--market-line-soft: rgba(152, 254, 253, .08);
	--market-accent: #49c5cd;
	--market-bright: #98fefd;
	--market-eyebrow: #78e7e8;
	--market-copy: #a9c7ce;
	--market-up: #7ee3ae;
	--market-down: #ff8a96;
}

.market-body .container { display: flex; flex-direction: column; gap: 1.25rem; }
.market-page .num, .market-page .is-num, .market-page strong { font-variant-numeric: tabular-nums; }

/* Search */
.market-search-form { position: relative; }
.market-suggestions {
	position: absolute; left: 0; right: 0; top: calc(100% + .35rem); z-index: 30;
	background: #00283b; border: 1px solid var(--market-accent);
	box-shadow: 0 1.1rem 2.5rem rgba(0, 0, 0, .45);
}
/* 10 compact rows tall, then the matches scroll; "See all results" sits below, always visible */
.market-suggestion-list {
	max-height: calc(10 * 2.2rem + 9px);
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-width: thin;
	scrollbar-color: rgba(152, 254, 253, .35) transparent;
}
.market-suggestion-list::-webkit-scrollbar { width: .45rem; }
.market-suggestion-list::-webkit-scrollbar-thumb { background: rgba(152, 254, 253, .3); border-radius: .25rem; }
.market-suggestion {
	display: flex; align-items: center; gap: .6rem; height: 2.2rem; padding: 0 .75rem;
	color: #fff; text-decoration: none; border-top: 1px solid var(--market-line-soft);
}
.market-suggestion:first-child { border-top: 0; }
.market-suggestion:hover, .market-suggestion.is-active { background: rgba(39, 150, 164, .24); color: #fff; }
.market-suggestion-name { flex: 1; min-width: 0; font-weight: 700; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.market-suggestion-price { font-weight: 700; font-size: .85rem; font-variant-numeric: tabular-nums; }
.market-suggestion .market-change { width: 4.2rem; text-align: right; font-size: .78rem; }
.market-suggestion .market-icon { width: 1.65rem; height: 1.65rem; }
.market-suggestion .market-pkp-icon { width: 1em; height: 1em; }
.market-suggestion-all { display: block; padding: .55rem .75rem; font-size: .82rem; font-weight: 700; color: var(--market-bright); text-decoration: none; border-top: 1px solid var(--market-line-soft); }
.market-suggestion-all:hover { color: #fff; }

/* Shared panels */
.market-panel { background: var(--market-panel); border: 1px solid var(--market-line); border-top: 2px solid var(--market-accent); padding: 1.35rem 1.5rem; }
.market-panel h2 { margin: 0; color: #fff; font-size: 1.3rem; font-weight: 800; letter-spacing: .03rem; text-transform: uppercase; }
.market-panel-heading { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .75rem 1rem; margin-bottom: 1rem; }
.market-panel-heading p { margin: .3rem 0 0; color: var(--market-copy); font-size: .85rem; }
.market-count { padding: .45rem .7rem; border: 1px solid var(--market-line); font-size: .7rem; font-weight: 800; letter-spacing: .08rem; color: var(--market-bright); text-transform: uppercase; }
.market-footnote { margin: 0; color: var(--market-copy); font-size: .78rem; line-height: 1.6; text-align: center; }
.market-empty-note { margin: .75rem 0; color: var(--market-copy); font-size: .85rem; }
.market-muted { color: var(--market-copy); }

.market-stale { display: flex; align-items: center; gap: .6rem; padding: .8rem 1rem; color: #ffe2a6; background: rgba(239, 178, 41, .12); border: 1px solid rgba(239, 178, 41, .4); font-size: .9rem; font-weight: 600; }

.market-breadcrumb { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; color: var(--market-copy); font-size: .85rem; font-weight: 700; }
.market-breadcrumb a { color: var(--market-bright); text-decoration: none; }
.market-breadcrumb span:last-child { color: #fff; }

.market-icon { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 2.4rem; height: 2.4rem; background: #001927; border: 1px solid rgba(152, 254, 253, .16); border-radius: .2rem; }
.market-icon img { max-width: 80%; max-height: 80%; image-rendering: pixelated; }
/* Item page picture: the sprites are tiny, so scale them up crisply */
.market-icon-large { width: 7.5rem; height: 7.5rem; background: radial-gradient(circle at 50% 45%, #2a7d96 0%, #12506a 38%, #032a3a 75%); }
.market-icon-large img { width: 5.5rem; height: 5.5rem; max-width: none; max-height: none; object-fit: contain; image-rendering: pixelated; }
@media (max-width: 575.98px) {
	.market-icon-large { width: 5.5rem; height: 5.5rem; }
	.market-icon-large img { width: 4rem; height: 4rem; }
}

/* PKP amounts: the number, then the PK Point icon */
.market-pkp { display: inline-flex; align-items: center; gap: .3em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.market-pkp-icon { flex: none; width: 1.1em; height: 1.1em; object-fit: contain; image-rendering: pixelated; }
.market-pkp.is-large { gap: .2em; }
.market-pkp.is-large .market-pkp-icon { width: .8em; height: .8em; }
.market-chart-tip-range { display: flex; flex-wrap: wrap; align-items: center; gap: .3em; }

/* Shortened prices (1.25M): the full price pops out to the left on hover or keyboard focus.
   Sideways, so the table's scroll box can't cut it off at the top or bottom row. */
.market-pkp.is-compact, .market-hover { position: relative; cursor: help; outline: none; }
.market-pkp.is-compact > span[aria-hidden], .market-hover > span[aria-hidden] { border-bottom: 1px dotted rgba(152, 254, 253, .45); }
.market-pkp.is-compact::after, .market-hover::after {
	content: attr(data-full);
	position: absolute;
	right: calc(100% + .5rem);
	top: 50%;
	transform: translateY(-50%);
	padding: .3rem .55rem;
	color: #fff;
	font-size: .8rem;
	font-weight: 700;
	white-space: nowrap;
	background: #00121d;
	border: 1px solid var(--market-accent);
	box-shadow: 0 .4rem 1rem rgba(0, 0, 0, .4);
	opacity: 0;
	pointer-events: none;
	transition: opacity .12s;
	z-index: 5;
}
.market-pkp.is-compact:hover::after, .market-pkp.is-compact:focus-visible::after,
.market-hover:hover::after, .market-hover:focus-visible::after { opacity: 1; }

.market-change { font-weight: 800; font-size: .82rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.market-change.is-up { color: var(--market-up); }
.market-change.is-down { color: var(--market-down); }
.market-change.is-flat { color: var(--market-copy); }

.market-pill { padding: .25rem .5rem; font-size: .75rem; font-weight: 800; color: #fff; background: rgba(169, 199, 206, .1); border-radius: .2rem; }
.market-badge { display: inline-block; margin-left: .35rem; padding: .1rem .35rem; border: 1px solid rgba(169, 199, 206, .35); border-radius: .2rem; font-size: .62rem; font-weight: 800; letter-spacing: .05rem; color: var(--market-copy); text-transform: uppercase; vertical-align: middle; }

.market-button { display: inline-flex; align-items: center; gap: .5rem; min-height: 2.5rem; padding: 0 1rem; color: #fff; font-size: .75rem; font-weight: 800; letter-spacing: .08rem; text-transform: uppercase; text-decoration: none; background: linear-gradient(135deg, #2796a4, #1c7180); border: 1px solid var(--market-accent); border-radius: .2rem; }
.market-button:hover { color: #fff; filter: brightness(1.1); }
.market-button.is-ghost { background: var(--market-sunk); border-color: rgba(152, 254, 253, .2); }

/* Home: tiles, categories, movers */
.market-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.market-tile { display: flex; flex-direction: column; gap: .3rem; padding: 1.1rem 1.25rem; background: var(--market-panel); border: 1px solid var(--market-line); border-top: 2px solid var(--market-accent); }
.market-tile strong { color: var(--market-bright); font-size: 1.7rem; font-weight: 900; line-height: 1.1; }
.market-tile-note { color: var(--market-copy); font-size: .78rem; }
.market-tile strong .market-pkp-icon { width: .8em; height: .8em; }
/* In a tile the full amount drops below the number (there's room, and nothing clips it) */
.market-tile .market-pkp.is-compact::after { right: auto; left: 0; top: calc(100% + .35rem); transform: none; font-size: .85rem; }
.market-updated { display: flex; align-items: center; gap: .5rem; margin: -.4rem 0 0; color: var(--market-copy); font-size: .8rem; }
.market-updated-dot { width: .45rem; height: .45rem; border-radius: 50%; background: var(--market-up); }

.market-category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .6rem; }
.market-category { display: flex; align-items: center; gap: .7rem; min-height: 3.4rem; padding: .5rem .75rem; color: #fff; font-size: .85rem; font-weight: 700; text-decoration: none; background: var(--market-sunk); border: 1px solid var(--market-line); }
.market-category:hover { color: #fff; border-color: var(--market-accent); }

.market-movers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.market-movers-list { display: flex; flex-direction: column; }
.market-movers-list h2 { font-size: 1.1rem; margin: .2rem 0 .6rem; }
.market-movers-heading { display: flex; align-items: center; gap: .7rem; color: inherit; text-decoration: none; }
.market-movers-heading h2 i { font-size: .8rem; color: var(--market-copy); transition: transform .15s; }
.market-movers-heading:hover h2 { color: var(--market-bright); }
.market-movers-heading:hover h2 i { color: var(--market-bright); transform: translateX(.15rem); }
.market-movers-more { margin-top: auto; padding: .75rem 0 .2rem; color: var(--market-bright); font-size: .78rem; font-weight: 800; letter-spacing: .04rem; text-decoration: none; border-top: 1px solid var(--market-line-soft); }
.market-movers-more:hover { color: #fff; }

/* Movers page */
.market-page-title { margin: .3rem 0 0; color: #fff; font-size: 1.9rem; font-weight: 900; letter-spacing: .08rem; text-transform: uppercase; }
.market-movers-head .market-panel-heading { margin-bottom: 0; }
/* Movers page: a full-width row under the title, period buttons on the left and the Units / PKP switch at the right edge */
.market-movers-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; flex: 1 1 100%; }
.market-movers-controls .market-vol-toggle { margin-left: auto; }
.market-ranges a.market-range { display: inline-flex; align-items: center; text-decoration: none; }
.market-movers-table .market-rank { width: 2.2rem; color: var(--market-copy); font-weight: 800; text-align: right; }
.market-movers-table .market-item-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 9.75rem; }
.market-movers-table .market-icon { width: 2.1rem; height: 2.1rem; }
.market-mover { display: flex; align-items: center; gap: .75rem; padding: .65rem 0; color: #fff; text-decoration: none; border-top: 1px solid var(--market-line-soft); }
.market-mover:hover { color: var(--market-bright); }
.market-mover-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.market-mover-name { font-weight: 700; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.market-mover-price { color: var(--market-copy); font-size: .78rem; font-variant-numeric: tabular-nums; }

/* Tables */
.market-table-panel { padding: 1.35rem 0 0; }
.market-table-panel > .market-panel-heading, .market-table-panel > .market-filters { padding: 0 1.5rem; }
.market-table-scroll { overflow-x: auto; }
.market-table { width: 100%; min-width: 56rem; border-collapse: collapse; }
.market-table th { padding: .8rem .75rem; color: var(--market-copy); font-size: .66rem; font-weight: 800; letter-spacing: .12rem; text-transform: uppercase; text-align: left; background: rgba(0, 25, 39, .6); white-space: nowrap; }
.market-table td { padding: .65rem .75rem; color: #fff; font-size: .88rem; border-top: 1px solid var(--market-line-soft); vertical-align: middle; }
.market-table th:first-child, .market-table td:first-child { padding-left: 1.5rem; }
.market-table th:last-child, .market-table td:last-child { padding-right: 1.5rem; }
.market-table .is-num { text-align: right; white-space: nowrap; }
.market-table tbody tr:hover td { background: rgba(152, 254, 253, .035); }
.market-table-empty { padding: 3rem 1.5rem !important; text-align: center; color: var(--market-copy) !important; }
.market-days { min-width: 34rem; }
.market-days tr.is-empty td { color: var(--market-copy); }
/* Daily + monthly side by side: both panels stretch to the same height, and every row (prices or "No sales")
   is the same height, so the two tables line up row for row */
.market-history-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; align-items: stretch; }
.market-history-grid > .market-panel { display: flex; flex-direction: column; }
.market-history-grid tbody tr { height: 2.9rem; }
/* Similar items (item page) */
.market-similar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .75rem; }
.market-similar-card { display: flex; align-items: center; gap: .8rem; min-width: 0; padding: .7rem .8rem; color: #fff; text-decoration: none; background: var(--market-sunk); border: 1px solid var(--market-line-soft); transition: border-color .15s, background .15s; }
.market-similar-card:hover { color: #fff; border-color: var(--market-accent); background: rgba(39, 150, 164, .14); }
.market-similar-icon { width: 2.75rem; height: 2.75rem; }
.market-similar-icon img { width: 2rem; height: 2rem; max-width: none; max-height: none; object-fit: contain; image-rendering: pixelated; }
.market-similar-text { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.market-similar-name { font-weight: 700; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.market-similar-price { display: flex; align-items: center; gap: .5rem; font-size: .82rem; font-weight: 700; }

.market-history-heading { display: flex; align-items: center; gap: .85rem; min-width: 0; }
.market-history-heading > div { min-width: 0; }
.market-history-heading .item-catalog-eyebrow { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.market-history-icon { width: 3rem; height: 3rem; background: radial-gradient(circle at 50% 45%, #2a7d96 0%, #12506a 38%, #032a3a 75%); }
.market-history-icon img { width: 2.25rem; height: 2.25rem; max-width: none; max-height: none; object-fit: contain; image-rendering: pixelated; }
.market-history-grid .market-table th:first-child, .market-history-grid .market-table td:first-child { white-space: nowrap; }
/* Two tables side by side: tighter columns so all five fit without scrolling */
.market-history-grid .market-days { min-width: 0; }
.market-history-grid .market-table th, .market-history-grid .market-table td { padding-left: .5rem; padding-right: .5rem; }
.market-history-grid .market-table th { letter-spacing: .08rem; }
@media (max-width: 1199.98px) { .market-history-grid { grid-template-columns: minmax(0, 1fr); } }
.market-sort { color: inherit; text-decoration: none; }
.market-sort:hover, .market-sort.is-active { color: var(--market-bright); }

.market-item-link { display: flex; align-items: center; gap: .75rem; min-width: 0; color: #fff; text-decoration: none; }
.market-item-link:hover .market-item-name { color: var(--market-bright); }
.market-item-name { display: block; font-weight: 700; }
.market-item-name mark { padding: 0 .05rem; color: #fff; background: rgba(152, 254, 253, .22); border-radius: .1rem; }


.market-table-foot { display: flex; justify-content: center; padding: 1.1rem 1.5rem; border-top: 1px solid var(--market-line-soft); }

/* Search filters + pagination */
.market-filters { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.market-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.market-chip, .market-toggle { display: inline-flex; align-items: center; gap: .45rem; min-height: 2.25rem; padding: 0 .8rem; color: var(--market-copy); font-size: .78rem; font-weight: 700; text-decoration: none; border: 1px solid rgba(152, 254, 253, .18); border-radius: .2rem; }
.market-chip span { opacity: .7; font-variant-numeric: tabular-nums; }
.market-chip:hover, .market-toggle:hover { color: #fff; }
.market-chip.is-active { color: #fff; border-color: var(--market-accent); background: rgba(39, 150, 164, .35); }
.market-toggle { border-color: transparent; padding: 0; }
.market-toggle.is-active { color: #fff; }

.market-pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: .35rem; }
.market-page-link { display: inline-flex; align-items: center; justify-content: center; min-width: 2.5rem; min-height: 2.5rem; padding: 0 .8rem; color: var(--market-copy); font-size: .75rem; font-weight: 800; letter-spacing: .06rem; text-transform: uppercase; text-decoration: none; background: var(--market-sunk); border: 1px solid rgba(152, 254, 253, .18); border-radius: .2rem; }
.market-page-link:hover { color: #fff; }
.market-page-link.is-active { color: #fff; border-color: var(--market-accent); background: rgba(39, 150, 164, .35); }
.market-page-link.is-disabled { opacity: .45; }

/* Item page */
/* Item pages: a short banner behind the site header, no title. The page body overlaps its foot as usual. */
.market-hero-slim .banner { min-height: 19rem; }
/* Home page: the big banner (with its title) also fades into the page instead of a hard edge */
.market-hero:not(.market-hero-slim) .banner::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 55%;
	background: linear-gradient(to bottom, rgba(0, 25, 39, 0) 0%, rgba(0, 25, 39, .6) 45%, rgba(0, 25, 39, .92) 80%, #001927 100%);
	pointer-events: none;
}
.market-hero:not(.market-hero-slim) .holder-bevels,
.market-hero:not(.market-hero-slim) .diamond { z-index: 2; }
.market-hero:not(.market-hero-slim) + .market-body {
	background: linear-gradient(to bottom, rgba(0, 25, 39, 0) 0, #001927 6rem);
}

/* Fade the bottom of the picture into the page colour instead of a hard edge */
.market-hero-slim .banner::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 70%;
	background: linear-gradient(to bottom, rgba(0, 25, 39, 0) 0%, rgba(0, 25, 39, .55) 40%, rgba(0, 25, 39, .9) 75%, #001927 100%);
	pointer-events: none;
}
/* The page body overlaps the faded part, so it starts see-through and turns solid lower down */
.market-hero-slim + .market-body {
	margin-top: -9.5rem; /* the breadcrumb + search bar sit just under the nav bar */
	background: linear-gradient(to bottom, rgba(0, 25, 39, 0) 0, #001927 9.5rem);
}
@media (max-width: 991.98px) { .market-hero-slim .banner { min-height: 19.5rem; } }
.market-item-topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.5rem; }
.market-quick-search { position: relative; display: flex; align-items: center; flex: 0 1 26rem; min-width: min(100%, 18rem); background: var(--market-sunk); border: 1px solid rgba(152, 254, 253, .22); border-radius: .2rem; }
.market-quick-search:focus-within { border-color: var(--market-accent); }
.market-quick-search > i { padding: 0 .2rem 0 .8rem; color: var(--market-copy); }
.market-quick-search input { flex: 1; min-width: 0; min-height: 2.6rem; padding: 0 .6rem; color: #e7f5f7; font-size: .85rem; font-weight: 600; background: transparent; border: 0; outline: 0; }
.market-quick-search input::placeholder { color: var(--market-copy); }
.market-quick-search button { align-self: stretch; padding: 0 1rem; color: #fff; font-size: .7rem; font-weight: 800; letter-spacing: .08rem; text-transform: uppercase; background: linear-gradient(135deg, #2796a4, #1c7180); border: 0; border-left: 1px solid var(--market-accent); cursor: pointer; }
.market-item-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem 2.5rem; }
.market-item-identity { display: flex; align-items: center; gap: 1.25rem; flex: 1 1 26rem; }
.market-tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.market-tags .item-catalog-eyebrow { margin: 0; padding: .2rem .45rem; border: 1px solid rgba(120, 231, 232, .35); }
.market-tag-link { text-decoration: none; transition: background .15s, color .15s; }
.market-tag-link:hover { color: #fff; background: rgba(39, 150, 164, .35); }
.market-item-title { margin: .4rem 0 0; color: #fff; font-size: 2.1rem; font-weight: 900; letter-spacing: .12rem; line-height: 1.05; text-transform: uppercase; }
.market-item-sub { margin-top: .45rem; color: var(--market-copy); font-size: .82rem; }
.market-item-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .85rem; }
.market-item-price { display: flex; flex-direction: column; align-items: flex-end; gap: .3rem; text-align: right; }
.market-item-price strong { color: #fff; font-size: 2.6rem; font-weight: 900; line-height: 1.05; }
.market-item-price strong small { color: var(--market-bright); font-size: 1rem; font-weight: 800; }
.market-item-price strong.is-muted { color: var(--market-copy); }
.market-item-price-note { color: var(--market-copy); font-size: .8rem; }

.market-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; }
.market-stat { display: flex; flex-direction: column; gap: .3rem; padding: .9rem 1rem; background: var(--market-sunk); border: 1px solid var(--market-line-soft); }
.market-stat .item-catalog-eyebrow { margin: 0; color: var(--market-copy); }
.market-stat strong { color: #fff; font-size: 1.25rem; font-weight: 900; }
.market-stat { min-width: 0; }
.market-stat-note { color: var(--market-copy); font-size: .74rem; }
.market-stat-note .market-change { white-space: normal; }

/* Chart */
.market-ranges { display: flex; flex-wrap: wrap; gap: .35rem; }
.market-range { min-width: 2.75rem; min-height: 2.25rem; padding: 0 .75rem; color: var(--market-copy); font-size: .74rem; font-weight: 800; letter-spacing: .05rem; background: var(--market-sunk); border: 1px solid rgba(152, 254, 253, .18); border-radius: .2rem; cursor: pointer; }
.market-range:hover { color: #fff; }
.market-range.is-active { color: #fff; border-color: var(--market-accent); background: linear-gradient(135deg, #2796a4, #1c7180); }
.market-chart-change { min-height: 1.2rem; }
.market-chart { position: relative; min-height: 22rem; transition: opacity .15s; }
.market-chart.is-loading { opacity: .45; }
.market-chart-svg { display: block; width: 100%; height: auto; overflow: visible; touch-action: pan-y; }
.market-chart-grid { stroke: rgba(152, 254, 253, .08); stroke-width: 1; }
.market-chart-baseline { stroke: rgba(152, 254, 253, .2); stroke-width: 1; }
.market-chart-axis { fill: var(--market-copy); font-size: 11.5px; font-family: inherit; font-variant-numeric: tabular-nums; }
.market-chart-line { fill: none; stroke: var(--market-bright); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.market-chart-bars rect { fill: rgba(73, 197, 205, .5); }
.market-chart-line.is-carried { stroke-dasharray: 6 5; stroke-width: 1.8; opacity: .7; }
.market-chart-sale { fill: var(--market-bright); stroke: #001927; stroke-width: 2; }
.market-chart-cross { stroke: rgba(255, 255, 255, .35); stroke-width: 1; }
.market-chart-dot { fill: var(--market-bright); stroke: rgba(152, 254, 253, .3); stroke-width: 6; }
.market-chart-tip { position: absolute; top: 0; left: 0; width: 22rem; max-width: calc(100% - .5rem); padding: .55rem .8rem .6rem; display: flex; flex-direction: column; gap: .3rem; background: #00121d; border: 1px solid rgba(73, 197, 205, .45); border-left: 3px solid var(--market-accent); box-shadow: 0 .6rem 1.5rem rgba(0, 0, 0, .45); pointer-events: none; font-size: .78rem; color: var(--market-copy); }
.market-chart-tip-head { display: flex; justify-content: space-between; align-items: baseline; gap: .75rem; }
.market-chart-tip-date { color: var(--market-eyebrow); font-size: .66rem; font-weight: 800; letter-spacing: .08rem; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.market-chart-tip-body { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .9rem; align-items: center; }
.market-chart-tip-main { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.market-chart-tip-price { display: flex; align-items: baseline; gap: .45rem; }
.market-chart-tip-price strong { color: #fff; font-size: 1.35rem; font-weight: 900; line-height: 1.1; }
.market-chart-tip-price .market-pkp-icon { width: .8em; height: .8em; }
.market-chart-tip-empty { color: var(--market-copy); font-size: 1.05rem; font-weight: 800; }
.market-chart-tip-label { color: var(--market-copy); font-size: .68rem; font-weight: 400; }
.market-chart-tip-bar { position: relative; height: 5px; margin-top: .15rem; border-radius: 3px; background: linear-gradient(90deg, rgba(126, 227, 174, .35), rgba(152, 254, 253, .18), rgba(255, 138, 150, .35)); }
.market-chart-tip-marker { position: absolute; top: -4px; width: 3px; height: 13px; margin-left: -1.5px; border-radius: 2px; background: #fff; box-shadow: 0 0 0 2px #00121d; }
.market-chart-tip-ends { display: flex; justify-content: space-between; font-size: .7rem; }
.market-chart-tip-volume { display: flex; flex-direction: column; gap: .3rem; padding-left: .9rem; border-left: 1px solid var(--market-line-soft); }
.market-chart-tip-volume > div { display: flex; flex-direction: column; gap: 0; }
.market-chart-tip-volume strong { display: inline-flex; align-items: center; gap: .3em; color: #fff; font-size: .9rem; font-weight: 800; }
.market-chart-tip-volume .market-unit-icon { margin-right: 0; vertical-align: 0; }
.market-chart-empty { padding: 6rem 1rem; text-align: center; color: var(--market-copy); }
.market-chart-note { margin: .75rem 0 0; color: var(--market-copy); font-size: .78rem; }

@media (max-width: 991.98px) {
	.market-tiles, .market-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.market-movers { grid-template-columns: minmax(0, 1fr); }
	.market-item-price { align-items: flex-start; text-align: left; }
}
@media (max-width: 575.98px) {
	.market-panel { padding: 1.1rem 1rem; }
	.market-table-panel { padding: 1.1rem 0 0; }
	.market-table-panel > .market-panel-heading, .market-table-panel > .market-filters { padding: 0 1rem; }
	.market-item-title { font-size: 1.5rem; }
	.market-item-price strong { font-size: 2rem; }
	.market-tile strong { font-size: 1.35rem; }
}

/* ::prices guide price, for items with no Trading Post sales in the last 31 days */
.market-guide { display: inline-flex; align-items: center; gap: 6px; color: var(--market-copy); }
.market-guide-label { font-size: 11px; font-weight: 600; letter-spacing: .02em; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--market-line, rgba(255,255,255,.12)); }
.market-item-price strong.is-guide { opacity: .8; }

/* Item stat boxes: 24h range bar, trend rows, rank badge */
.market-range-dash { margin: 0 .35rem; color: var(--market-copy); font-weight: 400; }
.market-stat-range strong { display: flex; align-items: center; flex-wrap: wrap; }
.market-range-bar { position: relative; height: 6px; margin-top: .45rem; border-radius: 3px; background: linear-gradient(90deg, rgba(126, 227, 174, .35), rgba(152, 254, 253, .18), rgba(255, 138, 150, .35)); }
.market-range-marker { position: absolute; top: -4px; width: 4px; height: 14px; margin-left: -2px; border-radius: 2px; background: #fff; box-shadow: 0 0 0 2px rgba(0, 25, 39, .9); }
.market-range-labels { display: flex; justify-content: space-between; gap: .5rem; color: var(--market-copy); font-size: .7rem; }
.market-range-labels span:nth-child(2) { color: #fff; font-weight: 700; }
.market-stat strong.is-muted { color: var(--market-copy); }
.market-rank-badge { align-self: flex-start; text-decoration: none; margin-top: .25rem; padding: .1rem .5rem; color: var(--market-bright); font-size: .7rem; font-weight: 700; border: 1px solid var(--market-line); border-radius: .2rem; background: rgba(73, 197, 205, .1); }
.market-stat-foot { margin-top: auto; padding-top: .3rem; border-top: 1px solid var(--market-line-soft); }

/* ::prices guide price under the headline price */
.market-item-guide { display: inline-flex; align-items: center; gap: .35em; margin-top: .15rem; color: var(--market-copy); font-size: .74rem; }
.market-item-guide .market-pkp { color: #fff; font-weight: 700; }
.market-item-guide .market-pkp-icon { width: 1em; height: 1em; }

/* "cheapest" after the live listing price */
.market-stat-unit { margin-left: .4rem; color: var(--market-copy); font-size: .72rem; font-weight: 400; }

/* Item stat boxes: each has its own colour (top edge, icon, corner glow), bigger headline numbers */
.market-stat { --stat-color: var(--market-accent); position: relative; gap: .4rem; padding: 1rem 1.1rem 1.05rem; border-top: 2px solid var(--stat-color);
	background: radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--stat-color) 13%, transparent), transparent 60%), var(--market-sunk); }
.market-stat-range { --stat-color: #49c5cd; }
.market-stat-trend.is-up { --stat-color: var(--market-up); }
.market-stat-trend.is-down { --stat-color: var(--market-down); }
.market-stat-trend.is-flat { --stat-color: #8fa9b0; }
.market-stat-traded { --stat-color: #f2c66d; }
.market-stat-listings { --stat-color: var(--market-up); }
.market-stat-label { display: inline-flex; align-items: center; gap: .45rem; }
.market-stat-label .bi { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; color: var(--stat-color); font-size: .85rem;
	background: color-mix(in srgb, var(--stat-color) 14%, transparent); border: 1px solid color-mix(in srgb, var(--stat-color) 35%, transparent); border-radius: .3rem; }
.market-stat strong { font-size: 1.55rem; line-height: 1.15; }
.market-stat strong .market-pkp-icon { width: .75em; height: .75em; }
.market-stat-range strong { font-size: 1.35rem; }
.market-stat-note { font-size: .76rem; }

/* Trend: label, a bar sized by the move (20% fills it), the change */
.market-trend { display: grid; gap: .45rem; margin: .15rem 0 0; padding: 0; list-style: none; }
.market-trend li { display: grid; grid-template-columns: 3.6rem 1fr auto; align-items: center; gap: .6rem; font-size: .85rem; }
.market-trend-label { color: var(--market-copy); }
.market-trend-bar { height: 6px; border-radius: 3px; background: rgba(152, 254, 253, .08); overflow: hidden; }
.market-trend-bar span { display: block; height: 100%; border-radius: 3px; background: #8fa9b0; }
.market-trend-bar span.is-up { background: var(--market-up); }
.market-trend-bar span.is-down { background: var(--market-down); }
.market-trend .market-change { min-width: 3.4rem; text-align: right; }

/* Live listings: green when the cheapest listing is under the current price, red when over */
.market-stat-listings strong.is-deal { color: var(--market-up); }
.market-listing-compare.is-deal { color: var(--market-up); font-weight: 700; }
.market-listing-compare.is-pricey { color: var(--market-down); font-weight: 700; }

/* Traded: the rank badge in the box's gold */
.market-stat-traded .market-rank-badge { color: #f2c66d; border-color: rgba(242, 198, 109, .35); background: rgba(242, 198, 109, .1); transition: background .12s, border-color .12s; }
.market-stat-traded .market-rank-badge:hover, .market-stat-traded .market-rank-badge:focus-visible { color: #ffd98a; border-color: rgba(242, 198, 109, .7); background: rgba(242, 198, 109, .2); }
.market-rank-badge .bi { font-size: .6rem; vertical-align: 0; }

/* The row a link points at (#item-<id>), e.g. from the "#1 most traded" badge */
.market-table tbody tr:target td { background: rgba(242, 198, 109, .12); }
.market-table tbody tr:target td:first-child { box-shadow: inset 3px 0 0 #f2c66d; }
.market-table tbody tr { scroll-margin-top: 6rem; }

/* Two stat boxes per row on phones: smaller headline numbers so they stay on one line */
@media (max-width: 575.98px) {
	.market-stat { padding: .85rem .8rem .9rem; }
	.market-stat strong { font-size: 1.2rem; }
	.market-stat-range strong { font-size: 1rem; }
	.market-stat strong .market-pkp-icon { width: .7em; height: .7em; }
	.market-stat-unit { margin-left: .3rem; font-size: .66rem; }
	.market-trend li { grid-template-columns: 2.9rem 1fr auto; gap: .4rem; font-size: .78rem; }
	.market-trend .market-change { min-width: 0; }
	.market-range-labels { font-size: .64rem; }
}

/* Range: one PKP icon for both ends ("464 – 530"), kept on one line */
.market-stat-range strong { flex-wrap: nowrap; white-space: nowrap; }
.market-stat-range strong .market-range-dash + .market-pkp .market-pkp-icon { display: none; }
.market-trend-label { white-space: nowrap; }
@media (max-width: 575.98px) {
	.market-trend li { grid-template-columns: auto 1fr auto; }
}

/* Small item sprite in front of unit counts in the stat boxes */
.market-unit-icon { width: 1.15em; height: 1.15em; margin-right: .25em; vertical-align: -.25em; object-fit: contain; image-rendering: pixelated; }

/* Daily / monthly tables: "[item] 1.5M  [PKP] 3.4B" in the volume column */
.market-history-volume { display: inline-flex; align-items: center; justify-content: flex-end; gap: .9rem; white-space: nowrap; }
.market-history-units { display: inline-flex; align-items: center; }
.market-history-volume .market-pkp { color: var(--market-copy); }

/* Hover note that opens to the right (first column, e.g. "Today" -> "Since 00:00 UTC") */
.market-hover.is-right::after { right: auto; left: calc(100% + .5rem); }

/* Home tile: the most traded item of the last 24 hours */
.market-tile-item { color: inherit; text-decoration: none; transition: border-color .12s, background .12s; }
.market-tile-item:hover, .market-tile-item:focus-visible { border-color: var(--market-accent); background: rgba(0, 40, 60, .96); }
.market-tile-item strong { display: flex; align-items: center; gap: .55rem; min-width: 0; font-size: 1.2rem; }
.market-tile-icon { flex: none; width: 2rem; height: 2rem; }
.market-tile-icon img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.market-tile-item-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.market-tile-item .market-tile-note { display: inline-flex; align-items: center; gap: .3rem; }
.market-tile-item .market-tile-note .market-pkp { color: #fff; font-weight: 700; }

/* Home page list cards: a small drawn chart beside each heading, in the list's colour */
.market-movers-list { --list-color: var(--market-accent); }
.market-movers-list.is-traded { --list-color: #f2c66d; }
.market-movers-list.is-up { --list-color: var(--market-up); }
.market-movers-list.is-down { --list-color: var(--market-down); }
.market-movers-chart { flex: none; fill: var(--list-color); }
.market-movers-chart .area { opacity: .18; }
.market-movers-chart .line { fill: none; stroke: var(--list-color); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.market-movers-title { display: flex; flex-direction: column; min-width: 0; }

/* Home page Most traded table: names 2px bigger (no categories or ID under them) */
/* Item tables (home and search): just the name, 2px bigger than the table text */
.market-table-panel .market-item-name { font-size: calc(.88rem + 2px); }

/* Volume with a hover card: "[item] 14 units" and "[PKP] 8,652,000 PKP traded" on two lines, popping out to the left
   like the other hovers (sideways, so a table's scroll box can't cut it off) */
.market-volume-hover { position: relative; display: inline-flex; align-items: center; cursor: help; outline: none; }
.market-volume-hover-value { border-bottom: 1px dotted rgba(152, 254, 253, .45); }
.market-hover-card { position: absolute; right: calc(100% + .5rem); top: 50%; transform: translateY(-50%); z-index: 5; display: flex; flex-direction: column; gap: .3rem;
	padding: .4rem .6rem; color: #fff; font-size: .8rem; font-weight: 700; white-space: nowrap; text-align: left; background: #00121d;
	border: 1px solid var(--market-accent); box-shadow: 0 .4rem 1rem rgba(0, 0, 0, .4); opacity: 0; pointer-events: none; transition: opacity .12s; }
.market-hover-card > span { display: inline-flex; align-items: center; gap: .35rem; }
.market-hover-card .market-unit-icon, .market-hover-card .market-pkp-icon { width: 1.1em; height: 1.1em; margin: 0; vertical-align: 0; }
.market-volume-hover:hover .market-hover-card, .market-volume-hover:focus-visible .market-hover-card { opacity: 1; }

/* Search page category dropdown: one button, a grid of categories with their ::prices icons when opened */
.market-filters { justify-content: flex-start; }
.market-cat-menu { position: relative; }
.market-cat-button { display: inline-flex; align-items: center; gap: .55rem; min-height: 2.6rem; padding: .3rem .8rem .3rem .4rem; color: #fff; font-size: .85rem;
	list-style: none; cursor: pointer; background: #00283b; border: 1px solid rgba(152, 254, 253, .25); border-radius: .3rem; transition: border-color .12s; }
.market-cat-button::-webkit-details-marker { display: none; }
.market-cat-button:hover, .market-cat-menu[open] .market-cat-button { border-color: var(--market-accent); }
.market-cat-button-label { color: var(--market-copy); }
.market-cat-button-value { font-weight: 800; }
.market-cat-count { color: var(--market-copy); font-size: .78rem; font-variant-numeric: tabular-nums; }
.market-cat-chevron { color: var(--market-bright); font-size: .75rem; transition: transform .15s; }
.market-cat-menu[open] .market-cat-chevron { transform: rotate(180deg); }
.market-icon.market-cat-icon { width: 1.9rem; height: 1.9rem; }
.market-cat-all { color: var(--market-bright); font-size: .9rem; }
.market-cat-panel { position: absolute; left: 0; top: calc(100% + .35rem); z-index: 25; width: min(40rem, calc(100vw - 2rem)); padding: .5rem;
	background: #00283b; border: 1px solid var(--market-accent); border-radius: .3rem; box-shadow: 0 1.1rem 2.5rem rgba(0, 0, 0, .45); }
.market-cat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .2rem; }
.market-cat-option { display: flex; align-items: center; gap: .55rem; min-width: 0; padding: .35rem .5rem; color: #fff; font-size: .82rem; font-weight: 700; text-decoration: none; border-radius: .25rem; }
.market-cat-option:hover, .market-cat-option:focus-visible { background: rgba(39, 150, 164, .24); color: #fff; }
.market-cat-option.is-active { background: rgba(39, 150, 164, .38); box-shadow: inset 0 0 0 1px var(--market-accent); }
.market-cat-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.market-cat-option .market-icon.market-cat-icon { width: 1.7rem; height: 1.7rem; }
.market-cat-clear { display: inline-flex; align-items: center; gap: .35rem; color: var(--market-bright); font-size: .78rem; font-weight: 700; text-decoration: none; }
.market-cat-clear:hover { color: #fff; }
@media (max-width: 575.98px) {
	.market-cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.market-cat-button-label { display: none; }
}

/* Category menu at the right of the search table's heading: opens towards the left so it stays on screen */
.market-filters.market-filters-heading { margin: 0; gap: .6rem; }
.market-filters-heading .market-cat-panel { left: auto; right: 0; }
@media (max-width: 767.98px) {
	.market-filters-heading .market-cat-panel { right: auto; left: 0; }
}

/* Units / PKP switch for the search table's volume columns, left of the category menu */
.market-vol-toggle { display: inline-flex; align-items: center; gap: .15rem; min-height: 2.6rem; padding: .25rem; background: #00283b;
	border: 1px solid rgba(152, 254, 253, .25); border-radius: .3rem; font-size: .85rem; }
.market-vol-toggle-label { padding: 0 .45rem 0 .4rem; color: var(--market-copy); }
.market-vol-option { display: inline-flex; align-items: center; min-height: 1.95rem; padding: 0 .75rem; color: var(--market-copy); font-weight: 800;
	text-decoration: none; border-radius: .22rem; transition: background .12s, color .12s; }
.market-vol-option:hover, .market-vol-option:focus-visible { color: #fff; background: rgba(39, 150, 164, .24); }
.market-vol-option.is-active { color: #fff; background: rgba(39, 150, 164, .45); box-shadow: inset 0 0 0 1px var(--market-accent); }
@media (max-width: 575.98px) {
	.market-vol-toggle-label { display: none; }
}

/* Daily / monthly tables never scroll: they fit their panel (and hover cards can pop out over the edge) */
.market-history-grid .market-table-scroll { overflow: visible; }
.market-history-grid .market-table { width: 100%; }
@media (max-width: 575.98px) {
	.market-history-grid .market-table th, .market-history-grid .market-table td { padding-left: .3rem; padding-right: .3rem; font-size: .8rem; }
	.market-history-grid .market-table th { letter-spacing: .04rem; font-size: .6rem; }
	.market-history-grid .market-table td .market-pkp-icon { display: none; }
}

/* Shortened PKP amounts: the hover tooltip shows the PK Point sprite in front of the full amount */
.market-pkp.is-compact::after {
	padding-left: 1.85rem;
	background: url("https://cdn.roatpkz.com/media/media-items/30246.png") no-repeat .5rem center / 1.05rem 1.05rem, #00121d;
	image-rendering: pixelated;
}
