/* © 2026 Peter G (Peter's HVAC Advisory). All rights reserved. */
/* P-H face. Shared axis and dome classes live in styles.css. */
:is(#ph-body, .ph-body) .ph-figure {
    margin: 0;
}

:is(#ph-body, .ph-body) .ph-diagram {
    display: block;
    width: 100%;
    height: auto;
}

.ph-stage {
    position: relative;
}

:is(#ph-overlay, .ph-overlay) {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    margin: 0;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    pointer-events: none;
}

:is(#ph-overlay, .ph-overlay).is-off {
    visibility: hidden;
}

:is(#ph-body, .ph-body) .ph-callout,
:is(#ph-body, .ph-body) .ph-small {
    display: inline;
}

:is(#ph-body, .ph-body) .ph-isotherm {
    fill: none;
    stroke: var(--ph-isotherm);
    stroke-width: 1.25;
    stroke-linejoin: round;
    stroke-linecap: round;
}

:is(#ph-body, .ph-body) .ph-isotherm-label {
    fill: var(--ph-isotherm);
    font-size: 11px;
    font-family: "Segoe UI", system-ui, sans-serif;
}

:is(#ph-body, .ph-body) .ph-station-label {
    fill: var(--text);
    font-size: 13px;
    font-weight: 700;
    font-family: "Segoe UI", system-ui, sans-serif;
}

:is(#ph-body, .ph-body) .ph-unplottable {
    fill: var(--text);
    font-size: 18px;
    font-weight: 700;
    font-family: "Segoe UI", system-ui, sans-serif;
    dominant-baseline: middle;
}

:is(#ph-body, .ph-body) .ph-isentrope {
    stroke: var(--text-light);
    stroke-width: 1;
}

:is(#ph-body, .ph-body) .ph-isentrope-s1 {
    stroke: var(--text-light);
    stroke-width: 1.5;
}

html.dark :is(#ph-body, .ph-body) .ph-isentrope,
html.dark :is(#ph-body, .ph-body) .ph-isentrope-s1 {
    stroke: #9aa8bc;
}

:is(#ph-body, .ph-body) .ph-cycle,
:is(#ph-body, .ph-body) .ph-compression {
    stroke: var(--ph-cycle);
    stroke-width: 1.5;
}

#ref-compare-body.ph-compare-chart .ph-cycle,
#ref-compare-body.ph-compare-chart .ph-compression {
    fill: none;
    stroke: var(--ph-current);
    stroke-width: 2.5;
    stroke-dasharray: none;
}

#ref-compare-body.ph-compare-chart .ph-point,
#ref-compare-body.ph-compare-chart .ph-dew-ring,
#ref-compare-body.ph-compare-chart .ph-dew-core {
    fill: var(--ph-current);
    stroke: var(--ph-current);
    stroke-width: 1.5;
}

#ref-compare-body.ph-compare-chart .ph-cycle.ph-cycle-compare,
#ref-compare-body.ph-compare-chart .ph-compression.ph-cycle-compare {
    fill: none;
    stroke: var(--ph-compare);
    stroke-width: 1.5;
    stroke-dasharray: none;
    opacity: 1;
}

#ref-compare-body.ph-compare-chart .ph-point.ph-cycle-compare,
#ref-compare-body.ph-compare-chart .ph-dew-ring.ph-cycle-compare,
#ref-compare-body.ph-compare-chart .ph-dew-core.ph-cycle-compare {
    fill: var(--ph-compare);
    stroke: var(--ph-compare);
    stroke-width: 1;
    opacity: 1;
}

:is(#ph-overlay, .ph-overlay) .ph-target {
    stroke: var(--ph-target);
    fill: var(--ph-target);
}

:is(#ph-overlay, .ph-overlay) .ph-cycle.ph-target,
:is(#ph-overlay, .ph-overlay) .ph-compression.ph-target {
    fill: none;
    stroke: var(--ph-target);
    stroke-width: 2.5;
    stroke-dasharray: 8 5;
}

:is(#ph-overlay, .ph-overlay) .ph-point.ph-target,
:is(#ph-overlay, .ph-overlay) .ph-dew-ring.ph-target {
    fill: var(--ph-target);
    stroke: var(--ph-target);
    stroke-width: 1.5;
}

html.dark :is(#ph-overlay, .ph-overlay) .ph-dew-core.ph-target {
    stroke: var(--ph-target);
    fill: var(--ph-target);
}

:is(#ph-body, .ph-body) .ph-callout { font-size: 11px; }
:is(#ph-body, .ph-body) .ph-small,
:is(#ph-body, .ph-body) .ph-axis-label { font-size: 10px; }
:is(#ph-body, .ph-body) .ph-grid-minor { fill: none; stroke: var(--text-light); stroke-width: 1; opacity: 0.35; }

:is(#ph-body, .ph-body) .ph-axis-h1,
:is(#ph-body, .ph-body) .ph-axis-h2,
:is(#ph-body, .ph-body) .ph-axis-h4,
:is(#ph-body, .ph-body) .ph-axis-h41 {
    fill: var(--primary-blue);
    font-size: 18px;
    font-weight: 700;
}

:is(#ph-body, .ph-body) .ph-axis-h23 {
    fill: var(--danger);
    font-size: 18px;
    font-weight: 700;
}

:is(#ph-body, .ph-body) .ph-cycle-ptick {
    fill: none;
    stroke: var(--text-light);
    stroke-width: 1;
}

html.dark :is(#ph-body, .ph-body) .ph-cycle-ptick {
    stroke: #9aa8bc;
}

#ph-face[hidden] {
    display: none;
}

#ph-face {
    width: auto;
    margin-left: -1rem;
    margin-right: -1rem;
}

#ph-face .ph-face-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    position: sticky;
    top: calc(37px + env(safe-area-inset-top, 0px));
    z-index: 2;
    background: var(--light-bg);
    scroll-margin-top: calc(60px + env(safe-area-inset-top, 0px));
}

#ph-face #ph-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

#ph-face .ph-back {
    margin: 0;
}

#ph-target-air {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    margin: 8px 0 0;
}

#ph-target-air .ph-target-spacer {
    flex: 1 1 0;
    min-width: 0;
}

#ph-target-air .ph-target-help-side {
    align-self: stretch;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
}

#ph-face .ph-target-help {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 44px;
    height: 44px;
    margin: 0;
    color: var(--text);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
}

#ph-face .ph-target-help:hover {
    text-decoration: underline;
}

#ph-target-air .ph-target-wb {
    margin-right: 8px;
}

#ph-target-air label {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    width: max-content;
    max-width: 100%;
    min-width: 0;
    color: var(--text-light);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.15;
    white-space: nowrap;
}

#ph-target-air .ph-target-line {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 4px;
    width: max-content;
}

#ph-target-air input {
    box-sizing: border-box;
    flex: 0 0 auto;
    width: calc(6ch + 0.8rem + 2px);
    min-height: 44px;
    margin: 0;
    padding: 0.35rem 0.4rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 1rem;
    font-weight: 700;
}

#ph-target-air .ph-target-unit {
    flex: 0 0 auto;
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 700;
}

.ref-calc-page.ph-on .calc-display,
.ref-calc-page.ph-on .ref-field-grid,
.ref-calc-page.ph-on #ref-calc-list,
.ref-calc-page.ph-on #ref-calc-ops {
    display: none;
}

.ref-calc-page.ph-on #clear-step-btn,
.ref-calc-page.ph-on #clear-all-btn {
    display: none;
}

#ph-outputs[hidden] {
    display: none;
}

#ph-outputs {
    margin: 8px 0 0;
}

#ph-outputs .ph-strip,
:is(#ph-body, .ph-body) .ph-strip {
    margin: 0;
    padding: 0;
}

#ph-outputs .ph-strip-row,
:is(#ph-body, .ph-body) .ph-strip-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin: 0;
    padding: 2px 0;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-size: 0.82rem;
    line-height: 1.35;
}

#ph-outputs .ph-strip-value,
:is(#ph-body, .ph-body) .ph-strip-value {
    font-weight: 700;
    text-align: right;
}

#ph-outputs .ph-strip-row.ph-target-heading {
    font-weight: 700;
}

#ph-outputs .ph-strip-note,
:is(#ph-body, .ph-body) .ph-strip-note {
    margin: 8px 0 0;
    color: var(--danger);
    font-size: 0.82rem;
    line-height: 1.35;
}

#ph-outputs .ph-strip-note.ph-strip-note-plain,
:is(#ph-body, .ph-body) .ph-strip-note.ph-strip-note-plain {
    color: var(--text);
}

:is(#ph-body, .ph-body) .ph-volume {
    fill: none;
    stroke: var(--text-light);
    stroke-width: 1;
    stroke-dasharray: 4 3;
    stroke-linejoin: round;
    stroke-linecap: round;
}

:is(#ph-body, .ph-body) .ph-volume-v1 {
    stroke: var(--primary-blue);
    stroke-width: 1.5;
    stroke-dasharray: none;
}

html.dark :is(#ph-body, .ph-body) .ph-volume {
    stroke: #9aa8bc;
}

html.dark :is(#ph-body, .ph-body) .ph-volume-v1 {
    stroke: #5eead4;
}

:is(#ph-body, .ph-body) .ph-volume-label,
:is(#ph-body, .ph-body) .ph-isentrope-label,
:is(#ph-body, .ph-body) .ph-quality-label {
    fill: var(--text-light);
    font-size: 18px;
    font-weight: 700;
    font-family: "Segoe UI", system-ui, sans-serif;
}

:is(#ph-body, .ph-body) .ph-quality {
    fill: none;
    stroke: var(--text-light);
    stroke-width: 1;
    stroke-dasharray: 4 3;
    stroke-linejoin: round;
    stroke-linecap: round;
}

html.dark :is(#ph-body, .ph-body) .ph-quality {
    stroke: #9aa8bc;
}

:is(#ph-body, .ph-body) .ph-h-drop {
    fill: none;
    stroke: var(--text-light);
    stroke-width: 1;
    stroke-dasharray: 4 3;
    stroke-linecap: round;
}

html.dark :is(#ph-body, .ph-body) .ph-h-drop {
    stroke: #9aa8bc;
}

:is(#ph-body, .ph-body) .ph-chart-note {
    margin: 8px 0 0;
    color: var(--text);
    font-size: 0.82rem;
    line-height: 1.35;
}

.ph-png-host {
    position: fixed;
    left: -12000px;
    top: 0;
    width: 760px;
    height: 625px;
    overflow: hidden;
    pointer-events: none;
}

#ref-saved-card {
    max-width: 100%;
    overflow-x: hidden;
}

.ref-report-frame {
    border: 2px solid var(--report-frame);
    border-radius: 18px;
    padding: 6px;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

.ref-report-paper {
    border: 1px solid var(--report-frame);
    border-radius: 10px;
    background: var(--report-paper);
    padding: 8px;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

.ref-report-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    column-gap: 12px;
    margin: 0 0 8px;
    padding: 6px 8px;
    border-radius: 8px;
    background: var(--report-bar, var(--report-band));
    color: var(--report-bar-ink, var(--report-ink));
    font-weight: 700;
    text-align: center;
    overflow-wrap: anywhere;
}

.ref-report-bar-left,
.ref-report-bar-right {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow-wrap: normal;
    font-weight: 400;
}

.ref-report-bar-left {
    text-align: left;
}

.ref-report-bar-right {
    text-align: right;
}

.ref-report-bar-name {
    font-weight: 700;
    white-space: nowrap;
    text-align: center;
}

.ref-report-job p {
    margin: 0;
    overflow-wrap: anywhere;
}

.ref-report-job-label {
    font-weight: 700;
    color: var(--report-unit);
}

.ref-report-job-value {
    color: var(--report-ink);
}

.ref-report-table {
    width: 100%;
    max-width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    overflow-wrap: anywhere;
}

.ref-report-table th,
.ref-report-table td {
    padding: 3px 4px;
    text-align: left;
    vertical-align: top;
    overflow-wrap: anywhere;
    word-break: break-word;
    color: var(--report-ink);
    border-bottom: 1px solid var(--report-rule);
}

.ref-report-table th {
    font-weight: 700;
}

.ref-report-value {
    font-weight: 700;
}

.ref-report-unit {
    color: var(--report-unit);
}

.ref-report-plain {
    background: var(--report-paper);
}

.ref-report-band {
    background: var(--report-band);
}

.ref-report-group td {
    font-weight: 700;
}

.ref-report-note td {
    color: var(--report-unit);
}

.ref-report-date,
.ref-report-version,
.ref-report-footer {
    margin: 8px 0 0;
    color: var(--report-unit);
    overflow-wrap: anywhere;
}

.ref-report-cycle {
    margin: 8px 0 0;
    color: var(--report-ink);
    overflow-wrap: anywhere;
}

#ref-saved-card-chart {
    max-width: 100%;
    overflow-x: hidden;
    margin-top: 8px;
}

.term-note-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    margin: 0 0 0 4px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--primary-blue);
    font: inherit;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.term-note-btn::before {
    content: "i";
}

.term-note-btn:focus-visible {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

.term-note {
    margin: 4px 0 0;
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 400;
    line-height: 1.35;
}

.term-note[hidden],
.term-note-row[hidden] {
    display: none;
}

.term-note-help {
    margin-left: 8px;
    color: var(--primary-blue);
    font-weight: 700;
}
