/* 組み合わせ滑車メーカー スタイルシート */

:root {
  --bg-main: #0f172a;
  --accent: #fbbf24;
  --accent-blue: #38bdf8;
  --accent-purple: #a78bfa;
  --accent-green: #4ade80;
  --accent-red: #f87171;
  --text: #f1f5f9;
  --text-dim: #cbd5e1;
  --text-secondary: #94a3b8;
  --glass: rgba(15, 23, 42, 0.72);
  --border: rgba(255, 255, 255, 0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', 'Outfit', 'Hiragino Kaku Gothic ProN', Meiryo, sans-serif;
  background-color: var(--bg-main);
  color: var(--text);
  overflow: hidden;
}

.app-container {
  position: relative;
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pinch-zoom;
}

.main-content {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
}

.app-title {
  position: absolute;
  top: 25px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  font-family: 'Outfit', sans-serif;
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  z-index: 100;
  white-space: nowrap;
  pointer-events: none;
}

#top-nav { position: absolute; top: 20px; left: 20px; z-index: 1000; }

.portal-link-btn-mini {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--glass); border: 1px solid var(--border);
  color: var(--text); text-decoration: none;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.portal-link-btn-mini:hover {
  background: rgba(255,255,255,0.1);
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  transform: translateY(-2px);
}

canvas#makerCanvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 1;
  touch-action: none;
}

.header-controls {
  position: absolute;
  top: 45px; right: 20px;
  display: flex; flex-direction: column;
  gap: 6px; z-index: 1000;
  width: 340px;
  max-height: calc(100% - 65px);
  overflow-y: auto;
  pointer-events: none;
}
.header-controls > * { pointer-events: auto; }

.floating-panel {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 8px 12px;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  width: 100%;
  flex-shrink: 0;
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  position: relative;
}
.panel-header h3 {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0;
  font-family: 'Outfit', sans-serif;
  letter-spacing: 0.02em;
}

/* パーツ説明の「?」ボタンとポップオーバー(輪軸などの説明を常時表示せず、
   タップしたときだけ出すことでパネルをコンパクトに保つ) */
.help-btn {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-dim);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.help-btn:hover, .help-btn.active {
  border-color: var(--accent-blue);
  color: #fff;
  background: rgba(56, 189, 248, 0.16);
}
/* 部品説明ポップオーバー: サイドパネルに埋もれないよう、キャンバスの上に
   フローティング表示する。デフォルト位置は部品設定パネルの横(JS側で計算)。
   ヘッダーをドラッグして移動でき、枠色はJSでパーツごとの色に切り替える。 */
/* 汎用: ドラッグ可能・非モーダルな浮動ウィンドウの共通見た目。
   パーツのヘルプポップオーバー(help-popover)と部品一覧・一括設定ウィンドウ
   (parts-list-window)の両方がこのクラス群を土台にする(コード重複を避けるため)。
   個々の見た目差分(幅・最大高さなど)は専用クラス側で上書きする。 */
.floating-window-base {
  position: fixed;
  display: flex;
  flex-direction: column;
  background: rgba(10, 16, 30, 0.98);
  border: 2px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  z-index: 1500;
  cursor: grab;
  touch-action: none;
}
.floating-window-base.dragging {
  transition: none;
  cursor: grabbing;
}
.floating-window-base.measuring {
  visibility: hidden;
}
.floating-window-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.floating-window-title {
  flex: 1;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.floating-window-close {
  flex-shrink: 0;
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-dim);
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s ease;
}
.floating-window-close:hover {
  background: rgba(248, 113, 113, 0.2);
  border-color: var(--accent-red);
  color: #fff;
}
.floating-window-body {
  padding: 10px 12px;
  font-size: 0.76rem;
  line-height: 1.55;
  color: var(--text-dim);
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

/* パーツのヘルプポップオーバー固有の見た目(幅・本文内の見出しスタイルなど) */
.help-popover {
  width: 260px;
  max-width: calc(100vw - 40px);
}
.help-popover .help-section + .help-section { margin-top: 8px; }
.help-popover .help-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent-blue);
  margin-bottom: 2px;
}

/* 部品一覧・一括設定ウィンドウ固有の見た目。左に一覧(見開きの左ページ)、
   右に選択中の1部品の設定(見開きの右ページ)を並べる2ペイン構成にしてある。
   ウィンドウ全体としては横に広げ、ヘッダーは固定・各ペインはそれぞれ独立して
   スクロールさせる(floating-window-body自体はスクロールさせず、内側の
   parts-list-master/parts-list-detailにoverflow-y:autoを持たせる)。
   本文にスライダー・セレクト・削除ボタンなど操作要素があるため、ドラッグの
   ハンドルはヘッダー部分のみに限定する(floating-window-baseの既定はcursor: grabで
   要素全体が対象だが、ここでは打ち消してヘッダーだけに付け直す)。 */
.parts-list-window {
  width: 560px;
  max-width: calc(100vw - 40px);
  max-height: min(70vh, 560px);
  cursor: default;
}
.parts-list-window .floating-window-header {
  cursor: grab;
}
.parts-list-window.dragging .floating-window-header {
  cursor: grabbing;
}
/* floating-window-bodyの共通paddingは2ペインレイアウトと相性が悪い(各ペインの
   淵まで背景・区切り線を伸ばしたい)ため、ここだけ打ち消してpaddingは各ペイン側に
   持たせる。overflowも「本体全体でスクロール」から「各ペインが個別にスクロール」に
   変えるためhiddenにする。 */
.parts-list-window .floating-window-body {
  padding: 0;
  overflow: hidden;
}

/* 見開きレイアウト本体: 左=一覧(master)、右=選択中の部品の設定(detail)。
   ウィンドウ幅が狭い場合(スマホ等)はメディアクエリ側でcolumnに切り替える。 */
.parts-list-layout {
  display: flex;
  height: 100%;
  min-height: 0;
}
.parts-list-master {
  width: 190px;
  flex-shrink: 0;
  overflow-y: auto;
  padding: 10px 8px;
  border-right: 1px solid var(--border);
}
.parts-list-detail {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 10px 12px;
}
.parts-list-detail-placeholder {
  margin: 0;
}
.parts-list-detail-heading {
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.parts-list-detail-body .control-group:first-child {
  margin-top: 0;
}

/* 部品一覧(見開き左ページ)。種別ごとのグループ見出し＋タップで右ページに
   設定を表示する行のリスト。 */
.parts-list-group + .parts-list-group {
  margin-top: 12px;
}
.parts-list-group-heading {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-blue);
  letter-spacing: 0.02em;
  margin-bottom: 5px;
}
.parts-list-row {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(30, 41, 59, 0.5);
  overflow: hidden;
}
/* 現在右ページ(parts-list-detail)に設定を表示中の行を強調する。 */
.parts-list-row.active {
  background: rgba(56, 189, 248, 0.14);
  border-color: var(--accent-blue);
}
/* キャンバス上のハイライトリング(#4ade80。drawSelectionRing参照)と同じ色に揃えて、
   一覧のどの行がキャンバス上で選択中の部品と対応しているか一目で分かるようにする(Step5)。 */
.parts-list-row.selected {
  border-color: #4ade80;
  box-shadow: 0 0 0 1px rgba(74, 222, 128, 0.5);
}
.parts-list-row.selected .parts-list-row-header {
  color: #fff;
}
.parts-list-row + .parts-list-row {
  margin-top: 6px;
}
.parts-list-row-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 7px 10px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 0.78rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: color 0.15s ease;
}
.parts-list-row-header:hover {
  color: #fff;
}
.parts-list-row-header::after {
  content: "›";
  flex-shrink: 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: color 0.15s ease;
}
.parts-list-row-header[aria-current="true"]::after {
  color: var(--accent-blue);
}

.hint-box {
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--text-secondary);
  background: rgba(0,0,0,0.2);
  border-radius: 8px;
  padding: 8px 10px;
}

/* ひもタブ: 短くしたヒント文と、詳しい説明を呼び出す「?」ボタンを横並びに。
   ヒント文はステータスに応じて長さが変わるので、ボタン側は幅を固定して
   常に同じ大きさで押せるようにする(align-items: flex-startで複数行時も上揃え)。 */
.rope-hint-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.rope-hint-row .hint-box {
  flex: 1;
  min-width: 0;
}
.rope-hint-row .help-btn {
  margin-top: 2px;
}

/* 組み立てパネルのタブ切り替え(パーツ/ひも)
   パーツパレットのカード型ボタンと混同しないよう、枠なしのセグメント
   コントロール(スライドする背景ハイライト)の見た目にしている。 */
.tab-switch {
  display: flex;
  gap: 2px;
  margin-bottom: 10px;
  background: rgba(0, 0, 0, 0.28);
  border-radius: 10px;
  padding: 3px;
}
.tab-btn {
  flex: 1;
  padding: 6px 8px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.tab-btn:hover:not(.active) { color: var(--text-dim); }
.tab-btn.active {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* 汎用の2択トグル(取り付け先「天井/地面」など)。見た目は.tab-switch/.tab-btnと同じ
   セグメントコントロールだが、部品設定フォーム側で使うための別クラスにしてある
   (組み立てパネルのタブ切替と用途が異なるため、片方の見た目調整がもう片方に
   意図せず影響しないよう分離した)。ネイティブの<select>だと開く方向をブラウザに
   任せるしかなく、下に開くと直下の削除ボタンに重なって誤タップすることがあった
   ため、常にその場でタップできるこの形に置き換えた(利用者からの要望対応)。 */
.segmented-toggle {
  display: flex;
  gap: 2px;
  background: rgba(0, 0, 0, 0.28);
  border-radius: 10px;
  padding: 3px;
}
.segmented-btn {
  flex: 1;
  padding: 6px 8px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.segmented-btn:hover:not(.active) { color: var(--text-dim); }
.segmented-btn.active {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* パーツパレット */
.palette-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 8px;
}
.palette-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 4px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-dim);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.palette-btn .palette-icon { font-size: 1.3rem; line-height: 1; }
.palette-btn:hover { border-color: var(--accent-blue); color: #fff; }
.palette-btn.armed {
  border-color: var(--accent);
  background: rgba(251, 191, 36, 0.15);
  color: var(--accent);
  box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.3);
}
.palette-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* 汎用ボタン */
.action-btn {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  border: none; border-radius: 8px; color: #fff;
  padding: 8px 12px; font-size: 0.82rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}
.action-btn:hover { transform: translateY(-1px); }
.action-btn.active {
  background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.4);
}

.secondary-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border);
  border-radius: 8px; color: var(--text-dim);
  padding: 8px 12px; font-size: 0.8rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s ease;
}
.secondary-btn:hover:not(:disabled) { border-color: var(--accent-blue); color: #fff; }
.secondary-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.danger-btn {
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.4);
  border-radius: 8px; color: var(--accent-red);
  padding: 8px 12px; font-size: 0.8rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s ease;
}
.danger-btn:hover { background: rgba(248, 113, 113, 0.22); }

/* 部品設定パネル */
.control-group { margin-bottom: 8px; }
.control-group:last-child { margin-bottom: 0; }
.control-group label {
  display: block; font-size: 0.8rem;
  color: var(--text-secondary); margin-bottom: 4px;
}
.control-group label span, .control-group label b { font-weight: 600; color: var(--text); }

input[type="range"] {
  -webkit-appearance: none; width: 100%;
  height: 6px; border-radius: 3px;
  background: rgba(255,255,255,0.1); outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px;
  border-radius: 50%; background: var(--accent-blue);
  cursor: pointer; box-shadow: 0 0 8px rgba(56, 189, 248, 0.5);
}
input[type="range"]:disabled::-webkit-slider-thumb { background: #64748b; }

select {
  width: 100%; padding: 7px 10px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font-size: 0.8rem; outline: none; cursor: pointer;
}

.checkbox-row {
  display: flex; align-items: center; gap: 7px;
  font-size: 0.8rem; color: var(--text-dim);
  cursor: pointer; margin-bottom: 7px;
}
.checkbox-row:last-child { margin-bottom: 0; }
.checkbox-row input[type="checkbox"] {
  width: 15px; height: 15px; flex-shrink: 0;
  accent-color: var(--accent-blue); cursor: pointer;
}

.sim-stats {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 0.82rem; color: var(--text-dim);
  border-top: 1px dashed var(--border);
  padding-top: 8px; margin-top: 6px;
}
.sim-stats b { color: var(--accent); }

/* おもりが複数あるときの「おもりの上昇」リスト表示(ステップ4) */
.lift-list {
  display: flex; flex-direction: column; gap: 3px;
  padding-left: 2px;
}
.lift-list > div { display: flex; justify-content: space-between; gap: 8px; }

/* ひも一覧(複数ひも対応) */
.rope-list {
  display: flex; flex-direction: column; gap: 6px;
  margin-top: 8px;
  max-height: 160px;
  overflow-y: auto;
}
.rope-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
}
.rope-item-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.rope-del-btn {
  flex-shrink: 0;
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(248, 113, 113, 0.15);
  border: 1px solid rgba(248, 113, 113, 0.4);
  border-radius: 6px;
  color: var(--accent-red);
  font-size: 0.7rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s ease;
}
.rope-del-btn:hover { background: rgba(248, 113, 113, 0.3); }

/* シミュレーションHUD: サイドパネルのスクロールに巻き込まれず、常に画面下部に見える */
#sim-panel {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  width: min(680px, calc(100% - 40px));
  z-index: 900;
  padding: 10px 18px;
}
#sim-panel .panel-content {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 22px;
}
/* 「ひもを引く長さ」は常にバー全体の幅を使う1行にして、数字が増えても
   折り返さないようにする(数字部分は幅を固定して桁が増えても位置がぶれない)。
   スライダーの横には「手でひもを引っ張る」という見出しラベルを添える。 */
.sim-hud-pull {
  flex: 1 1 100%;
  margin-bottom: 0;
}
.sim-hud-pull-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.sim-hud-pull-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dim);
  white-space: nowrap;
}
.sim-hud-pull-control {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sim-hud-pull-control label {
  white-space: nowrap;
  margin-bottom: 0;
}
.sim-hud-pull-control label #pullVal {
  display: inline-block;
  min-width: 2.2em;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.sim-hud-pull-control input[type="range"] {
  width: 140px;
  max-width: 100%;
}
/* 各数値は「-」から実際の値に変わっても幅がほぼ変わらないよう最小幅を確保し、
   折り返し位置が値の有無でガタつかないようにする。 */
#sim-panel .sim-stats {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 4px 16px;
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}
#sim-panel .sim-stats > div {
  min-width: 108px;
  white-space: nowrap;
}
#sim-panel .sim-stats b {
  font-variant-numeric: tabular-nums;
}
#sim-panel .sim-hud-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
}
#sim-panel .sim-hud-toggles .checkbox-row { margin-bottom: 0; white-space: nowrap; }
#sim-panel #simWarning {
  flex-basis: 100%;
  margin-top: 2px;
  color: var(--accent-red);
  border: 1px solid rgba(248,113,113,0.4);
}

.hidden { display: none !important; }

@media (max-width: 768px) {
  body { overflow-y: auto; }
  .app-container { width: 100%; height: auto; overflow-y: auto; touch-action: auto; }
  .main-content {
    position: relative; width: 100%; height: auto; min-height: 100dvh;
    display: flex; flex-direction: column; align-items: center;
    padding: 15px; gap: 10px;
  }
  .app-title { position: relative; top: 0; left: 0; transform: none; order: 1; font-size: 1.25rem; margin-bottom: 4px; }
  #top-nav { position: absolute; top: 15px; left: 15px; }
  .header-controls {
    display: contents;
  }
  #build-panel { order: 2; width: 100% !important; max-width: 480px; position: relative; margin-top: 40px; }
  #parts-list-open-panel { order: 2; width: 100% !important; max-width: 480px; position: relative; }
  canvas#makerCanvas {
    position: relative; order: 3; width: 100% !important; height: 380px !important;
    max-width: 480px; border-radius: 12px; border: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.4); z-index: 1;
  }
  #props-panel { order: 4; width: 100% !important; max-width: 480px; position: relative; }
  #sim-panel {
    order: 5; width: 100% !important; max-width: 480px;
    position: relative; left: auto; bottom: auto; transform: none;
  }
  #sim-panel .panel-content { flex-direction: column; align-items: stretch; }
  #sim-panel .sim-hud-pull-control input[type="range"] { width: 100%; }
  #sim-panel .sim-stats { flex-direction: column; }
  #sim-panel .sim-hud-toggles { flex-direction: column; gap: 0; }
  .floating-panel { width: 100% !important; max-width: 100%; max-height: none; overflow-y: visible; }

  /* 部品一覧・一括設定ウィンドウ(Step7): position:fixedのオーバーレイなので
     上記のflow配置(display:contents化など)の影響は受けない。デフォルト位置は
     defaultFloatingWindowPosition()がStep3から共通化済みで、狭い画面では
     自動的にボタンの下に回る(anchorがほぼ画面幅いっぱいのため、左に置く余白が
     足りず自動的にこの分岐に入る)ため、位置決めロジック自体はJS側の変更不要。
     ここではデスクトップ基準の固定幅のままだと画面に収まらないので、props-panel等の
     他パネルと同じ考え方(画面幅を活かす・上限を設ける)に合わせて狭めるのと、
     閉じるボタンをタップしやすい大きさにするだけの調整を行う。 */
  .parts-list-window {
    width: calc(100vw - 24px);
    max-width: 440px;
    max-height: min(72dvh, 560px);
  }
  .parts-list-window .floating-window-close {
    width: 26px;
    height: 26px;
    font-size: 0.95rem;
  }
  /* 見開き(左=一覧/右=設定)を横に並べる余白が無いため、狭い画面では上下2段に
     切り替える。一覧を上段・設定を下段に置き、それぞれが自分の持ち分の高さの中で
     独立してスクロールする(左右分割時のoverflow-y:autoの考え方はそのまま流用)。 */
  .parts-list-layout {
    flex-direction: column;
  }
  .parts-list-master {
    width: 100%;
    flex: 0 0 38%;
    max-height: 38%;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .parts-list-detail {
    flex: 1;
  }
}
