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

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

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

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

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

h2 {
  font-size: 1rem;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid #f0f0f0;
}

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

@media (max-width: 480px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

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

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

.form-group input:focus {
  border-color: #e74c3c;
}

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

.btn-primary:hover {
  background: #c0392b;
}

.btn-secondary {
  background: #ecf0f1;
  color: #555;
  border: none;
  border-radius: 8px;
  padding: 10px 24px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: background 0.2s;
}

.btn-secondary:hover {
  background: #dde1e4;
}

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

@media (max-width: 480px) {
  .result-grid {
    grid-template-columns: 1fr;
  }
}

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

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

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

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

.verdict.up {
  background: #eafaf1;
  color: #27ae60;
}

.verdict.down {
  background: #fef9e7;
  color: #e67e22;
}

.diff {
  text-align: center;
  font-size: 1rem;
  color: #555;
}

.scenario-note {
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 12px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th {
  background: #f0f0f0;
  padding: 8px 10px;
  text-align: center;
  font-weight: 700;
  white-space: nowrap;
}

td {
  padding: 7px 10px;
  text-align: center;
  border-bottom: 1px solid #f0f0f0;
  white-space: nowrap;
}

tr:last-child td {
  border-bottom: none;
}

tr.highlight-current {
  background: #fff3cd;
  font-weight: 700;
}

.badge-up {
  background: #eafaf1;
  color: #27ae60;
  border-radius: 4px;
  padding: 2px 8px;
  font-weight: 700;
}

.badge-down {
  background: #fef9e7;
  color: #e67e22;
  border-radius: 4px;
  padding: 2px 8px;
  font-weight: 700;
}

.badge-even {
  background: #eaf0fb;
  color: #2980b9;
  border-radius: 4px;
  padding: 2px 8px;
  font-weight: 700;
}
