* {
  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: 800px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

h1 {
  font-size: 1.4rem;
  font-weight: bold;
  margin-bottom: 20px;
  color: #2c5282;
  border-left: 4px solid #3182ce;
  padding-left: 12px;
}

h2 {
  font-size: 1.1rem;
  font-weight: bold;
  margin-bottom: 14px;
  color: #2c5282;
}

/* 入力セクション */
.input-section {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
  margin-bottom: 20px;
}

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

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

.input-group input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.input-group input:focus {
  border-color: #3182ce;
}

button {
  width: 100%;
  padding: 12px;
  background: #3182ce;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 6px;
  transition: background 0.2s;
}

button:hover {
  background: #2c6fba;
}

/* エラー */
.error {
  background: #fed7d7;
  color: #c53030;
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 20px;
  font-size: 0.9rem;
}

/* サマリー */
.summary {
  background: #ebf8ff;
  border: 1px solid #bee3f8;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.summary-item {
  text-align: center;
  background: #fff;
  border-radius: 6px;
  padding: 12px 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.summary-item .label {
  display: block;
  font-size: 0.75rem;
  color: #666;
  margin-bottom: 6px;
}

.summary-item .value {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: #2c5282;
}

/* テーブル */
.table-section {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  min-width: 480px;
}

th {
  background: #2c5282;
  color: #fff;
  padding: 10px 8px;
  text-align: right;
  white-space: nowrap;
}

th:first-child {
  text-align: center;
}

td {
  padding: 8px 8px;
  text-align: right;
  border-bottom: 1px solid #e8e8e8;
}

td:first-child {
  text-align: center;
  font-weight: 600;
  color: #555;
}

tr:nth-child(even) td {
  background: #f9f9f9;
}

tr.last-row td {
  background: #fff3cd;
  font-weight: 700;
  color: #856404;
}

/* ユーティリティ */
.hidden {
  display: none;
}

/* スマホ対応 */
@media (max-width: 500px) {
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    padding: 10px 14px;
  }

  .summary-item .label {
    margin-bottom: 0;
    font-size: 0.85rem;
  }

  .summary-item .value {
    font-size: 1rem;
  }
}
