:root {
    --bg: #f0f4f8;
    --card: #ffffff;
    --border: #e0e5eb;
    --text: #333;
    --muted: #555;
    --accent1: #FF4081;
    --accent2: #9C27B0;
    --accent3: #00BFA5;
    --accent4: #FF5722;
    --radius: 14px;
    --shadow: 0 4px 12px rgba(0,0,0,0.1);
}

body {
    margin: 0;
    font-family: "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

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

.card {
    background: white;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}

h2 {
    margin-top: 0;
}

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

input, select {
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ddd;
    font-size: 14px;
}

button, #areaUnit {
    width: 100%;
    padding: 12px;
    margin-top: 10px;
    border-radius: 10px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

button.primary {
    background: #6200ee;
    color: white;
}

button.secondary {
    background: #e0e0e0;
}

button.danger {
    background: #d32f2f;
    color: white;
}

button:hover {
    opacity: 0.9;
}

#historyList div {
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.result-card {
    display: none;
    background: linear-gradient(135deg,#6200ee,#7b1fa2);
    color: white;
}

.result-header {
    display:flex;
    justify-content:space-between;
    align-items:center;
}

.result-header button {
    width:auto;
    padding:4px 10px;
    background:rgba(255,255,255,0.2);
}

.result-main {
    margin-top:20px;
    display:grid;
    gap:14px;
}

.result-item {
    display:flex;
    justify-content:space-between;
    font-size:18px;
}

.result-item strong {
    font-size:22px;
}

.result-actions {
    margin-top:18px;
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:10px;
}

.result-actions button {
    background:white;
    color:#6200ee;
}

.result-details {
    margin-top:16px;
    padding:12px;
    border-radius:8px;
    background:rgba(255,255,255,0.15);
    font-size:14px;
}

.result-minor {
    display: none;
}

@media (max-width: 480px) {
    .grid {
        grid-template-columns: 1fr;
    }

    input, select {
        width: 100%;
        box-sizing: border-box;
    }
}

#installBtn {
    display: none;
    width: auto;
    margin: 0 10px;
    padding: 5px 15px;
    background: var(--accent3);
}

/* Toast */
.toast {
    position:fixed;
    bottom:40px;
    left:50%;
    transform:translateX(-50%) scale(0.9);
    background:linear-gradient(90deg,var(--accent2),var(--accent1));
    color:#fff;
    padding:10px 18px;
    border-radius:999px;
    box-shadow:0 4px 14px rgba(0,0,0,0.3);
    opacity:0;
    transition:all .3s;
}

.toast.show { opacity:1; transform:translateX(-50%) scale(1); }
