* {
  box-sizing: border-box;
}

body {
  font-family: "Hiragino Sans", "Yu Gothic", Arial, sans-serif;
  margin: 0;
  background: linear-gradient(0deg, #666 0%, #333 100%);
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 20px auto;
  background: white;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.header {
  background: #003;
  color: white;
  padding: 30px;
  text-align: center;
}

.header h1 {
  margin: 0;
  font-size: 28px;
}

.header p {
  margin: 10px 0 0 0;
  opacity: 0.9;
}

.content-wrapper {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 0;
}

.results {
  background: #f9f9f9;
  padding: 30px;
  border-right: 1px solid #e0e0e0;
}

.form-section {
  padding: 30px;
}

.form-group {
  margin-bottom: 25px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
  color: #333;
  font-size: 16px;
}

.form-group .description {
  font-size: 13px;
  color: #666;
  margin-bottom: 8px;
  line-height: 1.4;
}

.input-with-unit {
  display: flex;
  align-items: center;
  gap: 10px;
}

.input-with-unit input {
  flex: 1;
  padding: 12px 15px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.3s;
}

.input-with-unit input:focus {
  outline: none;
  border-color: #4caf50;
}

.input-with-unit .unit {
  background: #f5f5f5;
  padding: 12px 15px;
  border-radius: 8px;
  font-weight: bold;
  color: #666;
}

select {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 16px;
}

.submit-btn {
  width: 100%;
  background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
  color: white;
  padding: 15px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
  font-weight: bold;
  transition: transform 0.2s;
  margin-top: 30px;
}

.submit-btn:hover {
  transform: translateY(-2px);
}

.summary-card {
  background: white;
  padding: 25px;
  border-radius: 10px;
  margin-bottom: 20px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.scenario-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  margin: 20px 0;
}

.scenario-item {
  background: white;
  padding: 15px;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.scenario-item .label {
  font-size: 12px;
  color: #666;
  text-transform: uppercase;
  margin-bottom: 5px;
}

.scenario-item .value {
  font-size: 18px;
  font-weight: bold;
}

.percentile-10 {
  color: #dc3545;
}

.percentile-50 {
  color: #007bff;
}

.percentile-90 {
  color: #28a745;
}

.chart-container {
  background: white;
  padding: 20px;
  border-radius: 10px;
  margin: 20px 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.risk-warning {
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  color: #856404;
  padding: 15px;
  border-radius: 8px;
  margin: 15px 0;
  font-size: 14px;
}

@media (max-width: 900px) {
  .content-wrapper {
    grid-template-columns: 1fr;
  }

  .container {
    margin: 10px;
  }
}

@media (max-width: 768px) {
  .scenario-results {
    grid-template-columns: 1fr;
  }

  /* 詳細内訳のレスポンシブ対応 */
  div[style*="grid-template-columns: 1fr 1fr"] {
    display: block !important;
  }

  div[style*="grid-template-columns: repeat(4, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
}

/* Range input styling */
input[type="range"] {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: #e0e0e0;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  margin: 12px 0;
  cursor: pointer;
}

/* WebKit browsers (Chrome, Safari) */
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #4caf50;
  cursor: pointer;
  border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  background: #45a049;
  transform: scale(1.1);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
}

input[type="range"]::-webkit-slider-track {
  height: 8px;
  border-radius: 4px;
  background: #e0e0e0;
  border: none;
}

/* Firefox */
input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #4caf50;
  cursor: pointer;
  border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

input[type="range"]::-moz-range-thumb:hover {
  background: #45a049;
  transform: scale(1.1);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
}

input[type="range"]::-moz-range-track {
  height: 8px;
  border-radius: 4px;
  background: #e0e0e0;
  border: none;
}

/* Remove gradient styling - keep simple track */

.input-with-unit input[type="range"] {
  flex: 1;
  border: none;
  padding: 0;
  margin: 12px 8px;
}

.volatility-range-container {
  width: 100%;
}
