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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #ffd89b 0%, #ff6b35 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    transition: background 0.3s ease;
}

body.dark-mode {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
}

.container {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 450px;
    width: 100%;
    position: relative;
    transition: background 0.3s ease, color 0.3s ease;
}

body.dark-mode .container {
    background: #1a252f;
    color: #e0e0e0;
}

.toggle-container {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle-label {
    font-size: 20px;
}

.toggle-label::before {
    content: "☼";
    filter: grayscale(100%) brightness(0);
}

body.dark-mode .toggle-label::before {
    content: "☾";
    filter: grayscale(0%) brightness(2);
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #ff9800;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

h1 {
    color: #333;
    text-align: center;
    margin-bottom: 30px;
    font-size: 28px;
    margin-top: 20px;
}

body.dark-mode h1 {
    color: #e0e0e0;
}

.input-group {
    margin-bottom: 25px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 600;
    font-size: 14px;
}

body.dark-mode label {
    color: #bbb;
}

input, select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
    color: #333;
}

body.dark-mode input,
body.dark-mode select {
    background: #2c3e50;
    border-color: #34495e;
    color: #e0e0e0;
}

input:focus, select:focus {
    outline: none;
    border-color: #ff9800;
}

button {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #ff9800 0%, #ff5722 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease;
}

button:hover {
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
}

.tip {
    margin-top: 30px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 15px;
    display: none;
    text-align: center;
    transition: background 0.3s ease;
}

body.dark-mode .tip {
    background: #2c3e50;
}

.tip h2 {
    color: #ff9800;
    font-size: 24px;
    margin-bottom: 10px;
}

.tip-amount {
    font-size: 48px;
    color: #333;
    font-weight: 700;
    margin: 20px 0;
    white-space: nowrap;
}

body.dark-mode .tip-amount {
    color: #e0e0e0;
}

@media (max-width: 480px) {
    .tip-amount {
        font-size: clamp(24px, 8vw, 48px);
    }
}

#each {
    color: #666;
    font-size: 16px;
    display: none;
}

body.dark-mode #each {
    color: #aaa;
}