body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: linear-gradient(135deg, #1d2b64, #f8cdda);
    font-family: 'Segoe UI', sans-serif;
}

/* Heading */
.title {
    color: white;
    margin-bottom: 20px;
    font-size: 28px;
    letter-spacing: 1px;
}

/* Calculator Container */
.calculator {
    backdrop-filter: blur(15px);
    background: rgba(255, 255, 255, 0.15);
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    width: 320px;   
    /* Shrink-wrap to the grid size */
    display: inline-flex;
    flex-direction: column;
    align-items: center;
}

/* Display - FIXED: Added width and box-sizing to prevent overflow */
#display {
    width: 95%; /* Spans the full width of the buttons below */
    height: 70px;
    font-size: 26px;
    margin-bottom: 15px;
    box-sizing: border-box; 
    text-align: right;
    padding: 0 15px;
    border: none;
    border-radius: 12px;
    background: rgba(255,255,255,0.3);
    color: white;
    font-weight: bold;
    letter-spacing: 1px;
}

/* Buttons grid */
.buttons {
    display: grid;
    /* 4 strict columns of 70px each */
    grid-template-columns: repeat(4, 70px); 
    gap: 12px;
     justify-content: center;
}

/* Buttons */
button {
 padding: 18px;

    font-size: 18px;

    border: none;

    border-radius: 12px;

    cursor: pointer;

    background: rgba(255,255,255,0.3);

    color: white;

    transition: all 0.2s ease;
}
.backspace {
    background: #6c757d;
}
button:hover {
    transform: scale(1.05);
    background: rgba(255,255,255,0.5);
}

/* Special buttons */
.clear {
    background: #ff4d4d;
}

.operator {
    background: #ff9500;
}

.equal {
    background: #28a745;
    /* This ensures the equal button stays aligned within its cell 
       or you can set grid-column: span 1; */
}
/* First row adjustment */
/* First row alignment */

/* Professional Alignment Fix: 
   If your layout has an empty spot in a row, the container looks lopsided.
   Ensure all 4 columns are filled in your HTML or make a button span. */