#stopwatch-calc-wrapper {
    --bg-color: #f8f9fa;
    --text-black: #212529;
    --blue-accent: #3498db; 
    --start-green: #2ecc71;
    --stop-red: #e74c3c;
    --split-cyan: #17a2b8;
    --card-bg: #ffffff;
    --border: #e9ecef;

    background-color: var(--bg-color);
    padding: 40px 10px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    font-family: 'Segoe UI', Arial, sans-serif;
}

#stopwatch-calc-wrapper * { box-sizing: border-box; }

.main-wrapper {
    width: 100%;
    max-width: 600px;
    background: var(--card-bg) !important;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    text-align: center;
    border: 1px solid var(--border);
}

.title {
    font-size: 1.4rem !important;
    font-weight: 700 !important;
    color: var(--blue-accent) !important;
    margin-bottom: 25px !important;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-top: 0;
}

#display-box {
    margin-bottom: 30px;
    padding: 60px 20px !important;
    background: #f1f3f5 !important; 
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.time-wrapper {
    display: flex;
    align-items: baseline;
    white-space: nowrap; 
    font-family: 'Courier New', Courier, monospace !important;
}

#main-time {
    font-size: clamp(1.8rem, 8vw, 3.5rem) !important; 
    font-weight: 800;
    color: var(--text-black) !important;
    line-height: 1;
}

#ms-time {
    font-size: clamp(0.8rem, 3.5vw, 1.5rem) !important; 
    font-weight: 800;
    color: #6c757d !important;
    margin-left: 5px;
}

.controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.btn {
    border: none !important;
    padding: 16px !important;
    font-size: 1rem !important;
    font-weight: bold !important;
    color: white !important;
    border-radius: 12px !important;
    cursor: pointer;
    text-transform: uppercase;
    transition: 0.2s;
    box-shadow: none !important;
}

#startBtn { background-color: var(--start-green) !important; }
#stopBtn { background-color: var(--stop-red) !important; }
#splitResetBtn { 
    background-color: var(--split-cyan) !important;
    grid-column: span 2;
}

.btn:disabled {
    background-color: #dee2e6 !important;
    color: #adb5bd !important;
    cursor: not-allowed;
}

.history-area {
    margin-top: 30px;
    border-top: 2px solid #f1f3f5;
    padding-top: 20px;
}

#clearHistoryBtn {
    background-color: #6c757d !important;
    color: white !important;
    border: none !important;
    padding: 10px 20px !important;
    border-radius: 8px !important;
    margin-bottom: 15px;
    cursor: pointer;
    font-weight: bold;
}

#history {
    max-height: 200px;
    overflow-y: auto;
    text-align: left;
}

.history-item {
    display: flex;
    justify-content: space-between;
    padding: 12px;
    border-bottom: 1px solid #f8f9fa;
    font-family: monospace;
    font-size: 1rem;
    color: #333;
}