*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0f172a;
  color: #e5e7eb;
}

#app-root {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(320px, 420px) 1fr;
  gap: 1.5rem;
  padding: 1.5rem;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
}

.panel {
  background: rgba(15, 23, 42, 0.98);
  border-radius: 0.75rem;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.75rem;
}

.panel-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #e5e7eb;
}

.panel-subtitle {
  font-size: 0.85rem;
  color: #9ca3af;
}

.grid-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1rem;
}

.section-label {
  margin-top: 0.75rem;
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #cbd5f5;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-bottom: 0.3rem;
}

.field label {
  font-size: 0.8rem;
  color: #a5b4fc;
}

.field input,
.field select {
  border-radius: 0.45rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.9);
  padding: 0.4rem 0.55rem;
  color: #e5e7eb;
  font-size: 0.85rem;
}

.field input:focus,
.field select:focus {
  outline: 2px solid rgba(129, 140, 248, 0.7);
  outline-offset: 1px;
  border-color: transparent;
}

.field input::placeholder {
  color: #6b7280;
}

.radio-row {
  display: flex;
  gap: 0.75rem;
  font-size: 0.8rem;
}

.radio-row label {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

button {
  border-radius: 999px;
  border: none;
  padding: 0.45rem 0.95rem;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.btn-primary {
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  color: white;
  box-shadow: 0 12px 30px rgba(56, 189, 248, 0.45);
}

.btn-secondary {
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
  border: 1px solid rgba(148, 163, 184, 0.6);
}

.btn-ghost {
  background: transparent;
  color: #9ca3af;
}

.btn-primary:active,
.btn-secondary:active {
  transform: translateY(1px);
  box-shadow: none;
}

.summary-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.summary-chip {
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.9);
  font-size: 0.8rem;
  color: #e5e7eb;
}

.summary-label {
  color: #9ca3af;
  margin-right: 0.25rem;
}

.summary-value {
  font-weight: 600;
}

.results-layout {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 0.75rem;
}

.results-table-wrapper {
  border-radius: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  overflow: hidden;
  background: radial-gradient(circle at top left, rgba(37, 99, 235, 0.16), transparent 45%),
    rgba(15, 23, 42, 0.98);
}

.results-table-container {
  max-height: 480px;
  overflow: auto;
}

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

thead {
  position: sticky;
  top: 0;
  background: rgba(15, 23, 42, 0.98);
  box-shadow: 0 1px 0 rgba(31, 41, 55, 0.8);
}

th,
td {
  padding: 0.4rem 0.5rem;
  white-space: nowrap;
}

th {
  text-align: left;
  font-weight: 600;
  color: #9ca3af;
}

tbody tr:nth-child(even) {
  background: rgba(15, 23, 42, 0.8);
}

tbody tr:nth-child(odd) {
  background: rgba(15, 23, 42, 0.6);
}

tbody tr:hover {
  background: rgba(55, 65, 81, 0.8);
}

.cell-right {
  text-align: right;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
}

.badge-alive-both {
  background: rgba(34, 197, 94, 0.1);
  color: #bbf7d0;
}

.badge-alive-one {
  background: rgba(249, 115, 22, 0.1);
  color: #fed7aa;
}

.badge-exhausted {
  background: rgba(248, 113, 113, 0.12);
  color: #fecaca;
}

.chip-warning {
  border-color: rgba(248, 113, 113, 0.7);
  color: #fecaca;
}

.charts-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

@media (max-width: 1100px) {
  .charts-row {
    grid-template-columns: 1fr;
  }
}

.chart-card {
  background: rgba(15, 23, 42, 0.9);
  border-radius: 0.75rem;
  padding: 0.6rem 0.8rem 0.9rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.chart-title {
  font-size: 0.8rem;
  color: #9ca3af;
  margin-bottom: 0.2rem;
}

.note {
  font-size: 0.78rem;
  color: #9ca3af;
  margin-top: 0.75rem;
}

.error {
  color: #fecaca;
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

