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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  line-height: 1.5;
  color: #333;
  background-color: #f5f5f5;
}

.container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 20px;
}

/* Card styles */
.card {
  background-color: #fff;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 0.75rem;
}

.card-header {
  padding: 0.5rem 0.75rem;
  padding-left: 0px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0;
}

.card-header:hover {
  background-color: #f8f9fa;
}

.card-header::after {
  content: '▼';
  font-size: 0.75rem;
  color: #6c757d;
  transition: transform 0.2s ease;
}

.card-header.collapsed::after {
  transform: rotate(-90deg);
}

.card-content {
  padding: 0.5rem 0.75rem;
  transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
  opacity: 1;
  overflow: hidden;
}

.card-content.collapsed {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.card-footer {
  padding: 0.5rem 1.5rem;
  background-color: #f8f9fa;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
  padding-left: 20px;
  padding-top: 5px;
  padding-bottom: 5px;
}

.main-card .card-title {
  font-size: 1.75rem;
}

.card-description {
  color: #6c757d;
  font-size: 0.875rem;
}

.shadow-sm {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Grid layouts */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.grid-1 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
}

@media (min-width: 768px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* パネルレイアウト */
.panel-layout {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.panel {
  background-color: #f8f9fa;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-left {
  flex: 0.4;
}

.panel-right {
  flex: 0.6;
}

.panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

/* チャネル配分フォーム */
.channel-allocation-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.channel-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.input-with-percent {
  display: flex;
  align-items: center;
  width: 80px;
  margin-left: auto;
}

.number-input {
  width: 60px;
  padding: 0.25rem;
  border: 1px solid #d1d5db;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  text-align: right;
}

.percent-sign {
  margin-left: 0.25rem;
  font-size: 0.875rem;
  color: #6c757d;
}

.total-allocation {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: 0.5rem;
  font-weight: 600;
  padding: 0.5rem 0;
  border-top: 1px solid #e5e7eb;
}

.total-label {
  margin-right: 0.5rem;
}

.allocation-warning {
  color: #ef4444;
  font-size: 0.875rem;
  margin-top: 0.5rem;
  text-align: right;
}

.hidden {
  display: none;
}

#adjust-allocation-btn {
  align-self: flex-end;
  margin-top: 0.5rem;
}

/* パネル内のカードスタイル調整 */
.panel-content .card {
  margin-bottom: 0.5rem;
}

.panel-content .card:last-child {
  margin-bottom: 0;
}

/* 診断結果と改善提案のスタイル */
.kpi-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 0.5rem;
}

.recommendations-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.action-plan {
  background-color: #f0f9ff;
  padding: 0.75rem;
  border-radius: 0.5rem;
}

.action-plan-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #0369a1;
}

.consultant-advice {
  margin-top: 0.75rem;
}

.consultant-advice-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.consultant-advice-box {
  background-color: #f0f9ff;
  padding: 0.75rem;
  border-radius: 0.5rem;
  border-left: 4px solid #0ea5e9;
}

.diagnostic-list {
  margin-top: 0.75rem;
}

.diagnostic-list-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.diagnostics {
  list-style-type: none;
  padding-left: 0;
}

.diagnostics li {
  padding: 0.5rem;
  margin-bottom: 0.25rem;
  border-radius: 0.25rem;
  background-color: #f9fafb;
}

.summary-box {
  background-color: #f0f9ff;
  padding: 0.75rem;
  border-radius: 0.5rem;
}

.summary-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: #0369a1;
}

/* 広告診断テーブル */
.diagnostic-table {
  width: 100%;
  border-collapse: collapse;
}

.diagnostic-row {
  border-bottom: 1px solid #e2e8f0;
}

.diagnostic-label {
  padding: 0.5rem;
  text-align: left;
  font-weight: 500;
}

.diagnostic-divider {
  padding: 0.5rem;
  text-align: center;
  color: #718096;
}

.diagnostic-value {
  padding: 0.5rem;
  text-align: right;
  font-weight: 600;
}

/* チャネル別パフォーマンステーブル */
.channel-performance-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border-radius: 0.5rem;
  overflow: hidden;
}

.channel-performance-table thead {
  background-color: #f8f9fa;
}

.channel-performance-table th {
  padding: 0.75rem 1rem;
  text-align: center;
  font-weight: 600;
  color: #4b5563;
  border-bottom: 2px solid rgba(229, 231, 235, 0.7);
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.channel-performance-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(229, 231, 235, 0.5);
}

.channel-performance-table td:first-child {
  text-align: left;
}

.channel-performance-table td:not(:first-child) {
  text-align: right;
}

.channel-performance-table tr:last-child td {
  border-bottom: none;
}

.channel-performance-table tr:nth-child(even) {
  background-color: #f9fafb;
}

.channel-performance-table tr:hover {
  background-color: rgba(243, 244, 246, 0.5);
}

/* テーブルスタイルの改善 */
.table-responsive {
  overflow-x: auto;
  border-radius: 0.5rem;
  box-shadow: none;
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.data-table th,
.data-table td {
  padding: 0.75rem 0.75rem;
  border: none;
}

.data-table thead th {
  background-color: transparent;
  font-weight: 600;
  color: #4b5563;
  border-bottom: 2px solid rgba(229, 231, 235, 0.5);
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.data-table tbody tr {
  transition: background-color 0.2s ease;
  border-bottom: 1px solid rgba(229, 231, 235, 0.3);
}

.data-table tbody tr:last-child {
  border-bottom: none;
}

.data-table tbody tr:hover {
  background-color: rgba(243, 244, 246, 0.3);
}

/* チャネル別パフォーマンステーブル専用スタイル */
#channel-performance-table {
  margin-top: 0.5rem;
}

#channel-performance-table th {
  font-size: 0.9rem;
}

#channel-performance-table td {
  font-size: 0.95rem;
}

#channel-performance-table tbody tr:nth-child(odd) {
  background-color: rgba(249, 250, 251, 0.3);
}

#channel-performance-table tbody tr:hover {
  background-color: rgba(243, 244, 246, 0.5);
}

/* テキスト配置クラス */
.text-left {
  text-align: left;
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

/* テキスト色クラス */
.text-excellent {
  color: #10b981;
}

.text-good {
  color: #10b981;
}

.text-average {
  color: #f59e0b;
}

.text-poor {
  color: #ef4444;
}

/* チャートコンテナ */
.chart-container {
  position: relative;
  height: 250px;
  margin-top: 0.5rem;
}

.allocation-chart-container {
  position: relative;
  height: 200px;
  margin-top: 1rem;
}

/* Form elements */
.label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.range-control {
  margin-bottom: 1rem;
}

.range-wrapper {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.range {
  flex: 1;
  height: 8px;
  -webkit-appearance: none;
  background: #e9ecef;
  border-radius: 4px;
  outline: none;
}

.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background-color: #4299e1;
  border-radius: 50%;
  cursor: pointer;
}

.range-min, .range-max {
  font-size: 0.625rem;
  color: #6c757d;
  width: 4rem;
  text-align: center;
}

/* 入力フィールドのスタイル */
.input-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.number-input-box {
  width: 80px;
  padding: 0.25rem 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  text-align: right;
}

.input-suffix {
  font-size: 0.875rem;
  color: #6c757d;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.range-control {
  margin-bottom: 0.5rem;
}

.range-wrapper {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.range {
  flex-grow: 1;
  height: 0.5rem;
  -webkit-appearance: none;
  appearance: none;
  background: #e5e7eb;
  border-radius: 0.25rem;
  outline: none;
}

.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 1rem;
  height: 1rem;
  background: #3b82f6;
  border-radius: 50%;
  cursor: pointer;
}

.range-min, .range-max {
  font-size: 0.625rem;
  color: #6c757d;
  width: 4rem;
  text-align: center;
}

/* Button styles */
.button {
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  background-color: #f1f5f9;
  color: #475569;
}

.button:hover {
  background-color: #e2e8f0;
}

.button.active {
  background-color: #3b82f6;
  color: white;
}

.button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

/* Utility classes */
.mt-6 {
  margin-top: 0.75rem;
}

.mb-4 {
  margin-bottom: 0.5rem;
}

.section-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.table-wrapper {
  overflow-x: auto;
}

.performance-table {
  width: 100%;
  border-collapse: collapse;
}

.performance-table th,
.performance-table td {
  padding: 0.5rem;
  border: 1px solid #e2e8f0;
  text-align: left;
}

.performance-table th {
  background-color: #f8f9fa;
  font-weight: 600;
}

.performance-table tr:nth-child(even) {
  background-color: #f8f9fa;
}

.performance-table td.text-right {
  text-align: right;
}

.caption {
  font-size: 0.875rem;
  color: #6c757d;
  margin-top: 0.25rem;
}

/* KPI Status cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

@media (min-width: 768px) {
  .kpi-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.status-card {
  padding: 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid #e2e8f0;
}

.status-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.25rem;
}

.status-card-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: #64748b;
}

.status-card-value {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.status-card-message {
  font-size: 0.625rem;
}

/* Status colors */
.status-excellent {
  border-color: #d1fae5;
  background-color: #ecfdf5;
}

.status-good {
  border-color: #dbeafe;
  background-color: #eff6ff;
}

.status-average {
  border-color: #fef3c7;
  background-color: #fffbeb;
}

.status-poor {
  border-color: #fee2e2;
  background-color: #fef2f2;
}

/* Icon colors */
.icon-green {
  color: #10b981;
}

.icon-blue {
  color: #3b82f6;
}

.icon-yellow {
  color: #f59e0b;
}

.icon-red {
  color: #ef4444;
}

/* Metrics grid */
.metrics-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.metrics-row {
  display: flex;
  gap: 0.75rem;
  width: 100%;
}

.metrics-row .metric-card {
  flex: 1;
  min-width: 0;
}

.metric-card {
  padding: 0.75rem;
  border-radius: 0.5rem;
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.metric-label {
  font-size: 0.875rem;
  opacity: 0.9;
}

.metric-value {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 0.25rem;
  text-align: right;
}

/* 背景色 */
.blue-bg {
  background-color: #3b82f6;
}

.green-bg {
  background-color: #10b981;
}

.purple-bg {
  background-color: #8b5cf6;
}

.indigo-bg {
  background-color: #6366f1;
}

.red-bg {
  background-color: #ef4444;
}

.emerald-bg {
  background-color: #10b981;
}

.amber-bg {
  background-color: #f59e0b;
}

.cyan-bg {
  background-color: #06b6d4;
}

.transparent-bg {
  background-color: transparent;
  color: transparent;
  box-shadow: none;
  pointer-events: none;
}

/* 効果予測メトリクス */
/* .metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.5rem;
} */

/* サマリーセクション */
.summary {
  background-color: #f3f4f6;
  padding: 0.75rem;
  border-radius: 0.5rem;
}

.summary-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

/* Diagnostics list */
.diagnostics-list {
  padding-left: 1.25rem;
  list-style-type: disc;
  margin-bottom: 0.5rem;
}

.diagnostics-list li {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

/* Recommendations */
.recommendations-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.recommendation-card {
  padding: 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid #e2e8f0;
}

.high-priority {
  border-color: #fee2e2;
  background-color: #fef2f2;
}

.medium-priority {
  border-color: #fef3c7;
  background-color: #fffbeb;
}

.low-priority {
  border-color: #dbeafe;
  background-color: #eff6ff;
}

.recommendation-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.recommendation-title {
  font-weight: 500;
}

.priority-badge {
  font-size: 0.625rem;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
}

.high-badge {
  background-color: #fee2e2;
  color: #b91c1c;
}

.medium-badge {
  background-color: #fef3c7;
  color: #b45309;
}

.low-badge {
  background-color: #dbeafe;
  color: #1d4ed8;
}

.recommendation-description {
  font-size: 0.875rem;
  color: #4b5563;
}

/* Diagnosis summary */
.diagnosis-summary {
  padding: 0.75rem;
  background-color: #f9fafb;
  border-radius: 0.5rem;
}

.summary-title {
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.summary-text {
  font-size: 0.875rem;
  color: #4b5563;
  margin-bottom: 0.5rem;
}

.action-plan-title {
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.action-plan-list {
  font-size: 0.875rem;
  padding-left: 1.25rem;
}

/* Consultant advice */
.consultant-advice {
  font-size: 0.875rem;
}

.advice-title {
  color: #3b82f6;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

/* Implementation plans */
.implementation-plans {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
}

@media (min-width: 768px) {
  .implementation-plans {
    grid-template-columns: repeat(3, 1fr);
  }
}

.plan-card {
  padding: 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
}

.plan-title {
  font-size: 1.125rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.plan-list {
  padding-left: 1.25rem;
  font-size: 0.875rem;
}

.plan-list li {
  margin-bottom: 0.25rem;
}

/* Simulation summary */
.simulation-summary {
  font-size: 0.875rem;
  color: #4b5563;
  margin-top: 0.25rem;
}

/* 入力フィールドのスタイル */
.range-control {
  margin-bottom: 1rem;
}

.label-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.label {
  font-weight: 500;
  color: #333;
  margin-right: 0.5rem;
}

.input-group.inline {
  display: flex;
  align-items: center;
}

.editable-value {
  width: 100px;
  padding: 0.25rem;
  border: 1px solid #d1d5db;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  text-align: right;
  background-color: #f8f9fa;
}

.editable-value:focus {
  outline: none;
  border-color: #4f46e5;
  background-color: #fff;
}

.input-suffix {
  margin-left: 0.25rem;
  font-size: 0.875rem;
  color: #6c757d;
}

/* チャネル配分フォーム */
.channel-allocation-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.channel-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.input-with-percent {
  display: flex;
  align-items: center;
  width: 80px;
}

.number-input {
  width: 60px;
  padding: 0.25rem;
  border: 1px solid #d1d5db;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  text-align: right;
  background-color: #f8f9fa;
}

.number-input:focus {
  outline: none;
  border-color: #4f46e5;
  background-color: #fff;
}

.percent-sign {
  margin-left: 0.25rem;
  font-size: 0.875rem;
  color: #6c757d;
}

/* 診断リスト */
.diagnostic-list {
  margin-top: 1rem;
}

.diagnostics {
  list-style-type: none;
  padding: 0;
}

.diagnostic-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid #e5e7eb;
}

.diagnostic-label {
  font-weight: 500;
}

.diagnostic-value {
  font-weight: 600;
}

.good {
  color: #10b981;
}

.average {
  color: #f59e0b;
}

.poor {
  color: #ef4444;
}

/* 逆算結果グリッド */
.reverse-results-grid {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 20px;
}

.reverse-results-grid .metrics-row {
  display: flex;
  gap: 15px;
}

.reverse-results-grid .metric-card {
  flex: 1;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: white;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.reverse-results-grid .metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.reverse-results-grid .metric-label {
  font-size: 0.9rem;
  margin-bottom: 5px;
  font-weight: 500;
}

.reverse-results-grid .metric-value {
  font-size: 1.25rem;
  font-weight: 600;
}

/*
.reverse-result-item {
  margin-bottom: 15px;
  padding: 10px;
  border-radius: 6px;
  background-color: #f3f4f6;
}

.reverse-result-label {
  font-size: 0.9rem;
  color: #4b5563;
  margin-bottom: 5px;
}

.reverse-result-value {
  font-size: 1.25rem;
  font-weight: 600;
  color: #111827;
  text-align: right;
}
*/

.reverse-detail-table {
  width: 100%;
  overflow-x: auto;
}

/* Industry CPC dropdown select */
.form-group {
  margin-bottom: 15px;
}

.form-control {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.9rem;
  color: #374151;
  background-color: #fff;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
  border-color: #3b82f6;
  outline: 0;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.help-text {
  font-size: 0.8rem;
  color: #6b7280;
  margin-top: 4px;
}

/* 業種別クリック単価選択のスタイル */
.industry-select-wrapper {
  margin-bottom: 10px;
}

.sublabel {
  display: block;
  font-size: 0.85rem;
  color: #6b7280;
  margin-bottom: 5px;
}

.input-group-wrapper {
  display: flex;
  justify-content: flex-end;
  margin-top: 5px;
}

/* タブナビゲーション */
.tab-navigation {
  display: flex;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 15px;
}

.tab-button {
  padding: 10px 20px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-weight: 500;
  color: #6b7280;
  transition: all 0.3s ease;
}

.tab-button:hover {
  color: #3b82f6;
}

.tab-button.active {
  color: #3b82f6;
  border-bottom: 2px solid #3b82f6;
}

.tab-content {
  width: 100%;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* ラジオボタンスタイル */
.target-type-selector {
  display: flex;
  gap: 20px;
  margin-bottom: 15px;
}

.radio-container {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.radio-container input[type="radio"] {
  margin-right: 5px;
}

.radio-label {
  font-weight: 500;
}

/* 逆算フロー表示のスタイル */
.reverse-flow-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 15px 0;
  max-width: 500px;
  margin: 0 auto;
}

.flow-item {
  width: 100%;
  padding: 15px;
  border-radius: 8px;
  background-color: #f9fafb;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  text-align: center;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.flow-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  background-color: #f3f4f6;
}

.flow-item-label {
  font-size: 0.9rem;
  color: #6b7280;
  margin-bottom: 5px;
}

.flow-item-value {
  font-size: 1.5rem;
  font-weight: 600;
  color: #111827;
}

/* 矢印コンテナ */
.arrow-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  position: relative;
  height: 40px;
  margin: 5px 0;
}

/* 矢印 */
.flow-arrow {
  height: 100%;
  width: 2px;
  background-color: #d1d5db;
  position: relative;
}

.flow-arrow::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: -4px;
  width: 0;
  height: 0;
  border-top: 8px solid #d1d5db;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
}

/* 入力値ラベル */
.input-label {
  position: absolute;
  right: 20%;
  top: 50%;
  transform: translateY(-50%) translateX(30px);
  background-color: #f3f4f6;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  color: #4b5563;
  white-space: nowrap;
  border: 1px dashed #d1d5db;
}

/* 色付きフローアイテム */
.flow-item.blue-bg {
  background-color: #dbeafe;
  border-left: 4px solid #3b82f6;
}

.flow-item.blue-bg:hover {
  background-color: #bfdbfe;
}

.flow-item.green-bg {
  background-color: #d1fae5;
  border-left: 4px solid #10b981;
}

.flow-item.green-bg:hover {
  background-color: #a7f3d0;
}

.flow-item.amber-bg {
  background-color: #fef3c7;
  border-left: 4px solid #f59e0b;
}

.flow-item.amber-bg:hover {
  background-color: #fde68a;
}

.flow-item.red-bg {
  background-color: #fee2e2;
  border-left: 4px solid #ef4444;
}

.flow-item.red-bg:hover {
  background-color: #fecaca;
}

/* ツールチップ */
.flow-item .tooltip-icon {
  position: absolute;
  top: 10px;
  right: 10px;
  color: #9ca3af;
  cursor: help;
}

/* 注釈テキスト用のスタイル */
.disclaimer-text {
  font-size: 0.75rem;
  color: #666;
  text-align: right;
  margin-top: 0.5rem;
  font-style: italic;
}

/* 連動項目のラベル */
.sync-label small {
  font-size: 0.7rem;
  color: #666;
  font-style: italic;
  margin-left: 0.2rem;
  font-weight: normal;
}

/* 業界平均データ選択用のスタイル */
.industry-average-container {
  margin-bottom: 20px;
  padding: 10px;
  background-color: #f8f9fa;
  border-radius: 5px;
  border: 1px solid #e9ecef;
}

.industry-selectors {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.select-group {
  flex: 1;
  min-width: 200px;
}

.select-group select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  background-color: white;
  font-size: 14px;
}

.select-group select:focus {
  border-color: #80bdff;
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* 不要になったツールチップアイコンのCSSを削除 */
.flow-item .tooltip-icon {
  display: none;
}

/* 業界平均データ選択のスタイル */
.industry-average-container {
  margin-bottom: 15px;
  padding: 10px;
  background-color: #f0f9ff;
  border-radius: 6px;
  border-left: 3px solid #0ea5e9;
}

.industry-average-title {
  font-weight: 500;
  margin-bottom: 10px;
  color: #0369a1;
}

.industry-average-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.industry-average-field {
  flex: 1;
  min-width: 150px;
}

.industry-average-label {
  display: block;
  font-size: 0.85rem;
  color: #0369a1;
  margin-bottom: 5px;
}

/* 連動ラベルのスタイル */
.sync-label small {
  font-size: 0.7rem;
  color: #6b7280;
  font-weight: normal;
  margin-left: 5px;
}

/* ヘルプボタンのスタイル */
.help-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: #0ea5e9;
  color: white;
  font-size: 0.75rem;
  font-weight: bold;
  cursor: pointer;
  margin-left: 8px;
  position: relative;
}

.help-button:hover {
  background-color: #0284c7;
}

/* モーダルウィンドウのスタイル */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
  background-color: #fefefe;
  margin: 10% auto;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  width: 80%;
  max-width: 800px;
  position: relative;
}

.close-button {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  position: absolute;
  top: 10px;
  right: 20px;
}

.close-button:hover,
.close-button:focus {
  color: black;
  text-decoration: none;
  cursor: pointer;
}

/* 業界平均データテーブルのスタイル */
.industry-average-table-container {
  display: none;
  position: absolute;
  top: 25px;
  right: 0;
  z-index: 100;
  background-color: white;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 12px;
  width: 320px;
  max-height: 400px;
  overflow-y: auto;
}

.help-button:hover .industry-average-table-container {
  display: block;
}

.industry-average-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.industry-average-table th,
.industry-average-table td {
  padding: 6px 8px;
  border: 1px solid #e5e7eb;
  text-align: left;
}

.industry-average-table th {
  background-color: #f3f4f6;
  font-weight: 600;
  position: sticky;
  top: 0;
}

.industry-average-table tr:nth-child(even) {
  background-color: #f9fafb;
}

.industry-average-table tr:hover {
  background-color: #edf2f7;
}

.industry-average-table-title {
  font-weight: 600;
  margin-bottom: 8px;
  color: #0369a1;
  font-size: 0.9rem;
}