/* ========================================================
   Bubble Plan (バブルプラン) — スタイリング＆モバイル最適化
   株式会社住ま居る / スマイチ
   ======================================================== */

.bubble-studio-container {
  background: #ffffff;
  border: 1.5px solid #bae6fd;
  border-radius: 16px;
  padding: 1.8rem;
  box-shadow: 0 10px 30px rgba(2, 132, 199, 0.08);
  margin-bottom: 2.5rem;
}

/* ========================================================
   GATE: 測量図アップロード ＆ 建設地AI判定ゲート
   ======================================================== */
.bubble-gate-card {
  background: linear-gradient(135deg, #f8fafc 0%, #f0f9ff 100%);
  border: 2px solid #38bdf8;
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 10px 25px rgba(2, 132, 199, 0.1);
}

.bubble-gate-header {
  text-align: center;
  margin-bottom: 1.8rem;
}

.bubble-gate-step-badge {
  background: #e0f2fe;
  color: #0369a1;
  border: 1.5px solid #38bdf8;
  font-weight: 800;
  font-size: 0.85rem;
  padding: 4px 14px;
  border-radius: 20px;
  display: inline-block;
  margin-bottom: 0.5rem;
}

.bubble-gate-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.8rem;
}

.bubble-gate-box {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  padding: 1.4rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.bubble-upload-zone {
  border: 2px dashed #0284c7;
  background: #f0f9ff;
  border-radius: 12px;
  padding: 1.8rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 1rem;
}

.bubble-upload-zone:hover {
  background: #e0f2fe;
  border-color: #0369a1;
}

.bubble-survey-preview-box {
  background: #0f172a;
  border-radius: 8px;
  overflow: hidden;
  max-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 0.8rem;
}

.bubble-survey-preview-img {
  max-width: 100%;
  max-height: 220px;
  object-fit: contain;
}

/* Gemini 道路ヒアリング対話チャット */
.bubble-gate-chat-history {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1rem;
  height: 230px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 1rem;
}

.bubble-gate-chat-bubble {
  max-width: 90%;
  padding: 0.65rem 0.95rem;
  border-radius: 12px;
  font-size: 0.84rem;
  line-height: 1.6;
}

.bubble-gate-chat-bubble.ai {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
  align-self: flex-start;
  border-bottom-left-radius: 2px;
}

.bubble-gate-chat-bubble.user {
  background: #0284c7;
  color: #ffffff;
  align-self: flex-end;
  border-bottom-right-radius: 2px;
}

.bubble-gate-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 0.8rem;
}

.bubble-gate-chip {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  color: #334155;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.bubble-gate-chip:hover {
  border-color: #0284c7;
  background: #f0f9ff;
  color: #0284c7;
}

.bubble-gate-chip.selected {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}

/* Header Bar & Metrics */
.bubble-header-card {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border: 1.5px solid #86efac;
  border-radius: 14px;
  padding: 1.2rem 1.6rem;
  margin-bottom: 1.2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.bubble-metrics-badge {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  padding: 8px 14px;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
}

.bubble-metrics-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 2px;
}

.bubble-metrics-val {
  font-size: 1.15rem;
  font-weight: 900;
  color: #0f172a;
}

/* 断熱等性能等級セレクター & 比較バー */
.bubble-insulation-card {
  background: #ffffff;
  border: 1.5px solid #bae6fd;
  border-radius: 12px;
  padding: 0.9rem 1.2rem;
  margin-bottom: 1.2rem;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.05);
}

.bubble-insulation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.bubble-insulation-tier {
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  padding: 8px 10px;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.bubble-insulation-tier:hover {
  border-color: #0284c7;
  background: #f0f9ff;
}

.bubble-insulation-tier.active {
  border-color: #0284c7;
  background: #e0f2fe;
  box-shadow: 0 3px 10px rgba(2, 132, 199, 0.18);
}

.bubble-insulation-tier.recommended {
  border-color: #10b981;
}

.bubble-insulation-tier.recommended.active {
  background: #ecfdf5;
  border-color: #059669;
}

.bubble-insulation-tier-title {
  font-size: 0.82rem;
  font-weight: 800;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}

.bubble-insulation-tier-price {
  font-size: 1rem;
  font-weight: 900;
  color: #0f172a;
}

.bubble-insulation-tier-desc {
  font-size: 0.7rem;
  color: #64748b;
  margin-top: 2px;
  line-height: 1.35;
}

/* 設備機器別途の明示注記 */
.bubble-estimate-note-badge {
  background: #fffbeb;
  border: 1.5px solid #fde68a;
  color: #b45309;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

/* 敷地・配置条件バー (建物の最大外郭枠連動) */
.bubble-site-bar {
  background: #f1f5f9;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  padding: 0.8rem 1.2rem;
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.bubble-site-control-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.bubble-site-select {
  font-size: 0.82rem;
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  border: 1.5px solid #94a3b8;
  background: #ffffff;
  font-weight: 700;
  color: #1e293b;
}

/* Floor & Pattern Bar */
.bubble-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 1.2rem;
  background: #f8fafc;
  padding: 0.8rem 1.2rem;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

.bubble-floor-tabs {
  display: flex;
  gap: 8px;
}

.bubble-floor-tab {
  padding: 0.5rem 1.2rem;
  font-weight: 800;
  font-size: 0.88rem;
  border-radius: 8px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s ease;
}

.bubble-floor-tab.active {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.25);
}

/* Main Canvas & Palette Grid: フルワイド作図キャンバス ＋ 下部設定パネルグリッド */
.bubble-main-grid {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  width: 100%;
}

.bubble-canvas-wrapper {
  position: relative;
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  border: 2.5px solid #0284c7;
  box-shadow: 0 8px 25px rgba(2, 132, 199, 0.15);
  background: #ffffff;
}

#bubble-plan-canvas {
  display: block;
  width: 100%;
  height: 520px;
  touch-action: none;
}

/* 下部設定パネルグリッド (PC: 3〜4列、スマホ: 1〜2列) */
.bubble-settings-panels-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  width: 100%;
  align-items: stretch;
}

@media (max-width: 1280px) {
  .bubble-settings-panels-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .bubble-settings-panels-grid {
    grid-template-columns: 1fr;
  }
  #bubble-plan-canvas {
    height: 400px;
  }
}

.bubble-setting-card {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  padding: 0.9rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.bubble-inspect-card {
  background: #ffffff;
  border: 1.5px solid #bae6fd;
  border-radius: 12px;
  padding: 0.9rem;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.05);
}

.bubble-palette-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.btn-add-bubble {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0.45rem 0.6rem;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.btn-add-bubble:hover {
  background: #f0f9ff;
  border-color: #0284c7;
  transform: translateY(-1px);
}

.bubble-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 4px;
  display: inline-block;
  flex-shrink: 0;
}

.bubble-ai-advice-card {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border: 1px solid #86efac;
  border-radius: 12px;
  padding: 0.9rem;
}

/* Transfer Banner & Carte CTA */
.bubble-transfer-banner {
  margin-top: 1.5rem;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  border-radius: 14px;
  padding: 1.2rem 1.6rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  box-shadow: 0 8px 24px rgba(2, 132, 199, 0.2);
}

/* Modal Styling for AI Facilitator & Secret Request & My Carte */
.bubble-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(5px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.bubble-modal-content {
  background: #ffffff;
  border-radius: 16px;
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.8rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  position: relative;
}

.bubble-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: #f1f5f9;
  border: none;
  font-size: 1.2rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
}

.bubble-modal-close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* My Carte Cards */
.carte-card {
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
  transition: all 0.2s ease;
}

.carte-card:hover {
  border-color: #0284c7;
  background: #f0f9ff;
}

/* Responsive */
@media (max-width: 900px) {
  .bubble-gate-grid {
    grid-template-columns: 1fr;
  }
  .bubble-main-grid {
    grid-template-columns: 1fr;
  }
  #bubble-plan-canvas {
    height: 420px;
  }
  .bubble-transfer-banner {
    flex-direction: column;
    text-align: center;
  }
}

/* ========================================================
   🧭 5大優先決定ステップナビゲーター
   ======================================================== */
.bubble-step-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 1.5px solid #38bdf8;
  border-radius: 12px;
  padding: 8px 12px;
  margin-bottom: 12px;
  overflow-x: auto;
}

.bubble-step-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.76rem;
  font-weight: 800;
  color: #334155;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  user-select: none;
}

.bubble-step-item:hover {
  border-color: #0284c7;
  background: #f8fafc;
  transform: translateY(-1px);
}

.bubble-step-item.active {
  border-color: #0284c7;
  background: #0284c7;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.25);
}

.bubble-step-item.done {
  border-color: #10b981;
  background: #ecfdf5;
  color: #065f46;
}

.bubble-step-item .step-num {
  font-weight: 900;
}

.bubble-step-item .step-status {
  font-size: 0.7rem;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.05);
}

.bubble-step-item.active .step-status {
  background: rgba(255, 255, 255, 0.25);
}

.bubble-step-item.done .step-status {
  background: #dcfce7;
  color: #166534;
}

.bubble-step-arrow {
  color: #94a3b8;
  font-weight: 900;
  font-size: 0.8rem;
}
