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

body {
  background: #0d0f14;
  color: #c8cdd8;
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  min-height: 100vh;
}

header {
  background: #141720;
  border-bottom: 1px solid #252a38;
  padding: 14px 24px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}

header h1 {
  font-size: 18px;
  font-weight: 600;
  color: #a8c8ff;
  letter-spacing: 0.5px;
}

header span {
  color: #6a7390;
  font-size: 12px;
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.input-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 28px;
}

label {
  color: #8a94b0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

textarea {
  width: 100%;
  height: 180px;
  background: #141720;
  border: 1px solid #252a38;
  border-radius: 6px;
  color: #c8cdd8;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 13px;
  padding: 12px;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s;
}

textarea:focus { border-color: #3d5a8a; }

textarea::placeholder { color: #3d4255; }

.btn-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

button {
  background: #1e3a5f;
  color: #a8c8ff;
  border: 1px solid #2d5a8a;
  border-radius: 5px;
  padding: 9px 22px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
}

button:hover { background: #254a78; }
button:disabled { opacity: 0.4; cursor: not-allowed; }

#status {
  font-size: 12px;
  color: #6a7390;
}

.error { color: #e06060; }

/* Inventory summary */
.inv-summary {
  background: #141720;
  border: 1px solid #252a38;
  border-radius: 6px;
  padding: 14px 16px;
  margin-bottom: 24px;
  display: none;
}

.inv-summary h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #6a7390;
  margin-bottom: 10px;
}

.inv-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill {
  background: #1c2030;
  border: 1px solid #2e3448;
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 12px;
  color: #8fa8cc;
}

.pill span { color: #c8cdd8; font-weight: 600; }

/* Results */
.results-section { display: none; }

.tier-block {
  margin-bottom: 32px;
}

.tier-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.tier-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 3px;
  letter-spacing: 1px;
}

.badge-p2 { background: #1a3320; color: #5ecf80; border: 1px solid #2d5a3f; }
.badge-p3 { background: #2a2418; color: #d4a43a; border: 1px solid #5a4820; }
.badge-p4 { background: #1e1828; color: #9060e0; border: 1px solid #3a2860; }

.tier-header h2 { font-size: 15px; font-weight: 500; color: #a8b4cc; }
.tier-count { font-size: 12px; color: #6a7390; }

table {
  width: 100%;
  border-collapse: collapse;
  background: #141720;
  border: 1px solid #252a38;
  border-radius: 6px;
  overflow: hidden;
}

th {
  background: #1c2030;
  color: #6a7390;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid #252a38;
}

td {
  padding: 10px 14px;
  border-bottom: 1px solid #1c2030;
  vertical-align: top;
}

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

tr:hover td { background: #181d2a; }

.item-name {
  font-weight: 500;
  color: #d0daee;
}

.qty {
  font-family: 'Consolas', monospace;
  color: #7cb87c;
  font-weight: 600;
  white-space: nowrap;
}

.limiting { color: #e09060; font-size: 12px; }

.p1-breakdown {
  font-size: 12px;
  color: #6a7390;
  line-height: 1.8;
}

.p1-row { display: flex; align-items: baseline; gap: 8px; }
.p1-name { color: #8a9ab4; }
.p1-used { color: #c8cdd8; font-family: 'Consolas', monospace; }
.p1-pct { color: #4a5470; font-size: 11px; }

.no-results {
  color: #4a5470;
  font-style: italic;
  padding: 20px 14px;
  text-align: center;
}

.isk-cell { white-space: nowrap; }
.isk-unit { color: #8ab0d0; font-family: 'Consolas', monospace; }
.isk-total { color: #e8c060; font-family: 'Consolas', monospace; font-weight: 600; }
.isk-na { color: #3a4060; }

.price-note {
  margin-top: 12px;
  font-size: 11px;
  color: #3a4460;
  text-align: right;
}
