:root {
  --bg: #0f1420;
  --card: #1a2233;
  --text: #eef1f7;
  --muted: #8b93a7;
  --accent: #ffcb05;
  --accent2: #3d7dca;
  --border: #2a3448;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, #1c2740, var(--bg));
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding: 24px 16px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

header {
  text-align: center;
  margin-bottom: 24px;
}

h1 {
  margin: 0 0 4px;
  font-size: 1.6rem;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  position: relative;
}

label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin: 16px 0 6px;
}

label:first-of-type { margin-top: 0; }

input[type="text"],
input[type="number"] {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0f1626;
  color: var(--text);
  font-size: 1rem;
}

input:focus {
  outline: 2px solid var(--accent2);
  outline-offset: 1px;
}

.suggestions {
  position: absolute;
  z-index: 10;
  left: 20px;
  right: 20px;
  margin-top: -8px;
  background: #0f1626;
  border: 1px solid var(--border);
  border-radius: 10px;
  max-height: 220px;
  overflow-y: auto;
}

.suggestions button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 0.95rem;
  cursor: pointer;
}

.suggestions button:last-child { border-bottom: none; }
.suggestions button:hover,
.suggestions button:focus { background: #16203a; }

.result {
  margin-top: 20px;
  padding: 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255,203,5,0.12), rgba(61,125,202,0.12));
  border: 1px solid var(--border);
}

.result .headline {
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.result .headline strong { color: var(--accent); }

.result .big-number {
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--accent2);
  line-height: 1;
}

.result .big-label {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 12px;
}

.result .detail {
  font-size: 0.85rem;
  color: var(--muted);
}

.result .no-evo {
  color: var(--muted);
  font-size: 0.95rem;
}

.chain-breakdown {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
}

.chain-title {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 6px;
}

.chain-line {
  font-size: 1.15rem;
}

.chain-line strong {
  color: var(--accent);
}

.chain-plus {
  color: var(--muted);
  font-weight: 400;
}

.chain-breakdown .detail {
  margin-top: 6px;
}

.chain-breakdown .add-to-list-btn {
  border-color: var(--accent);
  background: rgba(255,203,5,0.12);
}

.chain-breakdown .add-to-list-btn:hover {
  background: rgba(255,203,5,0.22);
}

.empty-state {
  margin-top: 20px;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.add-to-list-btn {
  width: 100%;
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--accent2);
  background: rgba(61,125,202,0.15);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.add-to-list-btn:hover { background: rgba(61,125,202,0.28); }

.list-card {
  margin-top: 16px;
}

.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.list-header h2 {
  margin: 0;
  font-size: 1.05rem;
}

.clear-btn {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: none;
  color: var(--muted);
  font-size: 0.8rem;
  cursor: pointer;
}

.clear-btn:hover { color: var(--text); border-color: var(--muted); }

.list-total {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(255,203,5,0.1);
  border: 1px solid var(--border);
  font-size: 0.9rem;
}

.list-total strong {
  color: var(--accent);
  font-size: 1.1rem;
}

.list-items {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0f1626;
}

.list-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  accent-color: var(--accent2);
}

.list-item-info {
  flex: 1;
  min-width: 0;
}

.list-item-name {
  font-size: 0.9rem;
}

.list-item-detail {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2px;
}

.list-item.done {
  opacity: 0.5;
}

.list-item.done .list-item-name {
  text-decoration: line-through;
}

.remove-btn {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: none;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.remove-btn:hover { color: var(--text); border-color: var(--muted); }

footer {
  margin-top: 32px;
  color: var(--muted);
  font-size: 0.75rem;
}
