body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #dbe4eb;
    font-family: 'Segoe UI', sans-serif;
    margin: 0;
}

.calculator-container {
    background-color: #1e1e1e;
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.4);
    width: 340px; 
    overflow: hidden;
    transition: width 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.calculator-container.expanded {
    width: 540px; /* Wider to fit new keys */
}

.top-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    align-items: center;
}

.window-dots span {
    display: inline-block;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: #ff5f56;
    margin-right: 5px;
}
.window-dots span:nth-child(2) { background: #ffbd2e; }
.window-dots span:nth-child(3) { background: #27c93f; }

#toggleBtn {
    background: none;
    border: 1px solid #555;
    color: #aaa;
    border-radius: 12px;
    padding: 5px 12px;
    cursor: pointer;
    font-size: 12px;
    transition: 0.3s;
}

#toggleBtn:hover {
    border-color: #26e07f;
    color: #26e07f;
}

#display {
    width: 100%;
    height: 60px;
    background: #2b2b2b;
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 2.5rem;
    text-align: right;
    padding: 10px;
    box-sizing: border-box;
    margin-bottom: 15px;
    /* Allow horizontal scrolling for long formulas */
    overflow-x: auto;
    white-space: nowrap;
}

/* Hide scrollbar for cleaner look */
#display::-webkit-scrollbar { display: none; }

.keyboard-area {
    display: flex;
    gap: 20px;
}

.standard-keys {
    display: grid;
    grid-template-columns: repeat(4, 70px);
    gap: 10px;
    flex-shrink: 0;
}

.scientific-keys {
    display: grid;
    grid-template-columns: repeat(2, 70px);
    gap: 10px;
    opacity: 0;
    transition: opacity 0.2s ease-in;
    pointer-events: none;
}

.calculator-container.expanded .scientific-keys {
    opacity: 1;
    pointer-events: all;
    transition-delay: 0.2s;
}

.btn {
    height: 60px;
    font-size: 1.2rem;
    border: none;
    border-radius: 10px;
    background-color: #333;
    color: #fff;
    cursor: pointer;
}
.btn:hover { filter: brightness(1.2); }
.operator { background-color: #ff9f0a; color: white; }
.func { background-color: #a5a5a5; color: black; }
.equal { background-color: #ff9f0a; }
.zero { grid-column: span 2; }
.scif { background-color: #444; color: #63d2ff; font-size: 1rem; }