/* Raise vs. Pizza Calculator (/pizza/). Builds on tokens in styles.css. */

:root {
  --pz-prices: #c62d2d;
  --pz-raise: #4d6b22;
  --pz-pizza: #2b2622;
  --pz-grid: rgba(43, 38, 34, .18);
  --pz-accent: #a32222;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --pz-prices: #ff7a6e;
    --pz-raise: #a9cc6a;
    --pz-pizza: #f2d65c;
    --pz-grid: rgba(243, 230, 204, .18);
    --pz-accent: #f2d65c;
  }
}
:root[data-theme="dark"] {
  --pz-prices: #ff7a6e;
  --pz-raise: #a9cc6a;
  --pz-pizza: #f2d65c;
  --pz-grid: rgba(243, 230, 204, .18);
  --pz-accent: #f2d65c;
}

.pz-sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.pz-layout {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  align-items: start;
  margin: 32px 0;
}
.pz-form { transform: rotate(-.4deg); }
.pz-results { transform: rotate(.4deg); }

.pz-privacy {
  font-size: 0.95rem;
  color: var(--ink-soft);
  background: var(--paper);
  border: 2px dashed var(--ink-soft);
  border-radius: 6px;
  padding: 8px 12px;
  margin: 0 0 18px;
  text-wrap: pretty;
}

.pz-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; min-width: 0; }
.pz-field label { font-weight: 600; font-size: 0.95rem; line-height: 1.3; }
.pz-field input {
  font: inherit;
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  border: 2px solid var(--line-strong);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
}
.pz-field input:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }
.pz-field input[aria-invalid="true"] { border-color: var(--pz-prices); border-width: 3px; }
.pz-field--salary input { font-size: 1.35rem; font-weight: 700; }
.pz-money { display: flex; align-items: center; gap: 6px; font-size: 1.35rem; font-weight: 700; }
.pz-help { margin: 0; font-size: 0.85rem; color: var(--ink-soft); }

.pz-assumptions {
  border: 2px solid var(--ink-soft);
  border-radius: 8px;
  padding: 10px 14px 0;
  margin: 6px 0 0;
}
.pz-assumptions legend { font-weight: 700; padding: 0 6px; }
.pz-legend-note { font-weight: 400; color: var(--ink-soft); font-size: 0.9rem; }
.pz-grid { display: grid; gap: 0 14px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.pz-grid .pz-field { justify-content: flex-end; }
.pz-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--yellow);
  color: #2b2622;
  border-radius: 4px;
  padding: 0 5px;
  vertical-align: 1px;
}

.pz-empty { color: var(--ink-soft); font-style: italic; }
.pz-stats { margin: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.pz-stats[hidden], .pz-line[hidden], .pz-share[hidden] { display: none; }
.pz-stat {
  border: 2px solid var(--line-strong);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--paper);
}
.pz-stat dt { font-size: 0.85rem; font-weight: 600; color: var(--ink-soft); line-height: 1.3; }
.pz-stat dd { margin: 4px 0 0; font-size: 1.35rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.pz-stat dd small { display: block; font-size: 0.8rem; font-weight: 400; color: var(--ink-soft); }
.pz-stat--big { grid-column: 1 / -1; background: var(--yellow); color: #2b2622; }
.pz-stat--big dt { color: #2b2622; }
.pz-stat--big dd { font-size: clamp(2rem, 1.5rem + 2.5vw, 3rem); }
.pz-stat--big dd small { color: #2b2622; }

.pz-line {
  margin: 18px 0 10px;
  padding: 14px 16px;
  border: 3px solid var(--pz-accent);
  border-radius: 8px;
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1.45;
  color: var(--ink);
  text-wrap: pretty;
  transform: rotate(-1deg);
}
.pz-share { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.pz-copied { font-weight: 600; color: var(--pz-accent); }

.pz-chart-card { margin: 32px 0; }
.pz-chart-sub { color: var(--ink-soft); margin: 0 0 14px; max-width: 70ch; text-wrap: pretty; }
.pz-chart-wrap { width: 100%; }
.pz-chart { display: block; width: 100%; height: auto; font-family: inherit; }
.pz-chart .grid { stroke: var(--pz-grid); stroke-width: 1; }
.pz-chart .axis { stroke: var(--ink-soft); stroke-width: 1.5; }
.pz-chart .tick { fill: var(--ink-soft); font-size: 13px; }
.pz-chart .axis-title { fill: var(--ink-soft); font-size: 13px; font-weight: 600; }
.pz-chart .line { fill: none; stroke-width: 3.5; stroke-linejoin: round; stroke-linecap: round; }
.pz-chart .line--prices { stroke: var(--pz-prices); }
.pz-chart .line--raise { stroke: var(--pz-raise); stroke-dasharray: 10 6; }
.pz-chart .line--pizza { stroke: var(--pz-pizza); stroke-dasharray: 2 6; stroke-width: 4.5; }
.pz-chart .end { font-size: 13px; font-weight: 700; }
.pz-chart .end--prices { fill: var(--pz-prices); }
.pz-chart .end--raise { fill: var(--pz-raise); }
.pz-chart .end--pizza { fill: var(--pz-pizza); }
.pz-chart .dot--prices { fill: var(--pz-prices); }
.pz-chart .dot--raise { fill: var(--pz-raise); }
.pz-chart .dot--pizza { fill: var(--pz-pizza); }
.pz-chart .empty { fill: var(--ink-soft); font-size: 16px; font-style: italic; }

.pz-legend { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.9rem; color: var(--ink-soft); }
.pz-legend li { display: flex; align-items: center; gap: 8px; }
.pz-key { display: inline-block; width: 28px; height: 0; border-top: 4px solid; }
.pz-key--prices { border-color: var(--pz-prices); }
.pz-key--raise { border-color: var(--pz-raise); border-top-style: dashed; }
.pz-key--pizza { border-color: var(--pz-pizza); border-top-style: dotted; }

.pz-table-details { margin-top: 14px; }
.pz-table-details summary { cursor: pointer; font-weight: 600; color: var(--link); }
.pz-table-details summary:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }
.pz-table-scroll { overflow-x: auto; }
.pz-table { border-collapse: collapse; margin-top: 10px; width: 100%; font-variant-numeric: tabular-nums; font-size: 0.95rem; }
.pz-table caption { text-align: left; color: var(--ink-soft); font-size: 0.9rem; padding-bottom: 6px; }
.pz-table th, .pz-table td { border-bottom: 1px solid var(--pz-grid); padding: 6px 8px; text-align: right; }
.pz-table th:first-child, .pz-table td:first-child { text-align: left; }

@media (max-width: 600px) {
  .pz-form, .pz-results { transform: none; }
  .card.pz-form, .card.pz-results, .card.pz-chart-card { padding: 18px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .pz-line, .pz-form, .pz-results { transform: none; }
}

.pz-stat--wide { grid-column: 1 / -1; }
.pz-bump-read:empty { display: none; }
.pz-assume-note { margin-top: 10px; font-weight: 600; color: var(--pz-accent); }
.pz-assume-note:empty { display: none; }
