/* /btc-production-cost (src/pages/production-cost.js, public/static/production-cost.js). Phone redesign 7 Nov: the result
   first, the two inputs on the page, a heat grid that fits 360 px, the miner list with photos. 44 px taps. */
.pg-pcm .pcm .lead { margin-bottom: 0; }
@media (max-width: 900px) { .pg-pcm .hw-store > .hw-aside { order: 2; } }   /* the tools menu after the answer on phones */
.pcm [hidden] { display: none !important; }
.pcm-ci { display: inline-block; flex: none; vertical-align: middle; border-radius: 50%; object-fit: contain; }
.pcm-card, .pcm-hero { background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: 16px; padding: 16px; }
.pcm-card { margin-top: 12px; }
.pcm-card h2 { margin: 0 0 10px; font-size: 18px; line-height: 1.25; }
.pcm-note { margin: 4px 0 0; font-size: 13px; color: hsl(var(--muted-foreground)); }
.pcm-step { display: flex; align-items: center; gap: 8px; }
.pcm-step .n { display: grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 50%; background: #15233b; color: #fff; font-size: 13px; font-weight: 700; }
:root[data-theme="dark"] .pcm-step .n { background: #3a4d6b; }
@keyframes pcm-fl { from { background: #fff3b0; } to { background: transparent; } }
.pcm-flash { animation: pcm-fl .5s; }

/* the result */
.pcm-k { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: hsl(var(--muted-foreground)); }
.pcm-big { display: inline-block; margin: 4px 0 0; border-radius: 8px; font-size: clamp(32px, 9vw, 40px); font-weight: 800; line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.pcm-big.good { color: var(--pos); } .pcm-big.bad { color: var(--neg); }
.pcm-say { margin: 6px 0 12px; font-size: 15px; color: hsl(var(--muted-foreground)); }
.pcm-say b { color: hsl(var(--foreground)); }
.pcm-verdict { display: inline-block; margin-bottom: 8px; padding: 2px 8px; border-radius: 8px; font-size: 14px; font-weight: 700; }
.pcm-verdict.good { background: var(--green-100); color: var(--pos); } .pcm-verdict.bad { background: var(--red-100); color: var(--neg); }
.pcm-vs { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 6px 10px; font-size: 14px; }
.pcm-vs .t { color: hsl(var(--muted-foreground)); }
.pcm-vs .bar { height: 14px; border-radius: 7px; background: hsl(var(--muted)); box-shadow: inset 0 0 0 1px hsl(var(--border)); overflow: hidden; }
.pcm-vs .bar i { display: block; height: 100%; border-radius: 7px; transition: width .25s; }
.pcm-vs .bar i.good { background: var(--green-500); } .pcm-vs .bar i.bad { background: var(--red-500); } .pcm-vs .bar i.buy { background: #f7931a; }
.pcm-vs .v { font-weight: 700; text-align: end; font-variant-numeric: tabular-nums; }
.pcm-picked { display: flex; align-items: center; gap: 10px; margin: 12px 0 0; padding: 8px 10px; border-radius: 12px; background: hsl(var(--muted)); font-size: 14px; }
.pcm-picked img { flex: none; border-radius: 6px; background: #fff; object-fit: contain; }
.pcm-picked .tx { flex: 1; min-width: 0; } .pcm-picked b { display: block; line-height: 1.25; } .pcm-picked small { font-size: 12px; color: hsl(var(--muted-foreground)); }
.pcm-link { min-width: 44px; min-height: 44px; padding: 0 4px; border: 0; background: none; color: inherit; font: inherit; font-size: 14px; text-decoration: underline; cursor: pointer; }
.pcm-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.pcm-fact { min-width: 0; padding: 10px 12px; border-radius: 12px; background: hsl(var(--muted)); }
.pcm-fact .l, .pcm-fact .s { font-size: 12px; color: hsl(var(--muted-foreground)); }
.pcm-fact .v { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* the two inputs */
.pcm-f { display: block; margin: 0 0 6px; }
.pcm-f .lab { display: block; margin-bottom: 6px; font-size: 15px; font-weight: 600; }
.pcm-box { display: flex; align-items: center; gap: 6px; min-height: 48px; padding: 0 12px; border: 1.5px solid hsl(var(--field-border)); border-radius: 12px; background: hsl(var(--card)); }
.pcm-box:focus-within { border-color: var(--pos); box-shadow: 0 0 0 3px rgb(34 197 94 / .18); }
.pcm-box input { flex: 1; min-width: 0; height: 46px; border: 0; outline: 0; background: transparent; color: inherit; font: inherit; font-size: 16px; }
.pcm-box .pre, .pcm-box .suf { color: hsl(var(--muted-foreground)); font-size: 15px; white-space: nowrap; }
.pcm-help { display: block; margin-top: 8px; font-size: 13px; color: hsl(var(--muted-foreground)); }
.pcm-err { margin-top: 6px; font-size: 13px; color: var(--neg); }
.pcm-s2 { margin-top: 18px !important; }
.pcm-chips, .pcm-seg { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pcm-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border: 1.5px solid hsl(var(--field-border) / .6); border-radius: 999px; background: hsl(var(--card));
  color: inherit; font: inherit; font-size: 14px; line-height: 1.1; cursor: pointer; }
.pcm-chip small { font-size: 12px; color: hsl(var(--muted-foreground)); }
.pcm-chip[aria-pressed="true"] { border-color: #15233b; background: #15233b; color: #fff; }
.pcm-chip[aria-pressed="true"] small { color: #c9d3e0; }
:root[data-theme="dark"] .pcm-chip[aria-pressed="true"] { border-color: var(--green-400); background: var(--green-100); color: hsl(var(--foreground)); }

/* the heat grid: fits 360 px; full figures from 600 px */
.pcm-grid { display: grid; grid-template-columns: 50px repeat(7, minmax(0, 1fr)); gap: 3px; margin-top: 10px; }
.pcm-grid .h { align-self: end; padding-bottom: 2px; font-size: 11.5px; font-weight: 600; text-align: center; color: hsl(var(--muted-foreground)); }
.pcm-grid .h.r { align-self: center; text-align: start; font-size: 12px; line-height: 1.15; color: hsl(var(--foreground)); }
.pcm-grid .h.r small { display: block; font-size: 10.5px; font-weight: 400; color: hsl(var(--muted-foreground)); }
.pcm-grid .cell { min-width: 0; min-height: 44px; padding: 0 1px; border: 0; border-radius: 8px; font: inherit; font-size: 12.5px; font-weight: 700; line-height: 1.1; cursor: pointer; font-variant-numeric: tabular-nums; }
.pcm-grid .l, .pcm-grid .cell small, .pcm-wide { display: none; }
.pcm-grid .cell.ok { background: var(--green-100); color: var(--green-700); }
.pcm-grid .cell.bad { background: var(--red-100); color: var(--red-700); }
.pcm-grid .cell.on { outline: 2.5px solid hsl(var(--foreground)); outline-offset: 1px; }
.pcm-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px; font-size: 13px; }
.pcm-legend span::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-inline-end: 6px; border-radius: 3px; vertical-align: -2px; }
.pcm-legend .ok::before { background: var(--green-100); box-shadow: inset 0 0 0 1px var(--green-500); } .pcm-legend .bad::before { background: var(--red-100); box-shadow: inset 0 0 0 1px var(--red-500); }
@media (min-width: 600px) {
  .pcm-grid { grid-template-columns: 76px repeat(7, minmax(0, 1fr)); gap: 4px; }
  .pcm-grid .cell { min-height: 52px; font-size: 14px; }
  .pcm-grid .s, .pcm-pv { display: none; }
  .pcm-grid .l { display: inline; } .pcm-grid .cell small { display: block; margin-top: 2px; font-size: 11.5px; font-weight: 600; opacity: .85; }
  .pcm-grid .h { font-size: 12.5px; }
  .pcm-wide { display: block; }
}

/* the miner list */
.pcm-tools { display: flex; flex-direction: column; gap: 10px; margin: 12px 0 6px; }
.pcm-seg { margin-top: 0; }
.pcm-mlist { margin: 0; padding: 0; list-style: none; }
.pcm-m { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: start; gap: 4px 10px; padding: 12px 0; border-top: 1px solid hsl(var(--border)); }
.pcm-m:first-child { border-top: 0; }
.pcm-m .ph { grid-row: 1 / 3; line-height: 0; }
.pcm-m .ph img { width: 52px; height: 39px; border: 1px solid hsl(var(--border)); border-radius: 8px; background: #fff; object-fit: contain; }
.pcm-m .nm { min-width: 0; font-size: 15px; font-weight: 600; line-height: 1.25; color: inherit; text-decoration: none; }
.pcm-m .nm:hover { text-decoration: underline; }
.pcm-m .meta { display: block; margin-top: 2px; font-size: 13px; font-weight: 400; color: hsl(var(--muted-foreground)); }
.pcm-m .cost { text-align: end; white-space: nowrap; }
.pcm-m .cost b { display: block; font-size: 16px; font-variant-numeric: tabular-nums; }
.pcm-m .tag { display: inline-block; margin-top: 2px; padding: 1px 6px; border-radius: 6px; font-size: 12px; font-weight: 700; }
.pcm-m .tag.good { background: var(--green-100); color: var(--pos); } .pcm-m .tag.bad { background: var(--red-100); color: var(--neg); }
.pcm-m .act { grid-column: 1 / 4; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.pcm-m .act .pcm-btn { flex: 1 1 auto; }
.pcm-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 12px; border: 1.5px solid hsl(var(--field-border) / .6); border-radius: 12px;
  max-width: 100%; background: hsl(var(--card)); color: inherit; font: inherit; font-size: 14px; font-weight: 600; line-height: 1.2; text-align: center; text-decoration: none; cursor: pointer; }
.pcm-btn.use[aria-pressed="true"] { border-color: #15233b; background: #15233b; color: #fff; }
.pcm-btn.buy { border-color: transparent; background: var(--green-100); color: var(--green-700); }
.pcm-more { width: 100%; margin-top: 8px; }
.pcm-none { padding: 14px 0; font-size: 14px; color: hsl(var(--muted-foreground)); }
.pcm-how { margin-top: 12px; }
.pcm-how summary { display: flex; align-items: center; justify-content: space-between; min-height: 44px; font-weight: 600; list-style: none; cursor: pointer; }
.pcm-how summary::-webkit-details-marker { display: none; }
.pcm-how summary::after { content: "+"; font-size: 22px; color: hsl(var(--muted-foreground)); }
.pcm-how[open] summary::after { content: "–"; }
.pcm-how p { margin: 6px 0; font-size: 14px; color: hsl(var(--muted-foreground)); }
.pcm-share { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pcm-live { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 14px 0 0; font-size: 13px; color: hsl(var(--muted-foreground)); }

/* the details bar (phones) */
.pcm-dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  border: 0; background: #13202c; color: #fff; font: inherit; text-align: start; cursor: pointer; transform: translateY(110%); transition: transform .25s; }
.pcm-dock.on { transform: none; }
.pcm-dock[hidden] { display: none; }
.pcm-dock .tx { flex: 1; min-width: 0; line-height: 1.25; }
.pcm-dock b { font-size: 18px; } .pcm-dock small { display: block; font-size: 13px; opacity: .8; } .pcm-dock .bad { color: #ff9aab; }
.pcm-dock .up { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; background: rgb(255 255 255 / .12); }
@media (max-width: 759px) { .pg-pcm .ftr { padding-bottom: 76px; } }

/* side by side from 760 px: the inputs on the left, the result on the right (sticky) */
@media (min-width: 760px) {
  .pcm-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
  .pcm-right { position: sticky; top: 12px; order: 2; }
  .pcm-left { order: 1; }
  .pcm-left .pcm-card { margin-top: 0; }
  .pcm-dock { display: none !important; }
  .pcm-tools { flex-direction: row; align-items: center; justify-content: space-between; }
  .pcm-tools .pcm-q { flex: 1; max-width: 360px; }
  .pcm-m { grid-template-columns: 52px minmax(0, 1fr) auto auto; align-items: center; }
  .pcm-m .ph { grid-row: auto; }
  .pcm-m .act { grid-column: auto; margin-top: 0; flex-wrap: nowrap; }
}
@media (prefers-reduced-motion: reduce) { .pcm-flash { animation: none; } .pcm-vs .bar i, .pcm-dock { transition: none; } }
@media print { .pcm-dock, .pcm-share, .pcm-chips { display: none; } }
