.calculation-history {
    margin: 0 0 24px;
    padding: 18px;
    border: 1px solid rgba(0, 122, 255, .2);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(0, 122, 255, .07), rgba(90, 200, 250, .04));
}

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

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

.calculation-history-header span {
    color: var(--text-muted);
    font-size: 12px;
}

.calculation-history-controls,
.calculation-history-recent {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto;
    gap: 9px;
}

.calculation-history-recent {
    grid-template-columns: minmax(220px, 1fr) auto;
    margin-top: 9px;
}

.calculation-history input,
.calculation-history select {
    width: 100%;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid var(--border-light);
    border-radius: 9px;
    background: var(--surface);
    color: var(--text-primary);
}

.calculation-history-select-wrap {
    position: relative;
    min-width: 0;
}

.calculation-history-select-wrap select {
    appearance: none;
    padding: 10px 42px 10px 40px;
    border-color: rgba(0, 122, 255, .32);
    background: linear-gradient(135deg, var(--surface), rgba(0, 122, 255, .055));
    box-shadow: 0 4px 14px rgba(0, 74, 173, .08);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.calculation-history-select-wrap select:hover {
    border-color: rgba(0, 122, 255, .65);
    box-shadow: 0 6px 18px rgba(0, 74, 173, .13);
}

.calculation-history-select-wrap select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, .14), 0 6px 18px rgba(0, 74, 173, .12);
}

.calculation-history-select-icon,
.calculation-history-select-arrow {
    position: absolute;
    top: 50%;
    z-index: 1;
    color: var(--primary);
    pointer-events: none;
    transform: translateY(-50%);
}

.calculation-history-select-icon {
    left: 14px;
    font-size: 13px;
}

.calculation-history-select-arrow {
    right: 15px;
    font-size: 11px;
    transition: color .2s ease;
}

.calculation-history-select-wrap:focus-within .calculation-history-select-arrow {
    color: #005fcc;
}

.calculation-history-select-wrap option {
    background: var(--surface);
    color: var(--text-primary);
    font-weight: 500;
}

.calculation-history button {
    min-height: 42px;
    padding: 9px 15px;
    border: 1px solid var(--primary);
    border-radius: 9px;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    white-space: nowrap;
}

.calculation-history button.secondary {
    background: var(--surface);
    color: var(--primary);
}

.calculation-history button.danger {
    border-color: #ff5a5f;
    background: var(--surface);
    color: #d63a40;
}

.calculation-history button:disabled {
    cursor: not-allowed;
    opacity: .55;
}

.calculation-history-status {
    min-height: 18px;
    margin-top: 9px;
    color: var(--text-muted);
    font-size: 12px;
}

.calculation-history-status.success { color: #20853b; }
.calculation-history-status.error { color: #d63a40; }

@media (max-width: 640px) {
    .calculation-history-header { display: block; }
    .calculation-history-header span { display: block; margin-top: 5px; }
    .calculation-history-controls,
    .calculation-history-recent { grid-template-columns: 1fr; }
}
