/*
 * market.css: /market ("Radar"), reference/spec/market.md sections 2, 3 and 7.
 *
 * From 768 px the page is traded's fixed-height app shell: the document never scrolls, the
 * sidebar and the results pane scroll on their own. Below 768 the document scrolls under a
 * sticky toolbar, so the filters FAB can never hide the last row. Popovers (source menu, sort
 * menu, search suggestions) open in one fixed layer (.mk-pop) over a dimmed scrim: no panel is
 * ever drawn on top of live page content.
 */

/* traded's market route has no footer (the shell mounts one on every page) */
.mk-page .site-footer { display: none; }

.mk { position: relative; min-width: 0; }

/* ───────────── toolbar ───────────── */
.mk-toolbar {
  position: sticky; top: var(--header-h); z-index: 20;
  border-bottom: 1px solid var(--border); background: var(--bg);
  padding: 0 16px;
}
@media (min-width: 640px) { .mk-toolbar { padding: 0 20px; } }

/* below 768: two rows (source + search, then count + sort + view) as one wrapping flex line */
.mk-bar {
  display: flex; flex-wrap: wrap; align-items: center; column-gap: 12px; row-gap: 0;
  padding-bottom: 10px; min-width: 0;
}
.mk-filters { display: none; position: relative; flex-shrink: 0; }
.mk-badge {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  min-width: 20px; height: 20px; padding: 0 4px; border-radius: var(--radius-pill);
  background: var(--accent-bright); color: var(--on-accent-bright);
  font-size: 10px; line-height: 15px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.mk-vr { display: none; flex-shrink: 0; width: 1px; height: 24px; background: var(--border); }
.mk-vr3 { height: 20px; }
.mk-src { order: 1; display: flex; align-items: center; height: 48px; min-width: 0; }
.mk-src-trigger { max-width: 100%; }
.mk-src-trigger > .mk-src-long { display: none; }
.mk-vr2 { order: 2; }
.mk-search { order: 3; display: flex; align-items: center; flex: 1 1 0; height: 48px; min-width: 0; }
.mk-search > .search { flex: 1 1 auto; min-width: 0; }
.mk-go:disabled { opacity: 0.3; pointer-events: none; }
.mk-break { order: 4; flex-basis: 100%; height: 0; }
.mk-right { display: contents; }
.mk-count {
  order: 5; flex: 1 1 auto; min-width: 0; margin-top: 2px;
  display: inline-flex; align-items: center; gap: 4px; overflow: hidden;
  font-size: 12px; line-height: 16px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums;
}
.mk-count > span { flex-shrink: 0; }
.mk-count > .mk-count-tail { flex-shrink: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.mk-count-n { font-weight: 600; color: var(--fg); }
.mk-sort { order: 6; display: flex; align-items: center; flex: 0 1 auto; min-width: 0; margin-top: 2px; }
.mk-sort-trigger > .mk-sort-short { display: none; }
.mk-views { order: 7; margin-left: -4px; margin-top: 2px; }
.mk-views > .mk-view-sm { display: none; }
@media (max-width: 374.98px) {
  .mk-count-lead { display: none; }
  .mk-sort-trigger > .mk-sort-long { display: none; }
  .mk-sort-trigger > .mk-sort-short { display: inline; }
  .mk-src-trigger { min-width: 7.5rem; }
}
@media (min-width: 640px) {
  .mk-vr2 { display: block; }
  .mk-src-trigger > .mk-src-long { display: inline; }
  .mk-src-trigger > .mk-src-short { display: none; }
}

/* from 768: one grid row; the right cluster never shrinks below its content, search takes 180 to 384 */
@media (min-width: 768px) {
  .mk-toolbar { position: relative; top: auto; flex-shrink: 0; }
  .mk-bar {
    display: grid; height: 48px; padding-bottom: 0; column-gap: 12px;
    grid-template-columns: max-content max-content max-content max-content minmax(180px, 384px) minmax(max-content, 1fr);
  }
  .mk-filters { display: inline-flex; }
  .mk-vr1 { display: block; }
  .mk-src, .mk-vr2, .mk-search { order: 0; }
  .mk-src, .mk-search { height: auto; }
  .mk-break { display: none; }
  .mk-right { display: flex; justify-self: end; align-items: center; gap: 12px; }
  .mk-count, .mk-vr3 { display: none; }
  .mk-count, .mk-sort, .mk-views { margin-top: 0; }
  .mk-views { margin-left: 0; }
  .mk-views > .mk-view-sm { display: inline-flex; }
}
/* 768 to 1023: traded's search collapses to 8 px here; PONPACK hides the count, shows the Filters icon only */
@media (min-width: 768px) and (max-width: 1023.98px) {
  .mk-filters { padding: 6px 8px; }
  .mk-filters-label { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .mk-src-trigger { min-width: 8.5rem; }
}
@media (min-width: 1024px) {
  .mk-bar { column-gap: 16px; }
  .mk-count { display: inline-flex; gap: 6px; font-size: 14px; line-height: 20px; overflow: visible; }
  .mk-vr3 { display: block; }
}

/* ───────────── app shell (768 and up) ───────────── */
.mk-side { display: none; }
@media (min-width: 768px) {
  .mk { display: flex; flex-direction: column; height: calc(100dvh - var(--header-h)); min-height: 0; overflow: hidden; }
  .mk-body { display: flex; flex: 1 1 auto; min-height: 0; overflow: hidden; }
  .mk-side {
    display: block; flex-shrink: 0; width: 256px; overflow: hidden;
    border-right: 1px solid rgba(38, 38, 38, 0.5);
    transition: width 200ms var(--ease-out), border-right-width 200ms var(--ease-out);
  }
  .mk-side.is-collapsed { width: 0; border-right-width: 0; }
  .mk-results { position: relative; flex: 1 1 auto; min-width: 0; min-height: 0; overflow: hidden; }
  .mk-scroll { height: 100%; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
  .mk-scroll.is-list { overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) { .mk-side { transition: none; } }
.mk-side-inner { width: 256px; height: 100%; overflow-y: auto; scrollbar-width: none; }
.mk-side-inner::-webkit-scrollbar { display: none; }

/* below 768 the last row must clear the 56 px FAB (24 px from the bottom) at the page end */
.mk-scroll { position: relative; padding-bottom: 96px; }
@media (min-width: 768px) { .mk-scroll { padding-bottom: 0; } }

/* ───────────── filter body (sidebar and mobile drawer) ───────────── */
.mk-fb { display: flex; flex-direction: column; min-width: 0; }
.mk-sec { min-width: 0; padding: 12px 16px; border-bottom: 1px solid rgba(38, 38, 38, 0.5); }
.mk-sec-deals, .mk-sec-rest { display: flex; flex-direction: column; gap: 20px; }
.mk-sec-rest { padding-bottom: 16px; border-bottom: 0; }
.mk-group { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.mk-h { font-size: 12px; line-height: 16px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.mk-tcg, .mk-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.mk-two > .chip { justify-content: flex-start; padding: 4px 10px; }

.mk-deals {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-width: 0;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-lg);
  font-size: 14px; line-height: 16px; font-weight: 500; color: var(--fg);
  transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.mk-deals:hover { background: var(--secondary-60); }
.mk-deals[aria-pressed="true"] { background: var(--accent-strong); border-color: var(--accent); }
.mk-deals-mark { display: block; flex-shrink: 0; width: auto; height: 16px; max-width: none; }
.mk-deals-sub { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; line-height: 14.3px; color: var(--muted); }
.mk-deals[aria-pressed="true"] .mk-deals-sub { color: #fff; }

.mk-mindisc { padding: 0 4px; transition: opacity var(--dur-fast) var(--ease); }
.mk-mindisc[aria-disabled="true"] { opacity: 0.4; }
.mk-mindisc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 10px; line-height: 15px; }
.mk-mindisc-label { text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.mk-mindisc-val { font-family: var(--font-mono); color: var(--fg); white-space: nowrap; }
.mk-mindisc.is-on .mk-mindisc-val { color: var(--accent-bright); }
/* traded's slider is 16 px tall; 24 px keeps the tap target at WCAG 2.5.8 size in the mobile drawer */
.mk-range { height: 24px; }

.mk-graders { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 8px; }
.mk-grader {
  display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; min-height: 28px;
  padding: 4px 6px; border-radius: var(--radius-md); text-align: left;
  font-size: 14px; line-height: 20px; color: var(--fg-80);
  transition: color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}
.mk-grader:hover { color: var(--fg); background: var(--secondary-60); }
.mk-grader > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-box {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 16px; height: 16px; border: 1px solid var(--muted-40); border-radius: var(--radius-control); color: #fff;
  transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.mk-box > svg { width: 12px; height: 12px; }
.mk-grader[aria-pressed="true"] .mk-box { background: var(--accent-strong); border-color: var(--accent-bright); }

/* ───────────── grid ───────────── */
.mk-grid { display: grid; gap: 12px; padding: 16px 16px 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 768px) {
  .mk-grid.is-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mk-grid.is-compact { gap: 8px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .mk-grid.is-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .mk-grid.is-compact { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (min-width: 1280px) {
  .mk-grid.is-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .mk-grid.is-compact { grid-template-columns: repeat(7, minmax(0, 1fr)); }
}
@media (min-width: 1536px) {
  .mk-grid.is-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .mk-grid.is-compact { grid-template-columns: repeat(8, minmax(0, 1fr)); }
}
.mk-grid .lc { animation: none; }
/* the ETH-first price row and the compact Buy Now icon live in components.css for every grid */
.mk-grid .lc.mk-new, .mk-row.mk-new { animation: mk-card-in 0.4s ease-out both; }
@keyframes mk-card-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* sold or delisted during the session: shown for 4 s, then removed */
.mk-ended {
  position: absolute; inset: 0; z-index: 3;
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 12px; text-align: center;
  background: rgba(0, 0, 0, 0.7); -webkit-backdrop-filter: blur(1px); backdrop-filter: blur(1px);
  animation: fade-in-plain 180ms ease-out both;
}
.mk-ended-t { font-size: 12px; line-height: 16px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: #fff; overflow-wrap: anywhere; }
.mk-ended-p { margin-top: 4px; font-size: 11px; line-height: 16.5px; color: var(--fg-80); font-variant-numeric: tabular-nums; }
.lc.is-ended .chip-media, .lc.is-ended .lc-check { visibility: hidden; }
.lc.is-ended .lc-bar-clip { display: none; }

.mk-end {
  margin: 16px 16px 0; padding: 24px 0; border-top: 1px solid rgba(38, 38, 38, 0.4);
  text-align: center; font-size: 12px; line-height: 16px; color: var(--muted); overflow-wrap: anywhere;
}
@media (min-width: 768px) { .mk-grid + .mk-end { margin-bottom: 16px; } }
.mk-notice { margin: 16px 16px 0; font-size: 13px; line-height: 20px; }
.mk-notice > span { min-width: 0; overflow-wrap: anywhere; }

/* skeletons */
.mk-sk { overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-xl); background: var(--card); animation: pulse 2s var(--ease-pulse) infinite; }
.mk-sk-img { aspect-ratio: 3 / 4; background: var(--secondary); }
.mk-sk-body { display: flex; flex-direction: column; gap: 8px; padding: 12px; }
.mk-sk-bar { width: 75%; height: 16px; border-radius: 4px; background: var(--secondary); }
.mk-sk-bar.is-2 { width: 50%; height: 20px; }
.mk-sk-bar.is-3 { width: 33%; height: 12px; }
.mk-sk-list { display: flex; flex-direction: column; gap: 6px; padding: 16px; }
.mk-sk-row { height: 48px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--card); animation: pulse 2s var(--ease-pulse) infinite; }

/* empty and error */
.mk-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  min-height: calc(100dvh - var(--header-h) - 97px - 96px); padding: 40px 16px; text-align: center;
}
@media (min-width: 768px) { .mk-empty { min-height: 100%; padding: 80px 16px; } }
.mk-empty-title { max-width: 360px; font-size: 14px; line-height: 20px; color: var(--muted); overflow-wrap: anywhere; }
.mk-empty-title.is-error { font-weight: 500; color: var(--red-400); }
.mk-empty-sub { max-width: 320px; margin-top: -8px; font-size: 12px; line-height: 16px; color: var(--muted); overflow-wrap: anywhere; }
.mk-empty-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 28px;
  border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--secondary);
  padding: 6px 12px; font-size: 12px; line-height: 16px; font-weight: 500; color: var(--fg);
  transition: background-color var(--dur-fast) var(--ease);
}
.mk-empty-btn:hover { background: rgba(31, 31, 31, 0.7); }

/* ───────────── list ───────────── */
.mk-list-wrap { padding: 16px; min-width: 0; }
.mk-list-wrap .mk-notice { margin: 0 0 12px; }
.mk-list-box { position: relative; min-width: 0; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card); }
@media (min-width: 768px) {
  .mk-list-wrap { display: flex; flex-direction: column; height: 100%; }
  .mk-list-box { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; }
}
.mk-list-inner { width: 100%; min-width: 1172px; }
.mk-list-inner.has-time { min-width: 1258px; }
.mk-cols {
  display: grid; align-items: center; column-gap: 16px; padding: 0 12px;
  grid-template-columns: minmax(320px, 1fr) 140px 110px 120px 90px 80px 96px 32px 32px;
}
.has-time .mk-cols { grid-template-columns: minmax(320px, 1fr) 140px 110px 120px 90px 80px 70px 96px 32px 32px; }
.mk-list-head { border-bottom: 1px solid var(--border); background: rgba(31, 31, 31, 0.6); }
.mk-list-head .mk-cols { padding-top: 8px; padding-bottom: 8px; font-size: 10px; line-height: 15px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); white-space: nowrap; }
@media (min-width: 768px) {
  .mk-list-head { position: sticky; top: 0; z-index: 2; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
}
.mk-list-head .is-r { text-align: right; }
.mk-num { min-width: 0; overflow: hidden; text-align: right; font-family: var(--font-mono); }
.mk-num > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-row { border-bottom: 1px solid var(--border); }
.mk-row-main { height: 56px; cursor: pointer; transition: background-color var(--dur-fast) var(--ease); }
@media (hover: hover) { .mk-row-main:hover { background: rgba(31, 31, 31, 0.3); } }
.mk-row.is-ended .mk-row-main { opacity: 0.55; }
.mk-row-card { display: flex; align-items: center; gap: 10px; min-width: 0; color: inherit; border-radius: var(--radius-md); }
.mk-thumb { position: relative; display: block; flex-shrink: 0; width: 30px; height: 40px; overflow: hidden; border-radius: 4px; background: var(--secondary); }
.mk-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 2px; }
.mk-row-text { display: flex; flex-direction: column; min-width: 0; }
.mk-row-name { font-size: 14px; line-height: 20px; font-weight: 500; color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-row-meta { font-size: 11px; line-height: 16.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-row-source { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 12px; line-height: 16px; color: var(--muted); }
.mk-row-source > img, .mk-row-source > svg { width: 16px; height: 16px; flex-shrink: 0; object-fit: contain; }
.mk-row-source > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-gchip { display: inline-flex; align-items: center; max-width: 100%; padding: 2px 6px; border-radius: var(--radius-control); background: var(--secondary); font-size: 12px; line-height: 16px; font-weight: 600; color: var(--fg); white-space: nowrap; }
.mk-row-price > span { font-size: 14px; line-height: 20px; font-weight: 700; color: var(--fg); }
.mk-row-est > span { font-size: 12px; line-height: 16px; color: var(--muted); }
.mk-row-deal > span { font-size: 12px; line-height: 16px; font-weight: 600; color: var(--fg-70); }
.mk-row-deal.is-below > span { color: var(--emerald-400); }
.mk-row-deal.is-na > span, .mk-row-est .is-na { font-weight: 400; color: var(--muted-80); }
.mk-row-time { font-size: 12px; line-height: 16px; color: var(--muted); white-space: nowrap; }
.mk-row-act { display: flex; justify-content: flex-end; min-width: 0; }
.mk-row-sold { font-size: 11px; line-height: 16px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--fg); white-space: nowrap; }
.mk-row-basket {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 32px; height: 32px; border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--secondary); color: var(--muted);
  transition: color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.mk-row-basket > svg { width: 14px; height: 14px; }
.mk-row-basket:hover { color: var(--fg); }
.mk-row-basket:active { transform: scale(0.94); }
.mk-row-basket.is-on, .mk-row-basket.is-flash { border-color: rgba(0, 187, 127, 0.4); background: rgba(0, 187, 127, 0.15); color: var(--emerald-400); }
.mk-row-basket[aria-disabled="true"] { opacity: 0.5; }
.mk-row-basket[aria-disabled="true"]:active { transform: none; }
.mk-row-icon { display: flex; justify-content: center; }
.mk-row-exp, .mk-row-open {
  display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px;
  border-radius: var(--radius-control); color: var(--muted);
  transition: color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}
.mk-row-exp:hover, .mk-row-open:hover { background: var(--secondary); color: var(--fg); }
.mk-row-exp > svg, .mk-row-open > svg { width: 14px; height: 14px; }
.mk-row-exp > svg { transition: transform var(--dur-fast) var(--ease); }
.mk-row.is-open .mk-row-exp > svg { transform: rotate(180deg); }
.mk-row-details {
  display: grid; grid-template-rows: 0fr; opacity: 0; visibility: hidden;
  transition: grid-template-rows 200ms var(--ease), opacity 200ms var(--ease), visibility 0s linear 200ms;
}
.mk-row.is-open .mk-row-details { grid-template-rows: 1fr; opacity: 1; visibility: visible; transition: grid-template-rows 200ms var(--ease), opacity 200ms var(--ease), visibility 0s; }
.mk-row-details-inner { min-height: 0; overflow: hidden; }
.mk-details {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px;
  background: rgba(10, 10, 10, 0.5); padding: 12px 16px; font-size: 12px; line-height: 16px;
}
@media (min-width: 768px) { .mk-details { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .mk-details { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.mk-dl { display: flex; flex-direction: column; min-width: 0; }
.mk-dl dt { font-size: 10px; line-height: 13.3px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.mk-dl dd { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg-85); }
.mk-details-none { background: rgba(10, 10, 10, 0.5); padding: 12px 16px; font-size: 12px; line-height: 16px; color: var(--muted); }
.mk-list-end { margin: 0 16px; padding: 16px 0; }

/* ───────────── popover layer ───────────── */
.mk-pop { position: fixed; inset: 0; z-index: 45; pointer-events: none; }
.mk-pop-scrim {
  position: absolute; left: 0; right: 0; bottom: 0; top: var(--pop-scrim-top, 0px);
  background: var(--black-50); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  pointer-events: auto; animation: fade-in-plain var(--dur-overlay) ease-out;
}
.mk-pop-panel {
  position: absolute; min-width: 0; max-width: calc(100vw - 16px); overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
  border: 1px solid var(--border); background: var(--card); pointer-events: auto;
}
.mk-pop-panel.is-src { display: flex; flex-direction: column; gap: 6px; width: 288px; padding: 6px; border-radius: var(--radius-surface); box-shadow: var(--shadow-2xl); }
.mk-pop-panel.is-src .menu-rich-item:not([aria-checked="true"]) .mri-icon { border-color: var(--border); background: transparent; color: var(--muted); }
.mk-pop-panel.is-sort {
  display: flex; flex-direction: column; min-width: 180px; padding: 4px; border-radius: var(--radius-lg); box-shadow: var(--shadow-xl);
  transform-origin: top right; animation: popper-in var(--dur-menu-in) var(--ease-spring);
}
.mk-pop-panel.is-suggest {
  padding: 6px; border-radius: var(--radius-xl); background: rgba(20, 20, 20, 0.98);
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}
.mk-page.mk-pop-open .mk-fab, .mk-page.mk-pop-open .mk-top { visibility: hidden; }

.mk-sg-row {
  display: flex; align-items: center; gap: 12px; width: 100%; min-width: 0; padding: 8px 10px;
  border-radius: var(--radius-lg); text-align: left; color: var(--fg);
  transition: background-color var(--dur-fast) var(--ease);
}
.mk-sg-row:hover, .mk-sg-row.is-active { background: var(--secondary); }
.mk-sg-tile {
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 44px; height: 40px; overflow: hidden;
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg); color: var(--muted);
}
.mk-sg-tile > svg { width: 16px; height: 16px; }
.mk-sg-tile.is-search { width: 32px; height: 32px; border: 0; background: var(--accent-strong); color: #fff; }
.mk-sg-tile.is-card { padding: 2px; }
.mk-sg-tile.is-card img { width: 100%; height: 100%; object-fit: contain; }
.mk-sg-text { display: flex; flex: 1 1 auto; flex-direction: column; min-width: 0; }
.mk-sg-title { font-size: 14px; line-height: 20px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-sg-sub { font-size: 11px; line-height: 16.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-sg-arrow { width: 16px; height: 16px; flex-shrink: 0; color: var(--muted); }
.mk-sg-lang {
  flex-shrink: 0; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--bg);
  padding: 2px 8px; font-size: 10px; line-height: 15px; font-weight: 600; color: var(--muted);
}
.mk-sg-sep { height: 1px; margin: 4px 8px; background: rgba(38, 38, 38, 0.7); }
.mk-sg-head { padding: 4px 10px; font-size: 10px; line-height: 15px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }

/* ───────────── mobile filters drawer, FAB, Back to top ───────────── */
.mk-drawer .drawer-panel {
  top: 0; right: auto; bottom: 0; left: 0; width: 288px; max-width: calc(100vw - 32px); height: 100%; max-height: none;
  border-width: 0 1px 0 0; border-radius: 0; background: var(--card);
}
.mk-drawer[data-state="closed"] .drawer-panel { transform: translate3d(-100%, 0, 0); }
@media (min-width: 768px) { .mk-drawer { display: none; } }
.mk-drawer-head { display: flex; flex-shrink: 0; align-items: center; justify-content: space-between; gap: 12px; padding: 16px; border-bottom: 1px solid var(--border); }
.mk-drawer-title { font-size: 14px; line-height: 20px; font-weight: 600; color: var(--fg); }
.mk-drawer-x {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 24px; height: 24px;
  border-radius: var(--radius-md); color: var(--muted); transition: color var(--dur-fast) var(--ease);
}
.mk-drawer-x:hover { color: var(--fg); }
.mk-drawer-x > svg { width: 20px; height: 20px; }
.mk-drawer-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; }

.mk-fab {
  position: fixed; right: 24px; bottom: 24px; z-index: var(--z-fab);
  display: flex; align-items: center; justify-content: center; width: 56px; height: 56px;
  border-radius: var(--radius-pill); box-shadow: var(--shadow-fill), var(--shadow-lg);
}
.mk-fab > svg { width: 24px; height: 24px; }
@media (min-width: 768px) { .mk-fab { display: none; } }

.mk-top {
  position: fixed; left: 50%; bottom: 24px; z-index: 40; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  padding: 8px 14px; border: 1px solid var(--border); border-radius: var(--radius-pill);
  background: rgba(10, 10, 10, 0.9); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  font-size: 12px; line-height: 16px; font-weight: 600; color: var(--fg); box-shadow: var(--shadow-lg);
  transition: background-color var(--dur-fast) var(--ease);
  animation: mk-top-in 180ms ease-out;
}
.mk-top:hover { background: var(--secondary); }
.mk-top > svg { width: 14px; height: 14px; flex-shrink: 0; }
@keyframes mk-top-in { from { opacity: 0; transform: translate(-50%, 6px); } to { opacity: 1; transform: translate(-50%, 0); } }
