* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f4f6f8;
  color: #17202a;
}

.app {
  width: min(920px, 100%);
  margin: 0 auto;
  padding: 22px;
}

.hero {
  padding: 36px 10px 20px;
  text-align: center;
}

.badge {
  display: inline-block;
  background: #dff8ec;
  color: #157347;
  padding: 7px 14px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 14px;
  margin-bottom: 14px;
}

h1 {
  font-size: clamp(38px, 6vw, 68px);
  line-height: 0.95;
  margin: 0;
  letter-spacing: -2px;
}

.hero p {
  font-size: 18px;
  color: #5f6c72;
  max-width: 620px;
  margin: 18px auto 0;
}

.card {
  background: white;
  border-radius: 24px;
  padding: 22px;
  margin: 18px 0;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.07);
}

h2 {
  margin-top: 0;
  font-size: 22px;
}

input,
select {
  width: 100%;
  border: 1px solid #d9dee3;
  border-radius: 16px;
  padding: 15px;
  font-size: 16px;
  margin-bottom: 12px;
  background: white;
}

button {
  border: 0;
  border-radius: 16px;
  padding: 14px 18px;
  font-weight: 900;
  cursor: pointer;
  background: #17202a;
  color: white;
  font-size: 15px;
}

button:hover {
  opacity: 0.92;
}

.primary {
  background: #11a36a;
}

.full {
  width: 100%;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.chip {
  background: #eef2f5;
  padding: 10px 12px 10px 14px;
  border-radius: 999px;
  font-weight: 800;
}

.removable-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.mini-remove {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
  background: #e74c3c;
  color: white;
}

.mini-remove.dark {
  background: #17202a;
}

.checkbox-list {
  display: grid;
  gap: 9px;
  margin-bottom: 15px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f6f8fa;
  padding: 12px;
  border-radius: 14px;
  font-weight: 700;
}

.checkbox-item input {
  width: auto;
  margin: 0;
}

.small-title {
  font-weight: 900;
  margin-bottom: 10px;
}

.empty-message {
  color: #7b8790;
  background: #f6f8fa;
  padding: 12px;
  border-radius: 14px;
  margin: 0 0 12px;
}

.live-total {
  margin-top: 16px;
  padding: 14px;
  border-radius: 18px;
  background: #eefaf4;
  color: #157347;
  font-weight: 900;
  display: none;
}

.expense {
  border: 1px solid #e4e8ec;
  border-radius: 18px;
  padding: 14px;
  margin-top: 12px;
  background: #fafafa;
}

.expense-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.expense strong {
  display: block;
  font-size: 17px;
}

.expense p {
  margin-bottom: 6px;
}

.expense small {
  display: block;
  color: #63707a;
  margin-top: 6px;
}

.tip-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.tip-btn.active {
  background: #11a36a;
  color: white;
  box-shadow: 0 0 0 4px rgba(17, 163, 106, 0.18);
}

.result-card {
  margin-bottom: 40px;
}

.result-person {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid #edf0f2;
  font-weight: 900;
}

.summary {
  margin-top: 18px;
  padding: 16px;
  border-radius: 18px;
  background: #f1fbf6;
}

.summary p {
  margin: 8px 0;
}

.actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin-top: 16px;
}

.actions button {
  background: #34495e;
}

@media (max-width: 640px) {
  .app {
    padding: 14px;
  }

  .input-row,
  .actions,
  .tip-options {
    grid-template-columns: 1fr;
  }

  .card {
    border-radius: 20px;
  }

  h1 {
    letter-spacing: -1px;
  }
}