/* MOVE の見た目。iPad 横向き 1180×820 が基準。タップの的は 60px 以上、主なボタンは 88px 以上 */
:root {
  --bg: #fdf8ef; --card: #ffffff; --ink: #1f2d3d; --sub: #56677a; --line: #e2e8ef; --soft: #eef2f7;
  --blue: #2f6fe4; --green: #1d9d57; --red: #e0463f; --purple: #7a4de0; --yellow: #ffc933; --orange: #ef8a12;
  --radius: 18px;
  --font: "Hiragino Maru Gothic ProN", "Hiragino Sans", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; touch-action: manipulation; height: 100%; }
body {
  margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 18px; line-height: 1.55;
  -webkit-tap-highlight-color: transparent; overscroll-behavior: none;
}
ruby rt { font-size: .5em; font-weight: 600; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 1.4em; height: 1.4em; flex: none; }
.ic.big { width: 64px; height: 64px; }
h1, h2 { margin: 0; }
h2 { font-size: 22px; display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
h2 .ic { color: var(--blue); }
.boot { position: fixed; inset: 0; display: grid; place-content: center; text-align: center; font-size: 22px; color: var(--sub); margin: 0; }
.boot small { font-size: 15px; }

/* --- ボタン --- */
.btn {
  font: inherit; font-weight: 800; border: 0; border-radius: 16px; cursor: pointer;
  min-height: 60px; min-width: 60px; padding: 0 18px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--soft); color: var(--ink);
  touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  transition: transform .06s, filter .06s;
}
.btn:active { transform: translateY(1px) scale(.97); filter: brightness(.93); }
.btn:disabled { opacity: .4; cursor: default; }
.btn:focus-visible, .tab:focus-visible, .bigOpen:focus-within { outline: 4px solid #9cc0ff; outline-offset: 2px; }
.btn.icon { width: 60px; height: 60px; padding: 0; border-radius: 16px; }
.btn.icon .ic { width: 30px; height: 30px; }
.btn.go { background: var(--green); color: #fff; min-height: 72px; font-size: 20px; }
.btn.sub { background: #e6efff; color: #1b4fb8; }
.btn.wide { width: 100%; min-height: 64px; font-size: 19px; }
.btn.danger { background: #fde8e7; color: #b3261e; min-height: 60px; }
.btn.tile { min-height: 96px; font-size: 22px; background: #fff; border: 2px solid var(--line); border-radius: 22px; }
.btn.tile .ic { width: 40px; height: 40px; color: var(--blue); }
.btn.tile.quiet .ic { color: var(--orange); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.hint { margin: 8px 0 0; color: var(--sub); font-size: 16px; }
.hint.small { font-size: 15px; }
.empty { color: var(--sub); text-align: center; margin: 40px 16px; font-size: 18px; }

/* --- 画面の入れ物 --- */
.screen {
  position: fixed; top: 0; left: 0; right: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* --- ホーム --- */
.home { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.home > * { width: 100%; max-width: 1180px; margin-left: auto; margin-right: auto; padding-left: 28px; padding-right: 28px; }
.homeTop { display: flex; align-items: center; gap: 16px; padding-top: 18px; padding-bottom: 14px; }
.logo { width: 64px; height: 64px; border-radius: 16px; box-shadow: 0 2px 8px rgba(31,45,61,.18); }
.homeTop h1 { font-size: 40px; letter-spacing: .08em; color: var(--blue); line-height: 1.1; }
.lead { margin: 2px 0 0; color: var(--sub); font-size: 18px; }
.homeGrid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 20px; align-items: start; }
.openCard { display: flex; flex-direction: column; gap: 14px; }
.bigOpen {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 250px; border-radius: 24px; cursor: pointer; text-align: center; padding: 20px;
  background: linear-gradient(160deg, #3f86ff, #2358d6); color: #fff;
  box-shadow: 0 6px 0 #1a47ad, 0 10px 24px rgba(35,88,214,.28);
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: manipulation;
}
.bigOpen:active { transform: translateY(4px); box-shadow: 0 2px 0 #1a47ad, 0 6px 14px rgba(35,88,214,.25); }
.bigOpen input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.bigOpen .ic { width: 84px; height: 84px; color: #ffe27a; }
.bigOpen .bigText { font-size: 38px; font-weight: 900; letter-spacing: .04em; }
.bigOpen .subText { font-size: 17px; opacity: .95; }
.bigOpen.mid { min-height: 150px; }
.bigOpen.mid .ic { width: 56px; height: 56px; }
.bigOpen.mid .bigText { font-size: 28px; }
.homeStatus:empty { display: none; }
.status { border-radius: 14px; padding: 12px 16px; font-size: 18px; font-weight: 700; }
.status.wait { background: #eef4ff; color: #1b4fb8; }
.status.ok { background: #e4f6ea; color: #146c3c; }
.status.ng { background: #fdeceb; color: #a8231c; }
.status .next { display: block; font-weight: 600; color: var(--ink); margin-top: 4px; }
.status details { margin-top: 8px; font-weight: 500; font-size: 15px; color: var(--sub); }
.status summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; color: #1b4fb8; font-weight: 700; }
.currentProg { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #f2fbf5; border: 2px solid #bfe6cd; border-radius: 16px; padding: 10px 12px 10px 16px; }
.cpText { display: flex; flex-direction: column; min-width: 0; }
.cpLabel { font-size: 14px; color: var(--sub); }
.cpText strong { font-size: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.courseList { display: grid; gap: 12px; margin-bottom: 14px; }
.courseItem {
  display: flex; align-items: center; gap: 14px; min-height: 76px; width: 100%; text-align: left;
  background: #fff; border: 3px solid var(--line); border-radius: 18px; padding: 10px 16px; font-weight: 700; justify-content: flex-start;
}
.courseItem .dot { width: 30px; height: 30px; border-radius: 50%; border: 3px solid #b5c1cd; flex: none; display: grid; place-items: center; }
.courseItem[aria-checked="true"] { border-color: var(--blue); background: #eef4ff; }
.courseItem[aria-checked="true"] .dot { border-color: var(--blue); }
.courseItem[aria-checked="true"] .dot::after { content: ""; width: 14px; height: 14px; border-radius: 50%; background: var(--blue); }
.courseItem .cName { font-size: 20px; flex: 1; min-width: 0; }
.tag { font-size: 13px; font-weight: 800; border-radius: 999px; padding: 3px 10px; background: #fff1d6; color: #8a5300; white-space: nowrap; }
.tag.imp { background: #e7f0ff; color: #1b4fb8; }
.homeBottom { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding-top: 20px; padding-bottom: 20px; }
.howto { padding-bottom: 28px; }
.howto h2 { font-size: 19px; color: var(--sub); }
.howSteps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.howSteps li { display: flex; gap: 10px; align-items: flex-start; background: #fff; border: 1px dashed #cdd6e0; border-radius: 16px; padding: 12px 14px; font-size: 16px; line-height: 1.5; }
.howSteps .num { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--yellow); color: var(--ink); font-weight: 900; display: grid; place-items: center; }

/* --- 上の帯 --- */
.bar {
  display: flex; align-items: center; gap: 14px; min-height: 80px; padding: 10px 16px;
  background: #fff; border-bottom: 1px solid var(--line); flex: none;
}
.barTitle { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.progName { font-size: 23px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.courseName { font-size: 15px; color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timer { font-variant-numeric: tabular-nums; font-size: 34px; font-weight: 900; min-width: 150px; text-align: right; letter-spacing: .02em; }
.timer small { font-size: 17px; margin-left: 4px; color: var(--sub); }
.btn.icon.on { background: #e6efff; color: var(--blue); }

/* --- うごかす --- */
.move { background: var(--bg); }
.moveMain { flex: 1; min-height: 0; display: grid; grid-template-columns: 60fr 40fr; gap: 14px; padding: 12px 16px; }
.stageCol { display: flex; flex-direction: column; gap: 10px; min-height: 0; min-width: 0; }
.stageWrap { position: relative; flex: 1; min-height: 0; border-radius: var(--radius); overflow: hidden; background: #d9e3ec; }
#stage { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; user-select: none; -webkit-user-select: none; }
.stageTools { position: absolute; top: 10px; right: 10px; display: flex; flex-direction: column; gap: 10px; }
.stageTools .btn { background: rgba(255,255,255,.94); box-shadow: 0 1px 4px rgba(31,45,61,.18); }
.placeHint {
  position: absolute; left: 12px; top: 10px; margin: 0; max-width: calc(100% - 100px);
  background: rgba(255,255,255,.94); border-radius: 12px; padding: 8px 14px; font-size: 16px; font-weight: 700;
  box-shadow: 0 1px 4px rgba(31,45,61,.15); pointer-events: none;
}
/* ミッションは 2 行まで折り返す（横にかくれると気づけないため）。それ以上はたてにスクロール */
.missions { display: flex; flex-wrap: wrap; gap: 8px; overflow-y: auto; max-height: 126px; list-style: none; margin: 0; padding: 0; flex: none; scrollbar-width: none; }
.missions:empty { display: none; }
.missions li {
  flex: none; display: flex; align-items: center; gap: 10px; min-height: 56px; background: #fff;
  border: 2px solid var(--line); border-radius: 14px; padding: 4px 14px 4px 10px; font-size: 16px; font-weight: 700;
}
.missions .mk { width: 32px; height: 32px; border-radius: 9px; border: 3px solid #b5c1cd; display: grid; place-items: center; font-size: 20px; line-height: 1; flex: none; color: #fff; }
.missions li.done { border-color: #8fd3aa; background: #e8f8ee; }
.missions li.done .mk { background: var(--green); border-color: var(--green); }
.missions li.warn { border-color: #f3c27c; background: #fff5e6; }
.missions li.warn .mk { background: var(--orange); border-color: var(--orange); }

.side { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 8px; background: #f0f3f7; flex: none; }
.tab {
  font: inherit; font-size: 19px; font-weight: 800; min-height: 60px; border: 0; border-radius: 12px;
  background: transparent; color: var(--sub); cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.tab[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 5px rgba(31,45,61,.14); }
.panel { flex: 1; min-height: 0; overflow: auto; -webkit-overflow-scrolling: touch; padding: 12px; overscroll-behavior: contain; }
/* ブロック表示（blockview.js）は自分で拡大・移動するので、パネルいっぱいに置いてパネルはスクロールさせない */
#panelBlocks { position: relative; padding: 0; overflow: hidden; }
.blocksHost { position: absolute; inset: 0; overflow: auto; }
#panelBlocks .empty { position: relative; }

/* ハブ */
.hubBox { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.hubFace { background: linear-gradient(#fff3cf, #ffe39a); border: 3px solid #e7c25c; border-radius: 28px; padding: 16px 18px 14px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.matrix { display: grid; grid-template-columns: repeat(5, 38px); gap: 7px; padding: 14px; background: #1f2d3d; border-radius: 16px; }
.px { width: 38px; height: 38px; border-radius: 8px; background: #2d3f53; }
.hubButtons { display: flex; align-items: center; gap: 20px; }
.hubBtn {
  width: 68px; height: 68px; border-radius: 50%; border: 3px solid #d0b35a; background: #fff; color: var(--ink);
  display: grid; place-items: center; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.hubBtn .ic { width: 30px; height: 30px; }
.hubBtn.right .ic { transform: scaleX(-1); }
.hubBtn.center { width: 84px; height: 84px; }
.hubBtn.pressed { background: #ffe9a8; transform: scale(.94); }
.hubBtn:disabled { opacity: .5; }
.centerLight { width: 46px; height: 46px; border-radius: 50%; background: #fff; border: 3px solid #8c9aa8; display: block; }
.hubHint { margin: 0; color: var(--sub); font-size: 15px; }
.yawRow { display: flex; align-items: center; gap: 12px; font-size: 17px; background: #f6f8fb; border-radius: 14px; padding: 8px 14px; }
.yawRow strong { font-size: 26px; font-variant-numeric: tabular-nums; min-width: 72px; text-align: right; }
.yawDial { width: 52px; height: 52px; border-radius: 50%; border: 3px solid #c3cdd8; position: relative; background: #fff; flex: none; }
.yawNeedle { position: absolute; left: 50%; top: 5px; width: 5px; height: 20px; margin-left: -2.5px; background: var(--blue); border-radius: 3px; transform-origin: 50% 20px; }

/* センサー */
.ports { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ports li { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 16px; background: #f6f8fb; min-height: 72px; }
.pressBtn { min-width: 76px; background: #fff; border: 2px solid var(--line); touch-action: none; }
.pressBtn.pressed { background: #ffe1df; border-color: var(--red); color: #a8231c; }
.portBadge { width: 48px; height: 48px; border-radius: 13px; background: var(--ink); color: #fff; font-weight: 900; font-size: 24px; display: grid; place-items: center; }
.pName { font-size: 15px; color: var(--sub); font-weight: 700; }
.pVal { font-size: 22px; font-weight: 900; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.pVal small { font-size: 15px; font-weight: 700; color: var(--sub); }
.swatch { width: 36px; height: 36px; border-radius: 9px; border: 2px solid #c3cdd8; flex: none; }
.swatch.none { background: repeating-linear-gradient(45deg, #fff 0 6px, #e5eaf0 6px 12px); }
.bar100 { width: 120px; height: 12px; border-radius: 6px; background: #e3e8ee; overflow: hidden; }
.bar100 i { display: block; height: 100%; background: var(--blue); }
.pressDot { width: 18px; height: 18px; border-radius: 50%; background: #c3cdd8; }
.pressDot.on { background: var(--red); }

/* 下の操作 */
.controls {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 10px 16px 12px; background: #fff; border-top: 1px solid var(--line);
}
.mainBtns { display: flex; gap: 14px; }
.ctl { flex-direction: column; gap: 2px; min-height: 92px; min-width: 128px; font-size: 20px; color: #fff; border-radius: 22px; padding: 6px 16px; }
.ctl .ic { width: 38px; height: 38px; }
.ctl.play { background: var(--green); min-width: 150px; box-shadow: 0 4px 0 #147540; }
.ctl.play.pausing { background: #f2a516; box-shadow: 0 4px 0 #b57a0b; }
.ctl.stop { background: var(--red); box-shadow: 0 4px 0 #a82f29; }
.ctl.reset { background: var(--blue); box-shadow: 0 4px 0 #1f4fb0; }
.ctl.step { background: var(--purple); box-shadow: 0 4px 0 #5634a8; }
.ctl:active { transform: translateY(3px); box-shadow: none; }
.speed { display: flex; align-items: center; gap: 8px; background: #f0f3f7; border-radius: 20px; padding: 8px 10px; }
.speedLabel { font-size: 17px; font-weight: 800; color: var(--sub); padding: 0 4px; }
.spd { min-width: 64px; min-height: 64px; font-size: 20px; background: #fff; padding: 0 8px; }
.spd[aria-checked="true"] { background: var(--ink); color: #fff; }

/* --- ロボットの せってい --- */
.robotMain { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 16px; align-items: start; }
.diagramCard { display: flex; flex-direction: column; position: sticky; top: 0; }
#robotDiagram { width: 100%; height: 520px; display: block; touch-action: none; background: #fbfcfe; border-radius: 14px; }
.robotForm { display: grid; gap: 14px; }
.presetList { display: grid; gap: 10px; }
.preset { justify-content: flex-start; text-align: left; min-height: 64px; background: #fff; border: 3px solid var(--line); gap: 12px; font-size: 18px; }
.preset .dot { width: 26px; height: 26px; border-radius: 50%; border: 3px solid #b5c1cd; flex: none; display: grid; place-items: center; }
.preset[aria-checked="true"] { border-color: var(--blue); background: #eef4ff; }
.preset[aria-checked="true"] .dot::after { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--blue); }
.numRow { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; gap: 6px 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.numRow:last-of-type { border-bottom: 0; }
.numLabel { font-weight: 800; }
.stepper { grid-column: 1; display: flex; align-items: center; gap: 8px; }
.stepper input { width: 96px; height: 60px; font: inherit; font-size: 24px; font-weight: 900; text-align: center; border: 2px solid var(--line); border-radius: 14px; }
.unit { color: var(--sub); font-weight: 700; }
.est { grid-column: 2; grid-row: 1 / span 2; font-size: 14px; font-weight: 800; border-radius: 999px; padding: 4px 12px; background: #fff1d6; color: #8a5300; white-space: nowrap; }
.est.fixed { background: #e4f6ea; color: #146c3c; }
.portTable { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.portTable li { display: grid; grid-template-columns: 48px 1fr auto; gap: 10px; align-items: center; background: #f6f8fb; border-radius: 12px; padding: 6px 10px; min-height: 56px; }
.portTable .portBadge { width: 40px; height: 40px; font-size: 20px; border-radius: 10px; }
.portTable .none { color: #9aa6b2; }

/* --- コース・おうちの人へ --- */
.pageBody { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 16px 24px 40px; }
.pageBody > .card { max-width: 920px; margin: 0 auto 16px; }
.lead2 { margin: 0 0 14px; font-size: 19px; }
.savedCourses { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.savedCourses li { display: flex; align-items: center; gap: 12px; background: #f6f8fb; border-radius: 14px; padding: 8px 10px 8px 16px; flex-wrap: wrap; }
.savedCourses .cName { flex: 1; font-size: 19px; font-weight: 800; min-width: 160px; }
.adult { font-size: 17px; line-height: 1.75; }
.adult h2 { font-size: 20px; }
.adult p { margin: 0 0 8px; }
.steps { margin: 0 0 8px; padding-left: 1.6em; }
.steps li { margin: 4px 0; }
.plain { margin: 0 0 12px; padding-left: 1.3em; }
.note { color: var(--sub); font-size: 15px; }
.legal { color: var(--sub); font-size: 14px; }
.techInfo dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; font-size: 15px; }
.techInfo dt { color: var(--sub); }
.techInfo dd { margin: 0; word-break: break-all; }
.techInfo code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
.adult a { color: var(--blue); font-weight: 700; display: inline-flex; min-height: 44px; align-items: center; }

/* --- ポップアップ・おしらせ --- */
.popup { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(20,30,45,.45); }
.popCard { background: #fff; border-radius: 26px; padding: 24px 28px 22px; width: min(640px, 100%); max-height: calc(100% - 20px); overflow-y: auto; box-shadow: 0 16px 48px rgba(20,30,45,.3); }
.popCard h2 { font-size: 28px; }
.popBody { font-size: 19px; }
.popBody p { margin: 6px 0; }
.popBody .facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.popBody .chip { background: #f0f3f7; border-radius: 999px; padding: 4px 14px; font-weight: 800; font-size: 17px; }
.popBody .progIcon { display: block; max-width: 100%; max-height: 220px; margin: 8px auto; background: #f7f9fb; border: 1px solid var(--line); border-radius: 12px; }
.popBody .warnList { margin: 8px 0; padding: 10px 14px 10px 32px; background: #fff5e6; border-radius: 14px; font-size: 17px; }
.popBody .okList { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 8px; }
.popBody .okList li { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.popBody .okList .mk { width: 30px; height: 30px; border-radius: 9px; border: 3px solid #b5c1cd; display: grid; place-items: center; color: #fff; flex: none; }
.popBody .okList .done .mk { background: var(--green); border-color: var(--green); }
.popBody .okList .warn .mk { background: var(--orange); border-color: var(--orange); }   /* 結合 F：「！」が白地に白で見えなかった */
.popBody .bigTime { font-size: 44px; font-weight: 900; font-variant-numeric: tabular-nums; margin: 4px 0; }
.popBtns { display: flex; gap: 14px; justify-content: flex-end; flex-wrap: wrap; margin-top: 18px; }
.popBtns .btn { min-height: 72px; min-width: 150px; font-size: 21px; }
.popBtns .btn.primary { background: var(--green); color: #fff; }
.popBtns .btn.warn { background: var(--red); color: #fff; }
.toasts { position: fixed; left: 50%; top: calc(88px + env(safe-area-inset-top)); transform: translateX(-50%); z-index: 60; display: grid; gap: 8px; width: min(620px, calc(100% - 32px)); pointer-events: none; }
.toast { background: rgba(31,45,61,.95); color: #fff; border-radius: 16px; padding: 12px 18px; font-size: 18px; font-weight: 700; box-shadow: 0 6px 20px rgba(20,30,45,.25); text-align: center; }
.toast.good { background: rgba(21,122,67,.96); }
/* たて向きの案内。ポップアップより下（z-index 45）。出ている間は画面の下に同じ高さの余白を作り、ボタンを隠さない（点検 G2-5） */
.rotateHint {
  position: fixed; left: 50%; bottom: calc(12px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 45;
  display: flex; align-items: center; gap: 16px; background: #fff; border: 3px solid var(--yellow); border-radius: 24px; padding: 10px 18px;
  box-shadow: 0 10px 30px rgba(20,30,45,.25); width: min(560px, calc(100% - 32px)); height: 100px;
}
.rotateHint p { margin: 0; font-size: 19px; font-weight: 800; flex: 1; }
.rotateHint .ic { color: var(--orange); }
body.hintShown .screen { padding-bottom: calc(124px + env(safe-area-inset-bottom)); }

/* ホームの いちばん下の 断り書き（点検 G2-9） */
.homeFoot { margin: 0; padding-top: 4px; padding-bottom: 24px; color: var(--sub); font-size: 14px; text-align: center; }

/* ブロック表示の 拡大・縮小・ぜんたい（点検 G2-8）。ブロックは左上から並ぶので、右下に横ならびで置く */
.blockTools { z-index: 2; top: auto; bottom: 10px; flex-direction: row; }

/* --- たて向き（案内を出しつつ、使えるように並べかえる） --- */
@media (orientation: portrait) {
  .homeGrid { grid-template-columns: 1fr; }
  .howSteps { grid-template-columns: 1fr 1fr; }
  .moveMain { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1.15fr) minmax(0, 1fr); }
  .controls { justify-content: center; }
  .mainBtns { gap: 10px; }
  .ctl { min-width: 110px; }
  .robotMain { grid-template-columns: 1fr; }
  .diagramCard { position: static; }
  #robotDiagram { height: 420px; }
  /* ハブ：ライトの横にボタンを たてに並べ、パネルの中に全部おさめる（点検 G2-6） */
  .hubFace { flex-direction: row; align-items: center; padding: 10px 14px; gap: 14px; }
  .hubButtons { flex-direction: column; gap: 8px; }
  .matrix { grid-template-columns: repeat(5, 30px); gap: 6px; padding: 10px; }
  .px { width: 30px; height: 30px; }
  .hubBtn { width: 60px; height: 60px; }
  .hubBtn.center { width: 68px; height: 68px; }
  .centerLight { width: 38px; height: 38px; }
}
/* 少しせまい画面（Split View など） */
@media (max-width: 1000px) and (orientation: landscape) {
  .ctl { min-width: 104px; font-size: 18px; }
  .ctl.play { min-width: 120px; }
  .spd { min-width: 60px; }
  .timer { min-width: 120px; font-size: 28px; }
}

/* SPIKE アプリの絵（officialview.js、担当 I）。絵の CSS は Shadow DOM の中だけに効く。外へはみ出さないよう、ここで囲う。
   transform（動かない 0 の 移動）は、contain を 知らない 古い Safari でも「position:fixed の 基準」を この 枠に するため（点検 S1-1。
   絵の中の 仕組み（officialview.js の インラインの !important）と あわせて、守りを 1 つに たよらない） */
.ovHost { position: absolute; inset: 0; overflow: hidden; contain: strict; isolation: isolate; transform: translate(0, 0); background: #FBFBFB; }
/* 「こうしきの え ⇄ MOVE の え」：ボタンには かわる先の名前（60px 以上）。
   ブロックの 文字は 左に ならぶので、右はしの ＋／−／ぜんたい の上に置く（＋ の左だと 下の方の ブロックの 文字に かぶる。
   右上だと 本物のファイルの「プログラムがスタートしたとき」の おわりに かぶる。点検 J2-3） */
.picToggle { position: absolute; z-index: 2; bottom: 80px; right: 10px; min-height: 60px; min-width: 60px; padding: 0 16px; font-size: 17px; white-space: nowrap; gap: 6px;
  color: var(--blue); background: rgba(255,255,255,.94); box-shadow: 0 1px 4px rgba(31,45,61,.18); }
.picToggle .swap { font-size: 22px; line-height: 1; }

/* ポートの重なり（担当 I）：「よみこめたよ！」の中の説明と、うごかす がめんの 上の帯の しるし */
.popBody .portWarn { margin: 10px 0; padding: 12px 16px; background: #fff5e6; border: 2px solid #f3a64a; border-radius: 16px; font-size: 18px; }
.popBody .portWarn p { margin: 6px 0; }
.popBody .portWarn .pwHead { display: flex; align-items: center; gap: 10px; font-weight: 900; color: #8a4b00; }
.popBody .portWarn .pwSim { font-size: 16px; color: var(--sub); }
.popBody .portWarn .pwNext { font-weight: 700; color: #6b3a00; }
.wIcon { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--orange); color: #fff; font-weight: 900; display: grid; place-items: center; font-size: 19px; line-height: 1; }
.warnChip { flex: none; min-height: 60px; padding: 0 16px 0 12px; border-radius: 999px; background: #fff5e6; border: 2px solid #f3a64a; color: #8a4b00; font-size: 17px; white-space: nowrap; }
@media (orientation: portrait) {
  .warnChip { font-size: 15px; padding: 0 12px 0 10px; }
}
