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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f7fa;
  color: #333;
  min-height: 100vh;
}

.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 16px;
}

h1 {
  font-size: 1.4rem;
  text-align: center;
  color: #2563eb;
  margin-bottom: 16px;
  padding: 12px 0;
  border-bottom: 2px solid #2563eb;
}

h2 {
  font-size: 1rem;
  color: #1e40af;
  margin-bottom: 12px;
}

h3 {
  font-size: 0.95rem;
  color: #374151;
  margin: 12px 0 8px;
}

.card {
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.input-row {
  display: flex;
  gap: 8px;
}

.input-row input {
  flex: 1;
}

.form-group {
  margin-bottom: 10px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  color: #6b7280;
  margin-bottom: 4px;
}

input[type="text"],
input[type="number"],
select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

input:focus, select:focus {
  border-color: #2563eb;
}

button {
  padding: 9px 16px;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary {
  background: #2563eb;
  color: #fff;
  width: 100%;
  padding: 11px;
  font-size: 1rem;
  margin-top: 4px;
}

.btn-primary:hover { background: #1d4ed8; }

.btn-danger {
  background: #ef4444;
  color: #fff;
  width: 100%;
  padding: 11px;
  font-size: 1rem;
}

.btn-danger:hover { background: #dc2626; }

#addMemberBtn {
  background: #2563eb;
  color: #fff;
  white-space: nowrap;
}

#addMemberBtn:hover { background: #1d4ed8; }

.tag-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.tag-list li {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #e0e7ff;
  color: #1e40af;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.88rem;
}

.tag-list li .del {
  cursor: pointer;
  color: #6b7280;
  font-size: 1rem;
  line-height: 1;
  margin-left: 2px;
}

.tag-list li .del:hover { color: #ef4444; }

.checkbox-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.checkbox-list label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.88rem;
  cursor: pointer;
  color: #374151;
}

#payList {
  list-style: none;
}

#payList li {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid #f3f4f6;
  font-size: 0.9rem;
  gap: 8px;
}

#payList li:last-child {
  border-bottom: none;
}

.pay-info {
  flex: 1;
}

.pay-info .pay-main {
  font-weight: 600;
}

.pay-info .pay-sub {
  font-size: 0.8rem;
  color: #6b7280;
  margin-top: 2px;
}

.pay-del {
  cursor: pointer;
  color: #9ca3af;
  font-size: 1.1rem;
  padding: 0 4px;
}

.pay-del:hover { color: #ef4444; }

.pay-amount {
  font-weight: 700;
  color: #2563eb;
  white-space: nowrap;
}

#summaryArea {
  font-size: 0.9rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px solid #f3f4f6;
}

.summary-row:last-child { border-bottom: none; }

.summary-name { color: #374151; }

.summary-val {
  font-weight: 600;
  color: #059669;
}

.summary-val.negative { color: #ef4444; }

#settlementList {
  list-style: none;
}

#settlementList li {
  padding: 8px 12px;
  margin: 6px 0;
  background: #f0fdf4;
  border-left: 3px solid #059669;
  border-radius: 4px;
  font-size: 0.92rem;
}

#settlementList li .amount {
  font-weight: 700;
  color: #059669;
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.empty-msg {
  color: #9ca3af;
  font-size: 0.88rem;
  text-align: center;
  padding: 8px 0;
}

hr {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 12px 0;
}
