/* 22-minifigures-mobile.css — the phone's /Minifigures' own (task 118), linked by the page after 16-phone.css;
   everything else on it is the shared phone components — the three-a-row wall of figures is 16-phone.css'
   .ui-m-grid--figures since task 178, shared with the catalogue's «Мініфігурки» and the figure page. The sheet is a
   popover outside the page, so the sheet's rules are not scoped to .mf-m. Semantic tokens only. */
/* A tile whose every copy comes in a held set (task 189): its price is a reference — inside the set's value —, muted. */
.mf-m-price--ref b {
  color: var(--text-muted);
  font-weight: 600;
}

/* The sets a figure comes in: a set's number and name on one line, cut; its count at the right. */
.mf-m-sets .ui-m-menu__item {
  gap: var(--space-2);
  font-size: var(--text-md);
}

.mf-m-sets__name {
  flex: 1 1 auto;
  overflow: hidden;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* A set is a link to its page: a chevron says so (the menu's own ✓ is for the current choice). */
.mf-m-sets .ui-m-menu__item::after {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-top: 1.5px solid var(--text-faint);
  border-right: 1.5px solid var(--text-faint);
  transform: rotate(45deg);
}

/* ── The figure page on a phone (task 178): the photo square on --photo-bg, the name, BrickLink's link, the one price; a
   copy's line — count × price, its state's chip (task 181) — with «Змінити» at its right and its date · shop · note
   under it. ── */
.mf-m-photo {
  width: 200px;
  aspect-ratio: 1;
  margin: var(--space-2) auto var(--space-3);
  border-radius: var(--radius-3);
  background: var(--photo-bg);
}

.mf-m-photo img {
  display: block;
  width: 100%;
  height: 100%;
  padding: var(--photo-inset);
  object-fit: contain;
}

.mf-m-name {
  margin: 0 0 var(--space-1);
  font-size: var(--text-lg);
  text-align: center;
  text-wrap: balance;
}

.mf-m-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
  margin: 0 0 var(--space-2);
}

.mf-m-meta a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
}

/* The figure's one price (task 181) and, held, the copies' value (task 184): centred under the name as the photo and
   the name are — one figure alone, two halves of one row — each its label, its number, its lines (the sales only when
   there were sales, the date of the ask). */
.mf-m-stats {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-3);
  margin: var(--space-3) 0 0;
}

.mf-m-stats--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mf-m-price {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 2px;
  margin: 0;
  text-align: center;
}

.mf-m-price dt {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--space-1) var(--space-2);
  color: var(--text-muted);
  font-size: var(--text-xs);
  font-weight: 600;
}

.mf-m-price dd {
  margin: 0;
}

.mf-m-price__value {
  font-size: var(--text-2xl);
  font-weight: 700;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.mf-m-price__value--none {
  color: var(--text-muted);
  font-size: var(--text-lg);
  font-weight: 600;
}

/* The reader's chips under the price, apart from it. */
.ui-m-page .mf-m-mine {
  margin: var(--space-3) 0 0;
}

.mf-m-price__asof {
  color: var(--text-muted);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
}

/* «♡» and «+ У колекцію» (tasks 179, 184): side by side under the figures, each the edit panel; one alone is full width. */
.mf-m-actions {
  display: flex;
  gap: var(--space-2);
  margin: var(--space-4) 0;
}

.mf-m-actions .ui-btn {
  flex: 1 1 0;
  min-width: 0;
}

.mf-m-actions:not(:has(*)) {
  display: none;
}

.fig-m .pnl--up { color: var(--up); }
.fig-m .pnl--down { color: var(--down); }

.mf-m-lot .ui-m-cell__line {
  justify-content: space-between;
  font-variant-numeric: tabular-nums;
}

.mf-m-lot.is-editing {
  background: var(--surface-2);
}

.mf-m-lot__meta {
  color: var(--text-muted);
  font-size: var(--text-xs);
}

.mf-m-form {
  margin-top: var(--space-3);
}

/* The price's hint must not lift its input above «К-сть» beside it (the shared cell aligns its fields to the end). */
.mf-m-form .ui-m-cell--grid {
  align-items: start;
}

/* The summary's facts (task 183): three in one row when there are three (nothing held on its own — the usual case), two a
   row with «Окремо»'s fourth; a fact's note («68 різних», «з 21 набору», the prices' date) under its number, as the
   desktop's .mf-kpi__note. */
.mf-m .ui-m-summary__pair:has(> :nth-child(3):last-child) {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ui-m-summary__pair .mf-m-fact-note {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--text-xs);
  font-weight: 500;
}

/* ── The figure's price by day (task 189): the set page's chart (set-details-chart.js), full width; a finger reads it
   sideways and still scrolls the page. The legend only when there are a new and a used line: the set page's chips. ── */
.mf-m-chart {
  position: relative;
  height: 220px;
  margin: var(--space-2) calc(-1 * var(--space-1)) 0;
  touch-action: pan-y;
}

.mf-m-chart .price-chart {
  height: 100%;
  min-height: 0;
}

.mf-m-legend {
  max-width: none;
  gap: var(--space-1);
  margin: var(--space-1) calc(-1 * var(--m-gutter)) 0;
  padding: 0 var(--m-gutter);
}

.mf-m-legend .chart-side-legend-item {
  flex: none;
  gap: 6px;
  min-height: var(--touch);
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--surface-1);
  box-shadow: var(--shadow-1);
}

.mf-m-legend .chart-side-legend-item.is-hidden {
  opacity: 0.45;
}

.mf-m-legend .chart-side-legend-text {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.mf-m-legend .chart-side-legend-label,
.mf-m-legend .chart-side-legend-value {
  font-size: var(--text-xs);
}

.mf-m-legend .chart-side-legend-value {
  color: var(--text-muted);
}
