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

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

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

h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 4px;
}

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

/* フォームセクション */
.form-section {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  margin-bottom: 16px;
}

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

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

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

.default-note {
  font-weight: 400;
  color: #aaa;
  font-size: 0.8rem;
  margin-left: 6px;
}

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

input:focus {
  outline: none;
  border-color: #e67e22;
  background: #fff;
}

.btn-calc {
  width: 100%;
  padding: 12px;
  background: #e67e22;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 4px;
}

.btn-calc:hover {
  background: #cf6d17;
}

/* プレビューセクション */
.preview-section {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  margin-bottom: 16px;
  border-left: 4px solid #e67e22;
}

.preview-section h2 {
  font-size: 1rem;
  color: #2c3e50;
  margin-bottom: 14px;
}

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.result-item {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 12px;
}

.result-label {
  display: block;
  font-size: 0.78rem;
  color: #888;
  margin-bottom: 4px;
}

.result-value {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  color: #2c3e50;
}

.result-value.highlight-red {
  color: #e74c3c;
}

.result-value.highlight-orange {
  color: #e67e22;
  font-size: 1.15rem;
}

/* 一覧セクション */
.list-section {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

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

.list-header h2 {
  font-size: 1rem;
  color: #2c3e50;
}

.btn-clear {
  padding: 6px 12px;
  background: #fff;
  color: #e74c3c;
  border: 1.5px solid #e74c3c;
  border-radius: 6px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.btn-clear:hover {
  background: #e74c3c;
  color: #fff;
}

.empty-msg {
  text-align: center;
  color: #bbb;
  font-size: 0.9rem;
  padding: 24px 0;
}

/* 品目カード */
.item-card {
  border: 1.5px solid #eee;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 10px;
  position: relative;
}

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

.item-name {
  font-size: 1rem;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 10px;
  padding-right: 32px;
}

.item-values {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  font-size: 0.85rem;
}

.item-val {
  display: flex;
  flex-direction: column;
}

.item-val .lbl {
  color: #aaa;
  font-size: 0.75rem;
  margin-bottom: 2px;
}

.item-val .val {
  font-weight: 600;
  color: #444;
}

.item-val .val.red {
  color: #e74c3c;
}

.item-val .val.orange {
  color: #e67e22;
  font-size: 1rem;
}

.btn-delete {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  color: #ccc;
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}

.btn-delete:hover {
  color: #e74c3c;
}

@media (max-width: 400px) {
  .form-row {
    grid-template-columns: 1fr;
  }
  .result-grid {
    grid-template-columns: 1fr;
  }
  .item-values {
    grid-template-columns: 1fr;
  }
}
