"""
    pke_states(plant; predicates=nothing,
               T_standby_offset_C=-33.333333,
               n_shutdown=1e-6, n_heatup=1e-3)

Single-point initial conditions for every canonical DRC mode.

Returns a NamedTuple with:

- `T_standby` — scalar, hot-standby coolant temperature [°C]
- `op`       — full-power steady state (`n = 1`, precursors at equilibrium)
- `shutdown` — hot standby (trace `n`, all temperatures at `T_standby`)
- `heatup`   — critical at low power, thermals matched to `T_standby`

Each state is a 10-element `Vector{Float64}` matching
`[n; C₁..C₆; T_f; T_c; T_cold]`.

# Source of truth for `T_standby`

Pass `predicates=JSON.parsefile("reachability/predicates.json")` to read
the canonical offset from `predicates.derived.T_standby_offset_C`. If
omitted, falls back to the keyword default (`-33.333333` °C, equivalent
to `-60` °F — matches the `predicates.json` value at the time of writing).

# Why a single function

ICs were previously duplicated across `main_mode_sweep.jl`,
`barrier_sos_2d_shutdown.jl`, `validate_pj.jl`, etc. Each copy independently
defined `T_standby`, `n_shut = 1e-6`, `n_heat = 1e-3`, and the precursor-
equilibrium formula. Lifting once means you change power-level conventions
in one place.

# X_entry polytopes

This function returns single-point ICs for forward simulation and
equilibrium finding. The `X_entry` *polytopes* used by reach analysis
live in `reachability/predicates.json::mode_definitions.<mode>.X_entry_polytope`
and should be loaded directly by reach scripts — don't conflate the two.
"""
function pke_states(plant; predicates=nothing,
                    T_standby_offset_C=-33.333333,
                    n_shutdown=1e-6, n_heatup=1e-3)
    if predicates !== nothing
        T_standby = plant.T_c0 + predicates["derived"]["T_standby_offset_C"]
    else
        T_standby = plant.T_c0 + T_standby_offset_C
    end

    # Full-power steady state.
    op = pke_initial_conditions(plant)

    # Hot-standby: trace n, all thermals at T_standby.
    C_shut = (plant.beta_i ./ (plant.lambda_i .* plant.Lambda)) .* n_shutdown
    shutdown = [n_shutdown; C_shut; T_standby; T_standby; T_standby]

    # Heatup: critical at 0.1% power, thermals matched to T_standby.
    C_heat = (plant.beta_i ./ (plant.lambda_i .* plant.Lambda)) .* n_heatup
    heatup = [n_heatup; C_heat; T_standby; T_standby; T_standby]

    return (; T_standby, op, shutdown, heatup)
end
