/* PrintCost — light "fresh paper" theme.
   Cool off-white ream-paper surfaces, ink-teal primary (#0e7490) and
   process-magenta accent (#be185d): a CMYK nod that stays readable and
   distinct from the warm-amber powerbill theme on the same domain. */

:root {
  --bg: #f4f6f6;
  --surface: #ffffff;
  --surface-2: #e9f0f1;
  --text: #1d2733;
  --text-dim: #55636e;
  --border: #d8e0e2;
  --pc-good: #0e7a4f;
  --pc-ink: #0e7490;
  --pc-laser: #be185d;
  --pc-tick: rgba(14, 116, 144, 0.08);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #f4f6f6;
    --surface: #ffffff;
    --surface-2: #e9f0f1;
    --text: #1d2733;
    --text-dim: #55636e;
    --border: #d8e0e2;
  }
}
html {
  color-scheme: light;
}

/* ---------- calculator shell ---------- */
.pc {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  margin: 1.4rem 0 1.8rem;
  box-shadow: 0 10px 34px -26px rgba(29, 39, 51, 0.45);
  overflow: hidden;
}
@media (min-width: 54rem) {
  .prose .pc {
    width: min(64rem, calc(100vw - 2.5rem));
  }
}
.pc-sec {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0 0 0.65rem;
}
.pc-note {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin: 0;
  padding: 0 1rem 0.9rem;
}
.pc-note strong {
  color: var(--accent);
}

/* ---------- profile cards ---------- */
.pc-profs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  padding: 0.9rem 1rem;
  background:
    repeating-linear-gradient(0deg, transparent 0 1.1rem, var(--pc-tick) 1.1rem calc(1.1rem + 1px)),
    var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.pc-prof {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  margin: 0;
  padding: 0.6rem 0.7rem 0.75rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 0.6rem;
}
.pc-prof > legend {
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0 0.35rem;
}
.pc-prof[data-pc-prof="ink"] > legend {
  color: var(--pc-ink);
}
.pc-prof[data-pc-prof="laser"] > legend {
  color: var(--pc-laser);
}
.pc-f {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}
.pc-f-name {
  grid-column: 1 / -1;
}
.pc-f > span,
.pc-fil label > span,
.pc-shared label > span {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.pc input[type="text"],
.pc select {
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 0.38rem 0.5rem;
  box-sizing: border-box;
  width: 100%;
  min-height: 2.75rem; /* 44px tap target */
}
.pc input:focus,
.pc select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent);
}
.pc-check {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  color: var(--text);
  cursor: pointer;
  min-height: 2.2rem;
}
.pc-check input {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--primary);
}
/* P015: scoped with :not([hidden]) — the color box is toggled via the hidden
   attribute, so a bare display:grid would resurrect it. */
.pc-colorbox:not([hidden]) {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 0.6rem;
}
.pc-colorbox {
  grid-column: 1 / -1;
}

/* ---------- shared inputs ---------- */
.pc-shared {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.55rem 0.7rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border);
}
.pc-shared label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}
.pc-shared .pc-check {
  grid-column: auto;
  justify-content: flex-start;
}
.pc-covchips {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  align-items: center;
}
.pc-chip {
  font: inherit;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.24rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--primary);
  cursor: pointer;
  min-height: 2.75rem; /* 44px tap target */
  min-width: 2.75rem;
}
.pc-chip:hover {
  border-color: var(--primary);
}
.pc-covwrap {
  display: flex;
  gap: 0.4rem;
}
.pc-covwrap input {
  flex: 1;
  min-width: 0;
}
.pc-covhint {
  font-size: 0.7rem;
  color: var(--text-dim);
}
.pc-paperline {
  grid-column: 2 / -1;
  align-self: center;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  margin: 0;
}
.pc-shared .pc-check {
  align-self: end;
}
.pc-shared .pc-f-wide {
  grid-column: span 2;
}

/* ---------- results ---------- */
.pc-reswrap {
  padding: 0.9rem 1rem 1rem;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.pc-res {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.pc-res th,
.pc-res td {
  padding: 0.42rem 0.5rem;
  border-bottom: 1px dashed var(--border);
  text-align: end;
  font-size: 0.86rem;
  white-space: nowrap;
}
.pc-res thead th {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
}
.pc-res tbody th {
  text-align: start;
  font-weight: 700;
  color: var(--text);
}
.pc-res td {
  font-family: var(--mono);
  color: var(--text);
}
.pc-res td[data-r="mono"],
.pc-res td[data-r="blend"] {
  font-weight: 700;
}
.pc-res td[data-r="blend"] {
  color: var(--primary);
}
.pc-res tbody tr:last-child th,
.pc-res tbody tr:last-child td {
  border-bottom: none;
}

/* ---------- breakeven ---------- */
.pc-be {
  padding: 0.9rem 1rem 1rem;
  border-bottom: 1px solid var(--border);
}
.pc-be-out {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 0.25rem;
}
.pc-be-sub {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin: 0 0 0.7rem;
}
.pc-be-chart {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.pc-legend {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 0.45rem;
}
.pc-dot {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 999px;
  margin-left: 0.6rem;
}
.pc-dot:first-child {
  margin-left: 0;
}
.pc-legnote {
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--text-dim);
}
.pc-dot-a {
  background: var(--pc-ink);
}
.pc-dot-b {
  background: var(--pc-laser);
}

/* ---------- filament ---------- */
.pc-fil {
  padding: 0.9rem 1rem 1rem;
}
.pc-fil-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.55rem 0.7rem;
  margin-bottom: 0.8rem;
}
.pc-fil label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}
.pc-fil-out {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: 0.55rem;
}
.pc-fil-out > div {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  padding: 0.55rem 0.7rem;
}
.pc-fil-out b {
  display: block;
  font-size: 1.05rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.pc-fil-out span {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.pc-fil-note {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin: 0.7rem 0 0;
}

/* ---------- article polish ---------- */
.prose table {
  font-variant-numeric: tabular-nums;
}
.prose table code {
  white-space: nowrap;
}

/* ---------- mobile ---------- */
@media (max-width: 52rem) {
  .pc-profs {
    grid-template-columns: 1fr;
  }
  .pc-shared,
  .pc-fil-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  /* results table -> stacked rows */
  .pc-res thead {
    display: none;
  }
  .pc-res,
  .pc-res tbody,
  .pc-res tr,
  .pc-res th,
  .pc-res td {
    display: block;
  }
  .pc-res tbody tr {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 0.6rem;
    padding: 0.35rem 0.55rem;
    background: var(--bg);
  }
  .pc-res tbody tr:last-child {
    margin-bottom: 0;
  }
  .pc-res tbody th {
    border-bottom: none;
    padding: 0.25rem 0 0.1rem;
    font-size: 0.95rem;
  }
  .pc-res td {
    display: flex;
    justify-content: space-between;
    gap: 0.8rem;
    border-bottom: 1px dashed var(--border);
    font-size: 0.82rem;
  }
  .pc-res td::before {
    content: attr(data-label);
    font-family: var(--font);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-dim);
    align-self: center;
  }
  .pc-res tbody td:last-child {
    border-bottom: none;
  }
}
@media (max-width: 400px) {
  .pc-shared,
  .pc-fil-grid {
    grid-template-columns: 1fr;
  }
  .pc-paperline {
    grid-column: 1 / -1;
  }
  .pc-shared .pc-f-wide {
    grid-column: auto;
  }
}
