/* Briary PV suite.

   The application shell — head, bar, three-column layout, result panel, rows
   and modals — is the one the window U-value calculator uses, so this sheet
   only adds what is particular to the PV workspace: the step list, the drawing
   area, the modal form grids and the plane table. Load it after
   window-u-value-calculator.css. */

.pvx .wuv__coltitle:first-of-type { margin-top: 0; }

/* ------------------------------------------------------- project summary */

.pvx-summary { font-size: 12px; }
.pvx-summary div {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 3px 0; border-bottom: 1px solid #eaeef2;
}
.pvx-summary div:last-child { border-bottom: 0; }
.pvx-summary span { color: var(--wuv-muted); flex: 0 0 auto; }
.pvx-summary b {
  font-weight: 600; text-align: right; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ------------------------------------------------------------- step list */

/* The steps reuse .wuv-unit so they match the window list, but they are a
   sequence rather than a set, so they carry a number. */
.pvx-stage { counter-increment: pvx-step; }
.wuv-units { counter-reset: pvx-step; }
.pvx-stage .wuv-unit__ref::before {
  content: counter(pvx-step) ". ";
  color: var(--wuv-muted); font-weight: 600;
}
.pvx-stage .wuv-unit__uw { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pvx-stage .wuv-unit__size { line-height: 1.35; }
.pvx-stage.is-active { background: #f6f9fc; }

/* --------------------------------------------------------------- staging */

.pvx-stagehead { min-width: 0; flex: 1 1 260px; }
.pvx-stagehead h3 { margin: 0 0 2px; font-size: 14.5px; line-height: 1.2; color: var(--wuv-ink); }
.pvx .wuv__tip { line-height: 1.4; }

.pvx-canvas { padding: 6px; }
.pvx-svg { width: 100%; height: auto; max-height: 100%; }
.pvx-hit { cursor: pointer; }
.pvx-hit:hover { fill: rgba(39, 75, 109, .07); }
.pvx-empty {
  margin: 0; padding: 40px 20px; text-align: center;
  font-size: 13.5px; line-height: 1.6; color: var(--wuv-muted);
}

/* -------------------------------------------------------------- results */

/* A long label and a long value must never meet: the label may wrap, the
   value stays on one line and keeps its own column. */
.pvx .wuv-breakdown div {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; padding: 4px 0;
}
.pvx .wuv-breakdown span { flex: 1 1 auto; min-width: 0; line-height: 1.35; }
.pvx .wuv-breakdown b { flex: 0 0 auto; white-space: nowrap; text-align: right; }

/* ------------------------------------------------------- outstanding list */

/* A warning that cannot be acted on is just noise, so each one opens the
   modal holding the field and focuses it. */
.pvx-fix {
  background: none; border: 0; padding: 0; margin: 0;
  font: inherit; color: inherit; text-align: left; cursor: pointer;
  text-decoration: underline; text-underline-offset: 2px;
}
.pvx-fix:hover, .pvx-fix:focus-visible { color: var(--wuv-accent); }

/* ---------------------------------------------------------------- modals */

.pvx-grid {
  display: grid; gap: 12px 16px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.pvx-grid > .wuv-row--wide { margin: 0; }

.pvx-note { margin: 0 0 14px; font-size: 12.5px; line-height: 1.55; color: var(--wuv-muted); }
.pvx-note--warn {
  background: var(--wuv-warn); border-left: 3px solid #c8a13a;
  padding: 10px 13px; border-radius: 0 4px 4px 0; color: var(--wuv-ink);
  margin: 16px 0 0;
}
.pvx-hint {
  display: block; margin-top: 3px; font-size: 11.5px; line-height: 1.45;
  color: var(--wuv-muted); font-style: normal;
}

.pvx-months {
  display: grid; gap: 8px; margin-top: 4px;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
}
.pvx-months label { display: grid; gap: 3px; font-size: 11.5px; color: var(--wuv-muted); }
.pvx-months input {
  width: 100%; padding: 5px 7px; border: 1px solid var(--wuv-line);
  border-radius: 4px; font: inherit; font-size: 13px;
}

/* ----------------------------------------------------------- plane table */

/* One row per plane, so the whole roof can be seen and compared at once
   rather than stepping through a picker. */
.pvx-tablewrap { overflow-x: auto; border: 1px solid var(--wuv-line); border-radius: 6px; }
.pvx-table { border-collapse: collapse; width: 100%; min-width: 1010px; font-size: 12.5px; }
.pvx-table th {
  text-align: left; font-size: 11px; font-weight: 600; color: var(--wuv-muted);
  padding: 8px 8px 6px; border-bottom: 1px solid var(--wuv-line);
  background: #f7f9fb; white-space: nowrap; position: sticky; top: 0;
}
.pvx-table td { padding: 5px 6px; border-bottom: 1px solid #eef2f5; vertical-align: middle; }
.pvx-table tr:last-child td { border-bottom: 0; }
.pvx-table tr.is-on td { background: #fbfdff; }
.pvx-table input, .pvx-table select {
  width: 100%; padding: 5px 6px; border: 1px solid var(--wuv-line);
  border-radius: 4px; font: inherit; font-size: 12.5px; background: #fff;
}
.pvx-table input:focus-visible, .pvx-table select:focus-visible {
  outline: 2px solid var(--wuv-accent); outline-offset: -1px;
}
.pvx-col-on { width: 74px; }
.pvx-col-name { min-width: 150px; }
.pvx-col-layout { width: 112px; }
.pvx-col-small { width: 88px; }
.pvx-col-fit { width: 84px; text-align: right; white-space: nowrap; }
.pvx-col-fit b { display: block; font-size: 14px; font-variant-numeric: tabular-nums; }
.pvx-col-fit span { font-size: 11px; color: var(--wuv-muted); }

@media (max-width: 900px) {
  .pvx-stagehead h3 { font-size: 13.5px; }
  .pvx-canvas { padding: 2px; }
  .pvx-table { min-width: 890px; }
}

/* ------------------------------------------------------------ roof modules */

/* The array is laid out as a centred block, so adding or removing a module
   moves the others. Each module is a group with a stable identity, and the
   transition carries it from where it was to where it now belongs. */
.pvx-mod {
  cursor: pointer;
  transition: transform 300ms cubic-bezier(.22, .68, .3, 1), opacity 180ms linear;
}
.pvx-mod rect { transition: opacity 180ms linear; }
.pvx-mod:hover rect { opacity: 0.78; }
.pvx-mod.is-dragging { opacity: 0.45; }
.pvx-mod.is-entering { animation: pvx-mod-in 240ms ease-out both; }

@keyframes pvx-mod-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Bare plane is a target too: clicking it adds a module, and a dragged one
   can be dropped anywhere on it. */
.pvx-planehit { cursor: copy; }
.pvx-canvas.is-dragging { cursor: grabbing; }
.pvx-canvas.is-dragging .pvx-mod,
.pvx-canvas.is-dragging .pvx-planehit { cursor: grabbing; }

/* Someone who has asked for less motion gets the same result, immediately. */
@media (prefers-reduced-motion: reduce) {
  .pvx-mod { transition: none; }
  .pvx-mod.is-entering { animation: none; }
}

/* Actions sit alongside the modal buttons but read as verbs, not places. */
.pvx-action { font-weight: 600; }

/* ------------------------------------------------------- allocate controls */

.pvx-allocate {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  margin-top: 16px; padding: 12px 14px;
  background: #f6f9fc; border: 1px solid var(--wuv-line); border-radius: 6px;
}
.pvx-allocate label { font-size: 12.5px; color: var(--wuv-ink); flex: 1 1 260px; }
.pvx-allocate input {
  width: 90px; padding: 5px 7px; border: 1px solid var(--wuv-line);
  border-radius: 4px; font: inherit; font-size: 13px;
}
.pvx-allocate .btn { margin: 0; }

/* --------------------------------------------------- what goes in the PDF */

.pvx-checks { display: grid; gap: 2px; margin-top: 4px; }
.pvx-check {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 9px 10px; border-radius: 6px; cursor: pointer;
}
.pvx-check:hover { background: #f5f8fb; }
.pvx-check input { margin: 2px 0 0; width: 16px; height: 16px; flex: none; accent-color: var(--wuv-accent); }
.pvx-check b { display: block; font-size: 13.5px; font-weight: 600; }
.pvx-check em { display: block; font-style: normal; font-size: 12px; color: var(--wuv-muted); margin-top: 2px; }
.pvx-check input:focus-visible { outline: 2px solid var(--wuv-accent); outline-offset: 2px; }
.pvx-check--sub { margin-left: 26px; }
.pvx-check.is-off { opacity: .45; cursor: default; }
.pvx-check.is-off:hover { background: none; }
