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

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

.container {
  max-width: 560px;
  margin: 0 auto;
}

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

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

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

.card h2 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #4a90d9;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #e8f0fc;
}

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

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

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

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

.form-group input:focus {
  outline: none;
  border-color: #4a90d9;
  background: #fff;
}

.btn-calc {
  display: block;
  width: 100%;
  padding: 14px;
  background: #4a90d9;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 16px;
  transition: background 0.2s;
}

.btn-calc:hover {
  background: #357abd;
}

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

.result-card.hidden {
  display: none;
}

.verdict {
  text-align: center;
  font-size: 1.3rem;
  font-weight: 700;
  padding: 14px;
  border-radius: 10px;
  margin-bottom: 16px;
}

.verdict.profit {
  background: #e6f7ec;
  color: #1a7f37;
}

.verdict.loss {
  background: #fdecea;
  color: #c62828;
}

.verdict.break-even {
  background: #fff8e1;
  color: #b56400;
}

.result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.result-table td {
  padding: 9px 4px;
  border-bottom: 1px solid #f0f0f0;
}

.result-table td:last-child {
  text-align: right;
  font-weight: 500;
}

.result-table tr.highlight td {
  color: #1a7f37;
  font-weight: 600;
}

.result-table tr.highlight-net.profit td {
  color: #1a7f37;
  font-weight: 700;
  font-size: 1rem;
}

.result-table tr.highlight-net.loss td {
  color: #c62828;
  font-weight: 700;
  font-size: 1rem;
}

.note {
  font-size: 0.78rem;
  color: #888;
  margin-top: 12px;
  line-height: 1.5;
}

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

.history-section h2 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #4a90d9;
  margin-bottom: 12px;
}

.history-list {
  list-style: none;
  padding: 0;
}

.history-list li {
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.85rem;
  color: #555;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

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

.history-verdict {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 12px;
  white-space: nowrap;
}

.history-verdict.profit {
  background: #e6f7ec;
  color: #1a7f37;
}

.history-verdict.loss {
  background: #fdecea;
  color: #c62828;
}

.btn-clear {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 8px;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 0.85rem;
  color: #888;
  cursor: pointer;
}

.btn-clear:hover {
  background: #ffe0e0;
  color: #c62828;
  border-color: #ffbcbc;
}

@media (max-width: 375px) {
  h1 {
    font-size: 1.2rem;
  }
  .verdict {
    font-size: 1.1rem;
  }
}
