/* ==========================================
   容積マスター｜内のり体感ツール CSS
   プレフィックス: nvm-
   Version: 2.0.0（ヘッダー＋フルスクリーンcanvas＋右下ツールバー＋一本道ステップ構成）
   ========================================== */

.nvm-root, .nvm-root * { box-sizing: border-box; }

.nvm-root {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: "BIZ UDGothic", "M PLUS Rounded 1c", "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
  background: #f5f7fa;
  color: #2C3E50;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  z-index: 9999;
}

/* ===== ヘッダー ===== */
.nvm-root .nvm-header {
  position: fixed; top: 0; left: 0; right: 0;
  height: 52px;
  background: #1e3a5f;
  color: #fff;
  display: flex; align-items: center;
  padding: 0 16px;
  gap: 12px;
  z-index: 20;
}
.nvm-root .nvm-header h1 { font-size: 17px; font-weight: bold; flex: 1; margin: 0; }

/* 右端の状態表示＝タップで「内のり・容積」の答えを見られるバッジ */
.nvm-root .nvm-info {
  font-size: 13px;
  font-weight: bold;
  background: rgba(255,255,255,0.15);
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
.nvm-root .nvm-info.nvm-revealed { background: #d4af37; }

/* ===== 答えパネル（ヘッダー直下・タップで開閉） ===== */
.nvm-root .nvm-answer-panel {
  position: fixed;
  top: 52px; right: 16px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
  padding: 14px 18px;
  z-index: 19;
  width: min(80vw, 260px);
}
.nvm-root .nvm-answer-panel.hidden { display: none; }
.nvm-root .nvm-formula-row {
  font-size: 13px;
  color: #5a708a;
  margin-bottom: 4px;
}
.nvm-root .nvm-formula-row b { color: #1e3a5f; }
.nvm-root .nvm-result-row {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #c8d4e8;
  font-size: 14px;
  font-weight: bold;
  color: #1e3a5f;
}
.nvm-root .nvm-big-num { font-size: 22px; color: #d4af37; }

/* ===== フルスクリーンcanvas領域 ===== */
.nvm-root #nvm-canvas-wrap {
  position: fixed;
  top: 52px; left: 0;
  width: 100vw;
  height: calc(100vh - 52px);
  background: #e8edf4;
}
.nvm-root #nvm-canvas-wrap canvas { display: block; }

/* ===== 常設コントロールパネル（間かく・スライス） ===== */
.nvm-root .nvm-control-panel {
  position: fixed;
  left: 16px; top: 64px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.18);
  padding: 10px 16px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 10;
}
.nvm-root .nvm-ctrl-row { display: flex; align-items: center; gap: 10px; }
.nvm-root .nvm-ctrl-label { font-size: 12px; font-weight: bold; color: #1e3a5f; flex-shrink: 0; width: 52px; }
.nvm-root .nvm-ctrl-row input[type="range"] { width: 120px; }
.nvm-root .nvm-ctrl-val { font-size: 12px; font-weight: bold; color: #1e3a5f; width: 24px; text-align: right; flex-shrink: 0; }

/* ===== 右下ツールバー ===== */
/* ⚙設定 / 📦入れ物 / 💧中身 / 🎨色分け / 🔲格子線 の5個構成 */
.nvm-root .nvm-toolbar {
  position: fixed;
  right: 16px; bottom: 20px;
  display: flex; flex-direction: column;
  gap: 12px;
  z-index: 10;
}
.nvm-root .nvm-btn {
  width: 60px; height: 60px;
  border-radius: 999px;
  border: none;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(0,0,0,0.25);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.1s;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  background: #fff;
  color: #7F8C8D;
  border: 2px solid #c8d4e8;
}
.nvm-root .nvm-btn:active { transform: scale(0.92); }
.nvm-root .nvm-btn-setting { background: #fff; color: #1e3a5f; border: 2px solid #1e3a5f; }
.nvm-root .nvm-btn.nvm-on  { background: #1e3a5f; color: #fff; border-color: #1e3a5f; }
.nvm-root .nvm-btn.nvm-accent { background: #d4af37; color: #fff; border-color: #d4af37; }
.nvm-root .nvm-btn:disabled { opacity: 0.35; cursor: default; }
.nvm-root .nvm-btn:disabled:active { transform: none; }

/* 🎨色分けボタンの状態バッジ */
.nvm-root .nvm-mode-badge {
  position: absolute;
  top: -6px; right: -6px;
  background: #d4af37;
  color: #fff;
  font-size: 10px;
  font-weight: bold;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}
.nvm-root .nvm-mode-badge.hidden { display: none; }

/* ===== ステップ画面（オーバーレイ） ===== */
.nvm-root .nvm-overlay {
  position: fixed; inset: 0;
  background: rgba(30,58,95,0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  padding: 12px;
  touch-action: pan-y;
}
.nvm-root .nvm-overlay.hidden { display: none; }
.nvm-root .nvm-dialog {
  position: relative;
  background: #fff;
  border-radius: 16px;
  padding: 24px 24px 22px;
  width: min(92vw, 420px);
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
  text-align: center;
}
.nvm-root .nvm-dialog h2 { color: #1e3a5f; font-size: 19px; margin: 0 0 6px; }
.nvm-root .nvm-step-label {
  display: inline-block;
  background: #d4af37;
  color: #fff;
  font-size: 12px;
  font-weight: bold;
  border-radius: 999px;
  padding: 3px 14px;
  margin-bottom: 10px;
}
.nvm-root .nvm-hint { font-size: 13px; color: #5a708a; margin: 0 0 18px; }

.nvm-root .nvm-close {
  position: absolute;
  top: 12px; right: 12px;
  width: 32px; height: 32px;
  border-radius: 999px;
  border: none;
  background: #eef2f6;
  color: #5a708a;
  font-size: 16px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.nvm-root .nvm-form { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; text-align: left; }
.nvm-root .nvm-slider-row { display: flex; align-items: center; gap: 10px; }
.nvm-root .nvm-slider-label { width: 52px; flex-shrink: 0; font-size: 13px; font-weight: bold; color: #1e3a5f; }
.nvm-root .nvm-slider-row input[type="range"] { flex: 1; }
.nvm-root .nvm-slider-val { width: 28px; flex-shrink: 0; text-align: right; font-size: 14px; font-weight: bold; color: #1e3a5f; }

.nvm-root .nvm-decide-btn {
  width: 100%;
  padding: 14px 0;
  border-radius: 999px;
  border: none;
  background: #d4af37;
  color: #fff;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.nvm-root .nvm-decide-btn:active { transform: scale(0.97); }

.nvm-root .hidden { display: none !important; }
