:root {
  /* タテギリの表紙と同じ色: 白ベース・紺の文字・赤いボタン */
  --bg: #ffffff;
  --fg: #1B2A5B;
  --muted: #5a6275;
  --on: #00c24e;
  --off: #9a9a9a;
  --accent: #E60012;
  --panel: #f2f4f8;
  --line: #cfd4de;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); }
body {
  font-family: "Hiragino Sans", "Noto Sans JP", "BIZ UDPGothic", sans-serif;
  font-size: 16px; line-height: 1.6;
  padding: 0 16px calc(24px + env(safe-area-inset-bottom));
  max-width: 720px; margin: 0 auto;
}
header { padding: 20px 0 8px; }
h1 { font-size: 28px; font-weight: 900; margin: 0 0 6px; letter-spacing: .02em; color: var(--fg); }
.lead { margin: 0; color: var(--muted); font-size: 15px; }
section { margin-top: 18px; }
.big-btn {
  display: block; width: 100%; text-align: center; cursor: pointer;
  background: var(--accent); color: #fff; border: 0; border-radius: 14px;
  font-size: 20px; font-weight: 700; padding: 18px 12px; font-family: inherit;
}
.big-btn:active { transform: scale(.98); }
.sub-btn {
  display: block; width: 100%; margin-top: 10px; padding: 14px 12px;
  background: var(--panel); color: var(--fg); border: 1px solid var(--line); border-radius: 12px;
  font-size: 17px; font-family: inherit; cursor: pointer;
}
.note { color: var(--muted); font-size: 14px; text-align: center; }
.status { font-weight: 700; margin: 0 0 10px; }
.modes { display: flex; gap: 8px; margin-bottom: 10px; }
.mode {
  flex: 1; padding: 12px 6px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel); color: var(--fg); font-size: 15px; font-family: inherit;
}
.mode.on { background: var(--fg); color: #fff; font-weight: 700; border-color: var(--fg); }
#stage { position: relative; background: #000; border-radius: 12px; overflow: hidden; }
#view { display: block; width: 100%; height: auto; touch-action: manipulation; }
.legend { font-size: 14px; color: var(--muted); margin: 8px 0; }
.sw { display: inline-block; width: 14px; height: 14px; border: 3px solid; vertical-align: -2px; margin-right: 4px; }
.sw.on { border-color: var(--on); }
.sw.off { border-color: var(--off); border-style: dashed; }
.faces { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; margin: 10px 0; }
.face {
  position: relative; padding: 0; border: 3px solid var(--on); border-radius: 10px; overflow: hidden;
  background: #000; aspect-ratio: 1; cursor: pointer;
}
.face.off { border-color: var(--off); border-style: dashed; opacity: .75; }
.face canvas { width: 100%; height: 100%; display: block; }
.face span {
  position: absolute; left: 0; right: 0; bottom: 0; font-size: 12px; font-weight: 700;
  background: rgba(0,0,0,.7); color: #fff; text-align: center; padding: 1px 0;
}
.warn { background: #fff5e0; color: #5a3b00; border-left: 4px solid #ffb300; padding: 10px 12px; border-radius: 6px; font-size: 14px; }
.actions { margin-top: 14px; }
footer { margin-top: 28px; color: var(--muted); font-size: 12px; }
.bar { height: 10px; background: #2a2a2a; border-radius: 6px; overflow: hidden; margin: 6px 0 14px; }
#vbar { height: 100%; width: 0; background: var(--accent); transition: width .2s; }
#vstage { background: #000; border-radius: 12px; overflow: hidden; }
#vview { display: block; width: 100%; height: auto; touch-action: manipulation; }
#vtime { width: 100%; margin: 12px 0; }
.note-left { font-size: 14px; color: var(--muted); }
#vout { width: 100%; border-radius: 12px; background: #000; margin-bottom: 6px; }
details { background: var(--panel); border-radius: 10px; padding: 8px 10px; margin: 8px 0; }
summary { font-size: 14px; color: var(--muted); cursor: pointer; }
.check { display: flex; gap: 10px; align-items: center; margin: 14px 2px 4px; font-size: 16px; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); }
.hint { font-size: 14px; color: var(--muted); margin: 6px 2px 0; }
.label { font-size: 14px; color: var(--muted); margin: 14px 2px 6px; }
.style-sw { margin-bottom: 10px; }
details.pro { margin-top: 14px; }
.howto { font-size: 14px; color: var(--fg); padding-left: 18px; margin: 10px 0 4px; }
.howto li { margin-bottom: 6px; }
a { color: var(--accent); }
.links { margin: 6px 0 0; font-size: 15px; }
.text { width: 100%; padding: 12px; font-size: 16px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--fg); font-family: inherit; }
.doc main section { margin-top: 22px; }
.doc h2 { font-size: 20px; margin: 0 0 8px; border-left: 4px solid var(--accent); padding-left: 8px; }
.doc h3 { font-size: 16px; margin: 16px 0 4px; }
.doc ol, .doc ul { padding-left: 20px; }
.doc li { margin-bottom: 6px; }
