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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    padding: 16px;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    border: 1px solid #ddd;
}

header {
    background: white;
    border-bottom: 1px solid #ddd;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

h1 {
    font-size: 20px;
    font-weight: 600;
    color: #111;
}

.share-btn {
    background: white;
    border: 1px solid #ddd;
    color: #111;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 14px;
}

.share-btn:hover {
    background: #f5f5f5;
}

.tabs {
    display: flex;
    background: white;
    border-bottom: 1px solid #ddd;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    color: #666;
}

.tab-btn.active {
    color: #111;
    border-bottom: 2px solid #111;
}

.tab-content {
    display: none;
    padding: 16px;
}

.tab-content.active {
    display: block;
}

.expense-form {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
    padding: 16px;
    background: #fafafa;
    border: 1px solid #eee;
}

.expense-form input,
.expense-form button {
    padding: 8px;
    border: 1px solid #ddd;
    font-size: 14px;
}

.expense-form input:focus {
    outline: none;
    border-color: #111;
}

.expense-form button {
    background: #111;
    color: white;
    border: none;
    cursor: pointer;
}

.expense-form button:hover {
    background: #333;
}

.running-total {
    background: #fafafa;
    padding: 12px 16px;
    border: 1px solid #eee;
    margin-bottom: 16px;
    text-align: center;
    font-size: 14px;
}

#totalAmount {
    color: #111;
    font-size: 20px;
    font-weight: 600;
}

.expenses-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.expense-item {
    padding: 12px;
    background: white;
    border: 1px solid #eee;
    border-left: 3px solid #111;
}

.expense-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.expense-amount {
    font-size: 16px;
    font-weight: 600;
    color: #111;
}

.expense-paidby {
    font-weight: 500;
    color: #111;
    font-size: 14px;
}

.expense-note {
    color: #666;
    margin-bottom: 4px;
    font-size: 14px;
}

.expense-date {
    font-size: 12px;
    color: #999;
}

.settlement-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.settlement-item {
    padding: 12px;
    background: white;
    border: 1px solid #eee;
    border-left: 3px solid #111;
}

.settlement-text {
    font-size: 14px;
    color: #111;
    margin-bottom: 4px;
}

.settlement-amount {
    font-size: 18px;
    font-weight: 600;
    color: #111;
}

.balance-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.balance-item {
    padding: 12px;
    background: #fafafa;
    border: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.balance-positive {
    color: #111;
    font-weight: 500;
}

.balance-negative {
    color: #111;
    font-weight: 500;
}

.balance-zero {
    color: #666;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 14px;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 24px;
    border: 1px solid #ddd;
    max-width: 500px;
    width: 90%;
}

.modal-content h3 {
    margin-bottom: 12px;
    color: #111;
    font-size: 18px;
    font-weight: 600;
}

.modal-content p {
    margin-bottom: 12px;
    color: #666;
    font-size: 14px;
}

.share-link-container {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

#shareLink {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    font-size: 14px;
}

#copyBtn {
    padding: 8px 16px;
    background: #111;
    color: white;
    border: none;
    cursor: pointer;
}

#copyBtn:hover {
    background: #333;
}

.close-btn {
    width: 100%;
    padding: 8px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    cursor: pointer;
}

.close-btn:hover {
    background: #eee;
}

@media (max-width: 480px) {
    h1 {
        font-size: 18px;
    }
    
    .share-btn {
        font-size: 12px;
        padding: 6px 10px;
    }
}
