.tool-title-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--primary-light);
}

.tool-title-wrapper i {
    font-size: 2rem;
    color: var(--primary-color);
}

.tool-title-wrapper .tool-title {
    margin-bottom: 0;
    border-bottom: none;
}

.calculator-display {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
    color: white;
}

.display-history {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    min-height: 20px;
    text-align: right;
    margin-bottom: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
}

.display-input {
    width: 100%;
    background: transparent;
    border: none;
    color: white;
    font-size: 28px;
    font-weight: 500;
    text-align: right;
    font-family: 'Consolas', 'Monaco', monospace;
    outline: none;
    padding: 8px 0;
}

.display-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.display-result {
    font-size: 20px;
    color: rgba(255, 255, 255, 0.8);
    text-align: right;
    font-family: 'Consolas', 'Monaco', monospace;
    margin-top: 4px;
    min-height: 28px;
}

.display-result.error {
    color: #ff6b6b;
}

.calc-panels {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.calc-keys {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.key-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.calc-key {
    padding: 14px 8px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: 'Consolas', 'Monaco', monospace;
}

.calc-key:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.calc-key:active {
    transform: translateY(0);
}

.key-number {
    background: white;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.key-number:hover {
    background: var(--bg-light);
}

.key-operator {
    background: #f0f7ff;
    color: var(--primary-color);
    border: 1px solid #d6e8ff;
    font-size: 18px;
}

.key-operator:hover {
    background: #e0efff;
}

.key-function {
    background: #f5f5f5;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    font-size: 14px;
}

.key-function:hover {
    background: #eeeeee;
}

.key-equals {
    background: var(--primary-color);
    color: white;
    font-size: 20px;
    font-weight: 600;
}

.key-equals:hover {
    background: var(--primary-hover);
}

.key-zero {
    grid-column: span 2;
}

.calc-constants h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    margin-top: 0;
}

.calc-constants h4:not(:first-child) {
    margin-top: 16px;
}

.constant-list,
.example-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.constant-btn,
.example-btn {
    padding: 8px 12px;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
    text-align: left;
    font-family: 'Consolas', 'Monaco', monospace;
}

.constant-btn:hover,
.example-btn:hover {
    background: var(--primary-light);
    color: var(--primary-color);
    border-color: #d6e8ff;
}

.history-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.history-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.history-list {
    max-height: 250px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.history-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    padding: 30px 0;
}

.history-item {
    padding: 10px 14px;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
}

.history-item:hover {
    background: var(--primary-light);
    border-color: #d6e8ff;
}

.history-expr {
    font-size: 13px;
    color: var(--text-secondary);
    font-family: 'Consolas', 'Monaco', monospace;
    margin-bottom: 2px;
}

.history-result {
    font-size: 15px;
    font-weight: 600;
    color: var(--primary-color);
    font-family: 'Consolas', 'Monaco', monospace;
    text-align: right;
}

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

    .display-input {
        font-size: 24px;
    }

    .calc-key {
        padding: 12px 6px;
        font-size: 15px;
    }
}
