/* マイページ「応援してくれた人」— コメント / タップ貢献者ランキング
 *
 * Comments read cool (voice), taps read warm (the heart TikTok actually draws). That split is the whole
 * legend: the tab colour and the value colour agree, so the reader never has to check which list they are in.
 *
 * DELIBERATELY THIN. The ranked rows carry NO type sizing of their own — they wear .phone-rank-list--compact,
 * the gift screen's TOPギフター list, so their density is that list's density by construction rather than by
 * a number copied here that would drift the first time the app is retuned. The first version of this panel
 * styled its own tall rows with progress bars; it read well with five contributors and failed the livers who
 * need it most, who have hundreds. Only the metric colour is added on top.
 *
 * Numbers are tabular-nums and never wrap away from their unit. On a 390px phone the three tiles sit in a
 * ~95px column, where a 5-digit tap count plus its 「回」 overflowed and dropped the unit onto its own line —
 * it read as a rendering bug. The clamp below shrinks the figure instead of breaking it.
 */

.mpc {
  --mpc-comment: #49a6ff;
  --mpc-tap: #ff4d8a;
  --mpc-line: rgba(255, 255, 255, 0.09);
  --mpc-surface: rgba(255, 255, 255, 0.04);
  --mpc-muted: rgba(233, 236, 244, 0.62);
  --mpc-dim: rgba(233, 236, 244, 0.42);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mpc__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.mpc__title {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.01em;
}
/* 誰のデータか — only present when an owner/manager is viewing another liver. */
.mpc__whose {
  display: block;
  font-style: normal;
  font-size: 11px;
  font-weight: 600;
  color: rgba(147, 197, 253, 0.9);
  margin-top: 2px;
}

.mpc__period {
  font-size: 11px;
  color: var(--mpc-dim);
  white-space: nowrap;
  text-align: right;
}
/* 集計時点 — on its own line under the period, so a narrow phone never has to choose between them. */
.mpc__asof {
  display: block;
  font-style: normal;
  font-size: 10px;
  color: rgba(233, 236, 244, 0.34);
  font-variant-numeric: tabular-nums;
}

/* ── period chips ──────────────────────────────── */
/* Eight windows do not fit a phone row, and stacking them would push the data itself below the fold. They
   scroll horizontally inside their own track, so the panel never widens the page. */
.mpc-periods {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 1px;
  /* A flex item's min-width defaults to auto, so without this the chip track refuses to shrink below its
     content and scrolls the PAGE sideways instead of itself — measured at 280px, where eight chips pushed
     the document 137px wide. The overflow-x above only works once the track is allowed to be narrow. */
  min-width: 0;
}
.mpc-periods::-webkit-scrollbar { display: none; }
.mpc-period {
  appearance: none;
  flex: 0 0 auto;
  border: 1px solid var(--mpc-line);
  background: var(--mpc-surface);
  color: var(--mpc-muted);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
  cursor: pointer;
}
.mpc-period.is-on {
  background: rgba(73, 166, 255, 0.14);
  border-color: rgba(73, 166, 255, 0.5);
  color: #cfe6ff;
}
/* カスタム期間の日付入力 — 16px so iOS Safari does not zoom the page on focus. */
.mpc-range {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.mpc-range__input {
  flex: 1 1 40%;
  min-width: 0;
  background: var(--mpc-surface);
  border: 1px solid var(--mpc-line);
  border-radius: 10px;
  color: inherit;
  padding: 7px 8px;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}
.mpc-range__sep { font-size: 11px; color: var(--mpc-dim); }
.mpc-range__go {
  flex: 0 0 auto;
  appearance: none;
  border: 1px solid rgba(73, 166, 255, 0.45);
  background: rgba(73, 166, 255, 0.14);
  color: #cfe6ff;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  min-height: 44px;
  cursor: pointer;
}

.mpc-period:focus-visible { outline: 2px solid var(--mpc-comment); outline-offset: 2px; }

/* ── summary tiles ─────────────────────────────── */
.mpc-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
}
.mpc-tile {
  background: var(--mpc-surface);
  border: 1px solid var(--mpc-line);
  border-radius: 12px;
  padding: 8px;
  min-width: 0;
}
.mpc-tile__label {
  margin: 0 0 3px;
  font-size: 10px;
  color: var(--mpc-muted);
  white-space: nowrap;
}
.mpc-tile__value {
  margin: 0;
  /* never let the figure push its unit onto a second line */
  white-space: nowrap;
  font-size: clamp(15px, 4.2vw, 18px);
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.mpc-tile__value em {
  font-style: normal;
  font-size: 9px;
  font-weight: 700;
  color: var(--mpc-muted);
  margin-left: 1px;
}
.mpc-tile__sub {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  color: var(--mpc-dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── tabs ──────────────────────────────────────── */
.mpc-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.mpc-tab {
  appearance: none;
  border: 1px solid var(--mpc-line);
  background: var(--mpc-surface);
  border-radius: 12px;
  padding: 7px 8px;
  text-align: center;
  color: inherit;
  cursor: pointer;
  min-height: 44px; /* touch target */
}
.mpc-tab b {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--mpc-muted);
}
.mpc-tab small {
  display: block;
  font-size: 10px;
  color: var(--mpc-dim);
  margin-top: 1px;
  font-variant-numeric: tabular-nums;
}
.mpc-tab.is-on {
  background: rgba(73, 166, 255, 0.1);
  border-color: rgba(73, 166, 255, 0.45);
}
.mpc-tab.is-on b { color: var(--mpc-comment); }
.mpc-tab--tap.is-on {
  background: rgba(255, 77, 138, 0.1);
  border-color: rgba(255, 77, 138, 0.45);
}
.mpc-tab--tap.is-on b { color: var(--mpc-tap); }
.mpc-tab:focus-visible { outline: 2px solid var(--mpc-comment); outline-offset: 2px; }

/* ── ranked rows ───────────────────────────────── */
/* Size, padding and layout come from .phone-rank-list--compact. Only the metric colour is ours, so comment
   and tap stay distinguishable at a glance without a second legend. */
.mpc-body .mpc-list em { color: var(--mpc-comment); }
[data-mpc-kind='tap'] .mpc-list em { color: var(--mpc-tap); }

/* How far into the list you are. Without it, a list that stops at 20 of 4,000 reads as "I only have 20
   regulars" — the exact misreading this panel exists to prevent. */
.mpc-count {
  margin: 6px 0 0;
  text-align: right;
  font-size: 10px;
  color: var(--mpc-dim);
  font-variant-numeric: tabular-nums;
}
.mpc-more { width: 100%; }

/* ── 貢献者アイコン ───────────────────────────── */
/* Sized to the compact row, never taller than it: the density is the feature, and an icon that grows the row
   would undo it. A missing or expired picture falls back to an initial rather than a broken-image box. */
.mpc-who {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.mpc-who__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mpc-face {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.08);
}
.mpc-face--none {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: rgba(233, 236, 244, 0.55);
}

/* ── empty / blocked ───────────────────────────── */
.mpc-empty,
.mpc-notice {
  margin: 0;
  padding: 14px 12px;
  text-align: center;
  font-size: 12.5px;
  color: var(--mpc-muted);
  background: var(--mpc-surface);
  border: 1px solid var(--mpc-line);
  border-radius: 12px;
  line-height: 1.6;
}
/* A blocked state must not look like an empty one — same shape, different weight, so "could not load" is
   never mistaken for "nobody engaged". */
.mpc[data-state='error'] .mpc-notice { border-color: rgba(255, 120, 120, 0.35); }
.mpc[data-state='locked'] .mpc-notice { border-color: rgba(255, 194, 75, 0.3); }
