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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f5f7fa;
  color: #333;
  min-height: 100vh;
}

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

h1 {
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 4px;
  color: #1a1a2e;
}

.subtitle {
  text-align: center;
  color: #666;
  font-size: 0.875rem;
  margin-bottom: 24px;
}

/* 入力エリア */
.input-section {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  margin-bottom: 20px;
}

.input-group {
  margin-bottom: 16px;
}

.input-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #555;
  margin-bottom: 6px;
}

.input-group input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1.1rem;
  outline: none;
  transition: border-color 0.2s;
}

.input-group input:focus {
  border-color: #4a90e2;
}

#judgeBtn {
  width: 100%;
  padding: 14px;
  background: #4a90e2;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

#judgeBtn:hover {
  background: #357abd;
}

#judgeBtn:active {
  background: #2a6099;
}

/* 結果エリア */
.result {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  margin-bottom: 20px;
}

.result.hidden {
  display: none;
}

.wbgt-display {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid #eee;
  margin-bottom: 16px;
}

.wbgt-display .label {
  font-size: 0.875rem;
  color: #666;
}

.wbgt-display .value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a1a2e;
}

.risk-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding: 16px;
  border-radius: 10px;
}

.risk-level {
  font-size: 2.5rem;
  font-weight: 900;
  min-width: 60px;
  text-align: center;
}

.risk-label {
  font-size: 1.1rem;
  font-weight: 700;
}

/* リスクレベル別の色 */
.risk-safe    { background: #e8f5e9; color: #2e7d32; }
.risk-caution { background: #f9fbe7; color: #558b2f; }
.risk-warning { background: #fff9c4; color: #f57f17; }
.risk-severe  { background: #fff3e0; color: #e65100; }
.risk-danger  { background: #fce4ec; color: #c62828; }

.cautions {
  background: #f5f7fa;
  border-radius: 8px;
  padding: 14px;
}

.cautions h3 {
  font-size: 0.875rem;
  font-weight: 700;
  color: #555;
  margin-bottom: 8px;
}

.cautions ul {
  list-style: none;
  padding: 0;
}

.cautions ul li {
  font-size: 0.875rem;
  color: #444;
  padding: 4px 0;
  padding-left: 16px;
  position: relative;
  line-height: 1.5;
}

.cautions ul li::before {
  content: '・';
  position: absolute;
  left: 0;
}

/* 履歴 */
.history-section {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.history-header h2 {
  font-size: 1rem;
  color: #1a1a2e;
}

.clear-btn {
  padding: 5px 12px;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  color: #666;
  transition: background 0.2s;
}

.clear-btn:hover {
  background: #e0e0e0;
}

.history-list {
  list-style: none;
  padding: 0;
}

.history-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.875rem;
}

.history-list li:last-child {
  border-bottom: none;
}

.history-list .hist-info {
  color: #555;
}

.history-list .hist-badge {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 700;
}

.hist-safe    { background: #e8f5e9; color: #2e7d32; }
.hist-caution { background: #f9fbe7; color: #558b2f; }
.hist-warning { background: #fff9c4; color: #f57f17; }
.hist-severe  { background: #fff3e0; color: #e65100; }
.hist-danger  { background: #fce4ec; color: #c62828; }

.history-empty {
  text-align: center;
  color: #aaa;
  font-size: 0.875rem;
  padding: 12px 0;
}

@media (max-width: 375px) {
  h1 { font-size: 1.25rem; }
  .risk-level { font-size: 2rem; }
}
