@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:ital,wght@0,600;1,600&family=Noto+Sans+TC:wght@400;500;600;700&display=swap');
/* FTMS numbers, no 3D. Built for a phone propped on the machine, so the
   primary readout stays legible at arm's length. */
:root{color-scheme:dark;--lime:#d4ed93;--accent:#d4ed93;--ink:#eef2e8;--muted:#8b9b9d;--line:#ffffff18;
 font-family:'Noto Sans TC',sans-serif;color:var(--ink);background:#0b1620}
*{box-sizing:border-box}
body{margin:0;min-height:100dvh;background:radial-gradient(900px 520px at 50% -8%,#173340,#0b1620 62%);
 padding-bottom:env(safe-area-inset-bottom)}
button,input,select{font:inherit}button{cursor:pointer;color:inherit}
button:focus-visible,a:focus-visible,input:focus-visible{outline:2px solid var(--lime);outline-offset:3px}

.live-header{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:20px 5%}
.wordmark{display:flex;align-items:center;gap:10px;color:var(--ink);text-decoration:none;font:700 22px/1 sans-serif;letter-spacing:2.3px}
.wordmark svg{width:27px;height:30px;fill:var(--lime)}
.live-head-actions{display:flex;align-items:center;gap:10px}
.live-state{font:600 10px sans-serif;letter-spacing:1.6px;color:var(--muted);border:1px solid #ffffff22;
 border-radius:999px;padding:6px 12px}
.live-state[data-on=true]{color:#22301f;background:var(--lime);border-color:transparent}
.live-icon{width:34px;height:34px;border-radius:50%;border:1px solid #ffffff2b;background:#ffffff0d;font-size:14px}

.live{max-width:620px;margin:0 auto;padding:4px 5% 36px}
.live-hero{text-align:center;padding:18px 0 22px;border-bottom:1px solid var(--line)}
.live-label{font:600 9px sans-serif;letter-spacing:1.8px;color:var(--muted);margin:0}
.live-clock{display:block;margin:10px 0 8px;font:italic 600 clamp(58px,17vw,88px)/1 'Barlow Condensed',sans-serif;
 font-variant-numeric:tabular-nums;letter-spacing:1px}
.live-sub{margin:0;font-size:11px;color:var(--muted)}

.live-primary{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;text-align:center;padding:22px 0;border-bottom:1px solid var(--line)}
.live-primary span{display:block;font:600 9px sans-serif;letter-spacing:1.3px;color:var(--muted)}
.live-primary strong{display:block;margin:8px 0 3px;font:italic 600 clamp(30px,8.5vw,44px)/1 'Barlow Condensed',sans-serif;
 font-variant-numeric:tabular-nums}
.live-primary div:nth-child(1) strong{color:var(--lime)}
.live-primary small{font-size:10px;color:#7e9094}

/* Columns are the same width as .live-primary above so the two blocks line up.
   Flex rather than grid: a last row that does not fill centres itself instead of
   leaving a hole on the right, which is what an odd field count always produces. */
.live-grid{display:flex;flex-wrap:wrap;justify-content:center;gap:20px 10px;padding:22px 0;text-align:center}
.live-grid>div{flex:0 0 calc((100% - 20px)/3)}
/* Exactly four fields read as two balanced rows instead of three plus a lone
   orphan. Browsers without :has() keep the 3 + 1, which is still centred. */
.live-grid:has(>div:nth-child(4):last-child)>div{flex-basis:calc((100% - 10px)/2)}
.live-grid:empty{display:none}
.live-grid span{display:block;font:600 9px sans-serif;letter-spacing:1.1px;color:var(--muted)}
.live-grid strong{display:block;margin:6px 0 2px;font:600 24px/1 'Barlow Condensed',sans-serif;font-variant-numeric:tabular-nums}
.live-grid small{font-size:10px;color:#7e9094}

.live-connect{padding-top:4px}
/* The board above already shows every field this readout would repeat, so on this
   page the panel stays a connection control instead of a second, differently
   aligned table of the same numbers. Scene pages keep their readout. */
.live-connect .machine-readout{display:none}
.live-connect .machine-link{margin-top:0;padding-top:20px}

.live-actions{display:grid;grid-template-columns:1fr 1.6fr;gap:10px;margin-top:26px}
.live-actions button{border-radius:999px;padding:15px 12px;font-size:14px;font-weight:600}
.live-secondary{border:1px solid #ffffff26;background:transparent;color:#bccac7}
.live-primary-button{border:0;background:var(--lime);color:#22301f}
.live-hint{font-size:11px;line-height:1.9;color:var(--muted);margin:18px 0 0}

.live-links{display:flex;flex-wrap:wrap;justify-content:center;gap:14px;padding:0 5% 36px;font-size:12px}
.live-links a{color:#adc2b5;text-decoration:none}
.live-links a[aria-current]{color:var(--lime)}
.live-links a:hover{text-decoration:underline}

@media(max-width:700px){
 .live-header{padding:16px 18px}
 .live{padding:2px 16px 28px}
 .live-actions{grid-template-columns:1fr;gap:9px}
}

/* Speed and incline controls. Pressed mid-run with a sweaty thumb: big
   targets, one row per quantity, the requested value large and the machine's
   own reading right under it. */
.live-control{margin:18px 0 4px;padding:16px 16px 14px;border:1px solid #ffffff1f;border-radius:14px;background:#ffffff08}
.live-control[hidden]{display:none}
.control-head{display:flex;justify-content:space-between;align-items:baseline;font-size:14px;font-weight:600}
.control-head small{font:600 9px sans-serif;letter-spacing:1.4px;color:var(--muted)}
.control-caps{list-style:none;margin:10px 0 0;padding:0;display:flex;flex-wrap:wrap;gap:4px 14px;font-size:11.5px;color:#a9bab6}
.control-caps .off{color:#7e9094}
.control-readonly{margin:10px 0 0;font-size:13px;line-height:1.7;color:#b4c4bf}
.control-message{margin:10px 0 0;font-size:12.5px;line-height:1.6;color:#c9d6cf}
.control-message[data-tone=ok]{color:var(--lime)}
.control-message[data-tone=error]{color:#ffb4a3}
.control-message[hidden],.control-ack[hidden],.control-rows[hidden],.control-retry[hidden]{display:none}
.control-ack{margin-top:12px;padding:12px;border-radius:10px;background:#d4ed930f;border:1px solid #d4ed9333}
.control-ack p{margin:0 0 10px;font-size:12.5px;line-height:1.7;color:#d5e0d6}
.control-enable,.control-retry{width:100%;min-height:46px;border:0;border-radius:10px;background:var(--lime);color:#22301f;font-weight:700;font-size:14px}
.control-retry{margin-top:10px;background:transparent;color:var(--lime);border:1px solid #d4ed9366}
.control-rows{display:grid;gap:12px;margin-top:14px}
.control-row{display:grid;grid-template-columns:auto 56px 1fr 56px;grid-template-areas:"label minus value plus" "presets presets presets presets";align-items:center;gap:8px 10px}
.control-label{grid-area:label;font-size:12px;color:var(--muted);writing-mode:vertical-rl;letter-spacing:2px}
.control-step{width:56px;height:56px;border-radius:14px;border:1px solid #ffffff2e;background:#ffffff10;font:600 30px/1 sans-serif;touch-action:manipulation}
.control-step[data-dir="-1"]{grid-area:minus}.control-step[data-dir="1"]{grid-area:plus}
.control-step:not(:disabled):active{background:var(--lime);color:#22301f;transform:scale(.96)}
.control-value{grid-area:value;text-align:center;min-width:0}
.control-value strong{font:italic 600 40px/1 'Barlow Condensed',sans-serif;font-variant-numeric:tabular-nums;color:var(--ink)}
.control-value small{margin-left:4px;font-size:11px;color:#7e9094}
.control-value em{display:block;margin-top:4px;font-style:normal;font-size:11px;color:#8ea19d}
.control-row[data-adjusting=true] .control-value strong{color:var(--lime)}
.control-presets{grid-area:presets;display:flex;gap:8px}
.control-presets button{flex:1;min-height:40px;border-radius:9px;border:1px solid #ffffff22;background:transparent;font:600 15px 'Barlow Condensed',sans-serif;color:#cfdad3;touch-action:manipulation}
.control-row button:disabled{opacity:.35;cursor:not-allowed}
.control-hint{margin:12px 0 0;font-size:11px;line-height:1.6;color:#7e9094}
.control-hint:empty{display:none}
