*{box-sizing:border-box}
html,body{margin:0;height:100%;background:#000;color:#fff;font-family:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif}

/* ---------- presenter ---------- */
body.presenter{overflow:hidden;cursor:auto}
#viewport{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;background:#000}
#stage{position:absolute;left:50%;top:50%;width:1920px;height:1080px;overflow:hidden;background:#111;transform-origin:0 0}
.slide{position:absolute;inset:0;display:none}
.slide.on{display:block}
.ph{width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:40px}
.ph-id{font-size:120px;opacity:.5;font-variant-numeric:tabular-nums}
.ph-title{font-size:140px;margin:0;font-weight:700;text-align:center;padding:0 120px}
.net{position:fixed;right:6px;bottom:6px;width:8px;height:8px;border-radius:50%;background:#d33;opacity:0;transition:opacity .4s;pointer-events:none}
.net.show{opacity:.55}

/* ---------- controller ---------- */
body.controller{display:flex;flex-direction:column;height:100dvh;padding:env(safe-area-inset-top) 12px calc(env(safe-area-inset-bottom) + 10px);background:#111;-webkit-user-select:none;user-select:none;touch-action:manipulation;overscroll-behavior:none}
.controller header{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:8px 0}
.status{display:flex;align-items:center;gap:8px;font-size:15px;font-weight:600;padding:6px 12px;border-radius:99px;background:#222}
.status .dot{width:12px;height:12px;border-radius:50%;background:#999}
.s-live .dot{background:#2ecc71}.s-live{color:#2ecc71}
.s-retrying .dot{background:#f1c40f}.s-retrying{color:#f1c40f}
.s-offline,.s-badkey,.s-nodb{background:#5a1414;color:#ffb3b3}.s-offline .dot,.s-badkey .dot,.s-nodb .dot{background:#ff4d4d}
.s-viewonly{background:#4a3a10;color:#ffd98a}.s-viewonly .dot{background:#f1a40f}
.timer{display:flex;align-items:center;gap:6px}
#elapsed{font-size:22px;font-variant-numeric:tabular-nums;font-weight:700;min-width:62px;text-align:right}
.timer button{font:inherit;font-size:14px;padding:8px 10px;border-radius:8px;border:0;background:#2a2a2a;color:#fff}
.now{padding:4px 0 6px}
.count{font-size:20px;color:#aaa}
.count #id{font-size:34px;font-weight:800;color:#fff;font-variant-numeric:tabular-nums}
.now h1{font-size:30px;line-height:1.1;margin:2px 0 4px}
.next{margin:0;color:#9ab;font-size:16px}
.notes{flex:1;min-height:0;overflow:auto;-webkit-overflow-scrolling:touch;background:#1b1b1b;border-radius:12px;padding:12px 14px;font-size:19px;line-height:1.35;white-space:pre-wrap;-webkit-user-select:text;user-select:text}
.jump{margin:8px 0}
.jump summary{padding:10px 12px;background:#222;border-radius:10px;font-size:16px;list-style:none}
.jump[open] summary{margin-bottom:6px}
.jump ol{list-style:none;margin:0;padding:0;max-height:38dvh;overflow:auto;-webkit-overflow-scrolling:touch}
.jump li button{display:flex;gap:10px;width:100%;text-align:left;font:inherit;font-size:17px;padding:12px;border:0;border-bottom:1px solid #222;background:transparent;color:#ddd}
.jump li button b{min-width:34px;font-variant-numeric:tabular-nums;color:#888}
.jump li.cur button{background:#27407a;color:#fff}
.jump li.sec{padding:8px 12px 2px;font-size:12px;letter-spacing:.08em;text-transform:uppercase;color:#789}
.pad{display:flex;gap:10px;height:26dvh;min-height:130px}
.btn{font:inherit;font-size:34px;font-weight:800;border:0;border-radius:18px;color:#fff;-webkit-tap-highlight-color:transparent}
.btn:active{filter:brightness(1.3)}
.prev{flex:1;background:#333}
.nextb{flex:2;background:#1f6feb}
