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

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

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

h1 {
  font-size: 1.4rem;
  color: #1a73e8;
  text-align: center;
  margin-bottom: 4px;
}

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

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

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

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

input[type="number"] {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1.1rem;
  transition: border-color 0.2s;
  outline: none;
}

input[type="number"]:focus {
  border-color: #1a73e8;
}

.tax-toggle .toggle-group {
  display: flex;
  gap: 16px;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  color: #444;
}

input[type="radio"] {
  accent-color: #1a73e8;
  width: 16px;
  height: 16px;
}

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

button#calcBtn:hover {
  background: #1558b0;
}

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

.result-card h2 {
  font-size: 1rem;
  color: #333;
  margin-bottom: 14px;
  border-bottom: 2px solid #f0f0f0;
  padding-bottom: 8px;
}

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f5f5f5;
}

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

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

.result-value {
  font-size: 1rem;
  font-weight: 600;
  color: #333;
}

.result-row.highlight .result-label {
  color: #e53935;
}

.result-row.highlight .result-value {
  color: #e53935;
  font-size: 1.1rem;
}

.result-row.total .result-label {
  color: #1a73e8;
  font-weight: 700;
}

.result-row.total .result-value {
  color: #1a73e8;
  font-size: 1.3rem;
  font-weight: 700;
}

.calc-note {
  font-size: 0.78rem;
  color: #999;
  margin-top: 10px;
  line-height: 1.5;
}

.copy-btn {
  width: 100%;
  margin-top: 14px;
  padding: 10px;
  background: #f0f4f8;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  color: #555;
  transition: background 0.2s;
}

.copy-btn:hover {
  background: #e2e8f0;
}

.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: #333;
}

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

.clear-btn:hover {
  background: #fee;
  color: #e53935;
  border-color: #e53935;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.empty-msg {
  font-size: 0.85rem;
  color: #aaa;
  text-align: center;
  padding: 16px 0;
}

.history-item {
  background: #f8fafc;
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.history-info {
  font-size: 0.82rem;
  color: #666;
  line-height: 1.6;
}

.history-info .h-date {
  font-size: 0.75rem;
  color: #aaa;
}

.history-net {
  text-align: right;
  white-space: nowrap;
}

.history-net .net-label {
  font-size: 0.75rem;
  color: #999;
}

.history-net .net-val {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1a73e8;
}

@media (max-width: 400px) {
  h1 { font-size: 1.2rem; }
  .result-row.total .result-value { font-size: 1.1rem; }
}
