/* The Market (/market/ and /market/<brand>/, src/market.njk, src/market-brand.njk). Loads after site.css and guide.css.
   Green = sales and price cuts (as on the product pages' price history); a muted red = full-price rises. */
.mk { max-width: 1100px; margin: 0 auto; padding: 0 var(--edge) 3rem; }
.mk .crumbs { padding: 0.75rem 0 0.4rem; }
.mk-head { padding: 0.5rem 0 0; }
.mk-head .g-kicker { margin-top: 0.4rem; }
.mk-head h1 { margin: 0.35rem 0 0.6rem; font-size: clamp(1.7rem, 5vw, 2.6rem); line-height: 1.1; font-weight: 500; letter-spacing: -0.01em; }
.mk-stand { max-width: 46rem; margin: 0 0 0.5rem; font-size: 1.05rem; color: #2A2A2A; }
.mk-meta { margin: 0 0 1.2rem; font-size: 0.8rem; color: var(--muted); }
.mk-vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.mk-stats { list-style: none; margin: 0 0 1.4rem; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
@media (min-width: 720px) { .mk-stats { grid-template-columns: repeat(4, 1fr); } }
.mk-stats li { padding: 0.85rem 0.95rem; border-radius: var(--radius-s, 12px); background: #111214; color: #fff; }
.mk-stats b { display: block; font-size: clamp(1.35rem, 4vw, 1.8rem); font-weight: 500; font-variant-numeric: tabular-nums; }
.mk-stats span { font-size: 0.78rem; color: #C9CACE; }

.mk-tabs { position: sticky; top: 3.2rem; z-index: 5; display: flex; gap: 0.4rem; margin: 0 0 1rem; padding: 0.5rem 0; background: var(--page); }
.mk-tabs a { padding: 0.45rem 1rem; border: 1px solid var(--rule); border-radius: 999px; color: var(--ink); text-decoration: none; font-size: 0.9rem; }
.mk-tabs a[aria-current="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.js-mk .mk-panel:not(.is-on) { display: none; }

.mk-panel h2, .mk-sec h2 { margin: 1.6rem 0 0.5rem; font-size: clamp(1.25rem, 3.5vw, 1.6rem); font-weight: 500; }
.mk-h3 { margin: 1.8rem 0 0.5rem; font-size: 1.1rem; font-weight: 600; }
.mk-h4 { margin: 1rem 0 0.4rem; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.mk-h4 small { font-weight: 400; }
.mk-note, .mk-small { font-size: 0.8rem; color: var(--muted); margin: 0.4rem 0 0; }

.mk-charts { display: grid; gap: 0.8rem; grid-template-columns: 1fr; }
@media (min-width: 820px) { .mk-charts { grid-template-columns: 1fr 1fr; } }
.mk-c { padding: 0.9rem 1rem 0.8rem; border-radius: var(--radius-s, 12px); background: var(--surface, #fff); box-shadow: var(--shadow-1); }
.mk-c h3 { margin: 0 0 0.4rem; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.mk-chart { position: relative; margin: 0; }
.mk-chart svg { display: block; width: 100%; height: 160px; touch-action: pan-y; }
.mk-line { fill: none; stroke: #111214; stroke-width: 2; stroke-linejoin: round; }
.mk-area { fill: rgba(17, 18, 20, 0.06); stroke: none; }
[data-field="sale"] .mk-line { stroke: #1E4D3A; }
[data-field="sale"] .mk-area { fill: rgba(30, 77, 58, 0.1); }
.mk-x { display: flex; justify-content: space-between; font-size: 0.68rem; color: var(--muted); margin-top: 0.15rem; }
.mk-read { margin-top: 0.35rem; font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.mk-cursor { position: absolute; top: 0; width: 1px; height: 160px; background: rgba(0, 0, 0, 0.35); pointer-events: none; }

.mk-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; grid-template-columns: 1fr; }
@media (min-width: 720px) { .mk-list { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1040px) { .mk-list { grid-template-columns: 1fr 1fr 1fr; } }
.mk-item { display: flex; gap: 0.7rem; align-items: center; padding: 0.55rem; border-radius: var(--radius-s, 12px); background: var(--surface, #fff); box-shadow: var(--shadow-1); }
.mk-pic img { display: block; width: 72px; height: 72px; object-fit: contain; border-radius: 8px; background: var(--tile); }
.mk-txt { min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.mk-name { color: var(--ink); text-decoration: none; font-size: 0.88rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mk-move { font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.mk-move s { color: var(--muted); }
.mk-move small { color: var(--muted); font-size: 0.75rem; }
.mk-sale b, .mk-cut b, .mk-fall b, .mk-onsale b, .mk-low b { color: #1E4D3A; }
.mk-rise b { color: #9A3B2E; }
.mk-buy { align-self: flex-start; margin-top: 0.15rem; font-size: 0.78rem; font-weight: 600; color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.mk-out { font-size: 0.75rem; color: var(--muted); }

.mk-board-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.mk-board { width: 100%; border-collapse: collapse; font-size: 0.88rem; font-variant-numeric: tabular-nums; }
.mk-board th, .mk-board td { padding: 0.55rem 0.5rem; border-bottom: 1px solid var(--rule); text-align: left; white-space: nowrap; }
.mk-board thead th { font-size: 0.72rem; font-weight: 600; color: var(--muted); }
.mk-board tbody th { font-weight: 500; }
.mk-board tbody th a { color: var(--ink); }
.mk-board small { color: var(--muted); }
.mk-spark { display: block; width: 110px; height: 26px; }
.mk-spark .mk-line { stroke: #1E4D3A; stroke-width: 1.5; }
.mk-spark .mk-area { fill: rgba(30, 77, 58, 0.1); }
@media (max-width: 560px) { .mk-tr { display: none; } }

.mk-sec.g-body { max-width: 46rem; }
.mk-sec.g-body h3 { font-size: 1rem; margin: 1.1rem 0 0.25rem; }
.mk-links { display: flex; flex-wrap: wrap; gap: 0.6rem 1.2rem; margin-top: 1.2rem; }
.mk-links a { color: var(--ink); font-weight: 500; }

/* Collection pages: the price list (src/market-collection.njk). */
.mk-models tbody th a:first-child { display: flex; align-items: center; gap: 0.6rem; color: var(--ink); text-decoration: none; white-space: normal; min-width: 14rem; }
.mk-models img { width: 44px; height: 44px; object-fit: contain; border-radius: 6px; background: var(--tile); flex: none; }
.mk-models small { display: block; color: var(--muted); font-size: 0.72rem; }
.mk-models td s { color: var(--muted); font-size: 0.8rem; }
.mk-models tr.is-out { opacity: 0.55; }
.mk-up { color: #9A3B2E; font-weight: 600; }
.mk-down { color: #1E4D3A; font-weight: 600; }
.mk-tag { display: inline-block; padding: 0 0.35rem; border-radius: 4px; background: #E3EFE8; color: #1E4D3A; font-size: 0.68rem; }
.mk-colls { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }
.mk-colls a { display: block; padding: 0.7rem 0.85rem; border-radius: var(--radius-s, 12px); background: var(--surface, #fff); box-shadow: var(--shadow-1); color: var(--ink); text-decoration: none; }
.mk-colls b { display: block; font-weight: 500; }
.mk-colls small { color: var(--muted); }
/* Phones: the price list keeps model, price and lowest recorded; the buy link sits under the model name. */
.mk-models tbody th .mk-buy-m { display: none; }
@media (max-width: 640px) {
  .mk-models .mk-wide { display: none; }
  .mk-models tbody th .mk-buy-m { display: inline-block; margin: 0.25rem 0 0 calc(44px + 0.6rem); }
  .mk-models tbody th a:first-child { min-width: 0; }
  .mk-models th, .mk-models td { white-space: normal; }
}
