/* Cost per use calculator: page layout on top of the shared /style.css.
   Kept in this folder so the shared stylesheet stays untouched. Same layout as the other
   calculators: graph and answer on the left, a short inputs panel on the right
   (stacked graph, inputs, stats on phones). Everything is scoped to body.cpu. */

.cpu .hero-head { display: block; padding-block: 26px 6px; }
.cpu .hero-head h1 { font-size: var(--step-3); max-width: none; margin-top: 6px; }
.cpu .workspace { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px 40px; align-items: start; padding-top: 18px; }
.cpu .stage { position: sticky; top: 12px; display: grid; min-width: 0; }
.cpu .answer { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 4px 18px; }
.cpu .answer .label { flex-basis: 100%; }
.cpu .answer .big { font-size: clamp(2.8rem, 2rem + 2.6vw, 4.2rem); }
.cpu .answer .big.is-ahead { color: var(--slate); }
.cpu .answer-line { padding-bottom: 6px; max-width: 46ch; }
.cpu .landscape { padding-top: 14px; }
.cpu .legend-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 24px; padding-top: 10px; }
.cpu .legend { pointer-events: none; }
.cpu .legend span { display: inline-flex; align-items: center; gap: 7px; }


/* Stats under the graph */
.cpu .stats { margin-top: 22px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 640px) { .cpu .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cpu .stat { align-content: start; }
.cpu .stat .sub { font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.cpu .stat-gold .v { color: var(--gold); }
.cpu .stat-rust .v { color: var(--rust); }

/* Inputs panel */
.cpu .panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 18px; display: grid; gap: 4px; min-width: 0; }
.cpu .panel-head { display: grid; gap: 10px; padding-bottom: 12px; }
.cpu .panel-head h2 { font-size: 1.45rem; }
.cpu .panel-head .btn-row { flex-wrap: nowrap; }
.cpu .panel-head .inline-field { flex: 1; min-width: 0; }
.cpu .panel-head .inline-field select { width: 100%; }
.cpu .simple { display: grid; grid-template-columns: minmax(0, 1fr); border-top: 1px solid var(--ink); }
.cpu .simple .col { border: 0; margin: 0; padding: 14px 0; display: grid; gap: 12px; align-content: start; min-width: 0; }
.cpu .simple .col + .col { border-top: 1px solid var(--line); }
.cpu .simple .col:last-child { padding-bottom: 4px; }
.cpu .simple legend { float: left; width: 100%; padding: 0; font-family: var(--font-display); font-size: 1.05rem; }
.cpu .simple legend + * { clear: both; }
.cpu .row2 { gap: 10px; }
.cpu .row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.cpu .field-hint { font-size: 0.78rem; color: var(--muted); line-height: 1.4; }
.cpu .pct input { padding-right: 28px; }
.cpu .privacy { margin-top: 8px; }
.cpu input[type="text"] { min-height: 42px; }

/* Graph extras */
.cpu .chip-save { width: 12px; height: 10px; border: 0; border-radius: 2px; background: var(--gold-area); opacity: 0.3; }
.cpu legend .chip { margin-right: 8px; vertical-align: middle; position: relative; top: -2px; }
.cpu .pct input { padding-right: 52px; }
.chart-box .l-cheap { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linejoin: round; }
.chart-box .save-area { fill: var(--gold-area); fill-opacity: 0.2; }
.chart-box .lose-area { fill: var(--ink); fill-opacity: 0.05; }
.chart-box .buy-dot { fill: var(--paper); stroke: var(--ink); stroke-width: 1.4; }
.chart-box .buy-dot.q { stroke: var(--gold); stroke-width: 2; }
.chart-box .be-line { stroke: var(--gold); stroke-width: 1.2; stroke-dasharray: 3 3; }
.chart-box .be-dot { fill: var(--gold); stroke: var(--paper); stroke-width: 2.5; }
.chart-box .be-label { font-family: var(--font-body); font-style: normal; font-size: 12.5px; font-weight: 600; fill: var(--gold); }
.chart-box .need-line { stroke: var(--ink); stroke-width: 1; stroke-opacity: 0.35; }
.chart-box .out-v { font-size: 13px; font-weight: 700; }
.chart-box .halo { paint-order: stroke; stroke: var(--paper); stroke-width: 4px; stroke-linejoin: round; }
.chart-box .start-dot { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5; }
.chart-box .hover-dot.ink { fill: var(--ink); }
.chart-box .note { font-family: var(--font-body); font-style: normal; font-size: 12px; fill: var(--muted); }

/* Second graph: cost per use as you go */
.cpu .per-use { padding-top: 64px; display: grid; gap: 14px; }
.cpu .pu-msg { font-size: 1.05rem; max-width: 70ch; }
.cpu .pu-msg b { font-weight: 700; }
.cpu .pu-msg .g { color: var(--gold); }
.cpu .pu-box { border-top: 1px solid var(--ink); padding-top: 8px; }

/* Reading: one content width, heading left and text right on wide screens */
.cpu .prose, .cpu .disclaimer { max-width: none; }
@media (min-width: 900px) {
  .cpu .section.prose { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); column-gap: 48px; row-gap: 0; align-items: start; }
  .cpu .section.prose > h2 { grid-column: 1; grid-row: 1 / span 30; }
  .cpu .section.prose > :not(h2) { grid-column: 2; margin-bottom: 16px; }
}
.cpu .sources { font-size: var(--step--1); color: var(--muted); }

@media (max-width: 1200px) and (min-width: 961px) { .cpu .workspace { grid-template-columns: minmax(0, 1fr) 330px; gap: 28px; } }
@media (max-width: 960px) {
  .cpu .workspace { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .cpu .stage { display: contents; }
  .cpu .stage .answer { order: 1; }
  .cpu .stage .landscape { order: 2; }
  .cpu .panel { order: 3; margin-top: 20px; }
  .cpu .stage .stats { order: 4; margin-top: 28px; }
}
@media (max-width: 960px) and (min-width: 600px) {
  .cpu .simple { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .cpu .simple .col:nth-child(2) { border-top: 0; border-left: 1px solid var(--line); padding-left: 18px; grid-row: span 2; }
  .cpu .simple .col:nth-child(1), .cpu .simple .col:nth-child(3) { padding-right: 18px; }
}
@media (max-width: 600px) {
  .cpu .hero-head { padding-block: 18px 0; }
  .cpu .hero-head h1 { font-size: 1.6rem; }
  .cpu .hero-head .eyebrow { display: none; }
  .cpu .answer .big { font-size: 2.9rem; }
  .cpu .answer-line { font-size: 0.85rem; flex-basis: 100%; padding-bottom: 0; }
  .cpu .landscape { padding-top: 6px; }
  .cpu .panel { padding: 14px 14px 16px; margin-inline: -4px; }
  .cpu .legend-row { gap: 6px 14px; padding-top: 6px; }
  .cpu .legend { gap: 2px 14px; font-size: 0.8rem; }
  .cpu .panel { margin-top: 14px; }
}

/* While a number is invalid, keep the last result but fade it. */
.cpu .is-stale .landscape, .cpu .is-stale .stats { opacity: 0.35; transition: opacity 0.15s; }
