diff --git a/web/app.js b/web/app.js
index c5f6136..b2af1a6 100644
--- a/web/app.js
+++ b/web/app.js
@@ -270,6 +270,31 @@ function updateStepPlates() {
plate.energy.textContent = (i in energyByStep) ? `Energy ${energyByStep[i].toFixed(0)} Wh` : 'Energy —';
}
});
+ updateHeaderCountdown();
+}
+
+function updateHeaderCountdown() {
+ const currentElapsed = (elapsed !== null) ? elapsed : 0;
+ const n = sudSchedule.length;
+ let stepText = '--:--';
+ let totalText = '--:--';
+ let visible = false;
+ if (n > 0 && sudStepIndex !== null) {
+ visible = true;
+ let endT = forecastStepStarts[sudStepIndex + 1];
+ if (endT === undefined && sudStepIndex === n - 1 && forecastFinished) {
+ endT = forecastFinalT;
+ }
+ if (endT !== undefined) {
+ stepText = formatDuration(Math.max(0, endT - currentElapsed));
+ }
+ if (forecastFinalT !== null && elapsed !== null) {
+ totalText = formatDuration(Math.max(0, forecastFinalT - currentElapsed));
+ }
+ }
+ document.getElementById('hdr-step-remaining').textContent = stepText;
+ document.getElementById('hdr-total-remaining').textContent = totalText;
+ document.getElementById('header-countdown').classList.toggle('hidden', !visible);
}
// --- Stirrer visualization ---
diff --git a/web/index.html b/web/index.html
index f2cd21e..f51a187 100644
--- a/web/index.html
+++ b/web/index.html
@@ -19,6 +19,10 @@
+
diff --git a/web/style.css b/web/style.css
index 7017980..c6ec37e 100644
--- a/web/style.css
+++ b/web/style.css
@@ -84,6 +84,35 @@ header#connection-bar {
border-left: 1px solid var(--border);
}
+/* --- Header countdown --- */
+
+#header-countdown {
+ display: flex;
+ flex-direction: column;
+ gap: 0.05em;
+ padding-left: 0.8em;
+ border-left: 1px solid var(--border);
+}
+.hdr-cdown-row {
+ display: flex;
+ align-items: baseline;
+ gap: 0.35em;
+}
+.hdr-cdown-lbl {
+ font-size: 0.65em;
+ color: var(--text-muted);
+ text-transform: uppercase;
+ letter-spacing: 0.05em;
+ width: 2.8em;
+}
+#hdr-step-remaining,
+#hdr-total-remaining {
+ font-family: 'Courier New', 'Lucida Console', monospace;
+ font-weight: bold;
+ font-size: 1.35em;
+ color: var(--accent);
+}
+
/* --- Transport buttons (circular, coloured) --- */
.transport-btn {