:root {
  --bg: #070b12;
  --card: #121a28;
  --card-2: #0e1522;
  --line: rgba(255, 255, 255, 0.08);
  --text: #f4f7fb;
  --muted: #93a0b8;
  --green: #3ddc84;
  --green-2: #1faa62;
  --amber: #f5b942;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(900px 420px at 50% -10%, rgba(61, 220, 132, 0.16), transparent 55%),
    var(--bg);
}

button, input, select { font: inherit; }

.wrap {
  width: min(440px, calc(100% - 24px));
  margin: 0 auto;
  padding: 18px 0 40px;
}

.tabs {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 62px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #1a2333;
  color: #d5deea;
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  line-height: 1.15;
}

.tab.active {
  color: #06210f;
  border-color: transparent;
  background: linear-gradient(180deg, #62e89d, var(--green-2));
  box-shadow: 0 10px 24px rgba(61, 220, 132, 0.22);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 2px 12px;
}

.section-head h2 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
}

.pill {
  border-radius: 999px;
  padding: 3px 8px;
  background: #3a2a10;
  color: var(--amber);
  font-size: 11px;
  font-weight: 700;
}

.count { color: var(--muted); font-size: 13px; }

.quick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.card, .bonus-card, .history-card, .calc {
  background: linear-gradient(180deg, rgba(255,255,255,0.03), transparent 40%), var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
}

.bonus-card, .history-card, .calc { padding: 14px; }

.bonus-card h3, .history-card h3 { margin: 8px 0 12px; font-size: 15px; text-align: center; }

.icon-bubble {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #1e3a2a;
  color: var(--green);
  font-size: 16px;
}

.ask, .calc-btn, .more, .ghost {
  width: 100%;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
}

.ask, .calc-btn {
  min-height: 42px;
  color: #06210f;
  font-weight: 800;
  background: linear-gradient(180deg, #62e89d, var(--green-2));
}

.ask:disabled, .calc-btn:disabled { opacity: 0.55; cursor: not-allowed; }

.history { display: grid; gap: 10px; }

.history-card h3 { text-align: left; margin: 0 0 8px; }

.badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 8px;
  background: #123224;
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.when { margin: 0 0 8px; color: var(--muted); font-size: 12px; }

.more, .ghost {
  margin-top: 8px;
  min-height: 40px;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line);
}

.groups { display: grid; gap: 10px; }

details.group { padding: 0; overflow: hidden; }

details.group summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  cursor: pointer;
}

details.group summary::-webkit-details-marker { display: none; }

.group-copy { flex: 1; }
.group-copy strong { display: block; font-size: 13px; letter-spacing: 0.03em; }
.group-copy span { color: var(--muted); font-size: 12px; }

.chev { color: var(--muted); }

.group-list { display: grid; gap: 8px; padding: 0 14px 14px; }

.group-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.group-item p { margin: 0; font-size: 14px; }

.group-item .ask { width: auto; min-width: 92px; padding: 0 12px; }

.calc p { margin: 6px 0 12px; color: var(--muted); font-size: 13px; }

.empty-note {
  border-radius: 16px;
  padding: 12px;
  background: var(--card-2);
  border: 1px solid var(--line);
}

.empty-note strong { display: block; margin-bottom: 4px; }
.empty-note span { color: var(--muted); font-size: 13px; }

.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }

label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12px; }

input, select {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #0c121d;
  color: var(--text);
  min-height: 42px;
  padding: 0 12px;
}

.result { margin: 0 0 12px; font-weight: 700; }

.flash {
  margin: 0 0 12px;
  border-radius: 14px;
  padding: 10px 12px;
  background: #123224;
  color: var(--green);
  font-size: 14px;
}

.flash.error { background: #3a1720; color: #ffb4c0; }

.member {
  margin-top: 18px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.member strong { color: var(--text); }

.gate { padding: 18px; }
.gate h1 { margin: 0 0 8px; font-size: 22px; }
.gate p { color: var(--muted); }
