* {
  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;
  padding: 16px;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  padding: 24px 20px;
}

h1 {
  font-size: 1.4rem;
  color: #2a6bd4;
  margin-bottom: 20px;
  text-align: center;
}

.table-wrapper {
  overflow-x: auto;
  margin-bottom: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 400px;
}

thead th {
  background: #2a6bd4;
  color: #fff;
  padding: 10px 8px;
  font-size: 0.85rem;
  text-align: center;
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid #e8ecf0;
}

tbody tr:hover {
  background: #f0f4ff;
}

tbody td {
  padding: 8px 6px;
  text-align: center;
}

tbody td input {
  width: 100%;
  border: 1px solid #d0d7e3;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 0.9rem;
  text-align: right;
  outline: none;
  transition: border-color 0.2s;
}

tbody td input.input-name {
  text-align: left;
}

tbody td input:focus {
  border-color: #2a6bd4;
}

.subtotal-cell {
  font-weight: 600;
  color: #2a6bd4;
  white-space: nowrap;
  min-width: 90px;
}

.delete-btn {
  background: none;
  border: none;
  color: #c0392b;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.15s;
}

.delete-btn:hover {
  background: #fdecea;
}

.btn {
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 0.9rem;
  cursor: pointer;
  font-weight: 600;
  transition: opacity 0.15s, transform 0.1s;
}

.btn:active {
  transform: scale(0.97);
}

.btn-add {
  background: #e8f0fe;
  color: #2a6bd4;
  display: block;
  width: 100%;
  margin-bottom: 16px;
}

.btn-add:hover {
  background: #d0e0fc;
}

.total-area {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f0f4ff;
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.total-label {
  font-weight: 700;
  font-size: 1rem;
}

.total-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #2a6bd4;
}

.action-area {
  display: flex;
  gap: 10px;
}

.btn-copy {
  background: #2a6bd4;
  color: #fff;
  flex: 1;
}

.btn-copy:hover {
  opacity: 0.88;
}

.btn-clear {
  background: #f5f7fa;
  color: #666;
  border: 1px solid #d0d7e3;
}

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

.copy-msg {
  text-align: center;
  margin-top: 12px;
  color: #27ae60;
  font-weight: 600;
  font-size: 0.9rem;
  transition: opacity 0.3s;
}

.hidden {
  display: none;
}

@media (max-width: 480px) {
  .container {
    padding: 16px 12px;
  }

  h1 {
    font-size: 1.2rem;
  }

  .total-value {
    font-size: 1.3rem;
  }

  .action-area {
    flex-direction: column;
  }
}
