/* Responsive Design for Dotcon Simulation */
/* Version beacon: mobile-responsive.css */
.__dotcon_css_ver_mobile_responsive { --dotcon-css-ver: "1.0.0"; }
/* 768px以下でモバイル版、それ以上でPC版を表示 */
/* Figmaデザイン完全準拠版 */

/* ========================================
   レスポンシブ切り替え
   ======================================== */
.mobile-only {
  display: none !important;
}

.desktop-only {
  display: block;
}

@media (max-width: 768px) {
  .mobile-only {
    display: block !important;
  }

  .desktop-only {
    display: none !important;
  }

  body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
  }

  /* PC版の部材一覧テーブルはモバイルでは非表示にする（二重表示抑止） */
  .parts-table-container,
  .parts-table {
    display: none !important;
  }
}

/* ========================================
   カラーパレット（Figma準拠）
   ======================================== */
:root {
  --primary-blue: #3B82F6;
  --dark-navy: #334E68;
  --light-bg: #F3F4F6;
  --border-gray: #E5E7EB;
  --text-dark: #1F2937;
  --text-gray: #6B7280;
  --white: #FFFFFF;
}

/* ========================================
   基本レイアウト
   ======================================== */
.mobile-only {
  width: 100%;
  min-height: 100vh;
  background-color: var(--light-bg);
}

/* モバイルヘッダー */
.mobile-header {
  background-color: var(--white);
  border-bottom: 1px solid var(--border-gray);
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-logos {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-logos img {
  max-width: 100%;
  height: auto;
  max-height: 28px;
}

/* ========================================
   ヒーローセクション
   ======================================== */
.mobile-hero {
  position: relative;
  padding: 32px 20px;
  text-align: center;
  color: var(--white);
  background: linear-gradient(180deg, #3B82F6 0%, #2563EB 100%);
  overflow: hidden;
}

.mobile-hero-background {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
}

.mobile-hero-title {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: 4px;
  color: var(--white);
  opacity: 0.3;
}

.mobile-hero-subtitle {
  font-size: 13px;
  color: var(--white);
  font-weight: 400;
  opacity: 0.8;
}

/* ========================================
   メインコンテナ
   ======================================== */
.mobile-container {
  padding: 16px;
  max-width: 600px;
  margin: 0 auto;
}

/* 最小幅対応（320px） */
@media (max-width: 375px) {
  .mobile-container {
    padding: 12px;
  }
}

/* ========================================
   製品タイプタブ
   ======================================== */
.mobile-product-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 1px;
  background-color: var(--light-bg);
  border-radius: 12px;
  padding: 4px;
}

.mobile-product-tab {
  flex: 1;
  padding: 12px 16px;
  border: none;
  background: transparent;
  color: var(--text-gray);
  font-size: 15px;
  font-weight: 600;
  border-radius: 10px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.mobile-product-tab.active {
  background-color: var(--white);
  color: var(--primary-blue);
}

/* ========================================
   コンテンツ表示切り替え
   ======================================== */
.mobile-content {
  display: none;
}

.mobile-content[style*="display: block"] {
  display: block;
}

/* ========================================
   セクション見出し（濃紺バー）
   ======================================== */
.mobile-section-title {
  background-color: var(--dark-navy);
  color: var(--white);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 12px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;            /* 統一高さ（エリアベース基準） */
  box-sizing: border-box;      /* 幅/高さ算出の差異防止 */
}

/* 最小幅対応（320px） */
@media (max-width: 375px) {
  .mobile-section-title {
    padding: 8px 12px;
    font-size: 13px;
  }
}

/* ========================================
   エリアベース（3つ横並び）
   ======================================== */
.mobile-template-section {
  margin-bottom: 20px;
}

.mobile-template-buttons,
.shape-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap; /* 横1行固定 */
}

.mobile-template-btn,
.shape-btn {
  flex: 1;
  min-width: 0; /* flexアイテムの最小幅を0に設定 */
  padding: 16px 8px;
  border: 2px solid var(--border-gray);
  background-color: var(--white);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.mobile-template-btn.active,
.shape-btn.active {
  border-color: var(--primary-blue);
  background-color: #EFF6FF;
}

.shape-icon {
  color: var(--text-gray);
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.mobile-template-btn.active .shape-icon,
.shape-btn.active .shape-icon {
  color: var(--primary-blue);
}

.shape-label {
  font-size: 12px;
  color: var(--text-dark);
  font-weight: 500;
  text-align: center;
  word-break: keep-all;
}

/* 最小幅対応（320px） */
@media (max-width: 375px) {
  .mobile-template-btn,
  .shape-btn {
    padding: 12px 6px;
    gap: 4px;
  }

  .shape-icon {
    width: 24px;
    height: 24px;
  }

  .shape-label {
    font-size: 11px;
  }
}

/* ========================================
   デザイン選択（横スクロール）
   ======================================== */
.pattern-selection {
  margin-bottom: 20px;
}

.pattern-buttons {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE, Edge */
}

.pattern-buttons::-webkit-scrollbar {
  display: none; /* Chrome, Safari */
}

.mobile-pattern-btn,
.pattern-btn {
  flex-shrink: 0;
  min-width: 90px;
  padding: 12px 16px;
  border: 2px solid var(--border-gray);
  background-color: var(--white);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-pattern-btn.active,
.pattern-btn.active {
  border-color: var(--primary-blue);
  background-color: #EFF6FF;
}

.pattern-label {
  font-size: 13px;
  color: var(--text-dark);
  font-weight: 500;
  white-space: nowrap;
}

.mobile-pattern-btn.active .pattern-label,
.pattern-btn.active .pattern-label {
  color: var(--primary-blue);
  font-weight: 600;
}

/* 最小幅対応（320px） */
@media (max-width: 375px) {
  .mobile-pattern-btn,
  .pattern-btn {
    min-width: 80px;
    padding: 10px 12px;
  }

  .pattern-label {
    font-size: 12px;
  }
}

/* 端処理トグルのヒット判定を確実化（重なりを防止） */
.mobile-toggle-row {
  position: relative;
  z-index: 5;
  pointer-events: auto;
}
.mobile-toggle-row label,
.mobile-toggle-row input[type="checkbox"] {
  pointer-events: auto;
}

/* Edge finish switch (Mobile) - PCと同等のスイッチ見た目 */
.edge-finish-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
}
.edge-finish-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.edge-finish-toggle label {
  position: relative;
  display: inline-block;
  padding-left: 64px; /* スイッチ幅分の余白 */
  line-height: 28px;
  cursor: pointer;
  user-select: none;
}
.edge-finish-toggle label::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 28px;
  background: #cfcfcf;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08);
  transition: background 0.2s ease;
}
.edge-finish-toggle label::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  transition: transform 0.2s ease;
}
.edge-finish-toggle input[type="checkbox"]:checked + label::before {
  background: #2E6FE7; /* ON: ブルー */
}
.edge-finish-toggle input[type="checkbox"]:checked + label::after {
  transform: translate(24px, -50%);
}

/* ========================================
   モバイル: エリアベース/デザインのセクション背景を撤廃
   - mobile-styles.css の白背景/ボーダーをモバイル表示時に打ち消し
   - ボタン自体の白背景は維持（可読性確保）
   ======================================== */
.mobile-container .shape-selection,
.mobile-container .pattern-selection {
  background-color: transparent !important;
  border: none !important;
  padding-left: 0;
  padding-right: 0;
}

/* キャンバスセクションの外周余白を統一（見出し帯の横幅差を解消） */
.mobile-container .canvas-container {
  background-color: transparent !important;
  border: none !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* 極小画面（≤375px）でのカード縮小最適化 */
@media (max-width: 375px) {
  .mobile-parts-grid { gap: 12px; }
  .mobile-part-card { padding: 16px; min-height: 84px; }
  .mobile-part-icon { width: 48px; height: 48px; border-radius: 10px; }
  .mobile-part-count { font-size: 24px; }
}

/* ========================================
   使用パーツ（Dotcon/Dotcon+）強制スタイル（競合対策）
   ======================================== */
#dotconPlusContent .mobile-parts-section .mobile-parts-grid,
#dotconContent .mobile-parts-section .mobile-parts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

#dotconPlusContent .mobile-parts-section .mobile-part-card,
#dotconContent .mobile-parts-section .mobile-part-card {
  background-color: var(--white);
  border: 1px solid var(--border-gray);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 2px 6px rgba(17, 24, 39, 0.08);
  min-height: 96px;
}

#dotconPlusContent .mobile-parts-section .mobile-part-icon,
#dotconContent .mobile-parts-section .mobile-part-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  flex-shrink: 0;
}

#dotconPlusContent .mobile-parts-section .mobile-part-name,
#dotconContent .mobile-parts-section .mobile-part-name {
  font-size: 13px;
  color: var(--text-gray);
  font-weight: 500;
}

#dotconPlusContent .mobile-parts-section .mobile-part-count,
#dotconContent .mobile-parts-section .mobile-part-count {
  font-size: 28px;
  font-weight: 800;
  color: #0F172A;
  letter-spacing: -0.2px;
  line-height: 1.2;
}

@media (max-width: 375px) {
  #dotconPlusContent .mobile-parts-section .mobile-part-card,
  #dotconContent .mobile-parts-section .mobile-part-card { padding: 16px; min-height: 84px; }
  #dotconPlusContent .mobile-parts-section .mobile-part-icon,
  #dotconContent .mobile-parts-section .mobile-part-icon { width: 48px; height: 48px; border-radius: 10px; }
  #dotconPlusContent .mobile-parts-section .mobile-part-count,
  #dotconContent .mobile-parts-section .mobile-part-count { font-size: 24px; }
}

/* ========================================
   エリアサイズ
   ======================================== */
.mobile-area-section,
.canvas-size {
  margin-bottom: 20px;
}

.mobile-area-inputs {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mobile-area-input-group,
.size-input {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--white);
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-gray);
}

.mobile-area-input-group label,
.size-input label {
  font-size: 14px;
  color: var(--text-dark);
  font-weight: 500;
}

.mobile-area-input-field {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mobile-area-input-field input {
  border: none;
  background: none;
  font-size: 16px;
  color: var(--text-dark);
  font-weight: 600;
  width: 60px;
  text-align: right;
  outline: none;
}

.mobile-area-unit {
  font-size: 14px;
  color: var(--text-gray);
  font-weight: 500;
  min-width: 18px;
}

/* モバイル: エリアサイズ注記（文字のみ・小さめ） */
.mobile-area-note {
  font-size: 12px;
  color: var(--text-gray);
}

/* 最小幅対応（320px） */
@media (max-width: 375px) {
  .mobile-area-input-group,
  .size-input {
    padding: 8px 12px;
  }

  .mobile-area-input-group label,
  .size-input label {
    font-size: 13px;
  }

  .mobile-area-input-field input {
    font-size: 15px;
    width: 50px;
  }

  .mobile-area-unit {
    font-size: 13px;
  }
}

/* ========================================
   完成図イメージ
   ======================================== */
.mobile-canvas-section,
.canvas-container {
  margin-bottom: 24px;
}

.mobile-canvas-wrapper,
.preview-area {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  background-color: var(--white);
  border: 1px solid var(--border-gray);
  border-radius: 8px;
  overflow: hidden;
}

.mobile-canvas,
.preview-canvas {
  width: 100%;
  height: 100%;
}

.mobile-canvas-reset-zone {
  margin-top: 8px;
  text-align: left;
}

.mobile-inline-reset {
  border: 1px solid var(--border-gray);
  background: var(--white);
  color: var(--text-dark);
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* ========================================
   リサイズハンドル
   ======================================== */
.mobile-resize-handles,
.resize-handles {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}

.resize-handle {
  position: absolute;
  width: 20px;
  height: 20px;
  background-color: var(--primary-blue);
  border: 2px solid var(--white);
  border-radius: 50%;
  pointer-events: all;
  cursor: pointer;
  touch-action: none;
  transform: translate(-50%, -50%);
}

/* ========================================
   使用パーツ（Dotcon+）
   ======================================== */
.mobile-parts-section {
  margin-bottom: 24px;
}

/* 旧タブはモバイルのみ非表示（PCでは表示） */
@media (max-width: 767px) {
  .mobile-parts-section .parts-view-tabs,
  .mobile-only .parts-view-tabs {
    display: none !important;
  }
}

.mobile-parts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.mobile-part-card {
  background-color: var(--white);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--border-gray);
  box-shadow: 0 2px 6px rgba(17, 24, 39, 0.08);
  min-height: 96px;
}

.mobile-part-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  flex-shrink: 0;
}

.mobile-part-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mobile-part-name {
  font-size: 13px;
  color: var(--text-gray);
  font-weight: 500;
}

.mobile-part-count {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-dark);
  letter-spacing: -0.2px;
  line-height: 1.2;
}

/* ========================================
   Dotconパネル表示
   ======================================== */
.mobile-area-display {
  background-color: var(--white);
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dark);
  border: 1px solid var(--border-gray);
}

.mobile-panels-display {
  background-color: var(--white);
  border-radius: 8px;
  padding: 32px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  border: 1px solid var(--border-gray);
}

.mobile-panels-display span:first-child {
  font-size: 64px;
  font-weight: 900;
  color: var(--primary-blue);
  line-height: 1;
  margin-bottom: 8px;
}

.mobile-panels-unit {
  font-size: 20px;
  font-weight: 500;
  color: var(--text-dark);
}

/* ========================================
   コンクリート量
   ======================================== */
.mobile-concrete-info {
  background-color: var(--white);
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dark);
  border: 1px solid var(--border-gray);
}

/* ========================================
   合計金額
   ======================================== */
.mobile-total-section {
  background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
  color: var(--white);
  border-radius: 12px;
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.mobile-total-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  line-height: 1.2;
  font-size: 16px;
  font-weight: 600;
}

.mobile-total-note {
  font-size: 14px;
  font-weight: 500;
  color: inherit;
}

.mobile-total-amount {
  font-size: 28px;
  font-weight: 900;
}

/* ========================================
   アクションボタン
   ======================================== */
.mobile-action-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 32px;
}

.mobile-action-btn {
  width: 100%;
  padding: 16px 20px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mobile-reset-btn {
  background-color: var(--white);
  color: var(--text-gray);
  border: 1px solid var(--border-gray);
}

.mobile-estimate-btn {
  background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
  color: var(--white);
}

.mobile-share-btn {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: var(--white);
}

/* ========================================
   図形タブ
   ======================================== */
.mobile-shape-tabs {
  display: flex;
  gap: 8px;
  margin-top: 0;
  margin-bottom: 20px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-shape-tabs-scroll {
  display: flex;
  gap: 8px;
  flex: 1;
  overflow-x: auto;
}

.mobile-shape-tab {
  flex-shrink: 0;
  padding: 10px 16px;
  background-color: var(--white);
  border: 1px solid var(--border-gray);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.mobile-shape-tab.active {
  background-color: #EFF6FF;
  border-color: var(--primary-blue);
}

.mobile-shape-tab-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dark);
}

.mobile-shape-tab.active .mobile-shape-tab-label {
  color: var(--primary-blue);
  font-weight: 600;
}

.mobile-shape-tab-close {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  background: var(--white);
  border: 1px solid var(--border-gray);
  border-radius: 9999px;
  color: var(--text-gray);
  font-size: 14px;
  line-height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.mobile-shape-tab-close:hover { background: #F8FAFC; color: var(--text-dark); }

.mobile-shape-tab-add {
  flex-shrink: 0;
  padding: 10px 12px;
  background-color: var(--white);
  border: 1px solid var(--border-gray);
  border-radius: 8px;
  color: var(--text-dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.mobile-shape-tab-add:hover { background-color: #F8FAFC; border-color: #CBD5E1; }
.mobile-shape-tab-add:active { background-color: #EFF6FF; border-color: var(--primary-blue); color: var(--primary-blue); }
.mobile-shape-tab-add svg { color: currentColor; }

/* タブ長押しメニュー */
.mobile-tab-menu {
  position: fixed;
  z-index: 10000;
  background: var(--white);
  border: 1px solid var(--border-gray);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18), 0 4px 8px rgba(15, 23, 42, 0.08);
  padding: 6px;
  min-width: 180px;
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 140ms ease, transform 140ms cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: none;
  will-change: transform, opacity, left, top;
}

.mobile-tab-menu.open { opacity: 1; transform: scale(1); pointer-events: auto; }

/* ケアレ（矢印） */
.mobile-tab-menu::after {
  content: "";
  position: absolute;
  width: 10px; height: 10px;
  background: var(--white);
  border-left: 1px solid var(--border-gray);
  border-top: 1px solid var(--border-gray);
  transform: rotate(45deg);
  left: var(--caret-left, 18px);
}
.mobile-tab-menu.pos-bottom::after { top: -6px; box-shadow: -2px -2px 0 rgba(0,0,0,0.01); }
.mobile-tab-menu.pos-top::after { bottom: -6px; transform: rotate(225deg); box-shadow: 2px 2px 0 rgba(0,0,0,0.01); }

.mobile-tab-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  border: none;
  color: var(--text-dark);
  font-size: 14px;
  background: transparent;
}
.mobile-tab-menu-item svg { width: 18px; height: 18px; color: var(--text-gray); }
.mobile-tab-menu-item:hover { background: #F8FAFC; }
.mobile-tab-menu-item:active, .mobile-tab-menu-item.active { background: #EFF6FF; color: var(--primary-blue); }

/* モバイル面積（readonly）スピンボタン非表示（Dotcon/Dotcon+） */
#mobileAreaSquareDotcon::-webkit-outer-spin-button,
#mobileAreaSquareDotcon::-webkit-inner-spin-button,
#mobileAreaSquarePlus::-webkit-outer-spin-button,
#mobileAreaSquarePlus::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
#mobileAreaSquareDotcon,
#mobileAreaSquarePlus {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* ========================================
   Dotcon（パネル情報）も同デザインで統一
   ======================================== */
/* ========================================
   Dotcon/Dotcon+ 統一: セクション全体を単一オブジェクトで囲う
   ======================================== */
#dotconPlusContent .mobile-parts-section,
#dotconContent .mobile-parts-section {
  border: 2px solid var(--primary-blue);
  border-radius: 16px;
  background: var(--white);
  padding: 0;
  overflow: hidden;
}

/* パーツ一覧ラッパの余白/影/枠線を無効化（見出し帯を他と同幅に） */
#dotconPlusContent .mobile-parts-section .parts-legend-section,
#dotconContent .mobile-parts-section .parts-legend-section {
  padding: 0 !important; /* 見出しはフラットに保つ */
  box-shadow: none !important;
  border: none !important;
  border-radius: 0 !important;
}

/* パーツ一覧 見出し帯の高さを厳密に 44px へ固定 */
.mobile-parts-section .parts-legend-section > .mobile-section-title {
  height: 44px;               /* 全見出しと完全一致 */
  padding-top: 0;              /* 縦方向は高さで管理 */
  padding-bottom: 0;           /* 縦方向は高さで管理 */
  align-items: center;         /* 垂直中央揃え */
}
.mobile-parts-section .parts-legend-section > .mobile-section-title .segmented-control {
  height: 32px;
  box-sizing: border-box;
  padding: 3px;                /* 内側の枠余白 */
  margin: 0;                   /* はみ出し防止 */
  align-self: center;          /* タイトル行中央 */
  border-radius: 12px;
  gap: 6px;                    /* ボタン間の隙間 */
}
.mobile-parts-section .parts-legend-section > .mobile-section-title .segment-btn {
  height: 28px;
  line-height: 28px;
  padding: 0 12px;
  margin: 0;
  border-radius: 10px;
}

/* パーツ一覧の中身だけ余白を復帰（見出しはフラットのまま） */
#dotconPlusContent .mobile-parts-section .parts-legend-section .legend-grid,
#dotconContent .mobile-parts-section .parts-legend-section .legend-grid {
  padding: 12px 12px 0 12px;
}
#dotconPlusContent .mobile-parts-section .parts-legend-section .legend-divider,
#dotconContent .mobile-parts-section .parts-legend-section .legend-divider {
  margin: 8px 12px;
}
#dotconPlusContent .mobile-parts-section .parts-legend-section .legend-summary,
#dotconContent .mobile-parts-section .parts-legend-section .legend-summary {
  padding: 0 12px 12px 12px;
}

/* 内側要素は個別の枠を持たず、上境界のみ区切り線 */
#dotconPlusContent .mobile-parts-section .mobile-area-display,
#dotconPlusContent .mobile-parts-section .mobile-parts-grid,
#dotconPlusContent .mobile-parts-section .mobile-concrete-info,
#dotconPlusContent .mobile-parts-section .mobile-total-section,
#dotconContent .mobile-parts-section .mobile-area-display,
#dotconContent .mobile-parts-section .mobile-panels-display,
#dotconContent .mobile-parts-section .mobile-concrete-info,
#dotconContent .mobile-parts-section .mobile-total-section {
  border: none;
  margin: 0;
  border-top: 1px solid var(--border-gray);
}

/* 最初のブロックのみ区切り線なし */
#dotconPlusContent .mobile-parts-section .mobile-area-display:first-of-type,
#dotconPlusContent .mobile-parts-section .mobile-parts-grid:first-of-type,
#dotconContent .mobile-parts-section .mobile-area-display:first-of-type {
  border-top: none;
}

/* パディングの統一 */
#dotconPlusContent .mobile-parts-section .mobile-area-display,
#dotconPlusContent .mobile-parts-section .mobile-parts-grid,
#dotconContent .mobile-parts-section .mobile-area-display,
#dotconContent .mobile-parts-section .mobile-panels-display,
#dotconPlusContent .mobile-parts-section .mobile-concrete-info,
#dotconContent .mobile-parts-section .mobile-concrete-info,
#dotconPlusContent .mobile-parts-section .mobile-total-section,
#dotconContent .mobile-parts-section .mobile-total-section {
  padding: 0;
}

/* Dotcon+ パーツ行: 1列・行表示、行間コンパクト */
#dotconPlusContent .mobile-parts-section .mobile-parts-grid { display: block; }

#dotconPlusContent .mobile-parts-section .mobile-part-card {
  display: flex;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 16px 24px; /* パーツ行の間をやや詰める */
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* パーツごとの区切り線は不要（連続する行の上線を無効化） */
#dotconPlusContent .mobile-parts-section .mobile-part-card + .mobile-part-card { border-top: none; }

#dotconPlusContent .mobile-parts-section .mobile-part-icon {
  display: none;
}

#dotconPlusContent .mobile-parts-section .mobile-part-info {
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

#dotconPlusContent .mobile-parts-section .mobile-part-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-dark);
}

#dotconPlusContent .mobile-parts-section .mobile-part-count {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-dark);
  letter-spacing: 0;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

#dotconPlusContent .mobile-parts-section .mobile-part-count::after {
  content: ' 個';
  margin-left: 4px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-dark);
}

/* Dotcon 行（合計面積・枚数）を行表示に調整 */
#dotconPlusContent .mobile-parts-section .mobile-area-display,
#dotconContent .mobile-parts-section .mobile-area-display,
#dotconContent .mobile-parts-section .mobile-panels-display {
  padding: 22px 24px;
  background: var(--white);
}

#dotconContent .mobile-parts-section .mobile-panels-display {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

/* Dotcon 側のタイポグラフィを行スタイルに合わせて縮小 */
#dotconPlusContent .mobile-parts-section .mobile-area-display,
#dotconContent .mobile-parts-section .mobile-area-display,
#dotconContent .mobile-parts-section .mobile-concrete-info {
  font-size: 18px;
  font-weight: 700;
}

#dotconContent .mobile-parts-section .mobile-panels-display span:first-child {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.2;
  margin-bottom: 0;
  font-variant-numeric: tabular-nums;
}

#dotconContent .mobile-parts-section .mobile-panels-unit {
  font-size: 18px;
  font-weight: 700;
}

/* 合計金額（Dotcon/Dotcon+）: 枠内の一部として灰背景・区切り線のみ */
#dotconContent .mobile-parts-section .mobile-total-section,
#dotconPlusContent .mobile-parts-section .mobile-total-section {
  background: #F3F4F6;
  color: var(--text-dark);
  border: none;
  border-radius: 0;
  padding: 24px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0; /* 末尾の余白は外側で確保 */
}

/* 合計金額のフォント（両モード共通） */
#dotconContent .mobile-parts-section .mobile-total-label,
#dotconPlusContent .mobile-parts-section .mobile-total-label {
  font-size: 18px;
  font-weight: 700;
}

#dotconContent .mobile-parts-section .mobile-total-amount,
#dotconPlusContent .mobile-parts-section .mobile-total-amount {
  font-size: 36px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

#dotconPlusContent .mobile-concrete-info {
  background: var(--white);
  border: none;
  margin: 0;
  padding: 24px 24px;
  font-size: 18px;
  font-weight: 700;
}

/* パーツ枠内のコンクリート量（特異性を合わせて上書き） */
#dotconPlusContent .mobile-parts-section .mobile-concrete-info {
  padding: 30px 24px;
  line-height: 1.4;
}
#dotconContent .mobile-parts-section .mobile-concrete-info {
  padding: 30px 24px;
  line-height: 1.4;
}

#dotconPlusContent .mobile-total-section {
  background: #F3F4F6;
  color: var(--text-dark);
  border: none;
  border-radius: 0;
  padding: 24px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0;
}

/* パーツ枠の見出しだけ間隔を小さく（画像準拠） */
#dotconPlusContent .mobile-parts-section .parts-legend-section > .mobile-section-title,
#dotconContent  .mobile-parts-section .parts-legend-section > .mobile-section-title {
  margin: 0 0 8px 0;
}

/* 枠の直後ボタン群の上マージン */
.mobile-action-section { margin: 16px 0 32px 0; }

/* ===== Reset Dialog (mobile) ===== */
.reset-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: none; /* JSで開閉 */
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.reset-dialog {
  background: #fff;
  border-radius: 16px;
  width: min(480px, 92vw);
  padding: 28px 24px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  position: relative;
}

.reset-dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  border: none;
  background: none;
  cursor: pointer;
}

.reset-dialog-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-dark);
  text-align: center;
  margin: 4px 0 12px 0;
}

.reset-dialog-message {
  font-size: 14px;
  color: var(--text-gray);
  line-height: 1.6;
  text-align: center;
  margin: 0 0 16px 0;
}

.reset-dialog-footer {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.btn-reset-secondary,
.btn-reset-primary {
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.btn-reset-secondary {
  background: #fff;
  color: var(--text-dark);
  border: 1px solid var(--border-gray);
}

.btn-reset-primary {
  background: var(--primary-blue);
  color: #fff;
  border: none;
}

/* コンクリート量の値を太く大きく（左右で読みやすく） */
#dotconPlusContent .mobile-concrete-info span:last-child,
#dotconContent .mobile-concrete-info span:last-child {
  font-size: 20px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* パーツ枠内の値はさらに強調（特異性を合わせる） */
#dotconPlusContent .mobile-parts-section .mobile-concrete-info span:last-child,
#dotconContent .mobile-parts-section .mobile-concrete-info span:last-child {
  font-size: 22px;
  font-weight: 900;
}

/* Plus個別のカラー（テキストは共通でdark） */
#dotconPlusContent .mobile-total-label { color: var(--text-dark); }
#dotconPlusContent .mobile-total-amount { color: var(--text-dark); }
