* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: sans-serif;
}

body {
    background-color: white;
    color: black;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

body.dark {
    background-color: black;
    color: white;
}

.calculator {
    border: 2px solid black;
    padding: 20px;
    width: 320px;
    background-color: white;
}

body.dark .calculator {
    border: 2px solid white;
    background-color: black;
}

.calculator-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid black;
}

body.dark .calculator-header {
    border-bottom: 2px solid white;
}

.timer-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

#timer-display {
    font-size: 18px;
    font-weight: bold;
    font-family: monospace;
}

.timer-controls {
    display: flex;
    gap: 5px;
}

.timer-btn {
    padding: 5px;
    font-size: 12px;
    border: 1px solid black;
    background: transparent;
}

body.dark .timer-btn {
    border-color: white;
    color: white;
}

#theme-toggle {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: inherit;
    padding: 0;
}


.display {
    border: 2px solid black;
    padding: 10px;
    text-align: right;
    margin-bottom: 15px;
    min-height: 85px;
    word-break: break-all;
}

body.dark .display {
    border-color: white;
}

.previous-operand {
    font-size: 14px;
    color: gray;
    min-height: 20px;
}

.current-operand {
    font-size: 32px;
    font-weight: bold;
}

.keypad {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

button {
    padding: 15px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    background-color: #eee;
    color: black;
    border: 2px solid black;
}

body.dark button {
    background-color: #222;
    color: white;
    border-color: white;
}

button:hover {
    background-color: #ccc;
}

body.dark button:hover {
    background-color: #444;
}

.span-two-vertical {
    grid-row: span 2;
}

.span-three {
    grid-column: span 3;
}

.special-btn {
    background-color: black;
    color: white;
}

body.dark .special-btn {
    background-color: white;
    color: black;
}

.special-btn:hover {
    background-color: #333;
}

body.dark .special-btn:hover {
    background-color: #ccc;
}
