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

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

.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 16px;
}

header {
  text-align: center;
  padding: 24px 0 16px;
}

header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #222;
}

.subtitle {
  font-size: 0.85rem;
  color: #888;
  margin-top: 4px;
}

.card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.card h2 {
  font-size: 1rem;
  font-weight: 600;
  color: #444;
  margin-bottom: 16px;
  border-bottom: 2px solid #f0f0f0;
  padding-bottom: 8px;
}

/* 入力フォーム */
.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #555;
  margin-bottom: 4px;
}

.hint {
  font-size: 0.75rem;
  font-weight: 400;
  color: #999;
  margin-left: 6px;
}

.field input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s;
  background: #fafafa;
}

.field input:focus {
  outline: none;
  border-color: #e74c3c;
  background: #fff;
}

/* 計算結果 */
.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
}

.result-row:last-of-type {
  border-bottom: none;
}

.result-label {
  font-size: 0.88rem;
  color: #666;
}

.result-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: #222;
}

.result-row.highlight .result-label {
  color: #e74c3c;
  font-weight: 600;
}

.result-row.highlight .result-value {
  color: #e74c3c;
  font-size: 1.15rem;
}

/* 判定ボックス */
.verdict-box {
  margin-top: 14px;
  padding: 14px;
  border-radius: 8px;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 600;
  background: #f5f5f5;
  color: #888;
  transition: all 0.3s;
}

.verdict-box.ok {
  background: #e8f5e9;
  color: #2e7d32;
}

.verdict-box.warning {
  background: #fff8e1;
  color: #f57f17;
}

.verdict-box.danger {
  background: #ffebee;
  color: #c62828;
}

/* 履歴 */
.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  border-bottom: 2px solid #f0f0f0;
  padding-bottom: 8px;
}

.history-header h2 {
  margin-bottom: 0;
  border-bottom: none;
  padding-bottom: 0;
}

.btn-text {
  background: none;
  border: none;
  color: #e74c3c;
  font-size: 0.82rem;
  cursor: pointer;
  padding: 4px 8px;
}

.btn-text:hover {
  text-decoration: underline;
}

#history-list {
  list-style: none;
  max-height: 240px;
  overflow-y: auto;
}

.no-history {
  text-align: center;
  color: #bbb;
  font-size: 0.85rem;
  padding: 12px 0;
}

.history-item {
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.82rem;
  color: #555;
}

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

.history-item .h-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.history-item .h-date {
  color: #aaa;
  font-size: 0.76rem;
}

.history-item .h-ok {
  color: #2e7d32;
  font-weight: 600;
}

.history-item .h-ng {
  color: #c62828;
  font-weight: 600;
}

@media (max-width: 480px) {
  header h1 {
    font-size: 1.25rem;
  }
}
