:root {
  color-scheme: dark;
  font-family: "Segoe UI", "Microsoft JhengHei", system-ui, sans-serif;
  color: #eaf4ff;
  background: #0c1722;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
button, .download, .back {
  border: 1px solid #304454;
  background: #142533;
  color: #eaf4ff;
  border-radius: 7px;
  text-decoration: none;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
button:hover:not(:disabled), a:hover { background: #203a4c; border-color: #64c7e7; }
button:focus-visible, a:focus-visible, canvas:focus-visible { outline: 2px solid #7cdcff; outline-offset: 3px; }
button:disabled { opacity: .4; cursor: wait; }
[hidden] { display: none !important; }
.app { height: 100vh; height: 100dvh; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.topbar { min-height: 84px; padding: 15px 24px; display: flex; gap: 18px; align-items: center; border-bottom: 1px solid #253746; background: #0c1722; }
.back { width: 40px; height: 40px; display: grid; place-items: center; font-size: 22px; flex: none; }
.heading p { margin: 0 0 4px; color: #7fcbe3; font-size: 12px; letter-spacing: .15em; }
h1 { margin: 0; font-size: clamp(17px, 2.1vw, 23px); font-weight: 600; }
.download { margin-left: auto; padding: 10px 16px; white-space: nowrap; }
.download span { margin-left: 8px; color: #80ddf6; }
#viewport { position: relative; min-width: 0; overflow: hidden; background: #172735; }
canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.view-label { position: absolute; z-index: 2; top: 25px; left: 26px; display: flex; align-items: center; gap: 9px; pointer-events: none; font-size: 14px; color: #b9d0dd; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: #66c9de; }
.divider { margin: 0 3px; color: #5d7b8a; }
.toolbar { position: absolute; z-index: 2; right: 22px; top: 18px; display: flex; gap: 7px; }
.toolbar button { min-height: 40px; padding: 9px 13px; background: #102230ed; }
.toolbar button span { margin-left: 5px; }
.load-card { position: absolute; z-index: 3; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(360px, calc(100% - 40px)); padding: 26px; background: #0e1d2bec; border: 1px solid #395365; border-radius: 12px; box-shadow: 0 20px 80px #0005; }
.eyebrow { margin: 0 0 10px; color: #8bd6ed; letter-spacing: .1em; font-size: 13px; }
h2 { font-size: 21px; margin: 0 0 20px; }
progress { width: 100%; height: 5px; border: 0; background: #253f51; accent-color: #6cd4f5; }
progress::-webkit-progress-bar { background: #253f51; border-radius: 4px; }
progress::-webkit-progress-value { background: #6cd4f5; border-radius: 4px; }
#load-detail { color: #b6c9d9; font-size: 14px; line-height: 1.6; margin-bottom: 0; }
#retry { margin-top: 20px; padding: 10px 16px; }
.interaction-hint { position: absolute; bottom: 20px; width: 100%; text-align: center; pointer-events: none; color: #c3d5e1; font-size: 13px; }
.interaction-hint span { display: inline-block; padding: 9px 16px; border: 1px solid #ffffff12; border-radius: 20px; background: #102230d9; }
.interaction-hint .touch-hint { display: none; }
footer { display: flex; justify-content: space-between; gap: 20px; padding: 10px 24px max(10px, env(safe-area-inset-bottom)); font-size: 12px; color: #99b1c2; border-top: 1px solid #253746; }
@media (pointer: coarse) {
  .interaction-hint .desktop-hint { display: none; }
  .interaction-hint .touch-hint { display: inline-block; }
}
@media (max-width: 640px) {
  .topbar { min-height: 76px; padding: 12px; gap: 10px; }
  .heading p { font-size: 10px; letter-spacing: .08em; }
  .back { width: 34px; height: 36px; }
  .download { padding: 9px; font-size: 12px; }
  .download span { display: none; }
  .view-label { left: 16px; top: 20px; font-size: 13px; }
  .toolbar { right: 12px; top: 50px; }
  .toolbar button { padding: 8px 10px; }
  footer { padding: 10px 12px; }
  .footer-note { display: none; }
}
